about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2021-02-28 13:24:46 -0500
committerJoshua Nelson <jyn514@gmail.com>2021-06-06 00:44:54 -0400
commit1cdc81bdc109dab9a71108201a0e8edf24efeafa (patch)
tree553d7ca320c09c6b0962769437e123d0f911292b
parent34b9932f5c0f519d6b9b9f95f21723142c5dc877 (diff)
downloadrust-1cdc81bdc109dab9a71108201a0e8edf24efeafa.tar.gz
rust-1cdc81bdc109dab9a71108201a0e8edf24efeafa.zip
Don't pass -Z unstable-options by default for UI tests
- Pass it explicitly where appropriate
- Update stderr files and warnings; it turns that unstable-options has
  far-reaching effects on diagnostics.
-rw-r--r--src/bootstrap/test.rs1
-rw-r--r--src/test/rustdoc-ui/run-directory.rs4
-rw-r--r--src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.rs1
-rw-r--r--src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.stderr6
-rw-r--r--src/test/ui/annotate-snippet/missing-type.rs2
-rw-r--r--src/test/ui/annotate-snippet/multispan.rs2
-rw-r--r--src/test/ui/deduplicate-diagnostics.duplicate.stderr8
-rw-r--r--src/test/ui/deduplicate-diagnostics.rs1
-rw-r--r--src/test/ui/error-codes/E0452.rs2
-rw-r--r--src/test/ui/error-codes/E0452.stderr14
-rw-r--r--src/test/ui/error-codes/E0453.rs1
-rw-r--r--src/test/ui/error-codes/E0453.stderr11
-rw-r--r--src/test/ui/error-codes/E0602.stderr6
-rw-r--r--src/test/ui/feature-gates/feature-gate-lint-reasons.rs1
-rw-r--r--src/test/ui/feature-gates/feature-gate-lint-reasons.stderr11
-rw-r--r--src/test/ui/lint/crate_level_only_lint.rs3
-rw-r--r--src/test/ui/lint/crate_level_only_lint.stderr28
-rw-r--r--src/test/ui/lint/forbid-group-group-2.rs6
-rw-r--r--src/test/ui/lint/forbid-group-group-2.stderr38
-rw-r--r--src/test/ui/lint/forbid-group-member.rs2
-rw-r--r--src/test/ui/lint/forbid-group-member.stderr14
-rw-r--r--src/test/ui/lint/forbid-member-group.rs1
-rw-r--r--src/test/ui/lint/forbid-member-group.stderr11
-rw-r--r--src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs2
-rw-r--r--src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs2
-rw-r--r--src/test/ui/lint/force-warn/force-allowed-warning.rs2
-rw-r--r--src/test/ui/lint/force-warn/force-deny-by-default-lint.rs2
-rw-r--r--src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs2
-rw-r--r--src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs2
-rw-r--r--src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs2
-rw-r--r--src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs2
-rw-r--r--src/test/ui/lint/force-warn/force-warn-group.rs2
-rw-r--r--src/test/ui/lint/issue-80988.rs2
-rw-r--r--src/test/ui/lint/issue-80988.stderr14
-rw-r--r--src/test/ui/lint/issue-83477.rs1
-rw-r--r--src/test/ui/lint/issue-83477.stderr8
-rw-r--r--src/test/ui/lint/lint-forbid-attr.rs1
-rw-r--r--src/test/ui/lint/lint-forbid-attr.stderr11
-rw-r--r--src/test/ui/lint/lint-forbid-cmdline.rs1
-rw-r--r--src/test/ui/lint/lint-forbid-cmdline.stderr10
-rw-r--r--src/test/ui/lint/lint-malformed.rs2
-rw-r--r--src/test/ui/lint/lint-malformed.stderr14
-rw-r--r--src/test/ui/lint/lint-removed-cmdline.stderr6
-rw-r--r--src/test/ui/lint/lint-renamed-cmdline.stderr6
-rw-r--r--src/test/ui/lint/lint-unexported-no-mangle.stderr10
-rw-r--r--src/test/ui/lint/lint-unknown-lint-cmdline.stderr11
-rw-r--r--src/test/ui/lint/reasons-erroneous.rs20
-rw-r--r--src/test/ui/lint/reasons-erroneous.stderr100
-rw-r--r--src/test/ui/lint/register-tool-lint.rs2
-rw-r--r--src/test/ui/lint/register-tool-lint.stderr10
-rw-r--r--src/test/ui/lint/use_suggestion_json.stderr421
-rw-r--r--src/test/ui/tool_lints.rs1
-rw-r--r--src/test/ui/tool_lints.stderr10
-rw-r--r--src/test/ui/unknown-lint-tool-name.rs2
-rw-r--r--src/test/ui/unknown-lint-tool-name.stderr22
-rw-r--r--src/test/ui/unused-crate-deps/extern-loc-bad-loctype.rs2
-rw-r--r--src/test/ui/unused-crate-deps/extern-loc-json-bad-json.rs2
-rw-r--r--src/test/ui/unused-crate-deps/extern-loc-json-json.rs2
-rw-r--r--src/test/ui/unused-crate-deps/extern-loc-json-json.stderr2
-rw-r--r--src/test/ui/unused-crate-deps/extern-loc-json.rs2
-rw-r--r--src/test/ui/unused-crate-deps/extern-loc-missing-loctype.rs2
-rw-r--r--src/test/ui/unused-crate-deps/extern-loc-raw-json.rs2
-rw-r--r--src/test/ui/unused-crate-deps/extern-loc-raw-json.stderr2
-rw-r--r--src/test/ui/unused-crate-deps/extern-loc-raw-missing-loc.rs2
-rw-r--r--src/test/ui/unused-crate-deps/extern-loc-raw.rs2
-rw-r--r--src/tools/compiletest/src/header.rs3
-rw-r--r--src/tools/compiletest/src/runtest.rs3
67 files changed, 86 insertions, 817 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index cc7c143d474..1fa37737b55 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -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) {
diff --git a/src/test/rustdoc-ui/run-directory.rs b/src/test/rustdoc-ui/run-directory.rs
index 78431c0e80b..0d432c1e699 100644
--- a/src/test/rustdoc-ui/run-directory.rs
+++ b/src/test/rustdoc-ui/run-directory.rs
@@ -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"
 
diff --git a/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.rs b/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.rs
index f58446d5592..25f6490aa35 100644
--- a/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.rs
+++ b/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.rs
@@ -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.
 //
diff --git a/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.stderr b/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.stderr
index b846b30f4ed..15a06e721dd 100644
--- a/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.stderr
+++ b/src/test/ui-fulldeps/internal-lints/pass_ty_by_ref_self.stderr
@@ -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>`
diff --git a/src/test/ui/annotate-snippet/missing-type.rs b/src/test/ui/annotate-snippet/missing-type.rs
index d0814a9537d..b0d8b5fbaf2 100644
--- a/src/test/ui/annotate-snippet/missing-type.rs
+++ b/src/test/ui/annotate-snippet/missing-type.rs
@@ -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
diff --git a/src/test/ui/annotate-snippet/multispan.rs b/src/test/ui/annotate-snippet/multispan.rs
index 325252d7716..69d7e1a9d11 100644
--- a/src/test/ui/annotate-snippet/multispan.rs
+++ b/src/test/ui/annotate-snippet/multispan.rs
@@ -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)]
 
diff --git a/src/test/ui/deduplicate-diagnostics.duplicate.stderr b/src/test/ui/deduplicate-diagnostics.duplicate.stderr
index 3b100b59995..cd4700c7a7c 100644
--- a/src/test/ui/deduplicate-diagnostics.duplicate.stderr
+++ b/src/test/ui/deduplicate-diagnostics.duplicate.stderr
@@ -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`.
diff --git a/src/test/ui/deduplicate-diagnostics.rs b/src/test/ui/deduplicate-diagnostics.rs
index c5d41ff2fda..7d1c4f5f838 100644
--- a/src/test/ui/deduplicate-diagnostics.rs
+++ b/src/test/ui/deduplicate-diagnostics.rs
@@ -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() {}
diff --git a/src/test/ui/error-codes/E0452.rs b/src/test/ui/error-codes/E0452.rs
index 4e5a6c93014..5066cd99be9 100644
--- a/src/test/ui/error-codes/E0452.rs
+++ b/src/test/ui/error-codes/E0452.rs
@@ -2,7 +2,5 @@
                     //~| ERROR E0452
                     //~| ERROR E0452
                     //~| ERROR E0452
-                    //~| ERROR E0452
-                    //~| ERROR E0452
 fn main() {
 }
diff --git a/src/test/ui/error-codes/E0452.stderr b/src/test/ui/error-codes/E0452.stderr
index 30c11e3274e..f67b740ffe2 100644
--- a/src/test/ui/error-codes/E0452.stderr
+++ b/src/test/ui/error-codes/E0452.stderr
@@ -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`.
diff --git a/src/test/ui/error-codes/E0453.rs b/src/test/ui/error-codes/E0453.rs
index 6fa8dd9717f..ca9573c5b46 100644
--- a/src/test/ui/error-codes/E0453.rs
+++ b/src/test/ui/error-codes/E0453.rs
@@ -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() {
 }
diff --git a/src/test/ui/error-codes/E0453.stderr b/src/test/ui/error-codes/E0453.stderr
index 21c43cc052e..6d60dc84c21 100644
--- a/src/test/ui/error-codes/E0453.stderr
+++ b/src/test/ui/error-codes/E0453.stderr
@@ -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`.
diff --git a/src/test/ui/error-codes/E0602.stderr b/src/test/ui/error-codes/E0602.stderr
index 70137cb1662..2b372263345 100644
--- a/src/test/ui/error-codes/E0602.stderr
+++ b/src/test/ui/error-codes/E0602.stderr
@@ -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`.
diff --git a/src/test/ui/feature-gates/feature-gate-lint-reasons.rs b/src/test/ui/feature-gates/feature-gate-lint-reasons.rs
index b124e9b2f4d..7756074e235 100644
--- a/src/test/ui/feature-gates/feature-gate-lint-reasons.rs
+++ b/src/test/ui/feature-gates/feature-gate-lint-reasons.rs
@@ -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() {}
diff --git a/src/test/ui/feature-gates/feature-gate-lint-reasons.stderr b/src/test/ui/feature-gates/feature-gate-lint-reasons.stderr
index a7d5ea6b937..12793c7a28f 100644
--- a/src/test/ui/feature-gates/feature-gate-lint-reasons.stderr
+++ b/src/test/ui/feature-gates/feature-gate-lint-reasons.stderr
@@ -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`.
diff --git a/src/test/ui/lint/crate_level_only_lint.rs b/src/test/ui/lint/crate_level_only_lint.rs
index d9673faa214..38c5487183c 100644
--- a/src/test/ui/lint/crate_level_only_lint.rs
+++ b/src/test/ui/lint/crate_level_only_lint.rs
@@ -4,12 +4,10 @@ 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;
 
 }
