From 6203f68735a1b7511b85560b64995a14f1b40765 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 12 Jun 2019 16:20:22 +0300 Subject: [PATCH 1/4] compiletest: Introduce `// {check,build,run}-pass` pass modes --- src/test/incremental/no_mangle.rs | 2 +- src/test/run-pass/compiletest-skip-codegen.rs | 7 --- src/tools/compiletest/src/header.rs | 50 +++++++------------ src/tools/compiletest/src/runtest.rs | 29 +++++------ 4 files changed, 32 insertions(+), 56 deletions(-) delete mode 100644 src/test/run-pass/compiletest-skip-codegen.rs diff --git a/src/test/incremental/no_mangle.rs b/src/test/incremental/no_mangle.rs index 1b17886a4f9b5..8c1e8e6a8d3b9 100644 --- a/src/test/incremental/no_mangle.rs +++ b/src/test/incremental/no_mangle.rs @@ -1,4 +1,4 @@ -// revisions:rpass1 rpass2 +// revisions:cfail1 cfail2 // compile-flags: --crate-type cdylib // skip-codegen diff --git a/src/test/run-pass/compiletest-skip-codegen.rs b/src/test/run-pass/compiletest-skip-codegen.rs deleted file mode 100644 index 3c0e22613128a..0000000000000 --- a/src/test/run-pass/compiletest-skip-codegen.rs +++ /dev/null @@ -1,7 +0,0 @@ -// Test that with the `skip-codegen` option the test isn't executed. - -// skip-codegen - -fn main() { - unreachable!(); -} diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index ab5594f36050d..8be15bb15768f 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -290,6 +290,13 @@ impl EarlyProps { } } +#[derive(Clone, Copy, PartialEq, Debug)] +pub enum PassMode { + Check, + Build, + Run, +} + #[derive(Clone, Debug)] pub struct TestProps { // Lines that should be expected, in order, on standard out @@ -349,14 +356,10 @@ pub struct TestProps { // testing harness and used when generating compilation // arguments. (In particular, it propagates to the aux-builds.) pub incremental_dir: Option, - // Specifies that a test must actually compile without errors. - pub compile_pass: bool, + // How far should the test proceed while still passing. + pub pass_mode: Option, // rustdoc will test the output of the `--test` option pub check_test_line_numbers_match: bool, - // The test must be compiled and run successfully. Only used in UI tests for now. - pub run_pass: bool, - // Skip any codegen step and running the executable. Only for run-pass. - pub skip_codegen: bool, // Do not pass `-Z ui-testing` to UI tests pub disable_ui_testing_normalization: bool, // customized normalization rules @@ -396,10 +399,8 @@ impl TestProps { pretty_compare_only: false, forbid_output: vec![], incremental_dir: None, - compile_pass: false, + pass_mode: None, check_test_line_numbers_match: false, - run_pass: false, - skip_codegen: false, disable_ui_testing_normalization: false, normalize_stdout: vec![], normalize_stderr: vec![], @@ -525,17 +526,14 @@ impl TestProps { self.check_test_line_numbers_match = config.parse_check_test_line_numbers_match(ln); } - if !self.run_pass { - self.run_pass = config.parse_run_pass(ln); - } - - if !self.compile_pass { - // run-pass implies compile_pass - self.compile_pass = config.parse_compile_pass(ln) || self.run_pass; - } - - if !self.skip_codegen { - self.skip_codegen = config.parse_skip_codegen(ln); + if config.parse_name_directive(ln, "check-pass") || + config.parse_name_directive(ln, "skip-codegen") { + self.pass_mode = Some(PassMode::Check); + } else if config.parse_name_directive(ln, "build-pass") || + config.parse_name_directive(ln, "compile-pass") { + self.pass_mode = Some(PassMode::Build); + } else if config.parse_name_directive(ln, "run-pass") { + self.pass_mode = Some(PassMode::Run); } if !self.disable_ui_testing_normalization { @@ -710,10 +708,6 @@ impl Config { } } - fn parse_compile_pass(&self, line: &str) -> bool { - self.parse_name_directive(line, "compile-pass") - } - fn parse_disable_ui_testing_normalization(&self, line: &str) -> bool { self.parse_name_directive(line, "disable-ui-testing-normalization") } @@ -722,14 +716,6 @@ impl Config { self.parse_name_directive(line, "check-test-line-numbers-match") } - fn parse_run_pass(&self, line: &str) -> bool { - self.parse_name_directive(line, "run-pass") - } - - fn parse_skip_codegen(&self, line: &str) -> bool { - self.parse_name_directive(line, "skip-codegen") - } - fn parse_assembly_output(&self, line: &str) -> Option { self.parse_name_value_directive(line, "assembly-output") .map(|r| r.trim().to_string()) diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index d87bd66a1ac70..8b52a529d440a 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -10,7 +10,7 @@ use crate::common::{Config, TestPaths}; use crate::common::{Incremental, MirOpt, RunMake, Ui, JsDocTest, Assembly}; use diff; use crate::errors::{self, Error, ErrorKind}; -use crate::header::TestProps; +use crate::header::{TestProps, PassMode}; use crate::json; use regex::{Captures, Regex}; use rustfix::{apply_suggestions, get_suggestions_from_json, Filter}; @@ -310,20 +310,19 @@ impl<'test> TestCx<'test> { } fn should_run_successfully(&self) -> bool { - let run_pass = match self.config.mode { + match self.config.mode { RunPass => true, - Ui => self.props.run_pass, - _ => unimplemented!(), - }; - return run_pass && !self.props.skip_codegen; + Ui => self.props.pass_mode == Some(PassMode::Run), + mode => panic!("unimplemented for mode {:?}", mode), + } } fn should_compile_successfully(&self) -> bool { match self.config.mode { - CompileFail => self.props.compile_pass, + CompileFail => false, RunPass => true, JsDocTest => true, - Ui => self.props.compile_pass, + Ui => self.props.pass_mode.is_some(), Incremental => { let revision = self.revision .expect("incremental tests require a list of revisions"); @@ -331,7 +330,7 @@ impl<'test> TestCx<'test> { true } else if revision.starts_with("cfail") { // FIXME: would be nice if incremental revs could start with "cpass" - self.props.compile_pass + self.props.pass_mode.is_some() } else { panic!("revision name must begin with rpass, rfail, or cfail"); } @@ -433,11 +432,9 @@ impl<'test> TestCx<'test> { "run-pass tests with expected warnings should be moved to ui/" ); - if !self.props.skip_codegen { - let proc_res = self.exec_compiled_test(); - if !proc_res.status.success() { - self.fatal_proc_rec("test run failed!", &proc_res); - } + let proc_res = self.exec_compiled_test(); + if !proc_res.status.success() { + self.fatal_proc_rec("test run failed!", &proc_res); } } @@ -1344,7 +1341,7 @@ impl<'test> TestCx<'test> { fn check_error_patterns(&self, output_to_check: &str, proc_res: &ProcRes) { debug!("check_error_patterns"); if self.props.error_patterns.is_empty() { - if self.props.compile_pass { + if self.props.pass_mode.is_some() { return; } else { self.fatal(&format!( @@ -1971,7 +1968,7 @@ impl<'test> TestCx<'test> { } } - if self.props.skip_codegen { + if self.props.pass_mode == Some(PassMode::Check) { assert!( !self .props From 8e8fba1b3bb96bb64f104d85618cab4fe7dc0740 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 12 Jun 2019 17:56:51 +0300 Subject: [PATCH 2/4] compiletest: Validate pass modes harder --- ...ssue-59523-on-implemented-is-not-unused.rs | 2 +- ...layout-scalar-valid-range-is-not-unused.rs | 2 +- .../termination-trait-for-box-dyn-error.rs | 2 +- ...mination-trait-for-result-box-error_err.rs | 2 +- .../ui/consts/const-eval/const_transmute.rs | 1 - src/test/ui/consts/const-eval/enum_discr.rs | 1 - src/test/ui/expanded-cfg.rs | 4 +- src/test/ui/issues/issue-22603.rs | 4 +- src/test/ui/issues/issue-37515.rs | 8 ++-- .../one-use-in-fn-return.rs | 14 +++---- src/tools/compiletest/src/header.rs | 41 +++++++++++++++---- 11 files changed, 49 insertions(+), 32 deletions(-) diff --git a/src/test/incremental/issue-59523-on-implemented-is-not-unused.rs b/src/test/incremental/issue-59523-on-implemented-is-not-unused.rs index 3d16a1543f43a..afc086213403c 100644 --- a/src/test/incremental/issue-59523-on-implemented-is-not-unused.rs +++ b/src/test/incremental/issue-59523-on-implemented-is-not-unused.rs @@ -2,7 +2,7 @@ // rustc_on_unimplemented, but with this bug we are seeing it fire (on // subsequent runs) if incremental compilation is enabled. -// revisions: rpass1 rpass2 +// revisions: cfail1 cfail2 // compile-pass #![feature(on_unimplemented)] diff --git a/src/test/incremental/issue-59524-layout-scalar-valid-range-is-not-unused.rs b/src/test/incremental/issue-59524-layout-scalar-valid-range-is-not-unused.rs index e4802cba9b6d7..37bd8d0641fb9 100644 --- a/src/test/incremental/issue-59524-layout-scalar-valid-range-is-not-unused.rs +++ b/src/test/incremental/issue-59524-layout-scalar-valid-range-is-not-unused.rs @@ -3,7 +3,7 @@ // seeing it fire (on subsequent runs) if incremental compilation is // enabled. -// revisions: rpass1 rpass2 +// revisions: cfail1 cfail2 // compile-pass #![feature(rustc_attrs)] diff --git a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs b/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs index 5f76caabc796b..796729ac4cc28 100644 --- a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs +++ b/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs @@ -1,4 +1,4 @@ -// compile-pass +// error-pattern:returned Box from main() // failure-status: 1 use std::error::Error; diff --git a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs b/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs index bd47a9768f94b..2f3a73a30ad95 100644 --- a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs +++ b/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs @@ -1,4 +1,4 @@ -// compile-pass +// error-pattern:returned Box from main() // failure-status: 1 use std::io::{Error, ErrorKind}; diff --git a/src/test/ui/consts/const-eval/const_transmute.rs b/src/test/ui/consts/const-eval/const_transmute.rs index 4726f9dde3a84..0e0e003dcf476 100644 --- a/src/test/ui/consts/const-eval/const_transmute.rs +++ b/src/test/ui/consts/const-eval/const_transmute.rs @@ -1,4 +1,3 @@ -// compile-pass // run-pass #![feature(const_fn_union)] diff --git a/src/test/ui/consts/const-eval/enum_discr.rs b/src/test/ui/consts/const-eval/enum_discr.rs index 4851e7520948d..e09258f11206e 100644 --- a/src/test/ui/consts/const-eval/enum_discr.rs +++ b/src/test/ui/consts/const-eval/enum_discr.rs @@ -1,4 +1,3 @@ -// compile-pass // run-pass enum Foo { diff --git a/src/test/ui/expanded-cfg.rs b/src/test/ui/expanded-cfg.rs index c98fd7ffea8be..baa161af76abc 100644 --- a/src/test/ui/expanded-cfg.rs +++ b/src/test/ui/expanded-cfg.rs @@ -1,5 +1,4 @@ -// skip-codegen -// compile-pass +// check-pass macro_rules! mac { {} => { @@ -19,5 +18,4 @@ macro_rules! mac { mac! {} - fn main() {} diff --git a/src/test/ui/issues/issue-22603.rs b/src/test/ui/issues/issue-22603.rs index e298316f3b98e..717f15b76ac58 100644 --- a/src/test/ui/issues/issue-22603.rs +++ b/src/test/ui/issues/issue-22603.rs @@ -1,5 +1,5 @@ -// skip-codegen -// compile-pass +// check-pass + #![feature(unboxed_closures, fn_traits)] struct Foo; diff --git a/src/test/ui/issues/issue-37515.rs b/src/test/ui/issues/issue-37515.rs index cc07bd1d91509..caff507c91833 100644 --- a/src/test/ui/issues/issue-37515.rs +++ b/src/test/ui/issues/issue-37515.rs @@ -1,10 +1,8 @@ -// skip-codegen -// compile-pass +// check-pass + #![warn(unused)] type Z = dyn for<'x> Send; //~^ WARN type alias is never used - -fn main() { -} +fn main() {} diff --git a/src/test/ui/single-use-lifetime/one-use-in-fn-return.rs b/src/test/ui/single-use-lifetime/one-use-in-fn-return.rs index 876a0a564daf5..92b25cbf58410 100644 --- a/src/test/ui/single-use-lifetime/one-use-in-fn-return.rs +++ b/src/test/ui/single-use-lifetime/one-use-in-fn-return.rs @@ -1,20 +1,16 @@ -// compile-pass - -#![deny(single_use_lifetimes)] -#![allow(dead_code)] -#![allow(unused_variables)] - // Test that we DO NOT warn when lifetime name is used only // once in a fn return type -- using `'_` is not legal there, // as it must refer back to an argument. // // (Normally, using `'static` would be preferred, but there are // times when that is not what you want.) -// -// run-pass + +// compile-pass + +#![deny(single_use_lifetimes)] fn b<'a>() -> &'a u32 { // OK: used only in return type &22 } -fn main() { } +fn main() {} diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 8be15bb15768f..1f52421ecbc15 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -526,14 +526,41 @@ impl TestProps { self.check_test_line_numbers_match = config.parse_check_test_line_numbers_match(ln); } - if config.parse_name_directive(ln, "check-pass") || - config.parse_name_directive(ln, "skip-codegen") { - self.pass_mode = Some(PassMode::Check); - } else if config.parse_name_directive(ln, "build-pass") || - config.parse_name_directive(ln, "compile-pass") { - self.pass_mode = Some(PassMode::Build); + let check_no_run = |s| { + if config.mode != Mode::Ui && config.mode != Mode::Incremental { + panic!("`{}` header is only supported in UI and incremental tests", s); + } + if config.mode == Mode::Incremental && + !cfg.map_or(false, |r| r.starts_with("cfail")) && + !self.revisions.iter().all(|r| r.starts_with("cfail")) { + panic!("`{}` header is only supported in `cfail` incremental tests", s); + } + }; + let pass_mode = if config.parse_name_directive(ln, "check-pass") { + check_no_run("check-pass"); + Some(PassMode::Check) + } else if config.parse_name_directive(ln, "skip-codegen") { + check_no_run("skip-codegen"); + Some(PassMode::Check) + } else if config.parse_name_directive(ln, "build-pass") { + check_no_run("build-pass"); + Some(PassMode::Build) + } else if config.parse_name_directive(ln, "compile-pass") { + check_no_run("compile-pass"); + Some(PassMode::Build) } else if config.parse_name_directive(ln, "run-pass") { - self.pass_mode = Some(PassMode::Run); + if config.mode != Mode::Ui && config.mode != Mode::RunPass /* compatibility */ { + panic!("`run-pass` header is only supported in UI tests") + } + Some(PassMode::Run) + } else { + None + }; + match (self.pass_mode, pass_mode) { + (None, Some(_)) => self.pass_mode = pass_mode, + (Some(_), Some(pm)) if pm == PassMode::Check => self.pass_mode = pass_mode, + (Some(_), Some(_)) => panic!("multiple `*-pass` headers in a single test"), + (_, None) => {} } if !self.disable_ui_testing_normalization { From 932ea641758e2fe20500151e80a4968cc0799078 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Wed, 12 Jun 2019 18:18:32 +0300 Subject: [PATCH 3/4] compiletest: Remove `skip-codegen` --- src/test/incremental/no_mangle.rs | 2 +- src/test/ui/asm/asm-misplaced-option.rs | 6 +- src/test/ui/asm/asm-misplaced-option.stderr | 4 +- .../ui/associated-types/cache/chrono-scan.rs | 17 +- src/test/ui/associated-types/cache/elision.rs | 5 +- src/test/ui/bad/bad-lint-cap3.rs | 5 +- src/test/ui/bad/bad-lint-cap3.stderr | 2 +- .../coherence-projection-ok-orphan.rs | 10 +- .../ui/coherence/coherence-projection-ok.rs | 5 +- ...ce_copy_like_err_fundamental_struct_ref.rs | 5 +- src/test/ui/coherence/coherence_local.rs | 7 +- src/test/ui/coherence/coherence_local_ref.rs | 5 +- .../conditional-compilation/cfg_attr_path.rs | 7 +- .../ui/consts/const-fn-stability-calls-3.rs | 5 +- .../issue-43106-gating-of-builtin-attrs.rs | 19 +- ...issue-43106-gating-of-builtin-attrs.stderr | 404 +++++++++--------- .../issue-43106-gating-of-deprecated.rs | 3 +- src/test/ui/glob-cycles.rs | 5 +- src/test/ui/hygiene/assoc_ty_bindings.rs | 5 +- src/test/ui/if/if-loop.rs | 6 +- src/test/ui/imports/import-crate-var.rs | 4 +- src/test/ui/imports/import-crate-var.stderr | 2 +- src/test/ui/issues/issue-11740.rs | 6 +- src/test/ui/issues/issue-16994.rs | 5 +- src/test/ui/issues/issue-19601.rs | 9 +- src/test/ui/issues/issue-22603.rs | 1 + src/test/ui/issues/issue-22789.rs | 5 +- src/test/ui/issues/issue-22933-1.rs | 8 +- src/test/ui/issues/issue-24883.rs | 5 +- src/test/ui/issues/issue-26614.rs | 7 +- src/test/ui/issues/issue-26930.rs | 6 +- src/test/ui/issues/issue-29857.rs | 4 +- .../ui/issues/issue-31924-non-snake-ffi.rs | 8 +- src/test/ui/issues/issue-32119.rs | 6 +- src/test/ui/issues/issue-32222.rs | 5 +- src/test/ui/issues/issue-32797.rs | 4 +- src/test/ui/issues/issue-32922.rs | 5 +- src/test/ui/issues/issue-33241.rs | 4 +- src/test/ui/issues/issue-34028.rs | 4 +- src/test/ui/issues/issue-34171.rs | 4 +- src/test/ui/issues/issue-34418.rs | 5 +- src/test/ui/issues/issue-34839.rs | 5 +- src/test/ui/issues/issue-35570.rs | 4 +- src/test/ui/issues/issue-36116.rs | 6 +- src/test/ui/issues/issue-36379.rs | 6 +- src/test/ui/issues/issue-36839.rs | 4 +- src/test/ui/issues/issue-37051.rs | 10 +- src/test/ui/issues/issue-37366.rs | 8 +- src/test/ui/issues/issue-37510.rs | 4 +- src/test/ui/issues/issue-38160.rs | 7 +- src/test/ui/issues/issue-38381.rs | 4 +- src/test/ui/issues/issue-40350.rs | 5 +- ...does-outlive-lbr2-because-implied-bound.rs | 5 +- ...tch_with_exhaustive_patterns_same_crate.rs | 4 +- ...tch_with_exhaustive_patterns_same_crate.rs | 4 +- src/tools/compiletest/src/header.rs | 6 +- 56 files changed, 315 insertions(+), 401 deletions(-) diff --git a/src/test/incremental/no_mangle.rs b/src/test/incremental/no_mangle.rs index 8c1e8e6a8d3b9..b1c9b2bc37f64 100644 --- a/src/test/incremental/no_mangle.rs +++ b/src/test/incremental/no_mangle.rs @@ -1,6 +1,6 @@ // revisions:cfail1 cfail2 +// check-pass // compile-flags: --crate-type cdylib -// skip-codegen #![deny(unused_attributes)] diff --git a/src/test/ui/asm/asm-misplaced-option.rs b/src/test/ui/asm/asm-misplaced-option.rs index 5c202a158f401..14ff4c2e981b3 100644 --- a/src/test/ui/asm/asm-misplaced-option.rs +++ b/src/test/ui/asm/asm-misplaced-option.rs @@ -1,3 +1,4 @@ +// check-pass // ignore-android // ignore-arm // ignore-aarch64 @@ -11,14 +12,11 @@ // ignore-mips // ignore-mips64 -// compile-pass -// skip-codegen #![feature(asm)] -#![allow(dead_code, non_upper_case_globals)] #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] -pub fn main() { +fn main() { // assignment not dead let mut x: isize = 0; unsafe { diff --git a/src/test/ui/asm/asm-misplaced-option.stderr b/src/test/ui/asm/asm-misplaced-option.stderr index 39d88e3fb56dc..3d4b28c3dc444 100644 --- a/src/test/ui/asm/asm-misplaced-option.stderr +++ b/src/test/ui/asm/asm-misplaced-option.stderr @@ -1,11 +1,11 @@ warning: unrecognized option - --> $DIR/asm-misplaced-option.rs:26:64 + --> $DIR/asm-misplaced-option.rs:24:64 | LL | asm!("mov $1, $0" : "=r"(x) : "r"(5_usize), "0"(x) : : "cc"); | ^^^^ warning: expected a clobber, found an option - --> $DIR/asm-misplaced-option.rs:33:80 + --> $DIR/asm-misplaced-option.rs:31:80 | LL | asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8_usize) : "cc", "volatile"); | ^^^^^^^^^^ diff --git a/src/test/ui/associated-types/cache/chrono-scan.rs b/src/test/ui/associated-types/cache/chrono-scan.rs index 00d47c92a374c..8ddd347ff3607 100644 --- a/src/test/ui/associated-types/cache/chrono-scan.rs +++ b/src/test/ui/associated-types/cache/chrono-scan.rs @@ -1,10 +1,10 @@ -// compile-pass -// skip-codegen -#![allow(warnings)] +// check-pass + pub type ParseResult = Result; -pub enum Item<'a> { Literal(&'a str), - } +pub enum Item<'a> { + Literal(&'a str) +} pub fn colon_or_space(s: &str) -> ParseResult<&str> { unimplemented!() @@ -20,10 +20,9 @@ pub fn parse<'a, I>(mut s: &str, items: I) -> ParseResult<()> macro_rules! try_consume { ($e:expr) => ({ let (s_, v) = try!($e); s = s_; v }) } - let offset = try_consume!(timezone_offset_zulu(s.trim_left(), colon_or_space)); - let offset = try_consume!(timezone_offset_zulu(s.trim_left(), colon_or_space)); + let offset = try_consume!(timezone_offset_zulu(s.trim_start(), colon_or_space)); + let offset = try_consume!(timezone_offset_zulu(s.trim_start(), colon_or_space)); Ok(()) } - -fn main() { } +fn main() {} diff --git a/src/test/ui/associated-types/cache/elision.rs b/src/test/ui/associated-types/cache/elision.rs index 2b49cd33ba09b..b3e1ec8ad703c 100644 --- a/src/test/ui/associated-types/cache/elision.rs +++ b/src/test/ui/associated-types/cache/elision.rs @@ -1,10 +1,9 @@ -// compile-pass -// skip-codegen -#![allow(warnings)] // Check that you are allowed to implement using elision but write // trait without elision (a bug in this cropped up during // bootstrapping, so this is a regression test). +// check-pass + pub struct SplitWhitespace<'a> { x: &'a u8 } diff --git a/src/test/ui/bad/bad-lint-cap3.rs b/src/test/ui/bad/bad-lint-cap3.rs index 4cfa0b266c8c7..c38105870e4c0 100644 --- a/src/test/ui/bad/bad-lint-cap3.rs +++ b/src/test/ui/bad/bad-lint-cap3.rs @@ -1,10 +1,9 @@ +// check-pass // compile-flags: --cap-lints warn #![warn(unused)] #![deny(warnings)] -// compile-pass -// skip-codegen -use std::option; //~ WARN +use std::option; //~ WARN fn main() {} diff --git a/src/test/ui/bad/bad-lint-cap3.stderr b/src/test/ui/bad/bad-lint-cap3.stderr index a1ea3f774b40d..b898d792f65ca 100644 --- a/src/test/ui/bad/bad-lint-cap3.stderr +++ b/src/test/ui/bad/bad-lint-cap3.stderr @@ -5,7 +5,7 @@ LL | use std::option; | ^^^^^^^^^^^ | note: lint level defined here - --> $DIR/bad-lint-cap3.rs:4:9 + --> $DIR/bad-lint-cap3.rs:5:9 | LL | #![deny(warnings)] | ^^^^^^^^ diff --git a/src/test/ui/coherence/coherence-projection-ok-orphan.rs b/src/test/ui/coherence/coherence-projection-ok-orphan.rs index 652b438feb137..b34c31dcddb3d 100644 --- a/src/test/ui/coherence/coherence-projection-ok-orphan.rs +++ b/src/test/ui/coherence/coherence-projection-ok-orphan.rs @@ -1,11 +1,10 @@ -// compile-pass -// skip-codegen +// Here we do not get a coherence conflict because `Baz: Iterator` +// does not hold and (due to the orphan rules), we can rely on that. + +// check-pass // revisions: old re #![cfg_attr(re, feature(re_rebalance_coherence))] -#![allow(dead_code)] -// Here we do not get a coherence conflict because `Baz: Iterator` -// does not hold and (due to the orphan rules), we can rely on that. pub trait Foo

