Skip to content

Don't pass -Z unstable-options by default for UI tests #82639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/bootstrap/test.rs
Original file line number Diff line number Diff line change
@@ -1280,7 +1280,6 @@ note: if you're sure you want to do this, please open an issue as to why. In the
}
}
flags.push(format!("-Cdebuginfo={}", builder.config.rust_debuginfo_level_tests));
flags.push("-Zunstable-options".to_string());
flags.push(builder.config.cmd.rustc_args().join(" "));

if let Some(linker) = builder.linker(target) {
4 changes: 2 additions & 2 deletions src/test/rustdoc-ui/run-directory.rs
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@

// revisions: correct incorrect
// check-pass
// [correct]compile-flags:--test --test-run-directory={{src-base}}
// [incorrect]compile-flags:--test --test-run-directory={{src-base}}/coverage
// [correct]compile-flags:--test --test-run-directory={{src-base}} -Zunstable-options
// [incorrect]compile-flags:--test --test-run-directory={{src-base}}/coverage -Zunstable-options
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"

1 change: 1 addition & 0 deletions src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// compile-flags: -Z unstable-options
// NOTE: This test doesn't actually require `fulldeps`
// so we could instead use it as an `ui` test.
//
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
error: passing `TyCtxt<'tcx>` by reference
--> $DIR/pass_ty_by_ref_self.rs:17:15
--> $DIR/pass_ty_by_ref_self.rs:18:15
|
LL | fn by_ref(&self) {}
| ^^^^^ help: try passing by value: `TyCtxt<'tcx>`
|
note: the lint level is defined here
--> $DIR/pass_ty_by_ref_self.rs:7:9
--> $DIR/pass_ty_by_ref_self.rs:8:9
|
LL | #![deny(rustc::ty_pass_by_reference)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: passing `Ty<'tcx>` by reference
--> $DIR/pass_ty_by_ref_self.rs:30:21
--> $DIR/pass_ty_by_ref_self.rs:31:21
|
LL | fn by_ref(self: &Ty<'tcx>) {}
| ^^^^^^^^^ help: try passing by value: `Ty<'tcx>`
2 changes: 1 addition & 1 deletion src/test/ui/annotate-snippet/missing-type.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --error-format human-annotate-rs
// compile-flags: --error-format human-annotate-rs -Z unstable-options

pub fn main() {
let x: Iter; //~ ERROR cannot find type `Iter` in this scope
2 changes: 1 addition & 1 deletion src/test/ui/annotate-snippet/multispan.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// aux-build:multispan.rs
// compile-flags: --error-format human-annotate-rs
// compile-flags: --error-format human-annotate-rs -Z unstable-options

#![feature(proc_macro_hygiene)]

8 changes: 1 addition & 7 deletions src/test/ui/deduplicate-diagnostics.duplicate.stderr
Original file line number Diff line number Diff line change
@@ -22,12 +22,6 @@ error[E0452]: malformed lint attribute input
LL | #[deny("literal")]
| ^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/deduplicate-diagnostics.rs:8:8
|
LL | #[deny("literal")]
| ^^^^^^^^^ bad attribute argument

error: aborting due to 5 previous errors
error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0452`.
1 change: 0 additions & 1 deletion src/test/ui/deduplicate-diagnostics.rs
Original file line number Diff line number Diff line change
@@ -7,5 +7,4 @@ struct S;

#[deny("literal")] //~ ERROR malformed lint attribute input
//[duplicate]~| ERROR malformed lint attribute input
//[duplicate]~| ERROR malformed lint attribute input
fn main() {}
2 changes: 0 additions & 2 deletions src/test/ui/error-codes/E0452.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,5 @@
//~| ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
fn main() {
}
14 changes: 1 addition & 13 deletions src/test/ui/error-codes/E0452.stderr
Original file line number Diff line number Diff line change
@@ -22,18 +22,6 @@ error[E0452]: malformed lint attribute input
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument

error: aborting due to 6 previous errors
error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0452`.
1 change: 0 additions & 1 deletion src/test/ui/error-codes/E0453.rs
Original file line number Diff line number Diff line change
@@ -3,6 +3,5 @@
#[allow(non_snake_case)]
//~^ ERROR allow(non_snake_case) incompatible
//~| ERROR allow(non_snake_case) incompatible
//~| ERROR allow(non_snake_case) incompatible
fn main() {
}
11 changes: 1 addition & 10 deletions src/test/ui/error-codes/E0453.stderr
Original file line number Diff line number Diff line change
@@ -16,15 +16,6 @@ LL |
LL | #[allow(non_snake_case)]
| ^^^^^^^^^^^^^^ overruled by previous forbid

error[E0453]: allow(non_snake_case) incompatible with previous forbid
--> $DIR/E0453.rs:3:9
|
LL | #![forbid(non_snake_case)]
| -------------- `forbid` level set here
LL |
LL | #[allow(non_snake_case)]
| ^^^^^^^^^^^^^^ overruled by previous forbid

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0453`.
6 changes: 1 addition & 5 deletions src/test/ui/error-codes/E0602.stderr
Original file line number Diff line number Diff line change
@@ -6,10 +6,6 @@ error[E0602]: unknown lint: `bogus`
|
= note: requested on the command line with `-D bogus`

error[E0602]: unknown lint: `bogus`
|
= note: requested on the command line with `-D bogus`

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0602`.
1 change: 0 additions & 1 deletion src/test/ui/feature-gates/feature-gate-lint-reasons.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![warn(nonstandard_style, reason = "the standard should be respected")]
//~^ ERROR lint reasons are experimental
//~| ERROR lint reasons are experimental
//~| ERROR lint reasons are experimental

fn main() {}
11 changes: 1 addition & 10 deletions src/test/ui/feature-gates/feature-gate-lint-reasons.stderr
Original file line number Diff line number Diff line change
@@ -16,15 +16,6 @@ LL | #![warn(nonstandard_style, reason = "the standard should be respected")]
= note: see issue #54503 <https://github.com/rust-lang/rust/issues/54503> for more information
= help: add `#![feature(lint_reasons)]` to the crate attributes to enable

error[E0658]: lint reasons are experimental
--> $DIR/feature-gate-lint-reasons.rs:1:28
|
LL | #![warn(nonstandard_style, reason = "the standard should be respected")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #54503 <https://github.com/rust-lang/rust/issues/54503> for more information
= help: add `#![feature(lint_reasons)]` to the crate attributes to enable

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.
3 changes: 0 additions & 3 deletions src/test/ui/lint/crate_level_only_lint.rs
Original file line number Diff line number Diff line change
@@ -4,19 +4,16 @@ mod foo {
#![allow(uncommon_codepoints)]
//~^ ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]

#[allow(uncommon_codepoints)]
//~^ ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
const BAR: f64 = 0.000001;

}

#[allow(uncommon_codepoints)]
//~^ ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
//~| ERROR allow(uncommon_codepoints) is ignored unless specified at crate level [unused_attributes]
fn main() {
}
28 changes: 5 additions & 23 deletions src/test/ui/lint/crate_level_only_lint.stderr
Original file line number Diff line number Diff line change
@@ -11,13 +11,13 @@ LL | #![deny(uncommon_codepoints, unused_attributes)]
| ^^^^^^^^^^^^^^^^^

error: allow(uncommon_codepoints) is ignored unless specified at crate level
--> $DIR/crate_level_only_lint.rs:9:9
--> $DIR/crate_level_only_lint.rs:8:9
|
LL | #[allow(uncommon_codepoints)]
| ^^^^^^^^^^^^^^^^^^^

error: allow(uncommon_codepoints) is ignored unless specified at crate level
--> $DIR/crate_level_only_lint.rs:17:9
--> $DIR/crate_level_only_lint.rs:15:9
|
LL | #[allow(uncommon_codepoints)]
| ^^^^^^^^^^^^^^^^^^^
@@ -29,34 +29,16 @@ LL | #![allow(uncommon_codepoints)]
| ^^^^^^^^^^^^^^^^^^^

error: allow(uncommon_codepoints) is ignored unless specified at crate level
--> $DIR/crate_level_only_lint.rs:9:9
--> $DIR/crate_level_only_lint.rs:8:9
|
LL | #[allow(uncommon_codepoints)]
| ^^^^^^^^^^^^^^^^^^^

error: allow(uncommon_codepoints) is ignored unless specified at crate level
--> $DIR/crate_level_only_lint.rs:17:9
--> $DIR/crate_level_only_lint.rs:15:9
|
LL | #[allow(uncommon_codepoints)]
| ^^^^^^^^^^^^^^^^^^^

error: allow(uncommon_codepoints) is ignored unless specified at crate level
--> $DIR/crate_level_only_lint.rs:4:10
|
LL | #![allow(uncommon_codepoints)]
| ^^^^^^^^^^^^^^^^^^^

error: allow(uncommon_codepoints) is ignored unless specified at crate level
--> $DIR/crate_level_only_lint.rs:9:9
|
LL | #[allow(uncommon_codepoints)]
| ^^^^^^^^^^^^^^^^^^^

error: allow(uncommon_codepoints) is ignored unless specified at crate level
--> $DIR/crate_level_only_lint.rs:17:9
|
LL | #[allow(uncommon_codepoints)]
| ^^^^^^^^^^^^^^^^^^^

error: aborting due to 9 previous errors
error: aborting due to 6 previous errors

6 changes: 0 additions & 6 deletions src/test/ui/lint/forbid-group-group-2.rs
Original file line number Diff line number Diff line change
@@ -17,10 +17,4 @@
//~| WARNING previously accepted by the compiler
//~| ERROR incompatible with previous
//~| WARNING previously accepted by the compiler
//~| ERROR incompatible with previous
//~| WARNING previously accepted by the compiler
//~| ERROR incompatible with previous
//~| WARNING previously accepted by the compiler
//~| ERROR incompatible with previous
//~| WARNING previously accepted by the compiler
fn main() {}
38 changes: 1 addition & 37 deletions src/test/ui/lint/forbid-group-group-2.stderr
Original file line number Diff line number Diff line change
@@ -75,41 +75,5 @@ LL | #[allow(nonstandard_style)]
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>

error: allow(nonstandard_style) incompatible with previous forbid
--> $DIR/forbid-group-group-2.rs:7:9
|
LL | #![forbid(warnings)]
| -------- `forbid` level set here
...
LL | #[allow(nonstandard_style)]
| ^^^^^^^^^^^^^^^^^ overruled by previous forbid
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>

error: allow(nonstandard_style) incompatible with previous forbid
--> $DIR/forbid-group-group-2.rs:7:9
|
LL | #![forbid(warnings)]
| -------- `forbid` level set here
...
LL | #[allow(nonstandard_style)]
| ^^^^^^^^^^^^^^^^^ overruled by previous forbid
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>

error: allow(nonstandard_style) incompatible with previous forbid
--> $DIR/forbid-group-group-2.rs:7:9
|
LL | #![forbid(warnings)]
| -------- `forbid` level set here
...
LL | #[allow(nonstandard_style)]
| ^^^^^^^^^^^^^^^^^ overruled by previous forbid
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>

error: aborting due to 9 previous errors
error: aborting due to 6 previous errors

2 changes: 0 additions & 2 deletions src/test/ui/lint/forbid-group-member.rs
Original file line number Diff line number Diff line change
@@ -12,8 +12,6 @@
//~| WARNING previously accepted
//~| WARNING incompatible with previous forbid
//~| WARNING previously accepted
//~| WARNING incompatible with previous forbid
//~| WARNING previously accepted
fn main() {
let a: ();
}
14 changes: 1 addition & 13 deletions src/test/ui/lint/forbid-group-member.stderr
Original file line number Diff line number Diff line change
@@ -35,17 +35,5 @@ LL | #[allow(unused_variables)]
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>

warning: allow(unused_variables) incompatible with previous forbid
--> $DIR/forbid-group-member.rs:8:9
|
LL | #![forbid(unused)]
| ------ `forbid` level set here
LL |
LL | #[allow(unused_variables)]
| ^^^^^^^^^^^^^^^^ overruled by previous forbid
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>

warning: 4 warnings emitted
warning: 3 warnings emitted

1 change: 0 additions & 1 deletion src/test/ui/lint/forbid-member-group.rs
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@
#[allow(unused)]
//~^ ERROR incompatible with previous forbid
//~| ERROR incompatible with previous forbid
//~| ERROR incompatible with previous forbid
fn main() {
let a: ();
}
11 changes: 1 addition & 10 deletions src/test/ui/lint/forbid-member-group.stderr
Original file line number Diff line number Diff line change
@@ -16,15 +16,6 @@ LL |
LL | #[allow(unused)]
| ^^^^^^ overruled by previous forbid

error[E0453]: allow(unused) incompatible with previous forbid
--> $DIR/forbid-member-group.rs:6:9
|
LL | #![forbid(unused_variables)]
| ---------------- `forbid` level set here
LL |
LL | #[allow(unused)]
| ^^^^^^ overruled by previous forbid

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0453`.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --force-warns elided_lifetimes_in_paths
// compile-flags: --force-warns elided_lifetimes_in_paths -Zunstable-options
// check-pass

struct Foo<'a> {
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --force-warns const_err
// compile-flags: --force-warns const_err -Zunstable-options
// check-pass

#![allow(const_err)]
2 changes: 1 addition & 1 deletion src/test/ui/lint/force-warn/force-allowed-warning.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --force-warns dead_code
// compile-flags: --force-warns dead_code -Zunstable-options
// check-pass

#![allow(dead_code)]
2 changes: 1 addition & 1 deletion src/test/ui/lint/force-warn/force-deny-by-default-lint.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --force-warns const_err
// compile-flags: --force-warns const_err -Zunstable-options
// check-pass

const C: i32 = 1 / 0;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --force-warns dead_code
// compile-flags: --force-warns dead_code -Zunstable-options
// check-pass

#![allow(warnings)]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --force-warns nonstandard_style
// compile-flags: --force-warns nonstandard_style -Zunstable-options
// check-pass

#![allow(warnings)]
2 changes: 1 addition & 1 deletion src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --force-warns bare_trait_objects
// compile-flags: --force-warns bare_trait_objects -Zunstable-options
// check-pass

#![allow(rust_2018_idioms)]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --force-warns rust_2018_idioms
// compile-flags: --force-warns rust_2018_idioms -Zunstable-options
// check-pass

#![allow(bare_trait_objects)]
2 changes: 1 addition & 1 deletion src/test/ui/lint/force-warn/force-warn-group.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile-flags: --force-warns rust_2018_idioms
// compile-flags: --force-warns rust_2018_idioms -Zunstable-options
// check-pass

#![allow(rust_2018_idioms)]
2 changes: 0 additions & 2 deletions src/test/ui/lint/issue-80988.rs
Original file line number Diff line number Diff line change
@@ -11,6 +11,4 @@
//~| WARNING being phased out
//~| WARNING incompatible with previous forbid
//~| WARNING being phased out
//~| WARNING incompatible with previous forbid
//~| WARNING being phased out
fn main() {}
14 changes: 1 addition & 13 deletions src/test/ui/lint/issue-80988.stderr
Original file line number Diff line number Diff line change
@@ -35,17 +35,5 @@ LL | #[deny(warnings)]
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>

warning: deny(warnings) incompatible with previous forbid
--> $DIR/issue-80988.rs:7:8
|
LL | #![forbid(warnings)]
| -------- `forbid` level set here
LL |
LL | #[deny(warnings)]
| ^^^^^^^^ overruled by previous forbid
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>

warning: 4 warnings emitted
warning: 3 warnings emitted

1 change: 1 addition & 0 deletions src/test/ui/lint/issue-83477.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// compile-flags: -Zunstable-options
// check-pass
#![warn(rustc::internal)]

8 changes: 4 additions & 4 deletions src/test/ui/lint/issue-83477.stderr
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
warning: unknown lint: `rustc::foo::bar::default_hash_types`
--> $DIR/issue-83477.rs:4:9
--> $DIR/issue-83477.rs:5:9
|
LL | #[allow(rustc::foo::bar::default_hash_types)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `rustc::default_hash_types`
|
= note: `#[warn(unknown_lints)]` on by default

warning: unknown lint: `rustc::foo::default_hash_types`
--> $DIR/issue-83477.rs:8:9
--> $DIR/issue-83477.rs:9:9
|
LL | #[allow(rustc::foo::default_hash_types)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `rustc::default_hash_types`

warning: Prefer FxHashMap over HashMap, it has better performance
--> $DIR/issue-83477.rs:13:31
--> $DIR/issue-83477.rs:14:31
|
LL | let _ = std::collections::HashMap::<String, String>::new();
| ^^^^^^^ help: use: `FxHashMap`
|
note: the lint level is defined here
--> $DIR/issue-83477.rs:2:9
--> $DIR/issue-83477.rs:3:9
|
LL | #![warn(rustc::internal)]
| ^^^^^^^^^^^^^^^
1 change: 0 additions & 1 deletion src/test/ui/lint/lint-forbid-attr.rs
Original file line number Diff line number Diff line change
@@ -3,6 +3,5 @@
#[allow(deprecated)]
//~^ ERROR allow(deprecated) incompatible
//~| ERROR allow(deprecated) incompatible
//~| ERROR allow(deprecated) incompatible
fn main() {
}
11 changes: 1 addition & 10 deletions src/test/ui/lint/lint-forbid-attr.stderr
Original file line number Diff line number Diff line change
@@ -16,15 +16,6 @@ LL |
LL | #[allow(deprecated)]
| ^^^^^^^^^^ overruled by previous forbid

error[E0453]: allow(deprecated) incompatible with previous forbid
--> $DIR/lint-forbid-attr.rs:3:9
|
LL | #![forbid(deprecated)]
| ---------- `forbid` level set here
LL |
LL | #[allow(deprecated)]
| ^^^^^^^^^^ overruled by previous forbid

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0453`.
1 change: 0 additions & 1 deletion src/test/ui/lint/lint-forbid-cmdline.rs
Original file line number Diff line number Diff line change
@@ -2,6 +2,5 @@

#[allow(deprecated)] //~ ERROR allow(deprecated) incompatible
//~| ERROR allow(deprecated) incompatible
//~| ERROR allow(deprecated) incompatible
fn main() {
}
10 changes: 1 addition & 9 deletions src/test/ui/lint/lint-forbid-cmdline.stderr
Original file line number Diff line number Diff line change
@@ -14,14 +14,6 @@ LL | #[allow(deprecated)]
|
= note: `forbid` lint level was set on command line

error[E0453]: allow(deprecated) incompatible with previous forbid
--> $DIR/lint-forbid-cmdline.rs:3:9
|
LL | #[allow(deprecated)]
| ^^^^^^^^^^ overruled by previous forbid
|
= note: `forbid` lint level was set on command line

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0453`.
2 changes: 0 additions & 2 deletions src/test/ui/lint/lint-malformed.rs
Original file line number Diff line number Diff line change
@@ -3,6 +3,4 @@
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
fn main() { }
14 changes: 1 addition & 13 deletions src/test/ui/lint/lint-malformed.stderr
Original file line number Diff line number Diff line change
@@ -28,18 +28,6 @@ error[E0452]: malformed lint attribute input
LL | #![allow(bar = "baz")]
| ^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/lint-malformed.rs:2:10
|
LL | #![allow(bar = "baz")]
| ^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/lint-malformed.rs:2:10
|
LL | #![allow(bar = "baz")]
| ^^^^^^^^^^^ bad attribute argument

error: aborting due to 7 previous errors
error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0452`.
6 changes: 1 addition & 5 deletions src/test/ui/lint/lint-removed-cmdline.stderr
Original file line number Diff line number Diff line change
@@ -10,10 +10,6 @@ warning: lint `raw_pointer_derive` has been removed: using derive with raw point
|
= note: requested on the command line with `-D raw_pointer_derive`

warning: lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
|
= note: requested on the command line with `-D raw_pointer_derive`

error: unused variable: `unused`
--> $DIR/lint-removed-cmdline.rs:12:17
|
@@ -27,5 +23,5 @@ LL | #[deny(warnings)]
| ^^^^^^^^
= note: `#[deny(unused_variables)]` implied by `#[deny(warnings)]`

error: aborting due to previous error; 4 warnings emitted
error: aborting due to previous error; 3 warnings emitted

6 changes: 1 addition & 5 deletions src/test/ui/lint/lint-renamed-cmdline.stderr
Original file line number Diff line number Diff line change
@@ -10,10 +10,6 @@ warning: lint `bare_trait_object` has been renamed to `bare_trait_objects`
|
= note: requested on the command line with `-D bare_trait_object`

warning: lint `bare_trait_object` has been renamed to `bare_trait_objects`
|
= note: requested on the command line with `-D bare_trait_object`

error: unused variable: `unused`
--> $DIR/lint-renamed-cmdline.rs:8:17
|
@@ -27,5 +23,5 @@ LL | #[deny(unused)]
| ^^^^^^
= note: `#[deny(unused_variables)]` implied by `#[deny(unused)]`

error: aborting due to previous error; 4 warnings emitted
error: aborting due to previous error; 3 warnings emitted

10 changes: 1 addition & 9 deletions src/test/ui/lint/lint-unexported-no-mangle.stderr
Original file line number Diff line number Diff line change
@@ -22,14 +22,6 @@ warning: lint `private_no_mangle_statics` has been removed: no longer a warning,
|
= note: requested on the command line with `-F private_no_mangle_statics`

warning: lint `private_no_mangle_fns` has been removed: no longer a warning, `#[no_mangle]` functions always exported
|
= note: requested on the command line with `-F private_no_mangle_fns`

warning: lint `private_no_mangle_statics` has been removed: no longer a warning, `#[no_mangle]` statics always exported
|
= note: requested on the command line with `-F private_no_mangle_statics`

error: const items should never be `#[no_mangle]`
--> $DIR/lint-unexported-no-mangle.rs:9:1
|
@@ -48,5 +40,5 @@ LL | pub const PUB_FOO: u64 = 1;
| |
| help: try a static value: `pub static`

error: aborting due to 2 previous errors; 8 warnings emitted
error: aborting due to 2 previous errors; 6 warnings emitted

11 changes: 1 addition & 10 deletions src/test/ui/lint/lint-unknown-lint-cmdline.stderr
Original file line number Diff line number Diff line change
@@ -16,15 +16,6 @@ error[E0602]: unknown lint: `dead_cod`
= help: did you mean: `dead_code`
= note: requested on the command line with `-D dead_cod`

error[E0602]: unknown lint: `bogus`
|
= note: requested on the command line with `-D bogus`

error[E0602]: unknown lint: `dead_cod`
|
= help: did you mean: `dead_code`
= note: requested on the command line with `-D dead_cod`

error: aborting due to 6 previous errors
error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0602`.
20 changes: 0 additions & 20 deletions src/test/ui/lint/reasons-erroneous.rs
Original file line number Diff line number Diff line change
@@ -3,26 +3,18 @@
#![warn(absolute_paths_not_starting_with_crate, reason = 0)]
//~^ ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| NOTE reason must be a string literal
//~| NOTE reason must be a string literal
//~| NOTE reason must be a string literal
#![warn(anonymous_parameters, reason = b"consider these, for we have condemned them")]
//~^ ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| NOTE reason must be a string literal
//~| NOTE reason must be a string literal
//~| NOTE reason must be a string literal
#![warn(bare_trait_objects, reasons = "leaders to no sure land, guides their bearings lost")]
//~^ ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| NOTE bad attribute argument
//~| NOTE bad attribute argument
//~| NOTE bad attribute argument
//~| NOTE bad attribute argument
//~| NOTE bad attribute argument
@@ -32,10 +24,6 @@
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| NOTE bad attribute argument
//~| NOTE bad attribute argument
//~| NOTE bad attribute argument
//~| NOTE bad attribute argument
//~| NOTE bad attribute argument
@@ -45,26 +33,18 @@
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| NOTE bad attribute argument
//~| NOTE bad attribute argument
//~| NOTE bad attribute argument
//~| NOTE bad attribute argument
//~| NOTE bad attribute argument
//~| NOTE bad attribute argument
#![warn(ellipsis_inclusive_range_patterns, reason = "born barren", reason = "a freak growth")]
//~^ ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| NOTE reason in lint attribute must come last
//~| NOTE reason in lint attribute must come last
//~| NOTE reason in lint attribute must come last
#![warn(keyword_idents, reason = "root in rubble", macro_use_extern_crate)]
//~^ ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| NOTE reason in lint attribute must come last
//~| NOTE reason in lint attribute must come last
//~| NOTE reason in lint attribute must come last
#![warn(missing_copy_implementations, reason)]
100 changes: 20 additions & 80 deletions src/test/ui/lint/reasons-erroneous.stderr
Original file line number Diff line number Diff line change
@@ -5,61 +5,61 @@ LL | #![warn(absolute_paths_not_starting_with_crate, reason = 0)]
| ^ reason must be a string literal

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:10:40
--> $DIR/reasons-erroneous.rs:8:40
|
LL | #![warn(anonymous_parameters, reason = b"consider these, for we have condemned them")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reason must be a string literal

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:17:29
--> $DIR/reasons-erroneous.rs:13:29
|
LL | #![warn(bare_trait_objects, reasons = "leaders to no sure land, guides their bearings lost")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:17:29
--> $DIR/reasons-erroneous.rs:13:29
|
LL | #![warn(bare_trait_objects, reasons = "leaders to no sure land, guides their bearings lost")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:30:23
--> $DIR/reasons-erroneous.rs:22:23
|
LL | #![warn(box_pointers, blerp = "or in league with robbers have reversed the signposts")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:30:23
--> $DIR/reasons-erroneous.rs:22:23
|
LL | #![warn(box_pointers, blerp = "or in league with robbers have reversed the signposts")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:43:36
--> $DIR/reasons-erroneous.rs:31:36
|
LL | #![warn(elided_lifetimes_in_paths, reason("disrespectful to ancestors", "irresponsible to heirs"))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:43:36
--> $DIR/reasons-erroneous.rs:31:36
|
LL | #![warn(elided_lifetimes_in_paths, reason("disrespectful to ancestors", "irresponsible to heirs"))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:56:44
--> $DIR/reasons-erroneous.rs:40:44
|
LL | #![warn(ellipsis_inclusive_range_patterns, reason = "born barren", reason = "a freak growth")]
| ^^^^^^^^^^^^^^^^^^^^^^ reason in lint attribute must come last

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:63:25
--> $DIR/reasons-erroneous.rs:45:25
|
LL | #![warn(keyword_idents, reason = "root in rubble", macro_use_extern_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ reason in lint attribute must come last

warning: unknown lint: `reason`
--> $DIR/reasons-erroneous.rs:70:39
--> $DIR/reasons-erroneous.rs:50:39
|
LL | #![warn(missing_copy_implementations, reason)]
| ^^^^^^
@@ -73,119 +73,59 @@ LL | #![warn(absolute_paths_not_starting_with_crate, reason = 0)]
| ^ reason must be a string literal

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:10:40
--> $DIR/reasons-erroneous.rs:8:40
|
LL | #![warn(anonymous_parameters, reason = b"consider these, for we have condemned them")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reason must be a string literal

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:17:29
--> $DIR/reasons-erroneous.rs:13:29
|
LL | #![warn(bare_trait_objects, reasons = "leaders to no sure land, guides their bearings lost")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:17:29
--> $DIR/reasons-erroneous.rs:13:29
|
LL | #![warn(bare_trait_objects, reasons = "leaders to no sure land, guides their bearings lost")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:30:23
--> $DIR/reasons-erroneous.rs:22:23
|
LL | #![warn(box_pointers, blerp = "or in league with robbers have reversed the signposts")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:30:23
--> $DIR/reasons-erroneous.rs:22:23
|
LL | #![warn(box_pointers, blerp = "or in league with robbers have reversed the signposts")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:43:36
--> $DIR/reasons-erroneous.rs:31:36
|
LL | #![warn(elided_lifetimes_in_paths, reason("disrespectful to ancestors", "irresponsible to heirs"))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:43:36
--> $DIR/reasons-erroneous.rs:31:36
|
LL | #![warn(elided_lifetimes_in_paths, reason("disrespectful to ancestors", "irresponsible to heirs"))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:56:44
--> $DIR/reasons-erroneous.rs:40:44
|
LL | #![warn(ellipsis_inclusive_range_patterns, reason = "born barren", reason = "a freak growth")]
| ^^^^^^^^^^^^^^^^^^^^^^ reason in lint attribute must come last

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:63:25
--> $DIR/reasons-erroneous.rs:45:25
|
LL | #![warn(keyword_idents, reason = "root in rubble", macro_use_extern_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ reason in lint attribute must come last

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:3:58
|
LL | #![warn(absolute_paths_not_starting_with_crate, reason = 0)]
| ^ reason must be a string literal

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:10:40
|
LL | #![warn(anonymous_parameters, reason = b"consider these, for we have condemned them")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reason must be a string literal

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:17:29
|
LL | #![warn(bare_trait_objects, reasons = "leaders to no sure land, guides their bearings lost")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:17:29
|
LL | #![warn(bare_trait_objects, reasons = "leaders to no sure land, guides their bearings lost")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:30:23
|
LL | #![warn(box_pointers, blerp = "or in league with robbers have reversed the signposts")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:30:23
|
LL | #![warn(box_pointers, blerp = "or in league with robbers have reversed the signposts")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:43:36
|
LL | #![warn(elided_lifetimes_in_paths, reason("disrespectful to ancestors", "irresponsible to heirs"))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:43:36
|
LL | #![warn(elided_lifetimes_in_paths, reason("disrespectful to ancestors", "irresponsible to heirs"))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:56:44
|
LL | #![warn(ellipsis_inclusive_range_patterns, reason = "born barren", reason = "a freak growth")]
| ^^^^^^^^^^^^^^^^^^^^^^ reason in lint attribute must come last

error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:63:25
|
LL | #![warn(keyword_idents, reason = "root in rubble", macro_use_extern_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ reason in lint attribute must come last

error: aborting due to 30 previous errors; 1 warning emitted
error: aborting due to 20 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0452`.
2 changes: 0 additions & 2 deletions src/test/ui/lint/register-tool-lint.rs
Original file line number Diff line number Diff line change
@@ -7,5 +7,3 @@
//~| HELP add `#![register_tool(abc)]`
//~| ERROR unknown tool name `abc`
//~| HELP add `#![register_tool(abc)]`
//~| ERROR unknown tool name `abc`
//~| HELP add `#![register_tool(abc)]`
10 changes: 1 addition & 9 deletions src/test/ui/lint/register-tool-lint.stderr
Original file line number Diff line number Diff line change
@@ -14,14 +14,6 @@ LL | #![warn(abc::my_lint)]
|
= help: add `#![register_tool(abc)]` to the crate root

error[E0710]: unknown tool name `abc` found in scoped lint: `abc::my_lint`
--> $DIR/register-tool-lint.rs:5:9
|
LL | #![warn(abc::my_lint)]
| ^^^
|
= help: add `#![register_tool(abc)]` to the crate root

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0710`.
421 changes: 2 additions & 419 deletions src/test/ui/lint/use_suggestion_json.stderr

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/test/ui/tool_lints.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[warn(foo::bar)]
//~^ ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
//~| ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
//~| ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
fn main() {}
10 changes: 1 addition & 9 deletions src/test/ui/tool_lints.stderr
Original file line number Diff line number Diff line change
@@ -14,14 +14,6 @@ LL | #[warn(foo::bar)]
|
= help: add `#![register_tool(foo)]` to the crate root

error[E0710]: unknown tool name `foo` found in scoped lint: `foo::bar`
--> $DIR/tool_lints.rs:1:8
|
LL | #[warn(foo::bar)]
| ^^^
|
= help: add `#![register_tool(foo)]` to the crate root

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0710`.
2 changes: 0 additions & 2 deletions src/test/ui/unknown-lint-tool-name.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#![deny(foo::bar)] //~ ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
//~| ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
//~| ERROR unknown tool name `foo` found in scoped lint: `foo::bar`

#[allow(foo::bar)] //~ ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
//~| ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
//~| ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
fn main() {}
22 changes: 3 additions & 19 deletions src/test/ui/unknown-lint-tool-name.stderr
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ LL | #![deny(foo::bar)]
= help: add `#![register_tool(foo)]` to the crate root

error[E0710]: unknown tool name `foo` found in scoped lint: `foo::bar`
--> $DIR/unknown-lint-tool-name.rs:5:9
--> $DIR/unknown-lint-tool-name.rs:4:9
|
LL | #[allow(foo::bar)]
| ^^^
@@ -23,29 +23,13 @@ LL | #![deny(foo::bar)]
= help: add `#![register_tool(foo)]` to the crate root

error[E0710]: unknown tool name `foo` found in scoped lint: `foo::bar`
--> $DIR/unknown-lint-tool-name.rs:5:9
--> $DIR/unknown-lint-tool-name.rs:4:9
|
LL | #[allow(foo::bar)]
| ^^^
|
= help: add `#![register_tool(foo)]` to the crate root

error[E0710]: unknown tool name `foo` found in scoped lint: `foo::bar`
--> $DIR/unknown-lint-tool-name.rs:1:9
|
LL | #![deny(foo::bar)]
| ^^^
|
= help: add `#![register_tool(foo)]` to the crate root

error[E0710]: unknown tool name `foo` found in scoped lint: `foo::bar`
--> $DIR/unknown-lint-tool-name.rs:5:9
|
LL | #[allow(foo::bar)]
| ^^^
|
= help: add `#![register_tool(foo)]` to the crate root

error: aborting due to 6 previous errors
error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0710`.
2 changes: 1 addition & 1 deletion src/test/ui/unused-crate-deps/extern-loc-bad-loctype.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// --extern-location with bad location type

// aux-crate:bar=bar.rs
// compile-flags:--extern-location bar=badloc:in-the-test-file
// compile-flags:--extern-location bar=badloc:in-the-test-file -Z unstable-options

#![warn(unused_crate_dependencies)]

2 changes: 1 addition & 1 deletion src/test/ui/unused-crate-deps/extern-loc-json-bad-json.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// --extern-location with a raw reference

// aux-crate:bar=bar.rs
// compile-flags:--extern-location bar=json:[{"malformed
// compile-flags:--extern-location bar=json:[{"malformed -Z unstable-options

#![warn(unused_crate_dependencies)]

2 changes: 1 addition & 1 deletion src/test/ui/unused-crate-deps/extern-loc-json-json.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

// check-pass
// aux-crate:bar=bar.rs
// compile-flags:--extern-location bar=json:{"key":123,"value":{}} --error-format json
// compile-flags:--extern-location bar=json:{"key":123,"value":{}} --error-format json -Z unstable-options

#![warn(unused_crate_dependencies)]
//~^ WARNING external crate `bar` unused in
2 changes: 1 addition & 1 deletion src/test/ui/unused-crate-deps/extern-loc-json-json.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{"message":"external crate `bar` unused in `extern_loc_json_json`: remove the dependency or add `use bar as _;`","code":{"code":"unused_crate_dependencies","explanation":null},"level":"warning","spans":[{"file_name":"$DIR/extern-loc-json-json.rs","byte_start":169,"byte_end":169,"line_start":7,"line_end":7,"column_start":1,"column_end":1,"is_primary":true,"text":[{"text":"#![warn(unused_crate_dependencies)]","highlight_start":1,"highlight_end":1}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the lint level is defined here","code":null,"level":"note","spans":[{"file_name":"$DIR/extern-loc-json-json.rs","byte_start":177,"byte_end":202,"line_start":7,"line_end":7,"column_start":9,"column_end":34,"is_primary":true,"text":[{"text":"#![warn(unused_crate_dependencies)]","highlight_start":9,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"remove unnecessary dependency `bar`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"json extern location","code":null,"level":"help","spans":[],"children":[],"rendered":null,"tool_metadata":{"key":123,"value":{}}}],"rendered":"warning: external crate `bar` unused in `extern_loc_json_json`: remove the dependency or add `use bar as _;`
{"message":"external crate `bar` unused in `extern_loc_json_json`: remove the dependency or add `use bar as _;`","code":{"code":"unused_crate_dependencies","explanation":null},"level":"warning","spans":[{"file_name":"$DIR/extern-loc-json-json.rs","byte_start":189,"byte_end":189,"line_start":7,"line_end":7,"column_start":1,"column_end":1,"is_primary":true,"text":[{"text":"#![warn(unused_crate_dependencies)]","highlight_start":1,"highlight_end":1}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the lint level is defined here","code":null,"level":"note","spans":[{"file_name":"$DIR/extern-loc-json-json.rs","byte_start":197,"byte_end":222,"line_start":7,"line_end":7,"column_start":9,"column_end":34,"is_primary":true,"text":[{"text":"#![warn(unused_crate_dependencies)]","highlight_start":9,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"remove unnecessary dependency `bar`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"json extern location","code":null,"level":"help","spans":[],"children":[],"rendered":null,"tool_metadata":{"key":123,"value":{}}}],"rendered":"warning: external crate `bar` unused in `extern_loc_json_json`: remove the dependency or add `use bar as _;`
--> $DIR/extern-loc-json-json.rs:7:1
|
LL | #![warn(unused_crate_dependencies)]
2 changes: 1 addition & 1 deletion src/test/ui/unused-crate-deps/extern-loc-json.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

// check-pass
// aux-crate:bar=bar.rs
// compile-flags:--extern-location bar=json:{"key":123,"value":{}}
// compile-flags:--extern-location bar=json:{"key":123,"value":{}} -Z unstable-options

#![warn(unused_crate_dependencies)]
//~^ WARNING external crate `bar` unused in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// --extern-location with no type

// aux-crate:bar=bar.rs
// compile-flags:--extern-location bar=missing-loc-type
// compile-flags:--extern-location bar=missing-loc-type -Z unstable-options

#![warn(unused_crate_dependencies)]

2 changes: 1 addition & 1 deletion src/test/ui/unused-crate-deps/extern-loc-raw-json.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

// check-pass
// aux-crate:bar=bar.rs
// compile-flags:--extern-location bar=raw:in-the-test-file --error-format json
// compile-flags:--extern-location bar=raw:in-the-test-file --error-format json -Z unstable-options

#![warn(unused_crate_dependencies)]
//~^ WARNING external crate `bar` unused in
2 changes: 1 addition & 1 deletion src/test/ui/unused-crate-deps/extern-loc-raw-json.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{"message":"external crate `bar` unused in `extern_loc_raw_json`: remove the dependency or add `use bar as _;`","code":{"code":"unused_crate_dependencies","explanation":null},"level":"warning","spans":[{"file_name":"$DIR/extern-loc-raw-json.rs","byte_start":162,"byte_end":162,"line_start":7,"line_end":7,"column_start":1,"column_end":1,"is_primary":true,"text":[{"text":"#![warn(unused_crate_dependencies)]","highlight_start":1,"highlight_end":1}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the lint level is defined here","code":null,"level":"note","spans":[{"file_name":"$DIR/extern-loc-raw-json.rs","byte_start":170,"byte_end":195,"line_start":7,"line_end":7,"column_start":9,"column_end":34,"is_primary":true,"text":[{"text":"#![warn(unused_crate_dependencies)]","highlight_start":9,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"remove unnecessary dependency `bar` at `in-the-test-file`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"raw extern location","code":null,"level":"help","spans":[{"file_name":"$DIR/extern-loc-raw-json.rs","byte_start":0,"byte_end":0,"line_start":1,"line_end":1,"column_start":1,"column_end":1,"is_primary":true,"text":[],"label":null,"suggested_replacement":"in-the-test-file","suggestion_applicability":"Unspecified","expansion":null}],"children":[],"rendered":null},{"message":"json extern location","code":null,"level":"help","spans":[],"children":[],"rendered":null,"tool_metadata":"in-the-test-file"}],"rendered":"warning: external crate `bar` unused in `extern_loc_raw_json`: remove the dependency or add `use bar as _;`
{"message":"external crate `bar` unused in `extern_loc_raw_json`: remove the dependency or add `use bar as _;`","code":{"code":"unused_crate_dependencies","explanation":null},"level":"warning","spans":[{"file_name":"$DIR/extern-loc-raw-json.rs","byte_start":182,"byte_end":182,"line_start":7,"line_end":7,"column_start":1,"column_end":1,"is_primary":true,"text":[{"text":"#![warn(unused_crate_dependencies)]","highlight_start":1,"highlight_end":1}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the lint level is defined here","code":null,"level":"note","spans":[{"file_name":"$DIR/extern-loc-raw-json.rs","byte_start":190,"byte_end":215,"line_start":7,"line_end":7,"column_start":9,"column_end":34,"is_primary":true,"text":[{"text":"#![warn(unused_crate_dependencies)]","highlight_start":9,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"remove unnecessary dependency `bar` at `in-the-test-file`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"raw extern location","code":null,"level":"help","spans":[{"file_name":"$DIR/extern-loc-raw-json.rs","byte_start":0,"byte_end":0,"line_start":1,"line_end":1,"column_start":1,"column_end":1,"is_primary":true,"text":[],"label":null,"suggested_replacement":"in-the-test-file","suggestion_applicability":"Unspecified","expansion":null}],"children":[],"rendered":null},{"message":"json extern location","code":null,"level":"help","spans":[],"children":[],"rendered":null,"tool_metadata":"in-the-test-file"}],"rendered":"warning: external crate `bar` unused in `extern_loc_raw_json`: remove the dependency or add `use bar as _;`
--> $DIR/extern-loc-raw-json.rs:7:1
|
LL | #![warn(unused_crate_dependencies)]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// --extern-location with a raw reference

// aux-crate:bar=bar.rs
// compile-flags:--extern-location bar=raw
// compile-flags:--extern-location bar=raw -Z unstable-options

#![warn(unused_crate_dependencies)]

2 changes: 1 addition & 1 deletion src/test/ui/unused-crate-deps/extern-loc-raw.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

// check-pass
// aux-crate:bar=bar.rs
// compile-flags:--extern-location bar=raw:in-the-test-file
// compile-flags:--extern-location bar=raw:in-the-test-file -Z unstable-options

#![warn(unused_crate_dependencies)]
//~^ WARNING external crate `bar` unused in
3 changes: 3 additions & 0 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
@@ -438,6 +438,9 @@ impl TestProps {

if let Some(edition) = config.parse_edition(ln) {
self.compile_flags.push(format!("--edition={}", edition));
if edition == "2021" {
self.compile_flags.push("-Zunstable-options".to_string());
}
}

config.parse_and_update_revisions(ln, &mut self.revisions);
3 changes: 3 additions & 0 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
@@ -1785,6 +1785,9 @@ impl<'test> TestCx<'test> {
get_lib_name(&aux_path.trim_end_matches(".rs").replace('-', "_"), is_dylib);
rustc.arg("--extern").arg(format!("{}={}/{}", aux_name, aux_dir.display(), lib_name));
}
if !self.props.aux_crates.is_empty() {
rustc.arg("-Zunstable-options");
}

aux_dir
}