@@ -17,6 +15,5 @@ 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() {
 }
diff --git a/src/test/ui/lint/crate_level_only_lint.stderr b/src/test/ui/lint/crate_level_only_lint.stderr
index 8fb06df2a48..83bea0412ff 100644
--- a/src/test/ui/lint/crate_level_only_lint.stderr
+++ b/src/test/ui/lint/crate_level_only_lint.stderr
@@ -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
 
diff --git a/src/test/ui/lint/forbid-group-group-2.rs b/src/test/ui/lint/forbid-group-group-2.rs
index b12fd72da74..7d8a3981814 100644
--- a/src/test/ui/lint/forbid-group-group-2.rs
+++ b/src/test/ui/lint/forbid-group-group-2.rs
@@ -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() {}
diff --git a/src/test/ui/lint/forbid-group-group-2.stderr b/src/test/ui/lint/forbid-group-group-2.stderr
index 214e949c11a..d8c09e6526a 100644
--- a/src/test/ui/lint/forbid-group-group-2.stderr
+++ b/src/test/ui/lint/forbid-group-group-2.stderr
@@ -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
 
diff --git a/src/test/ui/lint/forbid-group-member.rs b/src/test/ui/lint/forbid-group-member.rs
index 6f1b2e9f668..664edeaa8b4 100644
--- a/src/test/ui/lint/forbid-group-member.rs
+++ b/src/test/ui/lint/forbid-group-member.rs
@@ -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: ();
 }