{} @@ -18,5 +17,4 @@ impl Foo for Baz { } impl Foo for A { } - fn main() {} diff --git a/src/test/ui/coherence/coherence-projection-ok.rs b/src/test/ui/coherence/coherence-projection-ok.rs index f759a9e1b4508..f4f5ca64de738 100644 --- a/src/test/ui/coherence/coherence-projection-ok.rs +++ b/src/test/ui/coherence/coherence-projection-ok.rs @@ -1,8 +1,8 @@ -// compile-pass -// skip-codegen +// check-pass // revisions: old re #![cfg_attr(re, feature(re_rebalance_coherence))] + pub trait Foo

{} pub trait Bar { @@ -17,5 +17,4 @@ impl Bar for i32 { type Output = u32; } - fn main() {} diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs index bd8317e224699..0d677800f7949 100644 --- a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs +++ b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs @@ -1,13 +1,11 @@ // Test that we are able to introduce a negative constraint that // `MyType: !MyTrait` along with other "fundamental" wrappers. +// check-pass // aux-build:coherence_copy_like_lib.rs -// compile-pass -// skip-codegen // revisions: old re #![cfg_attr(re, feature(re_rebalance_coherence))] -#![allow(dead_code)] extern crate coherence_copy_like_lib as lib; @@ -23,5 +21,4 @@ impl MyTrait for T { } // Huzzah. impl<'a> MyTrait for lib::MyFundamentalStruct<&'a MyType> { } - fn main() { } diff --git a/src/test/ui/coherence/coherence_local.rs b/src/test/ui/coherence/coherence_local.rs index cac45b0b9edff..3eab6e03ae3e2 100644 --- a/src/test/ui/coherence/coherence_local.rs +++ b/src/test/ui/coherence/coherence_local.rs @@ -1,13 +1,11 @@ // Test that we are able to introduce a negative constraint that // `MyType: !MyTrait` along with other "fundamental" wrappers. +// check-pass // aux-build:coherence_copy_like_lib.rs -// compile-pass -// skip-codegen // revisions: old re #![cfg_attr(re, feature(re_rebalance_coherence))] -#![allow(dead_code)] extern crate coherence_copy_like_lib as lib; @@ -22,5 +20,4 @@ impl lib::MyCopy for Box { } impl lib::MyCopy for lib::MyFundamentalStruct { } impl lib::MyCopy for lib::MyFundamentalStruct> { } - -fn main() { } +fn main() {} diff --git a/src/test/ui/coherence/coherence_local_ref.rs b/src/test/ui/coherence/coherence_local_ref.rs index a52510b8ea9ca..dff684c1699af 100644 --- a/src/test/ui/coherence/coherence_local_ref.rs +++ b/src/test/ui/coherence/coherence_local_ref.rs @@ -1,13 +1,11 @@ // Test that we are able to introduce a negative constraint that // `MyType: !MyTrait` along with other "fundamental" wrappers. +// check-pass // aux-build:coherence_copy_like_lib.rs -// compile-pass -// skip-codegen // revisions: old re #![cfg_attr(re, feature(re_rebalance_coherence))] -#![allow(dead_code)] extern crate coherence_copy_like_lib as lib; @@ -16,5 +14,4 @@ struct MyType { x: i32 } // naturally, legal impl lib::MyCopy for MyType { } - fn main() { } diff --git a/src/test/ui/conditional-compilation/cfg_attr_path.rs b/src/test/ui/conditional-compilation/cfg_attr_path.rs index 9e9ff6622ce96..efb718b786fa6 100644 --- a/src/test/ui/conditional-compilation/cfg_attr_path.rs +++ b/src/test/ui/conditional-compilation/cfg_attr_path.rs @@ -1,13 +1,12 @@ -// compile-pass -// skip-codegen -#![allow(dead_code)] +// check-pass + #![deny(unused_attributes)] // c.f #35584 + mod auxiliary { #[cfg_attr(any(), path = "nonexistent_file.rs")] pub mod namespaced_enums; #[cfg_attr(all(), path = "namespaced_enums.rs")] pub mod nonexistent_file; } - fn main() { let _ = auxiliary::namespaced_enums::Foo::A; let _ = auxiliary::nonexistent_file::Foo::A; diff --git a/src/test/ui/consts/const-fn-stability-calls-3.rs b/src/test/ui/consts/const-fn-stability-calls-3.rs index 44bcca8d8023a..b831dee580c1a 100644 --- a/src/test/ui/consts/const-fn-stability-calls-3.rs +++ b/src/test/ui/consts/const-fn-stability-calls-3.rs @@ -1,15 +1,12 @@ // Test use of const fn from another crate without a feature gate. -// compile-pass -// skip-codegen -#![allow(unused_variables)] +// check-pass // aux-build:const_fn_lib.rs extern crate const_fn_lib; use const_fn_lib::foo; - fn main() { let x = foo(); // use outside a constant is ok } diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs index ca0a432d3396e..3187b4cae55ee 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.rs @@ -30,8 +30,9 @@ // inputs are handled by each, and (2.) to ease searching for related // occurrences in the source text. +// check-pass + #![warn(unused_attributes, unknown_lints)] -#![allow(stable_features)] // UNGATED WHITE-LISTED BUILT-IN ATTRIBUTES @@ -75,7 +76,7 @@ // see issue-43106-gating-of-stable.rs // see issue-43106-gating-of-unstable.rs // see issue-43106-gating-of-deprecated.rs -#![windows_subsystem = "1000"] +#![windows_subsystem = "windows"] // UNGATED CRATE-LEVEL BUILT-IN ATTRIBUTES @@ -539,7 +540,7 @@ mod export_name { #[export_name = "2200"] impl S { } } -// Note that this test has a `skip-codegen`, so it +// Note that this is a `check-pass` test, so it // will never invoke the linker. These are here nonetheless to point // out that we allow them at non-crate-level (though I do not know // whether they have the same effect here as at crate-level). @@ -611,17 +612,17 @@ mod must_use { #[must_use] impl S { } } -#[windows_subsystem = "1000"] +#[windows_subsystem = "windows"] mod windows_subsystem { - mod inner { #![windows_subsystem="1000"] } + mod inner { #![windows_subsystem="windows"] } - #[windows_subsystem = "1000"] fn f() { } + #[windows_subsystem = "windows"] fn f() { } - #[windows_subsystem = "1000"] struct S; + #[windows_subsystem = "windows"] struct S; - #[windows_subsystem = "1000"] type T = S; + #[windows_subsystem = "windows"] type T = S; - #[windows_subsystem = "1000"] impl S { } + #[windows_subsystem = "windows"] impl S { } } // BROKEN USES OF CRATE-LEVEL BUILT-IN ATTRIBUTES diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr index c7081205e1481..e03b7124ac882 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr +++ b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr @@ -1,1182 +1,1186 @@ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:38:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:39:9 | LL | #![warn(x5400)] | ^^^^^ | note: lint level defined here - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:33:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:35:28 | LL | #![warn(unused_attributes, unknown_lints)] | ^^^^^^^^^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:39:10 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:40:10 | LL | #![allow(x5300)] | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:40:11 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:41:11 | LL | #![forbid(x5200)] | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:41:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:42:9 | LL | #![deny(x5100)] | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:99:8 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:100:8 | LL | #[warn(x5400)] | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:102:25 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:103:25 | LL | mod inner { #![warn(x5400)] } | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:105:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:106:12 | LL | #[warn(x5400)] fn f() { } | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:108:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:109:12 | LL | #[warn(x5400)] struct S; | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:111:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:112:12 | LL | #[warn(x5400)] type T = S; | ^^^^^ warning: unknown lint: `x5400` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:114:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:115:12 | LL | #[warn(x5400)] impl S { } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:118:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:119:9 | LL | #[allow(x5300)] | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:121:26 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:122:26 | LL | mod inner { #![allow(x5300)] } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:124:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:125:13 | LL | #[allow(x5300)] fn f() { } | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:127:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:128:13 | LL | #[allow(x5300)] struct S; | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:130:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:131:13 | LL | #[allow(x5300)] type T = S; | ^^^^^ warning: unknown lint: `x5300` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:133:13 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:134:13 | LL | #[allow(x5300)] impl S { } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:137:10 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:138:10 | LL | #[forbid(x5200)] | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:140:27 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:141:27 | LL | mod inner { #![forbid(x5200)] } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:143:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:144:14 | LL | #[forbid(x5200)] fn f() { } | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:146:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:147:14 | LL | #[forbid(x5200)] struct S; | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:149:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:150:14 | LL | #[forbid(x5200)] type T = S; | ^^^^^ warning: unknown lint: `x5200` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:152:14 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:153:14 | LL | #[forbid(x5200)] impl S { } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:156:8 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:157:8 | LL | #[deny(x5100)] | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:159:25 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:160:25 | LL | mod inner { #![deny(x5100)] } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:162:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:163:12 | LL | #[deny(x5100)] fn f() { } | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:165:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:166:12 | LL | #[deny(x5100)] struct S; | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:168:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:169:12 | LL | #[deny(x5100)] type T = S; | ^^^^^ warning: unknown lint: `x5100` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:171:12 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:172:12 | LL | #[deny(x5100)] impl S { } | ^^^^^ warning: macro_escape is a deprecated synonym for macro_use - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:455:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:456:1 | LL | #[macro_escape] | ^^^^^^^^^^^^^^^ warning: macro_escape is a deprecated synonym for macro_use - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:458:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:459:17 | LL | mod inner { #![macro_escape] } | ^^^^^^^^^^^^^^^^ | = help: consider an outer attribute, #[macro_use] mod ... +warning: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:89:12 + | +LL | #![feature(rust1)] + | ^^^^^ + | + = note: #[warn(stable_features)] on by default + warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:179:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:180:5 | LL | #[macro_use] fn f() { } | ^^^^^^^^^^^^ | note: lint level defined here - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:33:9 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:35:9 | LL | #![warn(unused_attributes, unknown_lints)] | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:182:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:183:5 | LL | #[macro_use] struct S; | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:185:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:186:5 | LL | #[macro_use] type T = S; | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:188:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:189:5 | LL | #[macro_use] impl S { } | ^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:195:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:196:17 | LL | mod inner { #![macro_export] } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:198:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:199:5 | LL | #[macro_export] fn f() { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:201:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:202:5 | LL | #[macro_export] struct S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:204:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:205:5 | LL | #[macro_export] type T = S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:207:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:208:5 | LL | #[macro_export] impl S { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:192:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:193:1 | LL | #[macro_export] | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:214:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:215:17 | LL | mod inner { #![plugin_registrar] } | ^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:219:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:220:5 | LL | #[plugin_registrar] struct S; | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:222:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:223:5 | LL | #[plugin_registrar] type T = S; | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:225:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:226:5 | LL | #[plugin_registrar] impl S { } | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:211:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:212:1 | LL | #[plugin_registrar] | ^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:232:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:233:17 | LL | mod inner { #![main] } | ^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:237:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:238:5 | LL | #[main] struct S; | ^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:240:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:241:5 | LL | #[main] type T = S; | ^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:243:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:244:5 | LL | #[main] impl S { } | ^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:229:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:230:1 | LL | #[main] | ^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:250:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:251:17 | LL | mod inner { #![start] } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:255:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:256:5 | LL | #[start] struct S; | ^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:258:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:259:5 | LL | #[start] type T = S; | ^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:261:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:262:5 | LL | #[start] impl S { } | ^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:247:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:248:1 | LL | #[start] | ^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:314:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:315:5 | LL | #[path = "3800"] fn f() { } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:317:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:318:5 | LL | #[path = "3800"] struct S; | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:320:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:321:5 | LL | #[path = "3800"] type T = S; | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:323:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:324:5 | LL | #[path = "3800"] impl S { } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:330:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:331:17 | LL | mod inner { #![automatically_derived] } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:333:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:334:5 | LL | #[automatically_derived] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:336:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:337:5 | LL | #[automatically_derived] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:339:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:340:5 | LL | #[automatically_derived] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:342:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:343:5 | LL | #[automatically_derived] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:327:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:328:1 | LL | #[automatically_derived] | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:362:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:363:17 | LL | mod inner { #![no_link] } | ^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:365:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:366:5 | LL | #[no_link] fn f() { } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:368:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:369:5 | LL | #[no_link] struct S; | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:371:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:372:5 | LL | #[no_link]type T = S; | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:374:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:375:5 | LL | #[no_link] impl S { } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:359:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:360:1 | LL | #[no_link] | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:381:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:382:17 | LL | mod inner { #![should_panic] } | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:384:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:385:5 | LL | #[should_panic] fn f() { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:387:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:388:5 | LL | #[should_panic] struct S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:390:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:391:5 | LL | #[should_panic] type T = S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:393:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:394:5 | LL | #[should_panic] impl S { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:378:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:379:1 | LL | #[should_panic] | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:400:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:17 | LL | mod inner { #![ignore] } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:403:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:404:5 | LL | #[ignore] fn f() { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:406:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:407:5 | LL | #[ignore] struct S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:409:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:410:5 | LL | #[ignore] type T = S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:412:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:413:5 | LL | #[ignore] impl S { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:397:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:398:1 | LL | #[ignore] | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:419:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:420:17 | LL | mod inner { #![no_implicit_prelude] } | ^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:422:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:423:5 | LL | #[no_implicit_prelude] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:425:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:5 | LL | #[no_implicit_prelude] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:428:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:429:5 | LL | #[no_implicit_prelude] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:431:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:432:5 | LL | #[no_implicit_prelude] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:416:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:417:1 | LL | #[no_implicit_prelude] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:438:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:439:17 | LL | mod inner { #![reexport_test_harness_main="2900"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:441:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:442:5 | LL | #[reexport_test_harness_main = "2900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:444:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:445:5 | LL | #[reexport_test_harness_main = "2900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:447:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:448:5 | LL | #[reexport_test_harness_main = "2900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:450:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:451:5 | LL | #[reexport_test_harness_main = "2900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:435:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:436:1 | LL | #[reexport_test_harness_main = "2900"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:461:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:5 | LL | #[macro_escape] fn f() { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:464:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:465:5 | LL | #[macro_escape] struct S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:467:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:468:5 | LL | #[macro_escape] type T = S; | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:470:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:471:5 | LL | #[macro_escape] impl S { } | ^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:478:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:479:17 | LL | mod inner { #![no_std] } | ^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:478:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:479:17 | LL | mod inner { #![no_std] } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:482:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:483:5 | LL | #[no_std] fn f() { } | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:482:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:483:5 | LL | #[no_std] fn f() { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:486:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:487:5 | LL | #[no_std] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:486:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:487:5 | LL | #[no_std] struct S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:490:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:491:5 | LL | #[no_std] type T = S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:490:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:491:5 | LL | #[no_std] type T = S; | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:494:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:495:5 | LL | #[no_std] impl S { } | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:494:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:495:5 | LL | #[no_std] impl S { } | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:474:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:475:1 | LL | #[no_std] | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:474:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:475:1 | LL | #[no_std] | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:633:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:634:17 | LL | mod inner { #![crate_name="0900"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:633:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:634:17 | LL | mod inner { #![crate_name="0900"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:637:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:638:5 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:637:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:638:5 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:641:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:642:5 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:641:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:642:5 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:645:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:646:5 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:645:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:646:5 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:649:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:650:5 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:649:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:650:5 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:629:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:630:1 | LL | #[crate_name = "0900"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:629:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:630:1 | LL | #[crate_name = "0900"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:658:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:659:17 | LL | mod inner { #![crate_type="0800"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:658:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:659:17 | LL | mod inner { #![crate_type="0800"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:662:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:5 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:662:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:5 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:666:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:5 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:666:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:5 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:670:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:671:5 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:670:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:671:5 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:674:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:5 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:674:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:5 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:654:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:655:1 | LL | #[crate_type = "0800"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:654:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:655:1 | LL | #[crate_type = "0800"] | ^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:683:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:684:17 | LL | mod inner { #![feature(x0600)] } | ^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:683:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:684:17 | LL | mod inner { #![feature(x0600)] } | ^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:5 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:5 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:692:5 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:692:5 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:680:1 | LL | #[feature(x0600)] | ^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:680:1 | LL | #[feature(x0600)] | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:709:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:710:17 | LL | mod inner { #![no_main] } | ^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:709:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:710:17 | LL | mod inner { #![no_main] } | ^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:714:5 | LL | #[no_main] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:714:5 | LL | #[no_main] fn f() { } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:5 | LL | #[no_main] struct S; | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:5 | LL | #[no_main] struct S; | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:722:5 | LL | #[no_main] type T = S; | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:722:5 | LL | #[no_main] type T = S; | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:726:5 | LL | #[no_main] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:726:5 | LL | #[no_main] impl S { } | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:705:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:1 | LL | #[no_main] | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:705:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:1 | LL | #[no_main] | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:747:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:748:17 | LL | mod inner { #![recursion_limit="0200"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:747:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:748:17 | LL | mod inner { #![recursion_limit="0200"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:752:5 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:752:5 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:756:5 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:756:5 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:760:5 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:760:5 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:764:5 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:764:5 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:1 | LL | #[recursion_limit="0200"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:1 | LL | #[recursion_limit="0200"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:772:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:773:17 | LL | mod inner { #![type_length_limit="0100"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be in the root module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:772:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:773:17 | LL | mod inner { #![type_length_limit="0100"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:776:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:777:5 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:776:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:777:5 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:780:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:5 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:780:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:5 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:5 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:5 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:5 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:5 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:768:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:769:1 | LL | #[type_length_limit="0100"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:768:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:769:1 | LL | #[type_length_limit="0100"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:43:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:44:1 | LL | #![macro_export] | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:44:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:45:1 | LL | #![plugin_registrar] | ^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:47:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:48:1 | LL | #![main] | ^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:48:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:49:1 | LL | #![start] | ^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:51:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:52:1 | LL | #![repr()] | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:53:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:54:1 | LL | #![path = "3800"] | ^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:54:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:1 | LL | #![automatically_derived] | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:56:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:57:1 | LL | #![no_link] | ^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:58:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1 | LL | #![should_panic] | ^^^^^^^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:60:1 | LL | #![ignore] | ^^^^^^^^^^ warning: unused attribute - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:65:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:66:1 | LL | #![proc_macro_derive()] | ^^^^^^^^^^^^^^^^^^^^^^^ -error: invalid windows subsystem `1000`, only `windows` and `console` are allowed - -error: aborting due to previous error - diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-deprecated.rs b/src/test/ui/feature-gate/issue-43106-gating-of-deprecated.rs index 360d570b65061..5e1d08dd919d0 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-deprecated.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-deprecated.rs @@ -5,8 +5,7 @@ // // (For non-crate-level cases, see issue-43106-gating-of-builtin-attrs.rs) -// compile-pass -// skip-codegen +// check-pass #![deprecated] diff --git a/src/test/ui/glob-cycles.rs b/src/test/ui/glob-cycles.rs index 84f9e5d843608..f354cc885d00d 100644 --- a/src/test/ui/glob-cycles.rs +++ b/src/test/ui/glob-cycles.rs @@ -1,5 +1,5 @@ -// compile-pass -// skip-codegen +// check-pass + mod foo { pub use bar::*; pub use main as f; @@ -15,5 +15,4 @@ mod baz { pub use super::*; } - pub fn main() {} diff --git a/src/test/ui/hygiene/assoc_ty_bindings.rs b/src/test/ui/hygiene/assoc_ty_bindings.rs index eb0ca6a7d5f76..93cf7591a0db2 100644 --- a/src/test/ui/hygiene/assoc_ty_bindings.rs +++ b/src/test/ui/hygiene/assoc_ty_bindings.rs @@ -1,8 +1,8 @@ +// check-pass // ignore-pretty pretty-printing is unhygienic #![feature(decl_macro, associated_type_defaults)] -// compile-pass -// skip-codegen + trait Base { type AssocTy; fn f(); @@ -35,5 +35,4 @@ macro mac() { mac!(); - fn main() {} diff --git a/src/test/ui/if/if-loop.rs b/src/test/ui/if/if-loop.rs index c799df2380013..06d0bdf456cdb 100644 --- a/src/test/ui/if/if-loop.rs +++ b/src/test/ui/if/if-loop.rs @@ -1,10 +1,8 @@ -// compile-pass -// skip-codegen -#![allow(warnings)] +// check-pass + // This used to ICE because the "if" being unreachable was not handled correctly fn err() { if loop {} {} } - fn main() {} diff --git a/src/test/ui/imports/import-crate-var.rs b/src/test/ui/imports/import-crate-var.rs index ab260500bb31f..b9d146d3735f2 100644 --- a/src/test/ui/imports/import-crate-var.rs +++ b/src/test/ui/imports/import-crate-var.rs @@ -1,10 +1,8 @@ +// check-pass // aux-build:import_crate_var.rs -// compile-pass -// skip-codegen #[macro_use] extern crate import_crate_var; - fn main() { m!(); //~^ WARN `$crate` may not be imported diff --git a/src/test/ui/imports/import-crate-var.stderr b/src/test/ui/imports/import-crate-var.stderr index 4c358a81cc1a4..2f8c845156a82 100644 --- a/src/test/ui/imports/import-crate-var.stderr +++ b/src/test/ui/imports/import-crate-var.stderr @@ -1,5 +1,5 @@ warning: `$crate` may not be imported - --> $DIR/import-crate-var.rs:9:5 + --> $DIR/import-crate-var.rs:7:5 | LL | m!(); | ^^^^^ diff --git a/src/test/ui/issues/issue-11740.rs b/src/test/ui/issues/issue-11740.rs index 47bdf085ee5db..dc10a205f2418 100644 --- a/src/test/ui/issues/issue-11740.rs +++ b/src/test/ui/issues/issue-11740.rs @@ -1,6 +1,5 @@ -// compile-pass -// skip-codegen -#![allow(warnings)] +// check-pass + struct Attr { name: String, value: String, @@ -21,7 +20,6 @@ impl Element { } } - fn main() { let element = Element { attrs: Vec::new() }; let _ = unsafe { element.get_attr("foo") }; diff --git a/src/test/ui/issues/issue-16994.rs b/src/test/ui/issues/issue-16994.rs index d5f1b1310eb5c..8d3074bcee9cc 100644 --- a/src/test/ui/issues/issue-16994.rs +++ b/src/test/ui/issues/issue-16994.rs @@ -1,10 +1,9 @@ -// compile-pass -// skip-codegen +// check-pass + fn cb<'a,T>(_x: Box, bool))) -> T>) -> T { panic!() } - fn main() { cb(Box::new(|(k, &(ref v, b))| (*k, v.clone(), b))); } diff --git a/src/test/ui/issues/issue-19601.rs b/src/test/ui/issues/issue-19601.rs index faaa2db370eea..176e6ba410670 100644 --- a/src/test/ui/issues/issue-19601.rs +++ b/src/test/ui/issues/issue-19601.rs @@ -1,9 +1,6 @@ -// compile-pass -// skip-codegen -#![allow(warnings)] +// check-pass + trait A {} struct B where B: A> { t: T } - -fn main() { -} +fn main() {} diff --git a/src/test/ui/issues/issue-22603.rs b/src/test/ui/issues/issue-22603.rs index 717f15b76ac58..a83e291f999ab 100644 --- a/src/test/ui/issues/issue-22603.rs +++ b/src/test/ui/issues/issue-22603.rs @@ -1,6 +1,7 @@ // check-pass #![feature(unboxed_closures, fn_traits)] + struct Foo; impl FnOnce<(A,)> for Foo { diff --git a/src/test/ui/issues/issue-22789.rs b/src/test/ui/issues/issue-22789.rs index e6680124f85a8..cef4075376686 100644 --- a/src/test/ui/issues/issue-22789.rs +++ b/src/test/ui/issues/issue-22789.rs @@ -1,6 +1,7 @@ -// compile-pass -// skip-codegen +// check-pass + #![feature(unboxed_closures, fn_traits)] + fn main() { let k = |x: i32| { x + 1 }; Fn::call(&k, (0,)); diff --git a/src/test/ui/issues/issue-22933-1.rs b/src/test/ui/issues/issue-22933-1.rs index 1bf8cb01cf7b5..3c9aa26697907 100644 --- a/src/test/ui/issues/issue-22933-1.rs +++ b/src/test/ui/issues/issue-22933-1.rs @@ -1,6 +1,5 @@ -// compile-pass -// skip-codegen -#![allow(warnings)] +// check-pass + struct CNFParser { token: char, } @@ -14,12 +13,11 @@ impl CNFParser { self.consume_while(&(CNFParser::is_whitespace)) } - fn consume_while(&mut self, p: &Fn(char) -> bool) { + fn consume_while(&mut self, p: &dyn Fn(char) -> bool) { while p(self.token) { return } } } - fn main() {} diff --git a/src/test/ui/issues/issue-24883.rs b/src/test/ui/issues/issue-24883.rs index 1aa62d3a3b6ed..819a20ddbda92 100644 --- a/src/test/ui/issues/issue-24883.rs +++ b/src/test/ui/issues/issue-24883.rs @@ -1,5 +1,5 @@ -// compile-pass -// skip-codegen +// check-pass + mod a { pub mod b { pub struct Foo; } @@ -11,7 +11,6 @@ mod a { pub use self::c::*; } - fn main() { let _ = a::c::Bar(a::b::Foo); let _ = a::Bar(a::b::Foo); diff --git a/src/test/ui/issues/issue-26614.rs b/src/test/ui/issues/issue-26614.rs index 11c22020733bb..b8ebbdc5abc3e 100644 --- a/src/test/ui/issues/issue-26614.rs +++ b/src/test/ui/issues/issue-26614.rs @@ -1,6 +1,5 @@ -// compile-pass -// skip-codegen -#![allow(warnings)] +// check-pass + trait Mirror { type It; } @@ -9,8 +8,6 @@ impl Mirror for T { type It = Self; } - - fn main() { let c: ::It = 5; const CCCC: ::It = 5; diff --git a/src/test/ui/issues/issue-26930.rs b/src/test/ui/issues/issue-26930.rs index abf6b933c3b5f..707e71b11249d 100644 --- a/src/test/ui/issues/issue-26930.rs +++ b/src/test/ui/issues/issue-26930.rs @@ -1,10 +1,8 @@ -// compile-pass -// skip-codegen -#![allow(unused)] +// check-pass + extern crate core; use core as core_export; use self::x::*; mod x {} - fn main() {} diff --git a/src/test/ui/issues/issue-29857.rs b/src/test/ui/issues/issue-29857.rs index 5aff968bb6a89..6f4c5f45d0d9c 100644 --- a/src/test/ui/issues/issue-29857.rs +++ b/src/test/ui/issues/issue-29857.rs @@ -1,5 +1,4 @@ -// compile-pass -// skip-codegen +// check-pass use std::marker::PhantomData; @@ -17,5 +16,4 @@ pub trait Bar { impl> Foo<*mut T> for W {} - fn main() {} diff --git a/src/test/ui/issues/issue-31924-non-snake-ffi.rs b/src/test/ui/issues/issue-31924-non-snake-ffi.rs index 5e2336cce2cc5..63e42b484427e 100644 --- a/src/test/ui/issues/issue-31924-non-snake-ffi.rs +++ b/src/test/ui/issues/issue-31924-non-snake-ffi.rs @@ -1,8 +1,8 @@ -// compile-pass -// skip-codegen +// check-pass + #![deny(non_snake_case)] -#[no_mangle] -pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} +#[no_mangle] +pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} // OK fn main() {} diff --git a/src/test/ui/issues/issue-32119.rs b/src/test/ui/issues/issue-32119.rs index ea8824b7966e8..36adb5289aca5 100644 --- a/src/test/ui/issues/issue-32119.rs +++ b/src/test/ui/issues/issue-32119.rs @@ -1,6 +1,5 @@ -// compile-pass -// skip-codegen -#![allow(dead_code)] +// check-pass + pub type T = (); mod foo { pub use super::T; } mod bar { pub use super::T; } @@ -15,5 +14,4 @@ mod baz { pub use self::bar::*; } - fn main() {} diff --git a/src/test/ui/issues/issue-32222.rs b/src/test/ui/issues/issue-32222.rs index 91f53ab2805a8..4ed06bff80341 100644 --- a/src/test/ui/issues/issue-32222.rs +++ b/src/test/ui/issues/issue-32222.rs @@ -1,6 +1,4 @@ -// compile-pass -// skip-codegen -#![allow(warnings)] +// check-pass mod foo { pub fn bar() {} @@ -21,5 +19,4 @@ mod b { pub use a::bar; } - fn main() {} diff --git a/src/test/ui/issues/issue-32797.rs b/src/test/ui/issues/issue-32797.rs index 5ceb7f49331e5..b12b929f8fcf8 100644 --- a/src/test/ui/issues/issue-32797.rs +++ b/src/test/ui/issues/issue-32797.rs @@ -1,5 +1,4 @@ -// compile-pass -// skip-codegen +// check-pass pub use bar::*; mod bar { @@ -11,5 +10,4 @@ mod baz { pub use main as f; } - pub fn main() {} diff --git a/src/test/ui/issues/issue-32922.rs b/src/test/ui/issues/issue-32922.rs index b06b63cbdc3ff..54ec44a1cf4e5 100644 --- a/src/test/ui/issues/issue-32922.rs +++ b/src/test/ui/issues/issue-32922.rs @@ -1,6 +1,4 @@ -// compile-pass -// skip-codegen -#![allow(warnings)] +// check-pass macro_rules! foo { () => { let x = 1; @@ -22,7 +20,6 @@ macro_rules! baz { } } - fn main() { foo! {}; bar! {}; diff --git a/src/test/ui/issues/issue-33241.rs b/src/test/ui/issues/issue-33241.rs index 4d6204cb28832..5f9f1e4a74211 100644 --- a/src/test/ui/issues/issue-33241.rs +++ b/src/test/ui/issues/issue-33241.rs @@ -1,5 +1,4 @@ -// compile-pass -// skip-codegen +// check-pass use std::fmt; @@ -7,7 +6,6 @@ use std::fmt; // an unsized tuple by transmuting a trait object. fn any() -> T { unreachable!() } - fn main() { let t: &(u8, dyn fmt::Debug) = any(); println!("{:?}", &t.1); diff --git a/src/test/ui/issues/issue-34028.rs b/src/test/ui/issues/issue-34028.rs index 8ebc730755faa..d761c0c823bcd 100644 --- a/src/test/ui/issues/issue-34028.rs +++ b/src/test/ui/issues/issue-34028.rs @@ -1,5 +1,4 @@ -// compile-pass -// skip-codegen +// check-pass macro_rules! m { () => { #[cfg(any())] fn f() {} } @@ -8,5 +7,4 @@ macro_rules! m { trait T {} impl T for () { m!(); } - fn main() {} diff --git a/src/test/ui/issues/issue-34171.rs b/src/test/ui/issues/issue-34171.rs index 25a5f72e803ba..157c58c459d66 100644 --- a/src/test/ui/issues/issue-34171.rs +++ b/src/test/ui/issues/issue-34171.rs @@ -1,12 +1,10 @@ -// compile-pass -// skip-codegen +// check-pass macro_rules! null { ($i:tt) => {} } macro_rules! apply_null { ($i:item) => { null! { $i } } } - fn main() { apply_null!(#[cfg(all())] fn f() {}); } diff --git a/src/test/ui/issues/issue-34418.rs b/src/test/ui/issues/issue-34418.rs index 6a86c277eafa6..6132f744b50a9 100644 --- a/src/test/ui/issues/issue-34418.rs +++ b/src/test/ui/issues/issue-34418.rs @@ -1,6 +1,4 @@ -// compile-pass -// skip-codegen -#![allow(unused)] +// check-pass macro_rules! make_item { () => { fn f() {} } @@ -18,5 +16,4 @@ fn g() { make_stmt! {} } - fn main() {} diff --git a/src/test/ui/issues/issue-34839.rs b/src/test/ui/issues/issue-34839.rs index 01669f01e2ff4..8ffed827e9087 100644 --- a/src/test/ui/issues/issue-34839.rs +++ b/src/test/ui/issues/issue-34839.rs @@ -1,6 +1,4 @@ -// compile-pass -// skip-codegen -#![allow(dead_code)] +// check-pass trait RegularExpression: Sized { type Text; @@ -18,5 +16,4 @@ enum FindCapturesInner<'r, 't> { Dynamic(FindCaptures<'t, ExecNoSyncStr<'r>>), } - fn main() {} diff --git a/src/test/ui/issues/issue-35570.rs b/src/test/ui/issues/issue-35570.rs index 9bb9db63951c3..fafef79ea5b86 100644 --- a/src/test/ui/issues/issue-35570.rs +++ b/src/test/ui/issues/issue-35570.rs @@ -1,5 +1,4 @@ -// compile-pass -// skip-codegen +// check-pass use std::mem; @@ -25,7 +24,6 @@ fn foo<'a>(x: &'a ()) -> <() as Lifetime<'a>>::Out { fn takes_lifetime(_f: for<'a> fn(&'a ()) -> <() as Lifetime<'a>>::Out) { } - fn main() { takes_lifetime(foo); } diff --git a/src/test/ui/issues/issue-36116.rs b/src/test/ui/issues/issue-36116.rs index b4bfba4d6e5d7..c7c70c7afe743 100644 --- a/src/test/ui/issues/issue-36116.rs +++ b/src/test/ui/issues/issue-36116.rs @@ -1,8 +1,7 @@ // Unnecessary path disambiguator is ok -// compile-pass -// skip-codegen -#![allow(unused)] +// check-pass + macro_rules! m { ($p: path) => { let _ = $p(0); @@ -23,5 +22,4 @@ fn f() { m!(S::); } - fn main() {} diff --git a/src/test/ui/issues/issue-36379.rs b/src/test/ui/issues/issue-36379.rs index b2da65131fb17..3a3e6f47067d9 100644 --- a/src/test/ui/issues/issue-36379.rs +++ b/src/test/ui/issues/issue-36379.rs @@ -1,7 +1,5 @@ -// compile-pass -// skip-codegen +// check-pass fn _test() -> impl Default { } - -fn main() { } +fn main() {} diff --git a/src/test/ui/issues/issue-36839.rs b/src/test/ui/issues/issue-36839.rs index a660368f40153..ca3d66b1c8eb7 100644 --- a/src/test/ui/issues/issue-36839.rs +++ b/src/test/ui/issues/issue-36839.rs @@ -1,5 +1,4 @@ -// compile-pass -// skip-codegen +// check-pass pub trait Foo { type Bar; @@ -17,7 +16,6 @@ impl Broken for T { } } - fn main() { let _m: &dyn Broken = &(); } diff --git a/src/test/ui/issues/issue-37051.rs b/src/test/ui/issues/issue-37051.rs index 1ccf5b9780190..9cae6cf5e7665 100644 --- a/src/test/ui/issues/issue-37051.rs +++ b/src/test/ui/issues/issue-37051.rs @@ -1,7 +1,7 @@ -// compile-pass -// skip-codegen +// check-pass + #![feature(associated_type_defaults)] -#![allow(warnings)] + trait State: Sized { type NextState: State = StateMachineEnded; fn execute(self) -> Option; @@ -15,6 +15,4 @@ impl State for StateMachineEnded { } } - -fn main() { -} +fn main() {} diff --git a/src/test/ui/issues/issue-37366.rs b/src/test/ui/issues/issue-37366.rs index 1c27960e9afb2..6bf3a276ce138 100644 --- a/src/test/ui/issues/issue-37366.rs +++ b/src/test/ui/issues/issue-37366.rs @@ -1,6 +1,6 @@ +// check-pass // ignore-emscripten -// compile-pass -// skip-codegen + #![feature(asm)] macro_rules! interrupt_handler { @@ -12,6 +12,4 @@ macro_rules! interrupt_handler { } interrupt_handler!{} - -fn main() { -} +fn main() {} diff --git a/src/test/ui/issues/issue-37510.rs b/src/test/ui/issues/issue-37510.rs index 465e680995704..2081c9f7e26ec 100644 --- a/src/test/ui/issues/issue-37510.rs +++ b/src/test/ui/issues/issue-37510.rs @@ -1,9 +1,7 @@ -// compile-pass -// skip-codegen +// check-pass fn foo(_: &mut i32) -> bool { true } - fn main() { let opt = Some(92); let mut x = 62; diff --git a/src/test/ui/issues/issue-38160.rs b/src/test/ui/issues/issue-38160.rs index a454211c4df87..0da8b7900a8a5 100644 --- a/src/test/ui/issues/issue-38160.rs +++ b/src/test/ui/issues/issue-38160.rs @@ -1,7 +1,5 @@ -// compile-pass -// skip-codegen -#![feature(associated_consts)] -#![allow(warnings)] +// check-pass + trait MyTrait { const MY_CONST: &'static str; } @@ -18,5 +16,4 @@ macro_rules! my_macro { my_macro!(); - fn main() {} diff --git a/src/test/ui/issues/issue-38381.rs b/src/test/ui/issues/issue-38381.rs index 135137690e577..82d4a4e325ac0 100644 --- a/src/test/ui/issues/issue-38381.rs +++ b/src/test/ui/issues/issue-38381.rs @@ -1,9 +1,7 @@ -// compile-pass -// skip-codegen +// check-pass use std::ops::Deref; - fn main() { let _x: fn(&i32) -> <&i32 as Deref>::Target = unimplemented!(); } diff --git a/src/test/ui/issues/issue-40350.rs b/src/test/ui/issues/issue-40350.rs index b2cc0047bb885..a39a8519aa986 100644 --- a/src/test/ui/issues/issue-40350.rs +++ b/src/test/ui/issues/issue-40350.rs @@ -1,6 +1,4 @@ -// compile-pass -// skip-codegen -#![allow(warnings)] +// check-pass enum E { A = { @@ -9,5 +7,4 @@ enum E { } } - fn main() {} diff --git a/src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs b/src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs index 5a008ad26b444..a558e8a1813fd 100644 --- a/src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs +++ b/src/test/ui/nll/closure-requirements/region-lbr1-does-outlive-lbr2-because-implied-bound.rs @@ -1,12 +1,11 @@ // Basic test for free regions in the NLL code. This test does not // report an error because of the (implied) bound that `'b: 'a`. +// check-pass // compile-flags:-Zborrowck=mir -Zverbose -// compile-pass -// skip-codegen fn foo<'a, 'b>(x: &'a &'b u32) -> &'a u32 { &**x } -fn main() { } +fn main() {} diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs index 5dbd38e07df02..d1e7c3b4d518a 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs @@ -1,5 +1,5 @@ -// compile-pass -// skip-codegen +// check-pass + #![deny(unreachable_patterns)] #![feature(exhaustive_patterns)] #![feature(never_type)] diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs index 74922d4bcb5d5..8973d21bff6fa 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs @@ -1,5 +1,5 @@ -// compile-pass -// skip-codegen +// check-pass + #![deny(unreachable_patterns)] #![feature(exhaustive_patterns)] #![feature(never_type)] diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 1f52421ecbc15..e4765c641aa8e 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -539,13 +539,10 @@ impl TestProps { let pass_mode = if config.parse_name_directive(ln, "check-pass") { check_no_run("check-pass"); Some(PassMode::Check) - } else if config.parse_name_directive(ln, "skip-codegen") { - check_no_run("skip-codegen"); - Some(PassMode::Check) } else if config.parse_name_directive(ln, "build-pass") { check_no_run("build-pass"); Some(PassMode::Build) - } else if config.parse_name_directive(ln, "compile-pass") { + } else if config.parse_name_directive(ln, "compile-pass") /* compatibility */ { check_no_run("compile-pass"); Some(PassMode::Build) } else if config.parse_name_directive(ln, "run-pass") { @@ -558,7 +555,6 @@ impl TestProps { }; match (self.pass_mode, pass_mode) { (None, Some(_)) => self.pass_mode = pass_mode, - (Some(_), Some(pm)) if pm == PassMode::Check => self.pass_mode = pass_mode, (Some(_), Some(_)) => panic!("multiple `*-pass` headers in a single test"), (_, None) => {} } From 0886bc4cbf3ec9b782b2dc9ed99ac6bed9df7b00 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 16 Jun 2019 12:43:35 +0300 Subject: [PATCH 4/4] compiletest: Move pass mode update into a separate function --- src/tools/compiletest/src/header.rs | 68 +++++++++++++++-------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index e4765c641aa8e..6ce7461f759a4 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -526,38 +526,7 @@ impl TestProps { self.check_test_line_numbers_match = config.parse_check_test_line_numbers_match(ln); } - let check_no_run = |s| { - if config.mode != Mode::Ui && config.mode != Mode::Incremental { - panic!("`{}` header is only supported in UI and incremental tests", s); - } - if config.mode == Mode::Incremental && - !cfg.map_or(false, |r| r.starts_with("cfail")) && - !self.revisions.iter().all(|r| r.starts_with("cfail")) { - panic!("`{}` header is only supported in `cfail` incremental tests", s); - } - }; - let pass_mode = if config.parse_name_directive(ln, "check-pass") { - check_no_run("check-pass"); - Some(PassMode::Check) - } else if config.parse_name_directive(ln, "build-pass") { - check_no_run("build-pass"); - Some(PassMode::Build) - } else if config.parse_name_directive(ln, "compile-pass") /* compatibility */ { - check_no_run("compile-pass"); - Some(PassMode::Build) - } else if config.parse_name_directive(ln, "run-pass") { - if config.mode != Mode::Ui && config.mode != Mode::RunPass /* compatibility */ { - panic!("`run-pass` header is only supported in UI tests") - } - Some(PassMode::Run) - } else { - None - }; - match (self.pass_mode, pass_mode) { - (None, Some(_)) => self.pass_mode = pass_mode, - (Some(_), Some(_)) => panic!("multiple `*-pass` headers in a single test"), - (_, None) => {} - } + self.update_pass_mode(ln, cfg, config); if !self.disable_ui_testing_normalization { self.disable_ui_testing_normalization = @@ -604,6 +573,41 @@ impl TestProps { } } } + + fn update_pass_mode(&mut self, ln: &str, revision: Option<&str>, config: &Config) { + let check_no_run = |s| { + if config.mode != Mode::Ui && config.mode != Mode::Incremental { + panic!("`{}` header is only supported in UI and incremental tests", s); + } + if config.mode == Mode::Incremental && + !revision.map_or(false, |r| r.starts_with("cfail")) && + !self.revisions.iter().all(|r| r.starts_with("cfail")) { + panic!("`{}` header is only supported in `cfail` incremental tests", s); + } + }; + let pass_mode = if config.parse_name_directive(ln, "check-pass") { + check_no_run("check-pass"); + Some(PassMode::Check) + } else if config.parse_name_directive(ln, "build-pass") { + check_no_run("build-pass"); + Some(PassMode::Build) + } else if config.parse_name_directive(ln, "compile-pass") /* compatibility */ { + check_no_run("compile-pass"); + Some(PassMode::Build) + } else if config.parse_name_directive(ln, "run-pass") { + if config.mode != Mode::Ui && config.mode != Mode::RunPass /* compatibility */ { + panic!("`run-pass` header is only supported in UI tests") + } + Some(PassMode::Run) + } else { + None + }; + match (self.pass_mode, pass_mode) { + (None, Some(_)) => self.pass_mode = pass_mode, + (Some(_), Some(_)) => panic!("multiple `*-pass` headers in a single test"), + (_, None) => {} + } + } } fn iter_header(testfile: &Path, cfg: Option<&str>, it: &mut dyn FnMut(&str)) {