diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index e0e4c076071b6..14bc90700b76e 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -523,6 +523,10 @@ def get_toml(self, key, section=None): 'value2' >>> rb.get_toml('key', 'c') is None True + + >>> rb.config_toml = 'key1 = true' + >>> rb.get_toml("key1") + 'true' """ cur_section = None @@ -571,6 +575,12 @@ def get_string(line): >>> RustBuild.get_string(' "devel" ') 'devel' + >>> RustBuild.get_string(" 'devel' ") + 'devel' + >>> RustBuild.get_string('devel') is None + True + >>> RustBuild.get_string(' "devel ') + '' """ start = line.find('"') if start != -1: @@ -822,13 +832,13 @@ def bootstrap(help_triggered): except (OSError, IOError): pass - match = re.search(r'\nverbose = (\d+)', build.config_toml) - if match is not None: - build.verbose = max(build.verbose, int(match.group(1))) + config_verbose = build.get_toml('verbose', 'build') + if config_verbose is not None: + build.verbose = max(build.verbose, int(config_verbose)) - build.use_vendored_sources = '\nvendor = true' in build.config_toml + build.use_vendored_sources = build.get_toml('vendor', 'build') == 'true' - build.use_locked_deps = '\nlocked-deps = true' in build.config_toml + build.use_locked_deps = build.get_toml('locked-deps', 'build') == 'true' build.check_vendored_status() diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs index f67526ea4a1d9..62910ec320494 100644 --- a/src/librustc/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -4,6 +4,7 @@ use std::borrow::Cow; use std::fmt; use rustc_target::spec::abi; use syntax::ast; +use syntax::errors::pluralise; use errors::{Applicability, DiagnosticBuilder}; use syntax_pos::Span; @@ -82,12 +83,6 @@ impl<'tcx> fmt::Display for TypeError<'tcx> { } }; - macro_rules! pluralise { - ($x:expr) => { - if $x != 1 { "s" } else { "" } - }; - } - match *self { CyclicTy(_) => write!(f, "cyclic type of infinite size"), Mismatch => write!(f, "types differ"), diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 6585633e00af8..c1fba416d6433 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -845,3 +845,10 @@ impl Level { } } } + +#[macro_export] +macro_rules! pluralise { + ($x:expr) => { + if $x != 1 { "s" } else { "" } + }; +} diff --git a/src/librustc_metadata/native_libs.rs b/src/librustc_metadata/native_libs.rs index 66971bb6f8b1c..66d676b7747d0 100644 --- a/src/librustc_metadata/native_libs.rs +++ b/src/librustc_metadata/native_libs.rs @@ -159,7 +159,7 @@ impl Collector<'tcx> { sym::link_cfg, span.unwrap(), GateIssue::Language, - "is feature gated"); + "is unstable"); } if lib.kind == cstore::NativeStaticNobundle && !self.tcx.features().static_nobundle { @@ -167,7 +167,7 @@ impl Collector<'tcx> { sym::static_nobundle, span.unwrap_or_else(|| syntax_pos::DUMMY_SP), GateIssue::Language, - "kind=\"static-nobundle\" is feature gated"); + "kind=\"static-nobundle\" is unstable"); } self.libs.push(lib); } diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 9e52eae88ef45..e9ca0f3d978ca 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -23,6 +23,7 @@ use rustc_target::spec::abi; use crate::require_c_abi_if_c_variadic; use smallvec::SmallVec; use syntax::ast; +use syntax::errors::pluralise; use syntax::feature_gate::{GateIssue, emit_feature_err}; use syntax::util::lev_distance::find_best_match_for_name; use syntax::symbol::sym; @@ -377,7 +378,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { quantifier, bound, kind, - if bound != 1 { "s" } else { "" }, + pluralise!(bound), )) }; diff --git a/src/librustc_typeck/check/compare_method.rs b/src/librustc_typeck/check/compare_method.rs index 8e187b7e05b51..f22499f547272 100644 --- a/src/librustc_typeck/check/compare_method.rs +++ b/src/librustc_typeck/check/compare_method.rs @@ -10,6 +10,7 @@ use rustc::util::common::ErrorReported; use errors::{Applicability, DiagnosticId}; use syntax_pos::Span; +use syntax::errors::pluralise; use super::{Inherited, FnCtxt, potentially_plural_count}; @@ -648,9 +649,9 @@ fn compare_number_of_generics<'tcx>( declaration has {} {kind} parameter{}", trait_.ident, impl_count, - if impl_count != 1 { "s" } else { "" }, + pluralise!(impl_count), trait_count, - if trait_count != 1 { "s" } else { "" }, + pluralise!(trait_count), kind = kind, ), DiagnosticId::Error("E0049".into()), @@ -665,7 +666,7 @@ fn compare_number_of_generics<'tcx>( "expected {} {} parameter{}", trait_count, kind, - if trait_count != 1 { "s" } else { "" }, + pluralise!(trait_count), )); } for span in spans { @@ -680,7 +681,7 @@ fn compare_number_of_generics<'tcx>( "found {} {} parameter{}{}", impl_count, kind, - if impl_count != 1 { "s" } else { "" }, + pluralise!(impl_count), suffix.unwrap_or_else(|| String::new()), )); } diff --git a/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs b/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs index 9db5233e21e57..ceca54b7cd75f 100644 --- a/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs +++ b/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![feature(associated_type_bounds)] diff --git a/src/test/ui/associated-type-bounds/fn-apit.rs b/src/test/ui/associated-type-bounds/fn-apit.rs index 7e208b4e70d81..3c9f511338f69 100644 --- a/src/test/ui/associated-type-bounds/fn-apit.rs +++ b/src/test/ui/associated-type-bounds/fn-apit.rs @@ -1,6 +1,7 @@ // run-pass // aux-build:fn-aux.rs +#![allow(unused)] #![feature(associated_type_bounds)] extern crate fn_aux; diff --git a/src/test/ui/associated-type-bounds/fn-dyn-apit.rs b/src/test/ui/associated-type-bounds/fn-dyn-apit.rs index 9ff4a50e1e6e4..c4e8092c211d6 100644 --- a/src/test/ui/associated-type-bounds/fn-dyn-apit.rs +++ b/src/test/ui/associated-type-bounds/fn-dyn-apit.rs @@ -1,6 +1,7 @@ // run-pass // aux-build:fn-dyn-aux.rs +#![allow(unused)] #![feature(associated_type_bounds)] extern crate fn_dyn_aux; diff --git a/src/test/ui/associated-type-bounds/fn-inline.rs b/src/test/ui/associated-type-bounds/fn-inline.rs index 7b188763b7a5e..8fa7212d6275b 100644 --- a/src/test/ui/associated-type-bounds/fn-inline.rs +++ b/src/test/ui/associated-type-bounds/fn-inline.rs @@ -1,6 +1,7 @@ // run-pass // aux-build:fn-aux.rs +#![allow(unused)] #![feature(associated_type_bounds)] extern crate fn_aux; diff --git a/src/test/ui/associated-type-bounds/fn-where.rs b/src/test/ui/associated-type-bounds/fn-where.rs index 60d7149a56f25..9c4f82ac991c8 100644 --- a/src/test/ui/associated-type-bounds/fn-where.rs +++ b/src/test/ui/associated-type-bounds/fn-where.rs @@ -1,6 +1,7 @@ // run-pass // aux-build:fn-aux.rs +#![allow(unused)] #![feature(associated_type_bounds)] extern crate fn_aux; diff --git a/src/test/ui/associated-type-bounds/fn-wrap-apit.rs b/src/test/ui/associated-type-bounds/fn-wrap-apit.rs index 23790d416e1f7..96df13e372a24 100644 --- a/src/test/ui/associated-type-bounds/fn-wrap-apit.rs +++ b/src/test/ui/associated-type-bounds/fn-wrap-apit.rs @@ -2,6 +2,7 @@ // aux-build:fn-aux.rs #![feature(associated_type_bounds)] +#![allow(dead_code)] extern crate fn_aux; diff --git a/src/test/ui/associated-type-bounds/struct-bounds.rs b/src/test/ui/associated-type-bounds/struct-bounds.rs index 2d189cd66724a..2c1ce1c3785ae 100644 --- a/src/test/ui/associated-type-bounds/struct-bounds.rs +++ b/src/test/ui/associated-type-bounds/struct-bounds.rs @@ -1,5 +1,6 @@ // run-pass +#![allow(unused)] #![feature(associated_type_bounds)] trait Tr1 { type As1; } diff --git a/src/test/ui/async-await/argument-patterns.rs b/src/test/ui/async-await/argument-patterns.rs index 0e42f48b8351e..b9fc1a88cee13 100644 --- a/src/test/ui/async-await/argument-patterns.rs +++ b/src/test/ui/async-await/argument-patterns.rs @@ -1,7 +1,6 @@ // edition:2018 -// run-pass +// check-pass -#![allow(unused_variables)] #![deny(unused_mut)] type A = Vec; diff --git a/src/test/ui/async-await/async-await.rs b/src/test/ui/async-await/async-await.rs index bf8bf0bcce0fe..1dc7315e88c11 100644 --- a/src/test/ui/async-await/async-await.rs +++ b/src/test/ui/async-await/async-await.rs @@ -1,5 +1,7 @@ // run-pass +#![allow(unused)] + // edition:2018 // aux-build:arc_wake.rs diff --git a/src/test/ui/async-await/drop-order/drop-order-for-locals-when-cancelled.rs b/src/test/ui/async-await/drop-order/drop-order-for-locals-when-cancelled.rs index 5d020c9a52601..15cc9fbc81fb7 100644 --- a/src/test/ui/async-await/drop-order/drop-order-for-locals-when-cancelled.rs +++ b/src/test/ui/async-await/drop-order/drop-order-for-locals-when-cancelled.rs @@ -3,6 +3,9 @@ // run-pass #![deny(dead_code)] +#![allow(unused_variables)] +#![allow(unused_must_use)] +#![allow(path_statements)] // Test that the drop order for locals in a fn and async fn matches up. extern crate arc_wake; @@ -10,7 +13,6 @@ extern crate arc_wake; use arc_wake::ArcWake; use std::cell::RefCell; use std::future::Future; -use std::marker::PhantomData; use std::pin::Pin; use std::rc::Rc; use std::sync::Arc; @@ -42,7 +44,7 @@ struct NeverReady; impl Future for NeverReady { type Output = (); - fn poll(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll { Poll::Pending } } diff --git a/src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs b/src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs index 84fe79348c601..9e8304935bffc 100644 --- a/src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs +++ b/src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs @@ -6,6 +6,8 @@ // parameters (used or unused) are not dropped until the async fn is cancelled. // This file is mostly copy-pasted from drop-order-for-async-fn-parameters.rs +#![allow(unused_variables)] + extern crate arc_wake; use arc_wake::ArcWake; @@ -43,7 +45,7 @@ struct NeverReady; impl Future for NeverReady { type Output = (); - fn poll(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll { Poll::Pending } } diff --git a/src/test/ui/async-await/issues/issue-54752-async-block.stderr b/src/test/ui/async-await/issues/issue-54752-async-block.stderr new file mode 100644 index 0000000000000..c3b3392cfc495 --- /dev/null +++ b/src/test/ui/async-await/issues/issue-54752-async-block.stderr @@ -0,0 +1,8 @@ +warning: unnecessary parentheses around assigned value + --> $DIR/issue-54752-async-block.rs:6:22 + | +LL | fn main() { let _a = (async { }); } + | ^^^^^^^^^^^^ help: remove these parentheses + | + = note: `#[warn(unused_parens)]` on by default + diff --git a/src/test/ui/async-await/issues/issue-59972.rs b/src/test/ui/async-await/issues/issue-59972.rs index 154226e8bb88f..c2e24a96b1d93 100644 --- a/src/test/ui/async-await/issues/issue-59972.rs +++ b/src/test/ui/async-await/issues/issue-59972.rs @@ -4,7 +4,7 @@ // run-pass -// compile-flags: --edition=2018 +// compile-flags: --edition=2018 -Aunused pub enum Uninhabited { } diff --git a/src/test/ui/async-await/multiple-lifetimes/hrtb.rs b/src/test/ui/async-await/multiple-lifetimes/hrtb.rs index 31d0736ba63c8..e788ca5ff49c3 100644 --- a/src/test/ui/async-await/multiple-lifetimes/hrtb.rs +++ b/src/test/ui/async-await/multiple-lifetimes/hrtb.rs @@ -1,5 +1,5 @@ // edition:2018 -// run-pass +// check-pass // Test that we can use async fns with multiple arbitrary lifetimes. diff --git a/src/test/ui/attributes/obsolete-attr.rs b/src/test/ui/attributes/obsolete-attr.rs index 8759344e6f820..cf6dd338552b8 100644 --- a/src/test/ui/attributes/obsolete-attr.rs +++ b/src/test/ui/attributes/obsolete-attr.rs @@ -1,4 +1,4 @@ -// Obsolete attributes fall back to feature gated custom attributes. +// Obsolete attributes fall back to unstable custom attributes. #[ab_isize="stdcall"] extern {} //~^ ERROR cannot find attribute macro `ab_isize` in this scope diff --git a/src/test/ui/attributes/unknown-attr.rs b/src/test/ui/attributes/unknown-attr.rs index 140a1fc3f93e5..544a6e2a7e78a 100644 --- a/src/test/ui/attributes/unknown-attr.rs +++ b/src/test/ui/attributes/unknown-attr.rs @@ -1,4 +1,4 @@ -// Unknown attributes fall back to feature gated custom attributes. +// Unknown attributes fall back to unstable custom attributes. #![feature(custom_inner_attributes)] diff --git a/src/test/ui/borrowck/borrowck-migrate-to-nll.rs b/src/test/ui/borrowck/borrowck-migrate-to-nll.rs index 98fd5682277b3..6587dfdbc03f3 100644 --- a/src/test/ui/borrowck/borrowck-migrate-to-nll.rs +++ b/src/test/ui/borrowck/borrowck-migrate-to-nll.rs @@ -17,7 +17,7 @@ // revisions: zflag edition //[zflag]compile-flags: -Z borrowck=migrate //[edition]edition:2018 -//[zflag] run-pass +//[zflag] check-pass pub struct Block<'a> { current: &'a u8, diff --git a/src/test/ui/borrowck/issue-10876.rs b/src/test/ui/borrowck/issue-10876.rs index 20ab905fec46e..22eaa119f2467 100644 --- a/src/test/ui/borrowck/issue-10876.rs +++ b/src/test/ui/borrowck/issue-10876.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass enum Nat { S(Box), diff --git a/src/test/ui/borrowck/two-phase-multiple-activations.rs b/src/test/ui/borrowck/two-phase-multiple-activations.rs index a7fa7fac13e73..599138a9ce0f1 100644 --- a/src/test/ui/borrowck/two-phase-multiple-activations.rs +++ b/src/test/ui/borrowck/two-phase-multiple-activations.rs @@ -11,7 +11,7 @@ pub trait FakeRead { } impl FakeRead for Foo { - fn read_to_end(&mut self, buf: &mut Vec) -> Result { + fn read_to_end(&mut self, _buf: &mut Vec) -> Result { Ok(4) } } @@ -19,5 +19,5 @@ impl FakeRead for Foo { fn main() { let mut a = Foo {}; let mut v = Vec::new(); - a.read_to_end(&mut v); + a.read_to_end(&mut v).unwrap(); } diff --git a/src/test/ui/const-generics/apit-with-const-param.rs b/src/test/ui/const-generics/apit-with-const-param.rs index 70e718d889029..7acc50819a6ad 100644 --- a/src/test/ui/const-generics/apit-with-const-param.rs +++ b/src/test/ui/const-generics/apit-with-const-param.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash diff --git a/src/test/ui/const-generics/array-wrapper-struct-ctor.rs b/src/test/ui/const-generics/array-wrapper-struct-ctor.rs index d83846fcf88d4..2d1a405ebdd80 100644 --- a/src/test/ui/const-generics/array-wrapper-struct-ctor.rs +++ b/src/test/ui/const-generics/array-wrapper-struct-ctor.rs @@ -3,6 +3,8 @@ #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash +#![allow(dead_code)] + struct ArrayStruct { data: [T; N], } diff --git a/src/test/ui/const-generics/const-types.rs b/src/test/ui/const-generics/const-types.rs index 11757cd588dab..bc5188133d7f1 100644 --- a/src/test/ui/const-generics/const-types.rs +++ b/src/test/ui/const-generics/const-types.rs @@ -3,7 +3,7 @@ #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash -#[allow(dead_code)] +#![allow(dead_code, unused_variables)] struct ConstArray { array: [T; LEN], diff --git a/src/test/ui/const-generics/issue-61422.rs b/src/test/ui/const-generics/issue-61422.rs index 68e5a52e0ac5c..45d37b6a2f3c5 100644 --- a/src/test/ui/const-generics/issue-61422.rs +++ b/src/test/ui/const-generics/issue-61422.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash @@ -8,7 +8,7 @@ use std::mem; fn foo() { let arr: [u8; SIZE] = unsafe { #[allow(deprecated)] - let mut array: [u8; SIZE] = mem::uninitialized(); + let array: [u8; SIZE] = mem::uninitialized(); array }; } diff --git a/src/test/ui/const-generics/unused-const-param.rs b/src/test/ui/const-generics/unused-const-param.rs index ee98e5eb4a01f..8025b3af8f1bf 100644 --- a/src/test/ui/const-generics/unused-const-param.rs +++ b/src/test/ui/const-generics/unused-const-param.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash diff --git a/src/test/ui/consts/const-eval/const_transmute.rs b/src/test/ui/consts/const-eval/const_transmute.rs index 4a7d8490ef25f..f0e1d8263022b 100644 --- a/src/test/ui/consts/const-eval/const_transmute.rs +++ b/src/test/ui/consts/const-eval/const_transmute.rs @@ -1,6 +1,7 @@ // run-pass #![feature(const_fn_union)] +#![allow(dead_code)] #[repr(C)] union Transmute { diff --git a/src/test/ui/consts/const-labeled-break.rs b/src/test/ui/consts/const-labeled-break.rs index 36e308ade9c54..7cdbb22f92459 100644 --- a/src/test/ui/consts/const-labeled-break.rs +++ b/src/test/ui/consts/const-labeled-break.rs @@ -1,4 +1,4 @@ -// run-pass +// build-pass // Using labeled break in a while loop has caused an illegal instruction being // generated, and an ICE later. diff --git a/src/test/ui/consts/packed_pattern.stderr b/src/test/ui/consts/packed_pattern.stderr new file mode 100644 index 0000000000000..9b7daf2e674fb --- /dev/null +++ b/src/test/ui/consts/packed_pattern.stderr @@ -0,0 +1,8 @@ +warning: unreachable pattern + --> $DIR/packed_pattern.rs:16:9 + | +LL | FOO => unreachable!(), + | ^^^ + | + = note: `#[warn(unreachable_patterns)]` on by default + diff --git a/src/test/ui/consts/packed_pattern2.stderr b/src/test/ui/consts/packed_pattern2.stderr new file mode 100644 index 0000000000000..6cc0225d3043d --- /dev/null +++ b/src/test/ui/consts/packed_pattern2.stderr @@ -0,0 +1,8 @@ +warning: unreachable pattern + --> $DIR/packed_pattern2.rs:24:9 + | +LL | FOO => unreachable!(), + | ^^^ + | + = note: `#[warn(unreachable_patterns)]` on by default + diff --git a/src/test/ui/deprecation/deprecation-in-future.rs b/src/test/ui/deprecation/deprecation-in-future.rs index c4f9fdce74907..464ddcc4cdb94 100644 --- a/src/test/ui/deprecation/deprecation-in-future.rs +++ b/src/test/ui/deprecation/deprecation-in-future.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![deny(deprecated_in_future)] diff --git a/src/test/ui/drop/dynamic-drop-async.rs b/src/test/ui/drop/dynamic-drop-async.rs index 79d09d1817601..91063edf0f6c4 100644 --- a/src/test/ui/drop/dynamic-drop-async.rs +++ b/src/test/ui/drop/dynamic-drop-async.rs @@ -8,6 +8,7 @@ // ignore-wasm32-bare compiled with panic=abort by default #![feature(slice_patterns)] +#![allow(unused)] use std::{ cell::{Cell, RefCell}, diff --git a/src/test/ui/feature-gate/feature-gate-static-nobundle-2.rs b/src/test/ui/feature-gate/feature-gate-static-nobundle-2.rs index 92844f9306d28..b6c8648a7d03d 100644 --- a/src/test/ui/feature-gate/feature-gate-static-nobundle-2.rs +++ b/src/test/ui/feature-gate/feature-gate-static-nobundle-2.rs @@ -1,4 +1,4 @@ -//~ ERROR kind="static-nobundle" is feature gated +//~ ERROR kind="static-nobundle" is unstable // Test the behavior of rustc when non-existent library is statically linked // compile-flags: -l static-nobundle=nonexistent diff --git a/src/test/ui/feature-gate/feature-gate-static-nobundle-2.stderr b/src/test/ui/feature-gate/feature-gate-static-nobundle-2.stderr index 059559dd92831..cfff4c36a6d7b 100644 --- a/src/test/ui/feature-gate/feature-gate-static-nobundle-2.stderr +++ b/src/test/ui/feature-gate/feature-gate-static-nobundle-2.stderr @@ -1,4 +1,4 @@ -error[E0658]: kind="static-nobundle" is feature gated +error[E0658]: kind="static-nobundle" is unstable | = note: for more information, see https://github.com/rust-lang/rust/issues/37403 = help: add `#![feature(static_nobundle)]` to the crate attributes to enable diff --git a/src/test/ui/feature-gates/feature-gate-is_sorted.rs b/src/test/ui/feature-gates/feature-gate-is_sorted.rs index 078ecc577610b..359ed835bcbb2 100644 --- a/src/test/ui/feature-gates/feature-gate-is_sorted.rs +++ b/src/test/ui/feature-gates/feature-gate-is_sorted.rs @@ -1,11 +1,11 @@ fn main() { - // Assert `Iterator` methods are feature gated + // Assert `Iterator` methods are unstable assert!([1, 2, 2, 9].iter().is_sorted()); //~^ ERROR: use of unstable library feature 'is_sorted': new API assert!(![-2i32, -1, 0, 3].iter().is_sorted_by_key(|n| n.abs())); //~^ ERROR: use of unstable library feature 'is_sorted': new API - // Assert `[T]` methods are feature gated + // Assert `[T]` methods are unstable assert!([1, 2, 2, 9].is_sorted()); //~^ ERROR: use of unstable library feature 'is_sorted': new API assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs())); diff --git a/src/test/ui/feature-gates/feature-gate-link_cfg.rs b/src/test/ui/feature-gates/feature-gate-link_cfg.rs index 1905346e2b5d7..27ec2e98eb68b 100644 --- a/src/test/ui/feature-gates/feature-gate-link_cfg.rs +++ b/src/test/ui/feature-gates/feature-gate-link_cfg.rs @@ -1,5 +1,5 @@ #[link(name = "foo", cfg(foo))] -//~^ ERROR: is feature gated +//~^ ERROR: is unstable extern {} fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-link_cfg.stderr b/src/test/ui/feature-gates/feature-gate-link_cfg.stderr index 58aa4ed7497ce..f6c5061546438 100644 --- a/src/test/ui/feature-gates/feature-gate-link_cfg.stderr +++ b/src/test/ui/feature-gates/feature-gate-link_cfg.stderr @@ -1,4 +1,4 @@ -error[E0658]: is feature gated +error[E0658]: is unstable --> $DIR/feature-gate-link_cfg.rs:1:1 | LL | #[link(name = "foo", cfg(foo))] diff --git a/src/test/ui/feature-gates/feature-gate-static-nobundle.rs b/src/test/ui/feature-gates/feature-gate-static-nobundle.rs index 1ce6c54aa4dc2..644b1f964a059 100644 --- a/src/test/ui/feature-gates/feature-gate-static-nobundle.rs +++ b/src/test/ui/feature-gates/feature-gate-static-nobundle.rs @@ -1,5 +1,5 @@ #[link(name="foo", kind="static-nobundle")] -//~^ ERROR: kind="static-nobundle" is feature gated +//~^ ERROR: kind="static-nobundle" is unstable extern {} fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-static-nobundle.stderr b/src/test/ui/feature-gates/feature-gate-static-nobundle.stderr index f2e29cf0678ae..cc0d426d6cf9a 100644 --- a/src/test/ui/feature-gates/feature-gate-static-nobundle.stderr +++ b/src/test/ui/feature-gates/feature-gate-static-nobundle.stderr @@ -1,4 +1,4 @@ -error[E0658]: kind="static-nobundle" is feature gated +error[E0658]: kind="static-nobundle" is unstable --> $DIR/feature-gate-static-nobundle.rs:1:1 | LL | #[link(name="foo", kind="static-nobundle")] diff --git a/src/test/ui/feature-gates/feature-gate-type_ascription.rs b/src/test/ui/feature-gates/feature-gate-type_ascription.rs index e42e340550681..7a597157300ed 100644 --- a/src/test/ui/feature-gates/feature-gate-type_ascription.rs +++ b/src/test/ui/feature-gates/feature-gate-type_ascription.rs @@ -1,4 +1,4 @@ -// Type ascription is feature gated +// Type ascription is unstable fn main() { let a = 10: u8; //~ ERROR type ascription is experimental diff --git a/src/test/ui/hrtb/issue-57639.rs b/src/test/ui/hrtb/issue-57639.rs index 4bcaef3616bd5..392e7233b567a 100644 --- a/src/test/ui/hrtb/issue-57639.rs +++ b/src/test/ui/hrtb/issue-57639.rs @@ -10,7 +10,7 @@ // // See [this comment on GitHub][c] for more details. // -// run-pass +// check-pass // // [c]: https://github.com/rust-lang/rust/issues/57639#issuecomment-455685861 diff --git a/src/test/ui/if-ret.stderr b/src/test/ui/if-ret.stderr new file mode 100644 index 0000000000000..73402e55a4fd8 --- /dev/null +++ b/src/test/ui/if-ret.stderr @@ -0,0 +1,8 @@ +warning: unreachable block in `if` expression + --> $DIR/if-ret.rs:6:24 + | +LL | fn foo() { if (return) { } } + | ^^^ + | + = note: `#[warn(unreachable_code)]` on by default + diff --git a/src/test/ui/impl-trait/closure-calling-parent-fn.rs b/src/test/ui/impl-trait/closure-calling-parent-fn.rs index 58d7875ccd034..9dab334a217c2 100644 --- a/src/test/ui/impl-trait/closure-calling-parent-fn.rs +++ b/src/test/ui/impl-trait/closure-calling-parent-fn.rs @@ -5,7 +5,7 @@ // `foo` and hence is treated opaquely within the closure body. This // resulted in a failed subtype relationship. // -// run-pass +// check-pass fn foo() -> impl Copy { || foo(); } fn bar() -> impl Copy { || bar(); } diff --git a/src/test/ui/impl-trait/issues/issue-53457.rs b/src/test/ui/impl-trait/issues/issue-53457.rs index de8c579743fc0..3f97502492506 100644 --- a/src/test/ui/impl-trait/issues/issue-53457.rs +++ b/src/test/ui/impl-trait/issues/issue-53457.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![feature(type_alias_impl_trait)] @@ -9,7 +9,7 @@ fn bar(f: F) -> F { } fn foo() -> X { - bar(|x| ()) + bar(|_| ()) } fn main() {} diff --git a/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs b/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs index 2da3886bb552b..3911769b0c63d 100644 --- a/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs +++ b/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs @@ -1,5 +1,5 @@ // edition:2018 -// run-pass +// check-pass // revisions: migrate mir //[mir]compile-flags: -Z borrowck=mir diff --git a/src/test/ui/impl-trait/needs_least_region_or_bound.rs b/src/test/ui/impl-trait/needs_least_region_or_bound.rs index 52475f65a8353..3c8682bb62aa5 100644 --- a/src/test/ui/impl-trait/needs_least_region_or_bound.rs +++ b/src/test/ui/impl-trait/needs_least_region_or_bound.rs @@ -1,9 +1,7 @@ -// run-pass +// check-pass #![feature(member_constraints)] -use std::fmt::Debug; - trait MultiRegionTrait<'a, 'b> {} impl<'a, 'b> MultiRegionTrait<'a, 'b> for (&'a u32, &'b u32) {} diff --git a/src/test/ui/issues/issue-26448-2.rs b/src/test/ui/issues/issue-26448-2.rs index 17e7c1f977a6d..c60e06c3ceb35 100644 --- a/src/test/ui/issues/issue-26448-2.rs +++ b/src/test/ui/issues/issue-26448-2.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass pub struct Bar { items: Vec<&'static str>, diff --git a/src/test/ui/issues/issue-26448-3.rs b/src/test/ui/issues/issue-26448-3.rs index e57352e57f4fc..d48022c09fee3 100644 --- a/src/test/ui/issues/issue-26448-3.rs +++ b/src/test/ui/issues/issue-26448-3.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass pub struct Item { _inner: &'static str, diff --git a/src/test/ui/issues/issue-27697.rs b/src/test/ui/issues/issue-27697.rs index 83070012f5f04..12af8a8e875af 100644 --- a/src/test/ui/issues/issue-27697.rs +++ b/src/test/ui/issues/issue-27697.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass use std::ops::Deref; diff --git a/src/test/ui/issues/issue-38591.rs b/src/test/ui/issues/issue-38591.rs index 7aa71f8b9eb9b..2f594b48e697f 100644 --- a/src/test/ui/issues/issue-38591.rs +++ b/src/test/ui/issues/issue-38591.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass struct S { t : T, diff --git a/src/test/ui/issues/issue-43806.rs b/src/test/ui/issues/issue-43806.rs index cbfbfa35afbd9..8c8cccfb2bb82 100644 --- a/src/test/ui/issues/issue-43806.rs +++ b/src/test/ui/issues/issue-43806.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![deny(unused_results)] diff --git a/src/test/ui/issues/issue-48132.rs b/src/test/ui/issues/issue-48132.rs index ea325ea695f66..f564aefe78ced 100644 --- a/src/test/ui/issues/issue-48132.rs +++ b/src/test/ui/issues/issue-48132.rs @@ -3,6 +3,8 @@ // run-pass +#![allow(dead_code)] + struct Inner { iterator: I, item: V, diff --git a/src/test/ui/issues/issue-48179.rs b/src/test/ui/issues/issue-48179.rs index 90e9858d74197..f81203dc41299 100644 --- a/src/test/ui/issues/issue-48179.rs +++ b/src/test/ui/issues/issue-48179.rs @@ -1,7 +1,7 @@ // Regression test for #48132. This was failing due to problems around // the projection caching and dropck type enumeration. -// run-pass +// check-pass pub struct Container { value: Option, diff --git a/src/test/ui/issues/issue-61711-once-caused-rustc-inf-loop.rs b/src/test/ui/issues/issue-61711-once-caused-rustc-inf-loop.rs index 8fc09c89f786b..de7d6a0d80c9e 100644 --- a/src/test/ui/issues/issue-61711-once-caused-rustc-inf-loop.rs +++ b/src/test/ui/issues/issue-61711-once-caused-rustc-inf-loop.rs @@ -5,7 +5,7 @@ // aux-build:xcrate-issue-61711-b.rs // compile-flags:--extern xcrate_issue_61711_b -// run-pass +// build-pass fn f(_: F) { } fn main() { } diff --git a/src/test/ui/lint/empty-lint-attributes.rs b/src/test/ui/lint/empty-lint-attributes.rs index 1f0a9538d88b1..9a0ec253322e4 100644 --- a/src/test/ui/lint/empty-lint-attributes.rs +++ b/src/test/ui/lint/empty-lint-attributes.rs @@ -1,6 +1,6 @@ #![feature(lint_reasons)] -// run-pass +// check-pass // Empty (and reason-only) lint attributes are legal—although we may want to // lint them in the future (Issue #55112). diff --git a/src/test/ui/nll/issue-55288.rs b/src/test/ui/nll/issue-55288.rs index c7b6ac5924837..aab2dc267d594 100644 --- a/src/test/ui/nll/issue-55288.rs +++ b/src/test/ui/nll/issue-55288.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass struct Slice(&'static [&'static [u8]]); diff --git a/src/test/ui/nll/issue-57960.rs b/src/test/ui/nll/issue-57960.rs index 1399694a79b6a..32e45184a9195 100644 --- a/src/test/ui/nll/issue-57960.rs +++ b/src/test/ui/nll/issue-57960.rs @@ -30,7 +30,6 @@ fn digits(x: u8) -> u32 { OneDigit::FIRST..=OneDigit::LAST => 1, TwoDigits::FIRST..=TwoDigits::LAST => 2, ThreeDigits::FIRST..=ThreeDigits::LAST => 3, - _ => unreachable!(), } } diff --git a/src/test/ui/nll/normalization-bounds.rs b/src/test/ui/nll/normalization-bounds.rs index 5d2825ef2d670..bb6d981e0133f 100644 --- a/src/test/ui/nll/normalization-bounds.rs +++ b/src/test/ui/nll/normalization-bounds.rs @@ -1,6 +1,6 @@ // Check that lifetime bounds get checked the right way around with NLL enabled. -//run-pass +// check-pass trait Visitor<'d> { type Value; diff --git a/src/test/ui/nll/promotable-mutable-zst-doesnt-conflict.rs b/src/test/ui/nll/promotable-mutable-zst-doesnt-conflict.rs index 6d5bdfa4da2f0..3b06b0db37065 100644 --- a/src/test/ui/nll/promotable-mutable-zst-doesnt-conflict.rs +++ b/src/test/ui/nll/promotable-mutable-zst-doesnt-conflict.rs @@ -1,11 +1,11 @@ // Check that mutable promoted length zero arrays don't check for conflicting // access -// run-pass +// check-pass pub fn main() { let mut x: Vec<&[i32; 0]> = Vec::new(); - for i in 0..10 { + for _ in 0..10 { x.push(&[]); } } diff --git a/src/test/ui/nll/user-annotations/issue-55219.rs b/src/test/ui/nll/user-annotations/issue-55219.rs index 4d18e96cc1543..147413663897d 100644 --- a/src/test/ui/nll/user-annotations/issue-55219.rs +++ b/src/test/ui/nll/user-annotations/issue-55219.rs @@ -3,7 +3,7 @@ // The `Self::HASH_LEN` here expands to a "self-type" where `T` is not // known. This unbound inference variable was causing an ICE. // -// run-pass +// check-pass pub struct Foo(T); diff --git a/src/test/ui/nll/user-annotations/normalize-self-ty.rs b/src/test/ui/nll/user-annotations/normalize-self-ty.rs index a06229a02032a..df905c8786a18 100644 --- a/src/test/ui/nll/user-annotations/normalize-self-ty.rs +++ b/src/test/ui/nll/user-annotations/normalize-self-ty.rs @@ -2,7 +2,7 @@ // the inherent impl requires normalization to be equal to the // user-provided type. // -// run-pass +// check-pass trait Mirror { type Me; @@ -15,7 +15,7 @@ impl Mirror for T { struct Foo(A, B); impl Foo::Me> { - fn m(b: A) { } + fn m(_: A) { } } fn main() { diff --git a/src/test/ui/proc-macro/resolve-error.rs b/src/test/ui/proc-macro/resolve-error.rs index 0a7861aba6ebb..088f39c6665ff 100644 --- a/src/test/ui/proc-macro/resolve-error.rs +++ b/src/test/ui/proc-macro/resolve-error.rs @@ -23,11 +23,11 @@ macro_rules! attr_proc_mac { //~^ ERROR cannot find struct Foo; -// Interpreted as a feature gated custom attribute +// Interpreted as an unstable custom attribute #[attr_proc_macra] //~ ERROR cannot find attribute macro `attr_proc_macra` in this scope struct Bar; -// Interpreted as a feature gated custom attribute +// Interpreted as an unstable custom attribute #[FooWithLongNan] //~ ERROR cannot find attribute macro `FooWithLongNan` in this scope struct Asdf; diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs index e43c8541e6d6d..041e410df85c9 100644 --- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs +++ b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs @@ -11,8 +11,8 @@ use std::sync::mpsc::channel; fn main() { let (tx, rx) = channel(); let x = Some(rx); - tx.send(false); - tx.send(false); + tx.send(false).unwrap(); + tx.send(false).unwrap(); match x { Some(z) if z.recv().unwrap() => { panic!() }, Some(z) => { assert!(!z.recv().unwrap()); }, diff --git a/src/test/ui/rfc-2008-non-exhaustive/variants_same_crate.rs b/src/test/ui/rfc-2008-non-exhaustive/variants_same_crate.rs index 470a5ea9833ad..fe7df44590b8d 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/variants_same_crate.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/variants_same_crate.rs @@ -10,11 +10,11 @@ pub enum NonExhaustiveVariants { fn main() { let variant_tuple = NonExhaustiveVariants::Tuple(340); - let variant_struct = NonExhaustiveVariants::Struct { field: 340 }; + let _variant_struct = NonExhaustiveVariants::Struct { field: 340 }; match variant_tuple { NonExhaustiveVariants::Unit => "", - NonExhaustiveVariants::Tuple(fe_tpl) => "", - NonExhaustiveVariants::Struct { field } => "" + NonExhaustiveVariants::Tuple(_fe_tpl) => "", + NonExhaustiveVariants::Struct { field: _ } => "" }; } diff --git a/src/test/ui/rfc-2497-if-let-chains/protect-precedences.rs b/src/test/ui/rfc-2497-if-let-chains/protect-precedences.rs index 1de4e5bcebee9..b95105b59eddb 100644 --- a/src/test/ui/rfc-2497-if-let-chains/protect-precedences.rs +++ b/src/test/ui/rfc-2497-if-let-chains/protect-precedences.rs @@ -2,8 +2,6 @@ #![allow(irrefutable_let_patterns)] -use std::ops::Range; - fn main() { let x: bool; // This should associate as: `(x = (true && false));`. diff --git a/src/test/ui/rfc-2497-if-let-chains/protect-precedences.stderr b/src/test/ui/rfc-2497-if-let-chains/protect-precedences.stderr new file mode 100644 index 0000000000000..be7ef658411e1 --- /dev/null +++ b/src/test/ui/rfc-2497-if-let-chains/protect-precedences.stderr @@ -0,0 +1,8 @@ +warning: unreachable block in `if` expression + --> $DIR/protect-precedences.rs:13:41 + | +LL | if let _ = return true && false {}; + | ^^ + | + = note: `#[warn(unreachable_code)]` on by default + diff --git a/src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs index 8c62b34bd9ea5..c07da4345f7d9 100644 --- a/src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs +++ b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs @@ -4,7 +4,7 @@ type B = rustfmt::skip; //~ ERROR expected type, found tool attribute `rustfmt:: #[derive(rustfmt)] //~ ERROR cannot find derive macro `rustfmt` in this scope struct S; -// Interpreted as a feature gated custom attribute +// Interpreted as an unstable custom attribute #[rustfmt] //~ ERROR cannot find attribute macro `rustfmt` in this scope fn check() {} diff --git a/src/test/ui/traits/trait-alias/trait-alias-object-wf.rs b/src/test/ui/traits/trait-alias/trait-alias-object-wf.rs index fb26b7e2df7cb..1440f02df1df8 100644 --- a/src/test/ui/traits/trait-alias/trait-alias-object-wf.rs +++ b/src/test/ui/traits/trait-alias/trait-alias-object-wf.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass // This test checks that trait objects involving trait aliases are well-formed. diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs index 0c212096f9234..19fcc78721ab1 100644 --- a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs +++ b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs @@ -9,13 +9,13 @@ #![allow(irrefutable_let_patterns)] -enum Enum { TSVariant(T), SVariant { v: T }, UVariant } +enum Enum { TSVariant(T), SVariant { _v: T }, UVariant } type Alias = Enum; type AliasFixed = Enum<()>; macro_rules! is_variant { (TSVariant, $expr:expr) => (is_variant!(@check TSVariant, (_), $expr)); - (SVariant, $expr:expr) => (is_variant!(@check SVariant, { v: _ }, $expr)); + (SVariant, $expr:expr) => (is_variant!(@check SVariant, { _v: _ }, $expr)); (UVariant, $expr:expr) => (is_variant!(@check UVariant, {}, $expr)); (@check $variant:ident, $matcher:tt, $expr:expr) => ( assert!(if let Enum::$variant::<()> $matcher = $expr { true } else { false }, @@ -37,14 +37,14 @@ fn main() { // Struct variant - is_variant!(SVariant, Enum::SVariant { v: () }); - is_variant!(SVariant, Enum::SVariant::<()> { v: () }); - is_variant!(SVariant, Enum::<()>::SVariant { v: () }); + is_variant!(SVariant, Enum::SVariant { _v: () }); + is_variant!(SVariant, Enum::SVariant::<()> { _v: () }); + is_variant!(SVariant, Enum::<()>::SVariant { _v: () }); - is_variant!(SVariant, Alias::SVariant { v: () }); - is_variant!(SVariant, Alias::<()>::SVariant { v: () }); + is_variant!(SVariant, Alias::SVariant { _v: () }); + is_variant!(SVariant, Alias::<()>::SVariant { _v: () }); - is_variant!(SVariant, AliasFixed::SVariant { v: () }); + is_variant!(SVariant, AliasFixed::SVariant { _v: () }); // Unit variant diff --git a/src/test/ui/while-let.rs b/src/test/ui/while-let.rs index 69f9de9497740..53babefae81c0 100644 --- a/src/test/ui/while-let.rs +++ b/src/test/ui/while-let.rs @@ -1,5 +1,6 @@ // run-pass +#[allow(dead_code)] fn macros() { macro_rules! foo{ ($p:pat, $e:expr, $b:block) => {{ @@ -12,16 +13,16 @@ fn macros() { }} } - foo!(a, 1, { //~ WARN irrefutable while-let + foo!(_a, 1, { //~ WARN irrefutable while-let println!("irrefutable pattern"); }); - bar!(a, 1, { //~ WARN irrefutable while-let + bar!(_a, 1, { //~ WARN irrefutable while-let println!("irrefutable pattern"); }); } pub fn main() { - while let a = 1 { //~ WARN irrefutable while-let + while let _a = 1 { //~ WARN irrefutable while-let println!("irrefutable pattern"); break; } diff --git a/src/test/ui/while-let.stderr b/src/test/ui/while-let.stderr index 348925aa9702c..30307ecaeadf2 100644 --- a/src/test/ui/while-let.stderr +++ b/src/test/ui/while-let.stderr @@ -1,10 +1,10 @@ warning: irrefutable while-let pattern - --> $DIR/while-let.rs:6:13 + --> $DIR/while-let.rs:7:13 | LL | while let $p = $e $b | ^^^^^ ... -LL | / foo!(a, 1, { +LL | / foo!(_a, 1, { LL | | println!("irrefutable pattern"); LL | | }); | |_______- in this macro invocation @@ -12,20 +12,20 @@ LL | | }); = note: `#[warn(irrefutable_let_patterns)]` on by default warning: irrefutable while-let pattern - --> $DIR/while-let.rs:6:13 + --> $DIR/while-let.rs:7:13 | LL | while let $p = $e $b | ^^^^^ ... -LL | / bar!(a, 1, { +LL | / bar!(_a, 1, { LL | | println!("irrefutable pattern"); LL | | }); | |_______- in this macro invocation warning: irrefutable while-let pattern - --> $DIR/while-let.rs:24:5 + --> $DIR/while-let.rs:25:5 | -LL | / while let a = 1 { +LL | / while let _a = 1 { LL | | println!("irrefutable pattern"); LL | | break; LL | | } diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 819d399f34a41..48dd68d0f61ee 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -628,6 +628,11 @@ impl TestProps { } self.pass_mode } + + // does not consider CLI override for pass mode + pub fn local_pass_mode(&self) -> Option { + self.pass_mode + } } fn iter_header(testfile: &Path, cfg: Option<&str>, it: &mut dyn FnMut(&str)) { diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 9a3d24facc2c8..aff554678a3f4 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1557,7 +1557,11 @@ impl<'test> TestCx<'test> { // want to actually assert warnings about all this code. Instead // let's just ignore unused code warnings by defaults and tests // can turn it back on if needed. - if !self.config.src_base.ends_with("rustdoc-ui") { + if !self.config.src_base.ends_with("rustdoc-ui") && + // Note that we don't call pass_mode() here as we don't want + // to set unused to allow if we've overriden the pass mode + // via command line flags. + self.props.local_pass_mode() != Some(PassMode::Run) { rustc.args(&["-A", "unused"]); } }