diff --git a/src/test/ui/lint/forbid-group-member.stderr b/src/test/ui/lint/forbid-group-member.stderr
index c818d7ff606..72772a42bed 100644
--- a/src/test/ui/lint/forbid-group-member.stderr
+++ b/src/test/ui/lint/forbid-group-member.stderr
@@ -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
 
diff --git a/src/test/ui/lint/forbid-member-group.rs b/src/test/ui/lint/forbid-member-group.rs
index 3279029a9cb..e2f76825a2d 100644
--- a/src/test/ui/lint/forbid-member-group.rs
+++ b/src/test/ui/lint/forbid-member-group.rs
@@ -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: ();
 }
diff --git a/src/test/ui/lint/forbid-member-group.stderr b/src/test/ui/lint/forbid-member-group.stderr
index 1d8ab4d5edb..39700af4d59 100644
--- a/src/test/ui/lint/forbid-member-group.stderr
+++ b/src/test/ui/lint/forbid-member-group.stderr
@@ -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`.
diff --git a/src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs b/src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs
index d4a5056ddf3..0a3e20b4f7d 100644
--- a/src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs
+++ b/src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs
@@ -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> {
diff --git a/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs b/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs
index afd2d6ec322..0abc4913726 100644
--- a/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs
+++ b/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs
@@ -1,4 +1,4 @@
-// compile-flags: --force-warns const_err
+// compile-flags: --force-warns const_err -Zunstable-options
 // check-pass
 
 #![allow(const_err)]
diff --git a/src/test/ui/lint/force-warn/force-allowed-warning.rs b/src/test/ui/lint/force-warn/force-allowed-warning.rs
index 5c83c525e38..bac0e4f8f8e 100644
--- a/src/test/ui/lint/force-warn/force-allowed-warning.rs
+++ b/src/test/ui/lint/force-warn/force-allowed-warning.rs
@@ -1,4 +1,4 @@
-// compile-flags: --force-warns dead_code
+// compile-flags: --force-warns dead_code -Zunstable-options
 // check-pass
 
 #![allow(dead_code)]
diff --git a/src/test/ui/lint/force-warn/force-deny-by-default-lint.rs b/src/test/ui/lint/force-warn/force-deny-by-default-lint.rs
index 4f267f085d5..e721760ab2d 100644
--- a/src/test/ui/lint/force-warn/force-deny-by-default-lint.rs
+++ b/src/test/ui/lint/force-warn/force-deny-by-default-lint.rs
@@ -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;
diff --git a/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs b/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs
index 5501faa437a..0dc1ce28ac4 100644
--- a/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs
+++ b/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs
@@ -1,4 +1,4 @@
-// compile-flags: --force-warns dead_code
+// compile-flags: --force-warns dead_code -Zunstable-options
 // check-pass
 
 #![allow(warnings)]
diff --git a/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs b/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs
index 9009971f0cf..4f637c7fefa 100644
--- a/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs
+++ b/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs
@@ -1,4 +1,4 @@
-// compile-flags: --force-warns nonstandard_style
+// compile-flags: --force-warns nonstandard_style -Zunstable-options
 // check-pass
 
 #![allow(warnings)]
diff --git a/src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs b/src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs
index b68b979ca11..bb2f394aef3 100644
--- a/src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs
+++ b/src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs
@@ -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)]
diff --git a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs b/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs
index 357a79b383d..fd029a3d55c 100644
--- a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs
+++ b/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs
@@ -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)]
diff --git a/src/test/ui/lint/force-warn/force-warn-group.rs b/src/test/ui/lint/force-warn/force-warn-group.rs
index a4615df42de..c97eeabbd4e 100644
--- a/src/test/ui/lint/force-warn/force-warn-group.rs
+++ b/src/test/ui/lint/force-warn/force-warn-group.rs
@@ -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)]
diff --git a/src/test/ui/lint/issue-80988.rs b/src/test/ui/lint/issue-80988.rs
index 16a041928db..1e116206f7b 100644
--- a/src/test/ui/lint/issue-80988.rs
+++ b/src/test/ui/lint/issue-80988.rs
@@ -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() {}
diff --git a/src/test/ui/lint/issue-80988.stderr b/src/test/ui/lint/issue-80988.stderr
index 4cae11f97c0..deee267d0c6 100644
--- a/src/test/ui/lint/issue-80988.stderr
+++ b/src/test/ui/lint/issue-80988.stderr
@@ -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
 
diff --git a/src/test/ui/lint/issue-83477.rs b/src/test/ui/lint/issue-83477.rs
index 0eba52acfa3..ab62f0c8b8c 100644
--- a/src/test/ui/lint/issue-83477.rs
+++ b/src/test/ui/lint/issue-83477.rs
@@ -1,3 +1,4 @@
+// compile-flags: -Zunstable-options
 // check-pass
 #![warn(rustc::internal)]
 
diff --git a/src/test/ui/lint/issue-83477.stderr b/src/test/ui/lint/issue-83477.stderr
index dbe0c9e0130..028890f3623 100644
--- a/src/test/ui/lint/issue-83477.stderr
+++ b/src/test/ui/lint/issue-83477.stderr
@@ -1,5 +1,5 @@
 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`
@@ -7,19 +7,19 @@ LL | #[allow(rustc::foo::bar::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)]
    |         ^^^^^^^^^^^^^^^
diff --git a/src/test/ui/lint/lint-forbid-attr.rs b/src/test/ui/lint/lint-forbid-attr.rs
index 13ebb6dccd8..6d4cfd83424 100644
--- a/src/test/ui/lint/lint-forbid-attr.rs
+++ b/src/test/ui/lint/lint-forbid-attr.rs
@@ -3,6 +3,5 @@
 #[allow(deprecated)]
 //~^ ERROR allow(deprecated) incompatible
 //~| ERROR allow(deprecated) incompatible
-//~| ERROR allow(deprecated) incompatible
 fn main() {
 }
diff --git a/src/test/ui/lint/lint-forbid-attr.stderr b/src/test/ui/lint/lint-forbid-attr.stderr
index cb0b25d1115..48228c5dfdd 100644
--- a/src/test/ui/lint/lint-forbid-attr.stderr
+++ b/src/test/ui/lint/lint-forbid-attr.stderr
@@ -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`.
diff --git a/src/test/ui/lint/lint-forbid-cmdline.rs b/src/test/ui/lint/lint-forbid-cmdline.rs
index 38bb8d29d3f..5246ccb57a6 100644
--- a/src/test/ui/lint/lint-forbid-cmdline.rs
+++ b/src/test/ui/lint/lint-forbid-cmdline.rs
@@ -2,6 +2,5 @@
 
 #[allow(deprecated)] //~ ERROR allow(deprecated) incompatible
                      //~| ERROR allow(deprecated) incompatible
-                     //~| ERROR allow(deprecated) incompatible
 fn main() {
 }
diff --git a/src/test/ui/lint/lint-forbid-cmdline.stderr b/src/test/ui/lint/lint-forbid-cmdline.stderr
index 5b1b015c4dd..0a92e58c04a 100644
--- a/src/test/ui/lint/lint-forbid-cmdline.stderr
+++ b/src/test/ui/lint/lint-forbid-cmdline.stderr
@@ -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`.
diff --git a/src/test/ui/lint/lint-malformed.rs b/src/test/ui/lint/lint-malformed.rs
index cf5570753d8..188e702f98b 100644
--- a/src/test/ui/lint/lint-malformed.rs
+++ b/src/test/ui/lint/lint-malformed.rs
@@ -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() { }
diff --git a/src/test/ui/lint/lint-malformed.stderr b/src/test/ui/lint/lint-malformed.stderr
index 6dc8d498444..b3a41a786c1 100644
--- a/src/test/ui/lint/lint-malformed.stderr
+++ b/src/test/ui/lint/lint-malformed.stderr
@@ -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`.
diff --git a/src/test/ui/lint/lint-removed-cmdline.stderr b/src/test/ui/lint/lint-removed-cmdline.stderr
index fc2ba92479c..9be532ef234 100644
--- a/src/test/ui/lint/lint-removed-cmdline.stderr
+++ b/src/test/ui/lint/lint-removed-cmdline.stderr
@@ -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
 
diff --git a/src/test/ui/lint/lint-renamed-cmdline.stderr b/src/test/ui/lint/lint-renamed-cmdline.stderr
index 1c37a5baa6d..8dfd61ac927 100644
--- a/src/test/ui/lint/lint-renamed-cmdline.stderr
+++ b/src/test/ui/lint/lint-renamed-cmdline.stderr
@@ -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
 
diff --git a/src/test/ui/lint/lint-unexported-no-mangle.stderr b/src/test/ui/lint/lint-unexported-no-mangle.stderr
index 66d64e8937a..a11ee769c7c 100644
--- a/src/test/ui/lint/lint-unexported-no-mangle.stderr
+++ b/src/test/ui/lint/lint-unexported-no-mangle.stderr
@@ -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
 
diff --git a/src/test/ui/lint/lint-unknown-lint-cmdline.stderr b/src/test/ui/lint/lint-unknown-lint-cmdline.stderr
index 27e7ee7fc03..3855d552792 100644
--- a/src/test/ui/lint/lint-unknown-lint-cmdline.stderr
+++ b/src/test/ui/lint/lint-unknown-lint-cmdline.stderr
@@ -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`.
diff --git a/src/test/ui/lint/reasons-erroneous.rs b/src/test/ui/lint/reasons-erroneous.rs
index 03cf0679fce..cd693ae166c 100644
--- a/src/test/ui/lint/reasons-erroneous.rs
+++ b/src/test/ui/lint/reasons-erroneous.rs
@@ -3,15 +3,11 @@
 #![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")]
@@ -19,10 +15,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
@@ -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,10 +33,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
@@ -56,15 +40,11 @@
 #![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)]
diff --git a/src/test/ui/lint/reasons-erroneous.stderr b/src/test/ui/lint/reasons-erroneous.stderr
index d7926b73cee..f65ca08694d 100644
--- a/src/test/ui/lint/reasons-erroneous.stderr
+++ b/src/test/ui/lint/reasons-erroneous.stderr
@@ -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`.
diff --git a/src/test/ui/lint/register-tool-lint.rs b/src/test/ui/lint/register-tool-lint.rs
index 0ba5a37b167..17d3afbf6e2 100644
--- a/src/test/ui/lint/register-tool-lint.rs
+++ b/src/test/ui/lint/register-tool-lint.rs
@@ -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)]`
diff --git a/src/test/ui/lint/register-tool-lint.stderr b/src/test/ui/lint/register-tool-lint.stderr
index 750c74cec1e..842d845ff7c 100644
--- a/src/test/ui/lint/register-tool-lint.stderr
+++ b/src/test/ui/lint/register-tool-lint.stderr
@@ -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`.
diff --git a/src/test/ui/lint/use_suggestion_json.stderr b/src/test/ui/lint/use_suggestion_json.stderr
index 21342e2ef37..d17514303ab 100644
--- a/src/test/ui/lint/use_suggestion_json.stderr
+++ b/src/test/ui/lint/use_suggestion_json.stderr
@@ -1,420 +1,3 @@
-{
-  "message": "cannot find type `Iter` in this scope",
-  "code": {
-    "code": "E0412",
-    "explanation": "A used type name is not in scope.
+{"message":"`--error-format=pretty-json` is unstable","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: `--error-format=pretty-json` is unstable\u001b[0m
 
-Erroneous code examples:
-
-```compile_fail,E0412
-impl Something {} // error: type name `Something` is not in scope
-
-// or:
-
-trait Foo {
-    fn bar(N); // error: type name `N` is not in scope
-}
-
-// or:
-
-fn foo(x: T) {} // type name `T` is not in scope
-```
-
-To fix this error, please verify you didn't misspell the type name, you did
-declare it or imported it into the scope. Examples:
-
-```
-struct Something;
-
-impl Something {} // ok!
-
-// or:
-
-trait Foo {
-    type N;
-
-    fn bar(_: Self::N); // ok!
-}
-
-// or:
-
-fn foo<T>(x: T) {} // ok!
-```
-
-Another case that causes this error is when a type is imported into a parent
-module. To fix this, you can follow the suggestion and use File directly or
-`use super::File;` which will import the types from the parent namespace. An
-example that causes this error is below:
-
-```compile_fail,E0412
-use std::fs::File;
-
-mod foo {
-    fn some_function(f: File) {}
-}
-```
-
-```
-use std::fs::File;
-
-mod foo {
-    // either
-    use super::File;
-    // or
-    // use std::fs::File;
-    fn foo(f: File) {}
-}
-# fn main() {} // don't insert it for us; that'll break imports
-```
-"
-  },
-  "level": "error",
-  "spans": [
-    {
-      "file_name": "$DIR/use_suggestion_json.rs",
-      "byte_start": 541,
-      "byte_end": 545,
-      "line_start": 12,
-      "line_end": 12,
-      "column_start": 12,
-      "column_end": 16,
-      "is_primary": true,
-      "text": [
-        {
-          "text": "    let x: Iter;",
-          "highlight_start": 12,
-          "highlight_end": 16
-        }
-      ],
-      "label": "not found in this scope",
-      "suggested_replacement": null,
-      "suggestion_applicability": null,
-      "expansion": null
-    }
-  ],
-  "children": [
-    {
-      "message": "consider importing one of these items",
-      "code": null,
-      "level": "help",
-      "spans": [
-        {
-          "file_name": "$DIR/use_suggestion_json.rs",
-          "byte_start": 518,
-          "byte_end": 518,
-          "line_start": 11,
-          "line_end": 11,
-          "column_start": 1,
-          "column_end": 1,
-          "is_primary": true,
-          "text": [
-            {
-              "text": "fn main() {",
-              "highlight_start": 1,
-              "highlight_end": 1
-            }
-          ],
-          "label": null,
-          "suggested_replacement": "use std::collections::binary_heap::Iter;
-
-",
-          "suggestion_applicability": "Unspecified",
-          "expansion": null
-        },
-        {
-          "file_name": "$DIR/use_suggestion_json.rs",
-          "byte_start": 518,
-          "byte_end": 518,
-          "line_start": 11,
-          "line_end": 11,
-          "column_start": 1,
-          "column_end": 1,
-          "is_primary": true,
-          "text": [
-            {
-              "text": "fn main() {",
-              "highlight_start": 1,
-              "highlight_end": 1
-            }
-          ],
-          "label": null,
-          "suggested_replacement": "use std::collections::btree_map::Iter;
-
-",
-          "suggestion_applicability": "Unspecified",
-          "expansion": null
-        },
-        {
-          "file_name": "$DIR/use_suggestion_json.rs",
-          "byte_start": 518,
-          "byte_end": 518,
-          "line_start": 11,
-          "line_end": 11,
-          "column_start": 1,
-          "column_end": 1,
-          "is_primary": true,
-          "text": [
-            {
-              "text": "fn main() {",
-              "highlight_start": 1,
-              "highlight_end": 1
-            }
-          ],
-          "label": null,
-          "suggested_replacement": "use std::collections::btree_set::Iter;
-
-",
-          "suggestion_applicability": "Unspecified",
-          "expansion": null
-        },
-        {
-          "file_name": "$DIR/use_suggestion_json.rs",
-          "byte_start": 518,
-          "byte_end": 518,
-          "line_start": 11,
-          "line_end": 11,
-          "column_start": 1,
-          "column_end": 1,
-          "is_primary": true,
-          "text": [
-            {
-              "text": "fn main() {",
-              "highlight_start": 1,
-              "highlight_end": 1
-            }
-          ],
-          "label": null,
-          "suggested_replacement": "use std::collections::hash_map::Iter;
-
-",
-          "suggestion_applicability": "Unspecified",
-          "expansion": null
-        },
-        {
-          "file_name": "$DIR/use_suggestion_json.rs",
-          "byte_start": 518,
-          "byte_end": 518,
-          "line_start": 11,
-          "line_end": 11,
-          "column_start": 1,
-          "column_end": 1,
-          "is_primary": true,
-          "text": [
-            {
-              "text": "fn main() {",
-              "highlight_start": 1,
-              "highlight_end": 1
-            }
-          ],
-          "label": null,
-          "suggested_replacement": "use std::collections::hash_set::Iter;
-
-",
-          "suggestion_applicability": "Unspecified",
-          "expansion": null
-        },
-        {
-          "file_name": "$DIR/use_suggestion_json.rs",
-          "byte_start": 518,
-          "byte_end": 518,
-          "line_start": 11,
-          "line_end": 11,
-          "column_start": 1,
-          "column_end": 1,
-          "is_primary": true,
-          "text": [
-            {
-              "text": "fn main() {",
-              "highlight_start": 1,
-              "highlight_end": 1
-            }
-          ],
-          "label": null,
-          "suggested_replacement": "use std::collections::linked_list::Iter;
-
-",
-          "suggestion_applicability": "Unspecified",
-          "expansion": null
-        },
-        {
-          "file_name": "$DIR/use_suggestion_json.rs",
-          "byte_start": 518,
-          "byte_end": 518,
-          "line_start": 11,
-          "line_end": 11,
-          "column_start": 1,
-          "column_end": 1,
-          "is_primary": true,
-          "text": [
-            {
-              "text": "fn main() {",
-              "highlight_start": 1,
-              "highlight_end": 1
-            }
-          ],
-          "label": null,
-          "suggested_replacement": "use std::collections::vec_deque::Iter;
-
-",
-          "suggestion_applicability": "Unspecified",
-          "expansion": null
-        },
-        {
-          "file_name": "$DIR/use_suggestion_json.rs",
-          "byte_start": 518,
-          "byte_end": 518,
-          "line_start": 11,
-          "line_end": 11,
-          "column_start": 1,
-          "column_end": 1,
-          "is_primary": true,
-          "text": [
-            {
-              "text": "fn main() {",
-              "highlight_start": 1,
-              "highlight_end": 1
-            }
-          ],
-          "label": null,
-          "suggested_replacement": "use std::option::Iter;
-
-",
-          "suggestion_applicability": "Unspecified",
-          "expansion": null
-        },
-        {
-          "file_name": "$DIR/use_suggestion_json.rs",
-          "byte_start": 518,
-          "byte_end": 518,
-          "line_start": 11,
-          "line_end": 11,
-          "column_start": 1,
-          "column_end": 1,
-          "is_primary": true,
-          "text": [
-            {
-              "text": "fn main() {",
-              "highlight_start": 1,
-              "highlight_end": 1
-            }
-          ],
-          "label": null,
-          "suggested_replacement": "use std::path::Iter;
-
-",
-          "suggestion_applicability": "Unspecified",
-          "expansion": null
-        },
-        {
-          "file_name": "$DIR/use_suggestion_json.rs",
-          "byte_start": 518,
-          "byte_end": 518,
-          "line_start": 11,
-          "line_end": 11,
-          "column_start": 1,
-          "column_end": 1,
-          "is_primary": true,
-          "text": [
-            {
-              "text": "fn main() {",
-              "highlight_start": 1,
-              "highlight_end": 1
-            }
-          ],
-          "label": null,
-          "suggested_replacement": "use std::result::Iter;
-
-",
-          "suggestion_applicability": "Unspecified",
-          "expansion": null
-        },
-        {
-          "file_name": "$DIR/use_suggestion_json.rs",
-          "byte_start": 518,
-          "byte_end": 518,
-          "line_start": 11,
-          "line_end": 11,
-          "column_start": 1,
-          "column_end": 1,
-          "is_primary": true,
-          "text": [
-            {
-              "text": "fn main() {",
-              "highlight_start": 1,
-              "highlight_end": 1
-            }
-          ],
-          "label": null,
-          "suggested_replacement": "use std::slice::Iter;
-
-",
-          "suggestion_applicability": "Unspecified",
-          "expansion": null
-        },
-        {
-          "file_name": "$DIR/use_suggestion_json.rs",
-          "byte_start": 518,
-          "byte_end": 518,
-          "line_start": 11,
-          "line_end": 11,
-          "column_start": 1,
-          "column_end": 1,
-          "is_primary": true,
-          "text": [
-            {
-              "text": "fn main() {",
-              "highlight_start": 1,
-              "highlight_end": 1
-            }
-          ],
-          "label": null,
-          "suggested_replacement": "use std::sync::mpsc::Iter;
-
-",
-          "suggestion_applicability": "Unspecified",
-          "expansion": null
-        }
-      ],
-      "children": [],
-      "rendered": null
-    }
-  ],
-  "rendered": "\u001b[0m\u001b[1m\u001b[38;5;9merror[E0412]\u001b[0m\u001b[0m\u001b[1m: cannot find type `Iter` in this scope\u001b[0m
-\u001b[0m  \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0m$DIR/use_suggestion_json.rs:12:12\u001b[0m
-\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
-\u001b[0m\u001b[1m\u001b[38;5;12mLL\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m    let x: Iter;\u001b[0m
-\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m           \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mnot found in this scope\u001b[0m
-\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
-\u001b[0m\u001b[1m\u001b[38;5;14mhelp\u001b[0m\u001b[0m: consider importing one of these items\u001b[0m
-\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
-\u001b[0m\u001b[1m\u001b[38;5;12mLL\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0muse std::collections::binary_heap::Iter;\u001b[0m
-\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
-\u001b[0m\u001b[1m\u001b[38;5;12mLL\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0muse std::collections::btree_map::Iter;\u001b[0m
-\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
-\u001b[0m\u001b[1m\u001b[38;5;12mLL\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0muse std::collections::btree_set::Iter;\u001b[0m
-\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
-\u001b[0m\u001b[1m\u001b[38;5;12mLL\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0muse std::collections::hash_map::Iter;\u001b[0m
-\u001b[0m   \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
-\u001b[0m     and 8 other candidates\u001b[0m
-
-"
-}
-{
-  "message": "aborting due to previous error",
-  "code": null,
-  "level": "error",
-  "spans": [],
-  "children": [],
-  "rendered": "\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to previous error\u001b[0m
-
-"
-}
-{
-  "message": "For more information about this error, try `rustc --explain E0412`.",
-  "code": null,
-  "level": "failure-note",
-  "spans": [],
-  "children": [],
-  "rendered": "\u001b[0m\u001b[1mFor more information about this error, try `rustc --explain E0412`.\u001b[0m
-"
-}
+"}
diff --git a/src/test/ui/tool_lints.rs b/src/test/ui/tool_lints.rs
index 9e4aa7a939a..ef27532f6de 100644
--- a/src/test/ui/tool_lints.rs
+++ b/src/test/ui/tool_lints.rs
@@ -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() {}
diff --git a/src/test/ui/tool_lints.stderr b/src/test/ui/tool_lints.stderr
index e06f6ddc1ca..d36cd193b15 100644
--- a/src/test/ui/tool_lints.stderr
+++ b/src/test/ui/tool_lints.stderr
@@ -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`.
diff --git a/src/test/ui/unknown-lint-tool-name.rs b/src/test/ui/unknown-lint-tool-name.rs
index 84ab7c1944a..cd5d2f028af 100644
--- a/src/test/ui/unknown-lint-tool-name.rs
+++ b/src/test/ui/unknown-lint-tool-name.rs
@@ -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() {}
diff --git a/src/test/ui/unknown-lint-tool-name.stderr b/src/test/ui/unknown-lint-tool-name.stderr
index 1d145515abf..5f8349ce6c3 100644
--- a/src/test/ui/unknown-lint-tool-name.stderr
+++ b/src/test/ui/unknown-lint-tool-name.stderr
@@ -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`.
diff --git a/src/test/ui/unused-crate-deps/extern-loc-bad-loctype.rs b/src/test/ui/unused-crate-deps/extern-loc-bad-loctype.rs
index 3e1527e2c2e..e69df0359fd 100644
--- a/src/test/ui/unused-crate-deps/extern-loc-bad-loctype.rs
+++ b/src/test/ui/unused-crate-deps/extern-loc-bad-loctype.rs
@@ -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)]
 
diff --git a/src/test/ui/unused-crate-deps/extern-loc-json-bad-json.rs b/src/test/ui/unused-crate-deps/extern-loc-json-bad-json.rs
index 6fdf710a126..aee6233e428 100644
--- a/src/test/ui/unused-crate-deps/extern-loc-json-bad-json.rs
+++ b/src/test/ui/unused-crate-deps/extern-loc-json-bad-json.rs
@@ -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)]
 
diff --git a/src/test/ui/unused-crate-deps/extern-loc-json-json.rs b/src/test/ui/unused-crate-deps/extern-loc-json-json.rs
index 02a9869151f..c7988cd469e 100644
--- a/src/test/ui/unused-crate-deps/extern-loc-json-json.rs
+++ b/src/test/ui/unused-crate-deps/extern-loc-json-json.rs
@@ -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
diff --git a/src/test/ui/unused-crate-deps/extern-loc-json-json.stderr b/src/test/ui/unused-crate-deps/extern-loc-json-json.stderr
index 5fc8397e469..001ec6a2554 100644
--- a/src/test/ui/unused-crate-deps/extern-loc-json-json.stderr
+++ b/src/test/ui/unused-crate-deps/extern-loc-json-json.stderr
@@ -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)]
diff --git a/src/test/ui/unused-crate-deps/extern-loc-json.rs b/src/test/ui/unused-crate-deps/extern-loc-json.rs
index 212610d532e..c0d76c86b89 100644
--- a/src/test/ui/unused-crate-deps/extern-loc-json.rs
+++ b/src/test/ui/unused-crate-deps/extern-loc-json.rs
@@ -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
diff --git a/src/test/ui/unused-crate-deps/extern-loc-missing-loctype.rs b/src/test/ui/unused-crate-deps/extern-loc-missing-loctype.rs
index 4768365a653..3590b9c2812 100644
--- a/src/test/ui/unused-crate-deps/extern-loc-missing-loctype.rs
+++ b/src/test/ui/unused-crate-deps/extern-loc-missing-loctype.rs
@@ -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)]
 
diff --git a/src/test/ui/unused-crate-deps/extern-loc-raw-json.rs b/src/test/ui/unused-crate-deps/extern-loc-raw-json.rs
index 207615ccc87..64c3d77ce08 100644
--- a/src/test/ui/unused-crate-deps/extern-loc-raw-json.rs
+++ b/src/test/ui/unused-crate-deps/extern-loc-raw-json.rs
@@ -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
diff --git a/src/test/ui/unused-crate-deps/extern-loc-raw-json.stderr b/src/test/ui/unused-crate-deps/extern-loc-raw-json.stderr
index 25f099927fd..4083bd51835 100644
--- a/src/test/ui/unused-crate-deps/extern-loc-raw-json.stderr
+++ b/src/test/ui/unused-crate-deps/extern-loc-raw-json.stderr
@@ -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)]
diff --git a/src/test/ui/unused-crate-deps/extern-loc-raw-missing-loc.rs b/src/test/ui/unused-crate-deps/extern-loc-raw-missing-loc.rs
index 65b64268394..a9e7afbda31 100644
--- a/src/test/ui/unused-crate-deps/extern-loc-raw-missing-loc.rs
+++ b/src/test/ui/unused-crate-deps/extern-loc-raw-missing-loc.rs
@@ -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)]
 
diff --git a/src/test/ui/unused-crate-deps/extern-loc-raw.rs b/src/test/ui/unused-crate-deps/extern-loc-raw.rs
index fc3fed1e10e..27d0975d01a 100644
--- a/src/test/ui/unused-crate-deps/extern-loc-raw.rs
+++ b/src/test/ui/unused-crate-deps/extern-loc-raw.rs
@@ -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
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index 983934d129a..19ea2157608 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -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);
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 54b079a3e86..e319de1ac1d 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -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
     }