about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-04-13 23:57:41 -0400
committerGitHub <noreply@github.com>2025-04-13 23:57:41 -0400
commit883c8dd52e87aa28f8a8808ec44049168334ef69 (patch)
treec371074e66daee119c58903a2f367fd7a19fce52
parentbb93324c6bd1dadc5f82bf723f23c04e14acc023 (diff)
parent93bee0789a45ea7d5d65bb9301c4ad5ece3abeb2 (diff)
downloadrust-883c8dd52e87aa28f8a8808ec44049168334ef69.tar.gz
rust-883c8dd52e87aa28f8a8808ec44049168334ef69.zip
Rollup merge of #139760 - petrochenkov:noerrpat2, r=jieyouxu
UI tests: migrate remaining compile time `error-pattern`s to line annotations when possible

There's a number of cases in which `error-pattern` is still necessary even for compile time checking.
- It checks something that compiler writes directly into stderr as text, and not to the structured json output. This includes some stuff reported during compiler panics, and also diagnostics that happen very early, for example when parsing the command line.
- It checks something that exists only in the full rendered diagnostic test, but not in its structured components, for example code fragments or output of `-Ztrack-diagnostics`. (The latter can probably be converted to structured form though.)

This is continuation of https://github.com/rust-lang/rust/pull/139137.
r? `@jieyouxu`
-rw-r--r--tests/incremental/const-generic-type-cycle.rs5
-rw-r--r--tests/incremental/delayed_span_bug.rs3
-rw-r--r--tests/incremental/link_order/main.rs3
-rw-r--r--tests/rustdoc-ui/deprecated-attrs.rs1
-rw-r--r--tests/rustdoc-ui/deprecated-attrs.stderr6
-rw-r--r--tests/rustdoc-ui/invalid-theme-name.rs2
-rw-r--r--tests/ui-fulldeps/missing-rustc-driver-error.rs8
-rw-r--r--tests/ui/abi/fixed_x18.rs1
-rw-r--r--tests/ui/associated-types/issue-36499.rs2
-rw-r--r--tests/ui/associated-types/issue-36499.stderr2
-rw-r--r--tests/ui/check-cfg/cargo-feature.rs3
-rw-r--r--tests/ui/codegen/empty-static-libs-issue-108825.rs4
-rw-r--r--tests/ui/conditional-compilation/cfg-arg-invalid-1.rs6
-rw-r--r--tests/ui/conditional-compilation/cfg-arg-invalid-2.rs6
-rw-r--r--tests/ui/conditional-compilation/cfg-arg-invalid-4.rs6
-rw-r--r--tests/ui/conditional-compilation/cfg-arg-invalid-6.rs6
-rw-r--r--tests/ui/conditional-compilation/cfg-arg-invalid-8.rs6
-rw-r--r--tests/ui/conditional-compilation/cfg-arg-invalid-9.rs6
-rw-r--r--tests/ui/conditional-compilation/cfg-empty-codemap.rs6
-rw-r--r--tests/ui/consts/miri_unleashed/drop.rs3
-rw-r--r--tests/ui/consts/miri_unleashed/drop.stderr4
-rw-r--r--tests/ui/debuginfo/dwarf-versions.rs1
-rw-r--r--tests/ui/error-codes/E0152-duplicate-lang-items.rs4
-rw-r--r--tests/ui/error-codes/E0152-duplicate-lang-items.stderr3
-rw-r--r--tests/ui/error-codes/E0602.rs6
-rw-r--r--tests/ui/extern-flag/invalid-crate-name-dashed.rs2
-rw-r--r--tests/ui/issues/issue-37131.rs3
-rw-r--r--tests/ui/layout/unknown-when-no-type-parameter.rs4
-rw-r--r--tests/ui/layout/unknown-when-no-type-parameter.stderr2
-rw-r--r--tests/ui/link-native-libs/suggest-libname-only-1.rs3
-rw-r--r--tests/ui/link-native-libs/suggest-libname-only-1.stderr2
-rw-r--r--tests/ui/link-native-libs/suggest-libname-only-2.rs3
-rw-r--r--tests/ui/link-native-libs/suggest-libname-only-2.stderr2
-rw-r--r--tests/ui/lint/cli-unknown-force-warn.rs6
-rw-r--r--tests/ui/lint/lint-removed-cmdline-deny.rs6
-rw-r--r--tests/ui/lint/lint-removed-cmdline-deny.stderr4
-rw-r--r--tests/ui/lint/lint-removed-cmdline.rs6
-rw-r--r--tests/ui/lint/lint-removed-cmdline.stderr4
-rw-r--r--tests/ui/lint/lint-renamed-cmdline-deny.rs9
-rw-r--r--tests/ui/lint/lint-renamed-cmdline-deny.stderr4
-rw-r--r--tests/ui/lint/lint-renamed-cmdline.rs6
-rw-r--r--tests/ui/lint/lint-renamed-cmdline.stderr4
-rw-r--r--tests/ui/lint/lint-unknown-lint-cmdline-deny.rs11
-rw-r--r--tests/ui/lint/lint-unknown-lint-cmdline.rs11
-rw-r--r--tests/ui/lint/non-local-defs/cargo-update.rs3
-rw-r--r--tests/ui/missing/missing-return.rs5
-rw-r--r--tests/ui/missing/missing-return.stderr2
-rw-r--r--tests/ui/nested-ty-params.rs1
-rw-r--r--tests/ui/nested-ty-params.stderr4
-rw-r--r--tests/ui/no_std/no-std-no-start-binary.rs1
-rw-r--r--tests/ui/optimization-remark.rs5
-rw-r--r--tests/ui/packed/packed-struct-generic-transmute.rs2
-rw-r--r--tests/ui/packed/packed-struct-generic-transmute.stderr2
-rw-r--r--tests/ui/packed/packed-struct-transmute.rs1
-rw-r--r--tests/ui/packed/packed-struct-transmute.stderr2
-rw-r--r--tests/ui/parser/utf16-be-without-bom.rsbin202 -> 183 bytes
-rw-r--r--tests/ui/parser/utf16-le-without-bom.rsbin203 -> 184 bytes
-rw-r--r--tests/ui/print-request/print-lints-help.rs5
-rw-r--r--tests/ui/proc-macro/inner-attrs.rs9
-rw-r--r--tests/ui/proc-macro/inner-attrs.stderr8
-rw-r--r--tests/ui/proc-macro/inner-attrs.stdout356
-rw-r--r--tests/ui/regions/region-invariant-static-error-reporting.rs3
-rw-r--r--tests/ui/target-feature/forbidden-target-feature-flag-disable.rs2
-rw-r--r--tests/ui/target-feature/tied-features-no-implication-1.rs2
-rw-r--r--tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs3
-rw-r--r--tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs3
66 files changed, 321 insertions, 293 deletions
diff --git a/tests/incremental/const-generic-type-cycle.rs b/tests/incremental/const-generic-type-cycle.rs
index cd0437f7ef6..40a40ebd13f 100644
--- a/tests/incremental/const-generic-type-cycle.rs
+++ b/tests/incremental/const-generic-type-cycle.rs
@@ -3,7 +3,6 @@
 //
 //@ compile-flags: -Zincremental-ignore-spans
 //@ revisions: cpass cfail
-//@ error-pattern: cycle detected when computing type of `Bar::N`
 
 #![feature(trait_alias)]
 #![crate_type="lib"]
@@ -13,5 +12,9 @@ trait Bar<const N: usize> {}
 
 #[cfg(cfail)]
 trait Bar<const N: dyn BB> {}
+//[cfail]~^ ERROR cycle detected when computing type of `Bar::N`
+//[cfail]~| ERROR cycle detected when computing type of `Bar::N`
+//[cfail]~| ERROR cycle detected when computing type of `Bar::N`
+//[cfail]~| ERROR `(dyn Bar<{ 2 + 1 }> + 'static)` is forbidden as the type of a const generic parameter
 
 trait BB = Bar<{ 2 + 1 }>;
diff --git a/tests/incremental/delayed_span_bug.rs b/tests/incremental/delayed_span_bug.rs
index 1534aca5ddd..7b409db2e18 100644
--- a/tests/incremental/delayed_span_bug.rs
+++ b/tests/incremental/delayed_span_bug.rs
@@ -1,8 +1,7 @@
 //@ revisions: cfail1 cfail2
 //@ should-ice
-//@ error-pattern: delayed bug triggered by #[rustc_delayed_bug_from_inside_query]
 
 #![feature(rustc_attrs)]
 
 #[rustc_delayed_bug_from_inside_query]
-fn main() {}
+fn main() {} //~ ERROR delayed bug triggered by #[rustc_delayed_bug_from_inside_query]
diff --git a/tests/incremental/link_order/main.rs b/tests/incremental/link_order/main.rs
index 847a47a7559..20931e25dd4 100644
--- a/tests/incremental/link_order/main.rs
+++ b/tests/incremental/link_order/main.rs
@@ -1,5 +1,4 @@
 //@ aux-build:my_lib.rs
-//@ error-pattern: error: linking with
 //@ revisions:cfail1 cfail2
 //@ compile-flags:-Z query-dep-graph
 
@@ -10,3 +9,5 @@
 extern crate my_lib;
 
 fn main() {}
+
+//~? ERROR linking with
diff --git a/tests/rustdoc-ui/deprecated-attrs.rs b/tests/rustdoc-ui/deprecated-attrs.rs
index 0ae65a5eaf7..dcf8a52de41 100644
--- a/tests/rustdoc-ui/deprecated-attrs.rs
+++ b/tests/rustdoc-ui/deprecated-attrs.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: --passes unknown-pass
-//@ error-pattern: the `passes` flag no longer functions
 
 #![doc(no_default_passes)]
 //~^ ERROR unknown `doc` attribute `no_default_passes`
diff --git a/tests/rustdoc-ui/deprecated-attrs.stderr b/tests/rustdoc-ui/deprecated-attrs.stderr
index a30523e7329..3e982052233 100644
--- a/tests/rustdoc-ui/deprecated-attrs.stderr
+++ b/tests/rustdoc-ui/deprecated-attrs.stderr
@@ -4,7 +4,7 @@ warning: the `passes` flag no longer functions
    = help: you may want to use --document-private-items
 
 error: unknown `doc` attribute `no_default_passes`
-  --> $DIR/deprecated-attrs.rs:4:8
+  --> $DIR/deprecated-attrs.rs:3:8
    |
 LL | #![doc(no_default_passes)]
    |        ^^^^^^^^^^^^^^^^^ no longer functions
@@ -15,7 +15,7 @@ LL | #![doc(no_default_passes)]
    = note: `#[deny(invalid_doc_attributes)]` on by default
 
 error: unknown `doc` attribute `passes`
-  --> $DIR/deprecated-attrs.rs:11:8
+  --> $DIR/deprecated-attrs.rs:10:8
    |
 LL | #![doc(passes = "collapse-docs unindent-comments")]
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no longer functions
@@ -25,7 +25,7 @@ LL | #![doc(passes = "collapse-docs unindent-comments")]
    = note: `doc(passes)` is now a no-op
 
 error: unknown `doc` attribute `plugins`
-  --> $DIR/deprecated-attrs.rs:17:8
+  --> $DIR/deprecated-attrs.rs:16:8
    |
 LL | #![doc(plugins = "xxx")]
    |        ^^^^^^^^^^^^^^^ no longer functions
diff --git a/tests/rustdoc-ui/invalid-theme-name.rs b/tests/rustdoc-ui/invalid-theme-name.rs
index 7f1d191c89d..22b5e616a3d 100644
--- a/tests/rustdoc-ui/invalid-theme-name.rs
+++ b/tests/rustdoc-ui/invalid-theme-name.rs
@@ -1,4 +1,4 @@
 //@ compile-flags:--theme {{src-base}}/invalid-theme-name.rs
-//@ error-pattern: must have a .css extension
 
 //~? ERROR invalid argument: "$DIR/invalid-theme-name.rs"
+//~? HELP must have a .css extension
diff --git a/tests/ui-fulldeps/missing-rustc-driver-error.rs b/tests/ui-fulldeps/missing-rustc-driver-error.rs
index d582efada90..c6dff2d99dd 100644
--- a/tests/ui-fulldeps/missing-rustc-driver-error.rs
+++ b/tests/ui-fulldeps/missing-rustc-driver-error.rs
@@ -1,11 +1,15 @@
 // Test that we get the following hint when trying to use a compiler crate without rustc_driver.
-//@ error-pattern: try adding `extern crate rustc_driver;` at the top level of this crate
-//@ compile-flags: --emit link --error-format=human
+//@ compile-flags: --emit link
 //@ normalize-stderr: ".*crate .* required.*\n\n" -> ""
 //@ normalize-stderr: "aborting due to [0-9]+" -> "aborting due to NUMBER"
+//@ dont-require-annotations: ERROR
 
 #![feature(rustc_private)]
 
 extern crate rustc_serialize;
 
 fn main() {}
+
+//~? HELP try adding `extern crate rustc_driver;` at the top level of this crate
+//~? HELP try adding `extern crate rustc_driver;` at the top level of this crate
+//~? HELP try adding `extern crate rustc_driver;` at the top level of this crate
diff --git a/tests/ui/abi/fixed_x18.rs b/tests/ui/abi/fixed_x18.rs
index d373468f68f..d64b845e5bd 100644
--- a/tests/ui/abi/fixed_x18.rs
+++ b/tests/ui/abi/fixed_x18.rs
@@ -2,7 +2,6 @@
 // Behavior on aarch64 is tested by tests/codegen/fixed-x18.rs.
 //
 //@ revisions: x64 i686 arm riscv32 riscv64
-//@ error-pattern: the `-Zfixed-x18` flag is not supported
 //@ dont-check-compiler-stderr
 //
 //@ compile-flags: -Zfixed-x18
diff --git a/tests/ui/associated-types/issue-36499.rs b/tests/ui/associated-types/issue-36499.rs
index 606918b40b7..941b1aaa0d5 100644
--- a/tests/ui/associated-types/issue-36499.rs
+++ b/tests/ui/associated-types/issue-36499.rs
@@ -1,5 +1,3 @@
-//@ error-pattern: aborting due to 1 previous error
-
 fn main() {
     2 + +2; //~ ERROR leading `+` is not supported
 }
diff --git a/tests/ui/associated-types/issue-36499.stderr b/tests/ui/associated-types/issue-36499.stderr
index dd91bac8158..aebf0faae2d 100644
--- a/tests/ui/associated-types/issue-36499.stderr
+++ b/tests/ui/associated-types/issue-36499.stderr
@@ -1,5 +1,5 @@
 error: leading `+` is not supported
-  --> $DIR/issue-36499.rs:4:9
+  --> $DIR/issue-36499.rs:2:9
    |
 LL |     2 + +2;
    |         ^ unexpected `+`
diff --git a/tests/ui/check-cfg/cargo-feature.rs b/tests/ui/check-cfg/cargo-feature.rs
index a9380ddae1a..a02b0437057 100644
--- a/tests/ui/check-cfg/cargo-feature.rs
+++ b/tests/ui/check-cfg/cargo-feature.rs
@@ -10,7 +10,7 @@
 //@ [none]compile-flags: --check-cfg=cfg(feature,values())
 //@ [some]compile-flags: --check-cfg=cfg(feature,values("bitcode"))
 //@ [some]compile-flags: --check-cfg=cfg(CONFIG_NVME,values("y"))
-//@ [none]error-pattern:Cargo.toml
+//@ dont-require-annotations: HELP
 
 #[cfg(feature = "serde")]
 //~^ WARNING unexpected `cfg` condition value
@@ -27,6 +27,7 @@ fn tokio() {}
 #[cfg(CONFIG_NVME = "m")]
 //[none]~^ WARNING unexpected `cfg` condition name
 //[some]~^^ WARNING unexpected `cfg` condition value
+//[none]~| HELP Cargo.toml
 fn tokio() {}
 
 fn main() {}
diff --git a/tests/ui/codegen/empty-static-libs-issue-108825.rs b/tests/ui/codegen/empty-static-libs-issue-108825.rs
index 46bd6d6b2da..4c644be0954 100644
--- a/tests/ui/codegen/empty-static-libs-issue-108825.rs
+++ b/tests/ui/codegen/empty-static-libs-issue-108825.rs
@@ -3,7 +3,6 @@
 
 //@ compile-flags: -Cpanic=abort --print=native-static-libs
 //@ build-pass
-//@ error-pattern: note: native-static-libs:
 //@ dont-check-compiler-stderr (libcore links `/defaultlib:msvcrt` or `/defaultlib:libcmt` on MSVC)
 //@ ignore-pass (the note is emitted later in the compilation pipeline, needs build)
 
@@ -14,3 +13,6 @@
 fn panic(_info: &core::panic::PanicInfo) -> ! {
     loop {}
 }
+
+//~? NOTE native-static-libs:
+//~? NOTE Link against the following native artifacts when linking against this static library
diff --git a/tests/ui/conditional-compilation/cfg-arg-invalid-1.rs b/tests/ui/conditional-compilation/cfg-arg-invalid-1.rs
index cd181f4a49f..28d2d266b62 100644
--- a/tests/ui/conditional-compilation/cfg-arg-invalid-1.rs
+++ b/tests/ui/conditional-compilation/cfg-arg-invalid-1.rs
@@ -1,3 +1,5 @@
-//@ compile-flags: --error-format=human --cfg a(b=c)
-//@ error-pattern: invalid `--cfg` argument: `a(b=c)` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\")
+//@ compile-flags: --cfg a(b=c)
+
 fn main() {}
+
+//~? ERROR invalid `--cfg` argument: `a(b=c)` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\")
diff --git a/tests/ui/conditional-compilation/cfg-arg-invalid-2.rs b/tests/ui/conditional-compilation/cfg-arg-invalid-2.rs
index a0c16bd1f80..a46022602e2 100644
--- a/tests/ui/conditional-compilation/cfg-arg-invalid-2.rs
+++ b/tests/ui/conditional-compilation/cfg-arg-invalid-2.rs
@@ -1,3 +1,5 @@
-//@ compile-flags: --error-format=human --cfg a{b}
-//@ error-pattern: invalid `--cfg` argument: `a{b}` (expected `key` or `key="value"`)
+//@ compile-flags: --cfg a{b}
+
 fn main() {}
+
+//~? ERROR invalid `--cfg` argument: `a{b}` (expected `key` or `key="value"`)
diff --git a/tests/ui/conditional-compilation/cfg-arg-invalid-4.rs b/tests/ui/conditional-compilation/cfg-arg-invalid-4.rs
index 30402d51852..ba34708c171 100644
--- a/tests/ui/conditional-compilation/cfg-arg-invalid-4.rs
+++ b/tests/ui/conditional-compilation/cfg-arg-invalid-4.rs
@@ -1,3 +1,5 @@
-//@ compile-flags: --error-format=human --cfg a(b)
-//@ error-pattern: invalid `--cfg` argument: `a(b)` (expected `key` or `key="value"`)
+//@ compile-flags: --cfg a(b)
+
 fn main() {}
+
+//~? ERROR invalid `--cfg` argument: `a(b)` (expected `key` or `key="value"`)
diff --git a/tests/ui/conditional-compilation/cfg-arg-invalid-6.rs b/tests/ui/conditional-compilation/cfg-arg-invalid-6.rs
index e0ce66eab87..2c2fc105958 100644
--- a/tests/ui/conditional-compilation/cfg-arg-invalid-6.rs
+++ b/tests/ui/conditional-compilation/cfg-arg-invalid-6.rs
@@ -1,3 +1,5 @@
-//@ compile-flags: --error-format=human --cfg a{
-//@ error-pattern: invalid `--cfg` argument: `a{` (expected `key` or `key="value"`)
+//@ compile-flags: --cfg a{
+
 fn main() {}
+
+//~? ERROR invalid `--cfg` argument: `a{` (expected `key` or `key="value"`)
diff --git a/tests/ui/conditional-compilation/cfg-arg-invalid-8.rs b/tests/ui/conditional-compilation/cfg-arg-invalid-8.rs
index 33f8da25830..c9185fc7b25 100644
--- a/tests/ui/conditional-compilation/cfg-arg-invalid-8.rs
+++ b/tests/ui/conditional-compilation/cfg-arg-invalid-8.rs
@@ -1,3 +1,5 @@
-//@ compile-flags: --error-format=human --cfg )
-//@ error-pattern: invalid `--cfg` argument: `)` (expected `key` or `key="value"`)
+//@ compile-flags: --cfg )
+
 fn main() {}
+
+//~? ERROR invalid `--cfg` argument: `)` (expected `key` or `key="value"`)
diff --git a/tests/ui/conditional-compilation/cfg-arg-invalid-9.rs b/tests/ui/conditional-compilation/cfg-arg-invalid-9.rs
index 8ab3b101da7..8d07165dfae 100644
--- a/tests/ui/conditional-compilation/cfg-arg-invalid-9.rs
+++ b/tests/ui/conditional-compilation/cfg-arg-invalid-9.rs
@@ -1,4 +1,6 @@
 // Test for missing quotes around value, issue #66450.
-//@ compile-flags: --error-format=human --cfg key=value
-//@ error-pattern: invalid `--cfg` argument: `key=value` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\")
+//@ compile-flags: --cfg key=value
+
 fn main() {}
+
+//~? ERROR invalid `--cfg` argument: `key=value` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\")
diff --git a/tests/ui/conditional-compilation/cfg-empty-codemap.rs b/tests/ui/conditional-compilation/cfg-empty-codemap.rs
index d8fc0277759..9f7ef1bcf9a 100644
--- a/tests/ui/conditional-compilation/cfg-empty-codemap.rs
+++ b/tests/ui/conditional-compilation/cfg-empty-codemap.rs
@@ -1,8 +1,8 @@
 // Tests that empty source_maps don't ICE (#23301)
 
-//@ compile-flags: --error-format=human --cfg ""
-
-//@ error-pattern: invalid `--cfg` argument: `""` (expected `key` or `key="value"`)
+//@ compile-flags: --cfg ""
 
 pub fn main() {
 }
+
+//~? ERROR invalid `--cfg` argument: `""` (expected `key` or `key="value"`)
diff --git a/tests/ui/consts/miri_unleashed/drop.rs b/tests/ui/consts/miri_unleashed/drop.rs
index 17d089222d9..190072d9c20 100644
--- a/tests/ui/consts/miri_unleashed/drop.rs
+++ b/tests/ui/consts/miri_unleashed/drop.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: -Zunleash-the-miri-inside-of-you
-//@ error-pattern: calling non-const function `<Vec<i32> as Drop>::drop`
 
 use std::mem::ManuallyDrop;
 
@@ -15,5 +14,7 @@ static TEST_OK: () = {
 static TEST_BAD: () = {
     let _v: Vec<i32> = Vec::new();
 }; //~ ERROR could not evaluate static initializer
+   //~| NOTE calling non-const function `<Vec<i32> as Drop>::drop`
+   //~| NOTE inside `std::ptr::drop_in_place::<Vec<i32>> - shim(Some(Vec<i32>))`
 
 //~? WARN skipping const checks
diff --git a/tests/ui/consts/miri_unleashed/drop.stderr b/tests/ui/consts/miri_unleashed/drop.stderr
index 40a29d5a819..f9ff5491ea6 100644
--- a/tests/ui/consts/miri_unleashed/drop.stderr
+++ b/tests/ui/consts/miri_unleashed/drop.stderr
@@ -1,5 +1,5 @@
 error[E0080]: could not evaluate static initializer
-  --> $DIR/drop.rs:17:1
+  --> $DIR/drop.rs:16:1
    |
 LL | };
    | ^ calling non-const function `<Vec<i32> as Drop>::drop`
@@ -10,7 +10,7 @@ note: inside `std::ptr::drop_in_place::<Vec<i32>> - shim(Some(Vec<i32>))`
 warning: skipping const checks
    |
 help: skipping check that does not even have a feature gate
-  --> $DIR/drop.rs:16:9
+  --> $DIR/drop.rs:15:9
    |
 LL |     let _v: Vec<i32> = Vec::new();
    |         ^^
diff --git a/tests/ui/debuginfo/dwarf-versions.rs b/tests/ui/debuginfo/dwarf-versions.rs
index 6030b2fcf3c..bb18cadce43 100644
--- a/tests/ui/debuginfo/dwarf-versions.rs
+++ b/tests/ui/debuginfo/dwarf-versions.rs
@@ -6,7 +6,6 @@
 //@[zero] compile-flags: -Zdwarf-version=0
 
 //@[one] compile-flags: -Zdwarf-version=1
-//@[one] error-pattern: requested DWARF version 1 is not supported
 
 //@[two] compile-flags: -Zdwarf-version=2
 //@[two] check-pass
diff --git a/tests/ui/error-codes/E0152-duplicate-lang-items.rs b/tests/ui/error-codes/E0152-duplicate-lang-items.rs
index 089810b1ad2..f707b72f9b2 100644
--- a/tests/ui/error-codes/E0152-duplicate-lang-items.rs
+++ b/tests/ui/error-codes/E0152-duplicate-lang-items.rs
@@ -3,8 +3,9 @@
 //!
 //! Issue: <https://github.com/rust-lang/rust/issues/31788>
 
-//@ error-pattern: first defined in crate `std`
 //@ normalize-stderr: "loaded from .*libstd-.*.rlib" -> "loaded from SYSROOT/libstd-*.rlib"
+//@ dont-require-annotations: NOTE
+
 #![feature(lang_items)]
 
 extern crate core;
@@ -14,6 +15,7 @@ use core::panic::PanicInfo;
 #[lang = "panic_impl"]
 fn panic_impl(info: &PanicInfo) -> ! {
     //~^ ERROR: found duplicate lang item `panic_impl`
+    //~| NOTE first defined in crate `std`
     loop {}
 }
 
diff --git a/tests/ui/error-codes/E0152-duplicate-lang-items.stderr b/tests/ui/error-codes/E0152-duplicate-lang-items.stderr
index 3c3d64322f3..2fe0d18fc2f 100644
--- a/tests/ui/error-codes/E0152-duplicate-lang-items.stderr
+++ b/tests/ui/error-codes/E0152-duplicate-lang-items.stderr
@@ -1,8 +1,9 @@
 error[E0152]: found duplicate lang item `panic_impl`
-  --> $DIR/E0152-duplicate-lang-items.rs:15:1
+  --> $DIR/E0152-duplicate-lang-items.rs:16:1
    |
 LL | / fn panic_impl(info: &PanicInfo) -> ! {
 LL | |
+LL | |
 LL | |     loop {}
 LL | | }
    | |_^
diff --git a/tests/ui/error-codes/E0602.rs b/tests/ui/error-codes/E0602.rs
index cba15bb92d4..381bd1ffb54 100644
--- a/tests/ui/error-codes/E0602.rs
+++ b/tests/ui/error-codes/E0602.rs
@@ -1,11 +1,11 @@
 //@ compile-flags:-D bogus
 //@ check-pass
-
-//@ error-pattern:requested on the command line with `-D bogus`
-//@ error-pattern:`#[warn(unknown_lints)]` on by default
+//@ dont-require-annotations: NOTE
 
 fn main() {}
 
 //~? WARN unknown lint: `bogus`
 //~? WARN unknown lint: `bogus`
 //~? WARN unknown lint: `bogus`
+//~? NOTE requested on the command line with `-D bogus`
+//~? NOTE `#[warn(unknown_lints)]` on by default
diff --git a/tests/ui/extern-flag/invalid-crate-name-dashed.rs b/tests/ui/extern-flag/invalid-crate-name-dashed.rs
index b336cc84569..bbf473cc514 100644
--- a/tests/ui/extern-flag/invalid-crate-name-dashed.rs
+++ b/tests/ui/extern-flag/invalid-crate-name-dashed.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: --extern=my-awesome-library=libawesome.rlib
-//@ error-pattern: consider replacing the dashes with underscores: `my_awesome_library`
 
 // In a sense, this is a regression test for issue #113035. We no longer suggest
 // `pub use my-awesome-library::*;` (sic!) as we outright ban this crate name.
@@ -9,3 +8,4 @@ pub use my_awesome_library::*;
 fn main() {}
 
 //~? ERROR crate name `my-awesome-library` passed to `--extern` is not a valid ASCII identifier
+//~? HELP consider replacing the dashes with underscores: `my_awesome_library`
diff --git a/tests/ui/issues/issue-37131.rs b/tests/ui/issues/issue-37131.rs
index 16681ac21d1..e91c76e1390 100644
--- a/tests/ui/issues/issue-37131.rs
+++ b/tests/ui/issues/issue-37131.rs
@@ -1,4 +1,6 @@
 //~ ERROR can't find crate for `std`
+//~| NOTE target may not be installed
+//~| NOTE can't find crate
 // Tests that compiling for a target which is not installed will result in a helpful
 // error message.
 
@@ -6,5 +8,4 @@
 //@ ignore-arm
 //@ needs-llvm-components: arm
 
-//@ error-pattern:target may not be installed
 fn main() { }
diff --git a/tests/ui/layout/unknown-when-no-type-parameter.rs b/tests/ui/layout/unknown-when-no-type-parameter.rs
index 500b7938eeb..87f90aa438a 100644
--- a/tests/ui/layout/unknown-when-no-type-parameter.rs
+++ b/tests/ui/layout/unknown-when-no-type-parameter.rs
@@ -1,13 +1,13 @@
 #![feature(trivial_bounds)]
 
-//@ error-pattern: the type `<() as Project>::Assoc` has an unknown layout
-
 trait Project {
     type Assoc;
 }
 
 fn foo() where (): Project {
     [(); size_of::<<() as Project>::Assoc>()]; //~ ERROR evaluation of constant value failed
+    //~| NOTE the type `<() as Project>::Assoc` has an unknown layout
+    //~| NOTE inside `std::mem::size_of::<<() as Project>::Assoc>`
 }
 
 fn main() {}
diff --git a/tests/ui/layout/unknown-when-no-type-parameter.stderr b/tests/ui/layout/unknown-when-no-type-parameter.stderr
index a2dbb191ee2..35fbb11f156 100644
--- a/tests/ui/layout/unknown-when-no-type-parameter.stderr
+++ b/tests/ui/layout/unknown-when-no-type-parameter.stderr
@@ -1,5 +1,5 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/unknown-when-no-type-parameter.rs:10:10
+  --> $DIR/unknown-when-no-type-parameter.rs:8:10
    |
 LL |     [(); size_of::<<() as Project>::Assoc>()];
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the type `<() as Project>::Assoc` has an unknown layout
diff --git a/tests/ui/link-native-libs/suggest-libname-only-1.rs b/tests/ui/link-native-libs/suggest-libname-only-1.rs
index 4ccfa086bde..c69949d1fdb 100644
--- a/tests/ui/link-native-libs/suggest-libname-only-1.rs
+++ b/tests/ui/link-native-libs/suggest-libname-only-1.rs
@@ -1,10 +1,11 @@
 //@ build-fail
 //@ compile-flags: --crate-type rlib
-//@ error-pattern: only provide the library name `foo`, not the full filename
 
 #[link(name = "libfoo.a", kind = "static")]
 extern { } //~ WARN extern declarations without an explicit ABI are deprecated
+           //~| HELP explicitly specify the "C" ABI
 
 pub fn main() { }
 
 //~? ERROR could not find native static library `libfoo.a`
+//~? HELP only provide the library name `foo`, not the full filename
diff --git a/tests/ui/link-native-libs/suggest-libname-only-1.stderr b/tests/ui/link-native-libs/suggest-libname-only-1.stderr
index 85a3599e8db..0320294a800 100644
--- a/tests/ui/link-native-libs/suggest-libname-only-1.stderr
+++ b/tests/ui/link-native-libs/suggest-libname-only-1.stderr
@@ -1,5 +1,5 @@
 warning: extern declarations without an explicit ABI are deprecated
-  --> $DIR/suggest-libname-only-1.rs:6:1
+  --> $DIR/suggest-libname-only-1.rs:5:1
    |
 LL | extern { }
    | ^^^^^^ help: explicitly specify the "C" ABI: `extern "C"`
diff --git a/tests/ui/link-native-libs/suggest-libname-only-2.rs b/tests/ui/link-native-libs/suggest-libname-only-2.rs
index c35b4a674b7..d5150c327cd 100644
--- a/tests/ui/link-native-libs/suggest-libname-only-2.rs
+++ b/tests/ui/link-native-libs/suggest-libname-only-2.rs
@@ -1,10 +1,11 @@
 //@ build-fail
 //@ compile-flags: --crate-type rlib
-//@ error-pattern: only provide the library name `bar`, not the full filename
 
 #[link(name = "bar.lib", kind = "static")]
 extern { } //~ WARN extern declarations without an explicit ABI are deprecated
+           //~| HELP explicitly specify the "C" ABI
 
 pub fn main() { }
 
 //~? ERROR could not find native static library `bar.lib`
+//~? HELP only provide the library name `bar`, not the full filename
diff --git a/tests/ui/link-native-libs/suggest-libname-only-2.stderr b/tests/ui/link-native-libs/suggest-libname-only-2.stderr
index d5c88931ad5..e492aea27b4 100644
--- a/tests/ui/link-native-libs/suggest-libname-only-2.stderr
+++ b/tests/ui/link-native-libs/suggest-libname-only-2.stderr
@@ -1,5 +1,5 @@
 warning: extern declarations without an explicit ABI are deprecated
-  --> $DIR/suggest-libname-only-2.rs:6:1
+  --> $DIR/suggest-libname-only-2.rs:5:1
    |
 LL | extern { }
    | ^^^^^^ help: explicitly specify the "C" ABI: `extern "C"`
diff --git a/tests/ui/lint/cli-unknown-force-warn.rs b/tests/ui/lint/cli-unknown-force-warn.rs
index 330d5570e21..0c60f48c514 100644
--- a/tests/ui/lint/cli-unknown-force-warn.rs
+++ b/tests/ui/lint/cli-unknown-force-warn.rs
@@ -3,12 +3,12 @@
 
 //@ check-pass
 //@ compile-flags: --force-warn foo-qux
-
-//@ error-pattern: requested on the command line with `--force-warn foo_qux`
-//@ error-pattern: `#[warn(unknown_lints)]` on by default
+//@ dont-require-annotations: NOTE
 
 fn main() {}
 
 //~? WARN unknown lint: `foo_qux`
 //~? WARN unknown lint: `foo_qux`
 //~? WARN unknown lint: `foo_qux`
+//~? NOTE requested on the command line with `--force-warn foo_qux`
+//~? NOTE `#[warn(unknown_lints)]` on by default
diff --git a/tests/ui/lint/lint-removed-cmdline-deny.rs b/tests/ui/lint/lint-removed-cmdline-deny.rs
index 6616781d5cb..83bbd248aa0 100644
--- a/tests/ui/lint/lint-removed-cmdline-deny.rs
+++ b/tests/ui/lint/lint-removed-cmdline-deny.rs
@@ -2,9 +2,7 @@
 // cc #30346
 
 //@ compile-flags:-D renamed-and-removed-lints -D raw_pointer_derive
-
-//@ error-pattern:requested on the command line with `-D raw_pointer_derive`
-//@ error-pattern:requested on the command line with `-D renamed-and-removed-lints`
+//@ dont-require-annotations: NOTE
 
 #![warn(unused)]
 
@@ -14,3 +12,5 @@ fn main() { let unused = (); } //~ ERROR unused variable: `unused`
 //~? ERROR lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
 //~? ERROR lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
 //~? ERROR 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`
+//~? NOTE requested on the command line with `-D renamed-and-removed-lints`
diff --git a/tests/ui/lint/lint-removed-cmdline-deny.stderr b/tests/ui/lint/lint-removed-cmdline-deny.stderr
index 27a3504a16a..2fb237339cd 100644
--- a/tests/ui/lint/lint-removed-cmdline-deny.stderr
+++ b/tests/ui/lint/lint-removed-cmdline-deny.stderr
@@ -14,13 +14,13 @@ error: lint `raw_pointer_derive` has been removed: using derive with raw pointer
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: unused variable: `unused`
-  --> $DIR/lint-removed-cmdline-deny.rs:12:17
+  --> $DIR/lint-removed-cmdline-deny.rs:10:17
    |
 LL | fn main() { let unused = (); }
    |                 ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
    |
 note: the lint level is defined here
-  --> $DIR/lint-removed-cmdline-deny.rs:11:8
+  --> $DIR/lint-removed-cmdline-deny.rs:9:8
    |
 LL | #[deny(warnings)]
    |        ^^^^^^^^
diff --git a/tests/ui/lint/lint-removed-cmdline.rs b/tests/ui/lint/lint-removed-cmdline.rs
index 4dde3dbc381..f83747a3a6b 100644
--- a/tests/ui/lint/lint-removed-cmdline.rs
+++ b/tests/ui/lint/lint-removed-cmdline.rs
@@ -2,9 +2,7 @@
 // cc #30346
 
 //@ compile-flags:-D raw_pointer_derive
-
-//@ error-pattern:`#[warn(renamed_and_removed_lints)]` on by default
-//@ error-pattern:requested on the command line with `-D raw_pointer_derive`
+//@ dont-require-annotations: NOTE
 
 #![warn(unused)]
 
@@ -14,3 +12,5 @@ fn main() { let unused = (); } //~ ERROR unused variable: `unused`
 //~? WARN lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
 //~? WARN lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
 //~? WARN lint `raw_pointer_derive` has been removed: using derive with raw pointers is ok
+//~? NOTE `#[warn(renamed_and_removed_lints)]` on by default
+//~? NOTE requested on the command line with `-D raw_pointer_derive`
diff --git a/tests/ui/lint/lint-removed-cmdline.stderr b/tests/ui/lint/lint-removed-cmdline.stderr
index 7994f9bcfd9..64e7c572ca7 100644
--- a/tests/ui/lint/lint-removed-cmdline.stderr
+++ b/tests/ui/lint/lint-removed-cmdline.stderr
@@ -14,13 +14,13 @@ warning: lint `raw_pointer_derive` has been removed: using derive with raw point
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: unused variable: `unused`
-  --> $DIR/lint-removed-cmdline.rs:12:17
+  --> $DIR/lint-removed-cmdline.rs:10:17
    |
 LL | fn main() { let unused = (); }
    |                 ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
    |
 note: the lint level is defined here
-  --> $DIR/lint-removed-cmdline.rs:11:8
+  --> $DIR/lint-removed-cmdline.rs:9:8
    |
 LL | #[deny(warnings)]
    |        ^^^^^^^^
diff --git a/tests/ui/lint/lint-renamed-cmdline-deny.rs b/tests/ui/lint/lint-renamed-cmdline-deny.rs
index 0ea4ce40817..c8b03507815 100644
--- a/tests/ui/lint/lint-renamed-cmdline-deny.rs
+++ b/tests/ui/lint/lint-renamed-cmdline-deny.rs
@@ -1,8 +1,6 @@
 //@ compile-flags:-D renamed-and-removed-lints -D bare_trait_object
-
-//@ error-pattern:use the new name `bare_trait_objects`
-//@ error-pattern:requested on the command line with `-D bare_trait_object`
-//@ error-pattern:requested on the command line with `-D renamed-and-removed-lints`
+//@ dont-require-annotations: HELP
+//@ dont-require-annotations: NOTE
 
 #[deny(unused)]
 fn main() { let unused = (); } //~ ERROR unused variable: `unused`
@@ -10,3 +8,6 @@ fn main() { let unused = (); } //~ ERROR unused variable: `unused`
 //~? ERROR lint `bare_trait_object` has been renamed to `bare_trait_objects`
 //~? ERROR lint `bare_trait_object` has been renamed to `bare_trait_objects`
 //~? ERROR lint `bare_trait_object` has been renamed to `bare_trait_objects`
+//~? HELP use the new name `bare_trait_objects`
+//~? NOTE requested on the command line with `-D bare_trait_object`
+//~? NOTE requested on the command line with `-D renamed-and-removed-lints`
diff --git a/tests/ui/lint/lint-renamed-cmdline-deny.stderr b/tests/ui/lint/lint-renamed-cmdline-deny.stderr
index a49cdc84f9e..b42b82834c1 100644
--- a/tests/ui/lint/lint-renamed-cmdline-deny.stderr
+++ b/tests/ui/lint/lint-renamed-cmdline-deny.stderr
@@ -17,13 +17,13 @@ error: lint `bare_trait_object` has been renamed to `bare_trait_objects`
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: unused variable: `unused`
-  --> $DIR/lint-renamed-cmdline-deny.rs:8:17
+  --> $DIR/lint-renamed-cmdline-deny.rs:6:17
    |
 LL | fn main() { let unused = (); }
    |                 ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
    |
 note: the lint level is defined here
-  --> $DIR/lint-renamed-cmdline-deny.rs:7:8
+  --> $DIR/lint-renamed-cmdline-deny.rs:5:8
    |
 LL | #[deny(unused)]
    |        ^^^^^^
diff --git a/tests/ui/lint/lint-renamed-cmdline.rs b/tests/ui/lint/lint-renamed-cmdline.rs
index 45df7b6d640..757cb514267 100644
--- a/tests/ui/lint/lint-renamed-cmdline.rs
+++ b/tests/ui/lint/lint-renamed-cmdline.rs
@@ -1,7 +1,5 @@
 //@ compile-flags:-D bare_trait_object
-
-//@ error-pattern:requested on the command line with `-D bare_trait_object`
-//@ error-pattern:`#[warn(renamed_and_removed_lints)]` on by default
+//@ dont-require-annotations: NOTE
 
 #[deny(unused)]
 fn main() { let unused = (); } //~ ERROR unused variable: `unused`
@@ -9,3 +7,5 @@ fn main() { let unused = (); } //~ ERROR unused variable: `unused`
 //~? WARN lint `bare_trait_object` has been renamed to `bare_trait_objects`
 //~? WARN lint `bare_trait_object` has been renamed to `bare_trait_objects`
 //~? WARN lint `bare_trait_object` has been renamed to `bare_trait_objects`
+//~? NOTE requested on the command line with `-D bare_trait_object`
+//~? NOTE `#[warn(renamed_and_removed_lints)]` on by default
diff --git a/tests/ui/lint/lint-renamed-cmdline.stderr b/tests/ui/lint/lint-renamed-cmdline.stderr
index 901e7a642d1..efd399e2169 100644
--- a/tests/ui/lint/lint-renamed-cmdline.stderr
+++ b/tests/ui/lint/lint-renamed-cmdline.stderr
@@ -17,13 +17,13 @@ warning: lint `bare_trait_object` has been renamed to `bare_trait_objects`
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: unused variable: `unused`
-  --> $DIR/lint-renamed-cmdline.rs:7:17
+  --> $DIR/lint-renamed-cmdline.rs:5:17
    |
 LL | fn main() { let unused = (); }
    |                 ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
    |
 note: the lint level is defined here
-  --> $DIR/lint-renamed-cmdline.rs:6:8
+  --> $DIR/lint-renamed-cmdline.rs:4:8
    |
 LL | #[deny(unused)]
    |        ^^^^^^
diff --git a/tests/ui/lint/lint-unknown-lint-cmdline-deny.rs b/tests/ui/lint/lint-unknown-lint-cmdline-deny.rs
index e2f7c73eacf..ac001e1b6a0 100644
--- a/tests/ui/lint/lint-unknown-lint-cmdline-deny.rs
+++ b/tests/ui/lint/lint-unknown-lint-cmdline-deny.rs
@@ -1,9 +1,6 @@
 //@ compile-flags:-D unknown-lints -D bogus -D dead_cod
-
-//@ error-pattern:requested on the command line with `-D bogus`
-//@ error-pattern:requested on the command line with `-D dead_cod`
-//@ error-pattern:requested on the command line with `-D unknown-lints`
-//@ error-pattern:did you mean: `dead_code`
+//@ dont-require-annotations: HELP
+//@ dont-require-annotations: NOTE
 
 fn main() { }
 
@@ -13,3 +10,7 @@ fn main() { }
 //~? ERROR unknown lint: `dead_cod`
 //~? ERROR unknown lint: `bogus`
 //~? ERROR unknown lint: `dead_cod`
+//~? NOTE requested on the command line with `-D bogus`
+//~? NOTE requested on the command line with `-D dead_cod`
+//~? NOTE requested on the command line with `-D unknown-lints`
+//~? HELP did you mean: `dead_code`
diff --git a/tests/ui/lint/lint-unknown-lint-cmdline.rs b/tests/ui/lint/lint-unknown-lint-cmdline.rs
index 931e945a1a3..7eb8c1f7314 100644
--- a/tests/ui/lint/lint-unknown-lint-cmdline.rs
+++ b/tests/ui/lint/lint-unknown-lint-cmdline.rs
@@ -1,10 +1,7 @@
 //@ check-pass
 //@ compile-flags:-D bogus -D dead_cod
-
-//@ error-pattern:requested on the command line with `-D bogus`
-//@ error-pattern:`#[warn(unknown_lints)]` on by default
-//@ error-pattern:requested on the command line with `-D dead_cod`
-//@ error-pattern:did you mean: `dead_code`
+//@ dont-require-annotations: HELP
+//@ dont-require-annotations: NOTE
 
 fn main() { }
 
@@ -14,3 +11,7 @@ fn main() { }
 //~? WARN unknown lint: `dead_cod`
 //~? WARN unknown lint: `bogus`
 //~? WARN unknown lint: `dead_cod`
+//~? NOTE requested on the command line with `-D bogus`
+//~? NOTE `#[warn(unknown_lints)]` on by default
+//~? NOTE requested on the command line with `-D dead_cod`
+//~? HELP did you mean: `dead_code`
diff --git a/tests/ui/lint/non-local-defs/cargo-update.rs b/tests/ui/lint/non-local-defs/cargo-update.rs
index 8b8c15795d3..f778752b28a 100644
--- a/tests/ui/lint/non-local-defs/cargo-update.rs
+++ b/tests/ui/lint/non-local-defs/cargo-update.rs
@@ -8,7 +8,7 @@
 //
 // and since we specifically want to check the presence
 // of the `cargo update` suggestion we assert it here.
-//@ error-pattern: `cargo update -p non_local_macro`
+//@ dont-require-annotations: NOTE
 
 extern crate non_local_macro;
 
@@ -16,5 +16,6 @@ struct LocalStruct;
 
 non_local_macro::non_local_impl!(LocalStruct);
 //~^ WARN non-local `impl` definition
+//~| NOTE `cargo update -p non_local_macro`
 
 fn main() {}
diff --git a/tests/ui/missing/missing-return.rs b/tests/ui/missing/missing-return.rs
index 5d9839a969c..4d48e7c13e2 100644
--- a/tests/ui/missing/missing-return.rs
+++ b/tests/ui/missing/missing-return.rs
@@ -1,5 +1,4 @@
-//@ error-pattern: return
-
 fn f() -> isize { } //~ ERROR mismatched types
-
+                    //~| NOTE implicitly returns `()` as its body has no tail or `return` expression
+                    //~| NOTE expected `isize`, found `()`
 fn main() { f(); }
diff --git a/tests/ui/missing/missing-return.stderr b/tests/ui/missing/missing-return.stderr
index 5f7fb504075..b2d202b9b57 100644
--- a/tests/ui/missing/missing-return.stderr
+++ b/tests/ui/missing/missing-return.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/missing-return.rs:3:11
+  --> $DIR/missing-return.rs:1:11
    |
 LL | fn f() -> isize { }
    |    -      ^^^^^ expected `isize`, found `()`
diff --git a/tests/ui/nested-ty-params.rs b/tests/ui/nested-ty-params.rs
index 866e6230f9e..c00c3bc3372 100644
--- a/tests/ui/nested-ty-params.rs
+++ b/tests/ui/nested-ty-params.rs
@@ -1,4 +1,3 @@
-//@ error-pattern:can't use generic parameters from outer item
 fn hd<U>(v: Vec<U> ) -> U {
     fn hd1(w: [U]) -> U { return w[0]; }
     //~^ ERROR can't use generic parameters from outer item
diff --git a/tests/ui/nested-ty-params.stderr b/tests/ui/nested-ty-params.stderr
index a9cdec66719..7ca65b421b2 100644
--- a/tests/ui/nested-ty-params.stderr
+++ b/tests/ui/nested-ty-params.stderr
@@ -1,5 +1,5 @@
 error[E0401]: can't use generic parameters from outer item
-  --> $DIR/nested-ty-params.rs:3:16
+  --> $DIR/nested-ty-params.rs:2:16
    |
 LL | fn hd<U>(v: Vec<U> ) -> U {
    |       - type parameter from outer item
@@ -9,7 +9,7 @@ LL |     fn hd1(w: [U]) -> U { return w[0]; }
    |           help: try introducing a local generic parameter here: `<U>`
 
 error[E0401]: can't use generic parameters from outer item
-  --> $DIR/nested-ty-params.rs:3:23
+  --> $DIR/nested-ty-params.rs:2:23
    |
 LL | fn hd<U>(v: Vec<U> ) -> U {
    |       - type parameter from outer item
diff --git a/tests/ui/no_std/no-std-no-start-binary.rs b/tests/ui/no_std/no-std-no-start-binary.rs
index df68b99346a..6853e2d4228 100644
--- a/tests/ui/no_std/no-std-no-start-binary.rs
+++ b/tests/ui/no_std/no-std-no-start-binary.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: -Cpanic=abort --emit link
-//@ error-pattern:using `fn main` requires the standard library
 
 // Make sure that we don't emit an error message mentioning internal lang items.
 
diff --git a/tests/ui/optimization-remark.rs b/tests/ui/optimization-remark.rs
index ebcf3b40ab2..165fc63c007 100644
--- a/tests/ui/optimization-remark.rs
+++ b/tests/ui/optimization-remark.rs
@@ -12,9 +12,8 @@
 //
 //@ [merge1] compile-flags: -Cremark=all    -Cremark=giraffe
 //@ [merge2] compile-flags: -Cremark=inline -Cremark=giraffe
-//
-//@ error-pattern: inline (missed): 'f' not inlined into 'g'
 //@ dont-check-compiler-stderr
+//@ dont-require-annotations: NOTE
 
 #[no_mangle]
 #[inline(never)]
@@ -25,3 +24,5 @@ pub fn f() {
 pub fn g() {
     f();
 }
+
+//~? NOTE inline (missed): 'f' not inlined into 'g'
diff --git a/tests/ui/packed/packed-struct-generic-transmute.rs b/tests/ui/packed/packed-struct-generic-transmute.rs
index 17e72bebc7d..66972633d80 100644
--- a/tests/ui/packed/packed-struct-generic-transmute.rs
+++ b/tests/ui/packed/packed-struct-generic-transmute.rs
@@ -3,8 +3,6 @@
 // the error points to the start of the file, not the line with the
 // transmute
 
-//@ error-pattern: cannot transmute between types of different sizes, or dependently-sized types
-
 use std::mem;
 
 #[repr(packed)]
diff --git a/tests/ui/packed/packed-struct-generic-transmute.stderr b/tests/ui/packed/packed-struct-generic-transmute.stderr
index e91f4988429..983742b78be 100644
--- a/tests/ui/packed/packed-struct-generic-transmute.stderr
+++ b/tests/ui/packed/packed-struct-generic-transmute.stderr
@@ -1,5 +1,5 @@
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/packed-struct-generic-transmute.rs:24:38
+  --> $DIR/packed-struct-generic-transmute.rs:22:38
    |
 LL |         let oof: Oof<[u8; 5], i32> = mem::transmute(foo);
    |                                      ^^^^^^^^^^^^^^
diff --git a/tests/ui/packed/packed-struct-transmute.rs b/tests/ui/packed/packed-struct-transmute.rs
index 5ad6524ff81..24ac1f4ac41 100644
--- a/tests/ui/packed/packed-struct-transmute.rs
+++ b/tests/ui/packed/packed-struct-transmute.rs
@@ -4,7 +4,6 @@
 // transmute
 
 //@ normalize-stderr: "\d+ bits" -> "N bits"
-//@ error-pattern: cannot transmute between types of different sizes, or dependently-sized types
 
 use std::mem;
 
diff --git a/tests/ui/packed/packed-struct-transmute.stderr b/tests/ui/packed/packed-struct-transmute.stderr
index 4d75820e944..c5f556f6d0c 100644
--- a/tests/ui/packed/packed-struct-transmute.stderr
+++ b/tests/ui/packed/packed-struct-transmute.stderr
@@ -1,5 +1,5 @@
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/packed-struct-transmute.rs:26:24
+  --> $DIR/packed-struct-transmute.rs:25:24
    |
 LL |         let oof: Oof = mem::transmute(foo);
    |                        ^^^^^^^^^^^^^^
diff --git a/tests/ui/parser/utf16-be-without-bom.rs b/tests/ui/parser/utf16-be-without-bom.rs
index 538728735f0..1f2abc1ad56 100644
--- a/tests/ui/parser/utf16-be-without-bom.rs
+++ b/tests/ui/parser/utf16-be-without-bom.rs
Binary files differdiff --git a/tests/ui/parser/utf16-le-without-bom.rs b/tests/ui/parser/utf16-le-without-bom.rs
index fc413663c9c..bb95f0dd071 100644
--- a/tests/ui/parser/utf16-le-without-bom.rs
+++ b/tests/ui/parser/utf16-le-without-bom.rs
Binary files differdiff --git a/tests/ui/print-request/print-lints-help.rs b/tests/ui/print-request/print-lints-help.rs
index 6dd88a701c3..9a706a29695 100644
--- a/tests/ui/print-request/print-lints-help.rs
+++ b/tests/ui/print-request/print-lints-help.rs
@@ -2,7 +2,8 @@
 //! `--print=lints` (which is not a valid print request).
 
 //@ compile-flags: --print lints
-//@ error-pattern: help: use `-Whelp` to print a list of lints
-//@ error-pattern: help: for more information, see the rustc book
 
 //~? ERROR unknown print request: `lints`
+//~? HELP use `-Whelp` to print a list of lints
+//~? HELP for more information, see the rustc book
+//~? HELP valid print requests are
diff --git a/tests/ui/proc-macro/inner-attrs.rs b/tests/ui/proc-macro/inner-attrs.rs
index 34c37ddfac3..c541e93f904 100644
--- a/tests/ui/proc-macro/inner-attrs.rs
+++ b/tests/ui/proc-macro/inner-attrs.rs
@@ -1,6 +1,5 @@
 // gate-test-custom_inner_attributes
-//@ compile-flags: -Z span-debug --error-format human
-//@ error-pattern:expected non-macro inner attribute
+//@ compile-flags: -Z span-debug
 //@ proc-macro: test-macros.rs
 //@ edition:2018
 
@@ -63,23 +62,27 @@ fn bar() {
 
     for _ in &[true] {
         #![print_attr]
+        //~^ ERROR expected non-macro inner attribute, found attribute macro `print_attr`
     }
 
     let _ = {
         #![print_attr]
+        //~^ ERROR expected non-macro inner attribute, found attribute macro `print_attr`
     };
 
     let _ = async {
         #![print_attr]
+        //~^ ERROR expected non-macro inner attribute, found attribute macro `print_attr`
     };
 
     {
         #![print_attr]
+        //~^ ERROR expected non-macro inner attribute, found attribute macro `print_attr`
     };
 }
 
 
-extern {
+extern { //~ WARN extern declarations without an explicit ABI are deprecated
     fn weird_extern() {
         #![print_target_and_args_consume(tenth)]
     }
diff --git a/tests/ui/proc-macro/inner-attrs.stderr b/tests/ui/proc-macro/inner-attrs.stderr
index 8b5fec1b4c3..4e7825c0d00 100644
--- a/tests/ui/proc-macro/inner-attrs.stderr
+++ b/tests/ui/proc-macro/inner-attrs.stderr
@@ -1,5 +1,5 @@
 error: expected non-macro inner attribute, found attribute macro `print_attr`
-  --> $DIR/inner-attrs.rs:65:12
+  --> $DIR/inner-attrs.rs:64:12
    |
 LL |         #![print_attr]
    |            ^^^^^^^^^^ not a non-macro inner attribute
@@ -11,19 +11,19 @@ LL |         #![print_attr]
    |            ^^^^^^^^^^ not a non-macro inner attribute
 
 error: expected non-macro inner attribute, found attribute macro `print_attr`
-  --> $DIR/inner-attrs.rs:73:12
+  --> $DIR/inner-attrs.rs:74:12
    |
 LL |         #![print_attr]
    |            ^^^^^^^^^^ not a non-macro inner attribute
 
 error: expected non-macro inner attribute, found attribute macro `print_attr`
-  --> $DIR/inner-attrs.rs:77:12
+  --> $DIR/inner-attrs.rs:79:12
    |
 LL |         #![print_attr]
    |            ^^^^^^^^^^ not a non-macro inner attribute
 
 warning: extern declarations without an explicit ABI are deprecated
-  --> $DIR/inner-attrs.rs:82:1
+  --> $DIR/inner-attrs.rs:85:1
    |
 LL | extern {
    | ^^^^^^ help: explicitly specify the "C" ABI: `extern "C"`
diff --git a/tests/ui/proc-macro/inner-attrs.stdout b/tests/ui/proc-macro/inner-attrs.stdout
index ed47ee2cf5a..4496f7b90c4 100644
--- a/tests/ui/proc-macro/inner-attrs.stdout
+++ b/tests/ui/proc-macro/inner-attrs.stdout
@@ -2,7 +2,7 @@ PRINT-ATTR_ARGS INPUT (DISPLAY): first
 PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
     Ident {
         ident: "first",
-        span: $DIR/inner-attrs.rs:18:25: 18:30 (#0),
+        span: $DIR/inner-attrs.rs:17:25: 17:30 (#0),
     },
 ]
 PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(second)] fn foo()
@@ -13,40 +13,40 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
     Punct {
         ch: '#',
         spacing: Alone,
-        span: $DIR/inner-attrs.rs:19:1: 19:2 (#0),
+        span: $DIR/inner-attrs.rs:18:1: 18:2 (#0),
     },
     Group {
         delimiter: Bracket,
         stream: TokenStream [
             Ident {
                 ident: "print_target_and_args",
-                span: $DIR/inner-attrs.rs:19:3: 19:24 (#0),
+                span: $DIR/inner-attrs.rs:18:3: 18:24 (#0),
             },
             Group {
                 delimiter: Parenthesis,
                 stream: TokenStream [
                     Ident {
                         ident: "second",
-                        span: $DIR/inner-attrs.rs:19:25: 19:31 (#0),
+                        span: $DIR/inner-attrs.rs:18:25: 18:31 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:19:24: 19:32 (#0),
+                span: $DIR/inner-attrs.rs:18:24: 18:32 (#0),
             },
         ],
-        span: $DIR/inner-attrs.rs:19:2: 19:33 (#0),
+        span: $DIR/inner-attrs.rs:18:2: 18:33 (#0),
     },
     Ident {
         ident: "fn",
-        span: $DIR/inner-attrs.rs:20:1: 20:3 (#0),
+        span: $DIR/inner-attrs.rs:19:1: 19:3 (#0),
     },
     Ident {
         ident: "foo",
-        span: $DIR/inner-attrs.rs:20:4: 20:7 (#0),
+        span: $DIR/inner-attrs.rs:19:4: 19:7 (#0),
     },
     Group {
         delimiter: Parenthesis,
         stream: TokenStream [],
-        span: $DIR/inner-attrs.rs:20:7: 20:9 (#0),
+        span: $DIR/inner-attrs.rs:19:7: 19:9 (#0),
     },
     Group {
         delimiter: Brace,
@@ -54,72 +54,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
             Punct {
                 ch: '#',
                 spacing: Joint,
-                span: $DIR/inner-attrs.rs:21:5: 21:6 (#0),
+                span: $DIR/inner-attrs.rs:20:5: 20:6 (#0),
             },
             Punct {
                 ch: '!',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:21:6: 21:7 (#0),
+                span: $DIR/inner-attrs.rs:20:6: 20:7 (#0),
             },
             Group {
                 delimiter: Bracket,
                 stream: TokenStream [
                     Ident {
                         ident: "print_target_and_args",
-                        span: $DIR/inner-attrs.rs:21:8: 21:29 (#0),
+                        span: $DIR/inner-attrs.rs:20:8: 20:29 (#0),
                     },
                     Group {
                         delimiter: Parenthesis,
                         stream: TokenStream [
                             Ident {
                                 ident: "third",
-                                span: $DIR/inner-attrs.rs:21:30: 21:35 (#0),
+                                span: $DIR/inner-attrs.rs:20:30: 20:35 (#0),
                             },
                         ],
-                        span: $DIR/inner-attrs.rs:21:29: 21:36 (#0),
+                        span: $DIR/inner-attrs.rs:20:29: 20:36 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:21:7: 21:37 (#0),
+                span: $DIR/inner-attrs.rs:20:7: 20:37 (#0),
             },
             Punct {
                 ch: '#',
                 spacing: Joint,
-                span: $DIR/inner-attrs.rs:22:5: 22:6 (#0),
+                span: $DIR/inner-attrs.rs:21:5: 21:6 (#0),
             },
             Punct {
                 ch: '!',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:22:6: 22:7 (#0),
+                span: $DIR/inner-attrs.rs:21:6: 21:7 (#0),
             },
             Group {
                 delimiter: Bracket,
                 stream: TokenStream [
                     Ident {
                         ident: "print_target_and_args",
-                        span: $DIR/inner-attrs.rs:22:8: 22:29 (#0),
+                        span: $DIR/inner-attrs.rs:21:8: 21:29 (#0),
                     },
                     Group {
                         delimiter: Parenthesis,
                         stream: TokenStream [
                             Ident {
                                 ident: "fourth",
-                                span: $DIR/inner-attrs.rs:22:30: 22:36 (#0),
+                                span: $DIR/inner-attrs.rs:21:30: 21:36 (#0),
                             },
                         ],
-                        span: $DIR/inner-attrs.rs:22:29: 22:37 (#0),
+                        span: $DIR/inner-attrs.rs:21:29: 21:37 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:22:7: 22:38 (#0),
+                span: $DIR/inner-attrs.rs:21:7: 21:38 (#0),
             },
         ],
-        span: $DIR/inner-attrs.rs:20:10: 23:2 (#0),
+        span: $DIR/inner-attrs.rs:19:10: 22:2 (#0),
     },
 ]
 PRINT-ATTR_ARGS INPUT (DISPLAY): second
 PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
     Ident {
         ident: "second",
-        span: $DIR/inner-attrs.rs:19:25: 19:31 (#0),
+        span: $DIR/inner-attrs.rs:18:25: 18:31 (#0),
     },
 ]
 PRINT-ATTR INPUT (DISPLAY): fn foo()
@@ -129,16 +129,16 @@ PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): fn foo()
 PRINT-ATTR INPUT (DEBUG): TokenStream [
     Ident {
         ident: "fn",
-        span: $DIR/inner-attrs.rs:20:1: 20:3 (#0),
+        span: $DIR/inner-attrs.rs:19:1: 19:3 (#0),
     },
     Ident {
         ident: "foo",
-        span: $DIR/inner-attrs.rs:20:4: 20:7 (#0),
+        span: $DIR/inner-attrs.rs:19:4: 19:7 (#0),
     },
     Group {
         delimiter: Parenthesis,
         stream: TokenStream [],
-        span: $DIR/inner-attrs.rs:20:7: 20:9 (#0),
+        span: $DIR/inner-attrs.rs:19:7: 19:9 (#0),
     },
     Group {
         delimiter: Brace,
@@ -146,72 +146,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
             Punct {
                 ch: '#',
                 spacing: Joint,
-                span: $DIR/inner-attrs.rs:21:5: 21:6 (#0),
+                span: $DIR/inner-attrs.rs:20:5: 20:6 (#0),
             },
             Punct {
                 ch: '!',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:21:6: 21:7 (#0),
+                span: $DIR/inner-attrs.rs:20:6: 20:7 (#0),
             },
             Group {
                 delimiter: Bracket,
                 stream: TokenStream [
                     Ident {
                         ident: "print_target_and_args",
-                        span: $DIR/inner-attrs.rs:21:8: 21:29 (#0),
+                        span: $DIR/inner-attrs.rs:20:8: 20:29 (#0),
                     },
                     Group {
                         delimiter: Parenthesis,
                         stream: TokenStream [
                             Ident {
                                 ident: "third",
-                                span: $DIR/inner-attrs.rs:21:30: 21:35 (#0),
+                                span: $DIR/inner-attrs.rs:20:30: 20:35 (#0),
                             },
                         ],
-                        span: $DIR/inner-attrs.rs:21:29: 21:36 (#0),
+                        span: $DIR/inner-attrs.rs:20:29: 20:36 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:21:7: 21:37 (#0),
+                span: $DIR/inner-attrs.rs:20:7: 20:37 (#0),
             },
             Punct {
                 ch: '#',
                 spacing: Joint,
-                span: $DIR/inner-attrs.rs:22:5: 22:6 (#0),
+                span: $DIR/inner-attrs.rs:21:5: 21:6 (#0),
             },
             Punct {
                 ch: '!',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:22:6: 22:7 (#0),
+                span: $DIR/inner-attrs.rs:21:6: 21:7 (#0),
             },
             Group {
                 delimiter: Bracket,
                 stream: TokenStream [
                     Ident {
                         ident: "print_target_and_args",
-                        span: $DIR/inner-attrs.rs:22:8: 22:29 (#0),
+                        span: $DIR/inner-attrs.rs:21:8: 21:29 (#0),
                     },
                     Group {
                         delimiter: Parenthesis,
                         stream: TokenStream [
                             Ident {
                                 ident: "fourth",
-                                span: $DIR/inner-attrs.rs:22:30: 22:36 (#0),
+                                span: $DIR/inner-attrs.rs:21:30: 21:36 (#0),
                             },
                         ],
-                        span: $DIR/inner-attrs.rs:22:29: 22:37 (#0),
+                        span: $DIR/inner-attrs.rs:21:29: 21:37 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:22:7: 22:38 (#0),
+                span: $DIR/inner-attrs.rs:21:7: 21:38 (#0),
             },
         ],
-        span: $DIR/inner-attrs.rs:20:10: 23:2 (#0),
+        span: $DIR/inner-attrs.rs:19:10: 22:2 (#0),
     },
 ]
 PRINT-ATTR_ARGS INPUT (DISPLAY): third
 PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
     Ident {
         ident: "third",
-        span: $DIR/inner-attrs.rs:21:30: 21:35 (#0),
+        span: $DIR/inner-attrs.rs:20:30: 20:35 (#0),
     },
 ]
 PRINT-ATTR INPUT (DISPLAY): fn foo() { #![print_target_and_args(fourth)] }
@@ -219,16 +219,16 @@ PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): fn foo() { #! [print_target_and_args(fou
 PRINT-ATTR INPUT (DEBUG): TokenStream [
     Ident {
         ident: "fn",
-        span: $DIR/inner-attrs.rs:20:1: 20:3 (#0),
+        span: $DIR/inner-attrs.rs:19:1: 19:3 (#0),
     },
     Ident {
         ident: "foo",
-        span: $DIR/inner-attrs.rs:20:4: 20:7 (#0),
+        span: $DIR/inner-attrs.rs:19:4: 19:7 (#0),
     },
     Group {
         delimiter: Parenthesis,
         stream: TokenStream [],
-        span: $DIR/inner-attrs.rs:20:7: 20:9 (#0),
+        span: $DIR/inner-attrs.rs:19:7: 19:9 (#0),
     },
     Group {
         delimiter: Brace,
@@ -236,70 +236,70 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
             Punct {
                 ch: '#',
                 spacing: Joint,
-                span: $DIR/inner-attrs.rs:22:5: 22:6 (#0),
+                span: $DIR/inner-attrs.rs:21:5: 21:6 (#0),
             },
             Punct {
                 ch: '!',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:22:6: 22:7 (#0),
+                span: $DIR/inner-attrs.rs:21:6: 21:7 (#0),
             },
             Group {
                 delimiter: Bracket,
                 stream: TokenStream [
                     Ident {
                         ident: "print_target_and_args",
-                        span: $DIR/inner-attrs.rs:22:8: 22:29 (#0),
+                        span: $DIR/inner-attrs.rs:21:8: 21:29 (#0),
                     },
                     Group {
                         delimiter: Parenthesis,
                         stream: TokenStream [
                             Ident {
                                 ident: "fourth",
-                                span: $DIR/inner-attrs.rs:22:30: 22:36 (#0),
+                                span: $DIR/inner-attrs.rs:21:30: 21:36 (#0),
                             },
                         ],
-                        span: $DIR/inner-attrs.rs:22:29: 22:37 (#0),
+                        span: $DIR/inner-attrs.rs:21:29: 21:37 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:22:7: 22:38 (#0),
+                span: $DIR/inner-attrs.rs:21:7: 21:38 (#0),
             },
         ],
-        span: $DIR/inner-attrs.rs:20:10: 23:2 (#0),
+        span: $DIR/inner-attrs.rs:19:10: 22:2 (#0),
     },
 ]
 PRINT-ATTR_ARGS INPUT (DISPLAY): fourth
 PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
     Ident {
         ident: "fourth",
-        span: $DIR/inner-attrs.rs:22:30: 22:36 (#0),
+        span: $DIR/inner-attrs.rs:21:30: 21:36 (#0),
     },
 ]
 PRINT-ATTR INPUT (DISPLAY): fn foo() {}
 PRINT-ATTR INPUT (DEBUG): TokenStream [
     Ident {
         ident: "fn",
-        span: $DIR/inner-attrs.rs:20:1: 20:3 (#0),
+        span: $DIR/inner-attrs.rs:19:1: 19:3 (#0),
     },
     Ident {
         ident: "foo",
-        span: $DIR/inner-attrs.rs:20:4: 20:7 (#0),
+        span: $DIR/inner-attrs.rs:19:4: 19:7 (#0),
     },
     Group {
         delimiter: Parenthesis,
         stream: TokenStream [],
-        span: $DIR/inner-attrs.rs:20:7: 20:9 (#0),
+        span: $DIR/inner-attrs.rs:19:7: 19:9 (#0),
     },
     Group {
         delimiter: Brace,
         stream: TokenStream [],
-        span: $DIR/inner-attrs.rs:20:10: 23:2 (#0),
+        span: $DIR/inner-attrs.rs:19:10: 22:2 (#0),
     },
 ]
 PRINT-ATTR_ARGS INPUT (DISPLAY): mod_first
 PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
     Ident {
         ident: "mod_first",
-        span: $DIR/inner-attrs.rs:25:25: 25:34 (#0),
+        span: $DIR/inner-attrs.rs:24:25: 24:34 (#0),
     },
 ]
 PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(mod_second)] mod inline_mod
@@ -313,35 +313,35 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
     Punct {
         ch: '#',
         spacing: Alone,
-        span: $DIR/inner-attrs.rs:26:1: 26:2 (#0),
+        span: $DIR/inner-attrs.rs:25:1: 25:2 (#0),
     },
     Group {
         delimiter: Bracket,
         stream: TokenStream [
             Ident {
                 ident: "print_target_and_args",
-                span: $DIR/inner-attrs.rs:26:3: 26:24 (#0),
+                span: $DIR/inner-attrs.rs:25:3: 25:24 (#0),
             },
             Group {
                 delimiter: Parenthesis,
                 stream: TokenStream [
                     Ident {
                         ident: "mod_second",
-                        span: $DIR/inner-attrs.rs:26:25: 26:35 (#0),
+                        span: $DIR/inner-attrs.rs:25:25: 25:35 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:26:24: 26:36 (#0),
+                span: $DIR/inner-attrs.rs:25:24: 25:36 (#0),
             },
         ],
-        span: $DIR/inner-attrs.rs:26:2: 26:37 (#0),
+        span: $DIR/inner-attrs.rs:25:2: 25:37 (#0),
     },
     Ident {
         ident: "mod",
-        span: $DIR/inner-attrs.rs:27:1: 27:4 (#0),
+        span: $DIR/inner-attrs.rs:26:1: 26:4 (#0),
     },
     Ident {
         ident: "inline_mod",
-        span: $DIR/inner-attrs.rs:27:5: 27:15 (#0),
+        span: $DIR/inner-attrs.rs:26:5: 26:15 (#0),
     },
     Group {
         delimiter: Brace,
@@ -349,72 +349,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
             Punct {
                 ch: '#',
                 spacing: Joint,
-                span: $DIR/inner-attrs.rs:28:5: 28:6 (#0),
+                span: $DIR/inner-attrs.rs:27:5: 27:6 (#0),
             },
             Punct {
                 ch: '!',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:28:6: 28:7 (#0),
+                span: $DIR/inner-attrs.rs:27:6: 27:7 (#0),
             },
             Group {
                 delimiter: Bracket,
                 stream: TokenStream [
                     Ident {
                         ident: "print_target_and_args",
-                        span: $DIR/inner-attrs.rs:28:8: 28:29 (#0),
+                        span: $DIR/inner-attrs.rs:27:8: 27:29 (#0),
                     },
                     Group {
                         delimiter: Parenthesis,
                         stream: TokenStream [
                             Ident {
                                 ident: "mod_third",
-                                span: $DIR/inner-attrs.rs:28:30: 28:39 (#0),
+                                span: $DIR/inner-attrs.rs:27:30: 27:39 (#0),
                             },
                         ],
-                        span: $DIR/inner-attrs.rs:28:29: 28:40 (#0),
+                        span: $DIR/inner-attrs.rs:27:29: 27:40 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:28:7: 28:41 (#0),
+                span: $DIR/inner-attrs.rs:27:7: 27:41 (#0),
             },
             Punct {
                 ch: '#',
                 spacing: Joint,
-                span: $DIR/inner-attrs.rs:29:5: 29:6 (#0),
+                span: $DIR/inner-attrs.rs:28:5: 28:6 (#0),
             },
             Punct {
                 ch: '!',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:29:6: 29:7 (#0),
+                span: $DIR/inner-attrs.rs:28:6: 28:7 (#0),
             },
             Group {
                 delimiter: Bracket,
                 stream: TokenStream [
                     Ident {
                         ident: "print_target_and_args",
-                        span: $DIR/inner-attrs.rs:29:8: 29:29 (#0),
+                        span: $DIR/inner-attrs.rs:28:8: 28:29 (#0),
                     },
                     Group {
                         delimiter: Parenthesis,
                         stream: TokenStream [
                             Ident {
                                 ident: "mod_fourth",
-                                span: $DIR/inner-attrs.rs:29:30: 29:40 (#0),
+                                span: $DIR/inner-attrs.rs:28:30: 28:40 (#0),
                             },
                         ],
-                        span: $DIR/inner-attrs.rs:29:29: 29:41 (#0),
+                        span: $DIR/inner-attrs.rs:28:29: 28:41 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:29:7: 29:42 (#0),
+                span: $DIR/inner-attrs.rs:28:7: 28:42 (#0),
             },
         ],
-        span: $DIR/inner-attrs.rs:27:16: 30:2 (#0),
+        span: $DIR/inner-attrs.rs:26:16: 29:2 (#0),
     },
 ]
 PRINT-ATTR_ARGS INPUT (DISPLAY): mod_second
 PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
     Ident {
         ident: "mod_second",
-        span: $DIR/inner-attrs.rs:26:25: 26:35 (#0),
+        span: $DIR/inner-attrs.rs:25:25: 25:35 (#0),
     },
 ]
 PRINT-ATTR INPUT (DISPLAY): mod inline_mod
@@ -427,11 +427,11 @@ PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): mod inline_mod
 PRINT-ATTR INPUT (DEBUG): TokenStream [
     Ident {
         ident: "mod",
-        span: $DIR/inner-attrs.rs:27:1: 27:4 (#0),
+        span: $DIR/inner-attrs.rs:26:1: 26:4 (#0),
     },
     Ident {
         ident: "inline_mod",
-        span: $DIR/inner-attrs.rs:27:5: 27:15 (#0),
+        span: $DIR/inner-attrs.rs:26:5: 26:15 (#0),
     },
     Group {
         delimiter: Brace,
@@ -439,72 +439,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
             Punct {
                 ch: '#',
                 spacing: Joint,
-                span: $DIR/inner-attrs.rs:28:5: 28:6 (#0),
+                span: $DIR/inner-attrs.rs:27:5: 27:6 (#0),
             },
             Punct {
                 ch: '!',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:28:6: 28:7 (#0),
+                span: $DIR/inner-attrs.rs:27:6: 27:7 (#0),
             },
             Group {
                 delimiter: Bracket,
                 stream: TokenStream [
                     Ident {
                         ident: "print_target_and_args",
-                        span: $DIR/inner-attrs.rs:28:8: 28:29 (#0),
+                        span: $DIR/inner-attrs.rs:27:8: 27:29 (#0),
                     },
                     Group {
                         delimiter: Parenthesis,
                         stream: TokenStream [
                             Ident {
                                 ident: "mod_third",
-                                span: $DIR/inner-attrs.rs:28:30: 28:39 (#0),
+                                span: $DIR/inner-attrs.rs:27:30: 27:39 (#0),
                             },
                         ],
-                        span: $DIR/inner-attrs.rs:28:29: 28:40 (#0),
+                        span: $DIR/inner-attrs.rs:27:29: 27:40 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:28:7: 28:41 (#0),
+                span: $DIR/inner-attrs.rs:27:7: 27:41 (#0),
             },
             Punct {
                 ch: '#',
                 spacing: Joint,
-                span: $DIR/inner-attrs.rs:29:5: 29:6 (#0),
+                span: $DIR/inner-attrs.rs:28:5: 28:6 (#0),
             },
             Punct {
                 ch: '!',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:29:6: 29:7 (#0),
+                span: $DIR/inner-attrs.rs:28:6: 28:7 (#0),
             },
             Group {
                 delimiter: Bracket,
                 stream: TokenStream [
                     Ident {
                         ident: "print_target_and_args",
-                        span: $DIR/inner-attrs.rs:29:8: 29:29 (#0),
+                        span: $DIR/inner-attrs.rs:28:8: 28:29 (#0),
                     },
                     Group {
                         delimiter: Parenthesis,
                         stream: TokenStream [
                             Ident {
                                 ident: "mod_fourth",
-                                span: $DIR/inner-attrs.rs:29:30: 29:40 (#0),
+                                span: $DIR/inner-attrs.rs:28:30: 28:40 (#0),
                             },
                         ],
-                        span: $DIR/inner-attrs.rs:29:29: 29:41 (#0),
+                        span: $DIR/inner-attrs.rs:28:29: 28:41 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:29:7: 29:42 (#0),
+                span: $DIR/inner-attrs.rs:28:7: 28:42 (#0),
             },
         ],
-        span: $DIR/inner-attrs.rs:27:16: 30:2 (#0),
+        span: $DIR/inner-attrs.rs:26:16: 29:2 (#0),
     },
 ]
 PRINT-ATTR_ARGS INPUT (DISPLAY): mod_third
 PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
     Ident {
         ident: "mod_third",
-        span: $DIR/inner-attrs.rs:28:30: 28:39 (#0),
+        span: $DIR/inner-attrs.rs:27:30: 27:39 (#0),
     },
 ]
 PRINT-ATTR INPUT (DISPLAY): mod inline_mod { #![print_target_and_args(mod_fourth)] }
@@ -512,11 +512,11 @@ PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): mod inline_mod { #! [print_target_and_ar
 PRINT-ATTR INPUT (DEBUG): TokenStream [
     Ident {
         ident: "mod",
-        span: $DIR/inner-attrs.rs:27:1: 27:4 (#0),
+        span: $DIR/inner-attrs.rs:26:1: 26:4 (#0),
     },
     Ident {
         ident: "inline_mod",
-        span: $DIR/inner-attrs.rs:27:5: 27:15 (#0),
+        span: $DIR/inner-attrs.rs:26:5: 26:15 (#0),
     },
     Group {
         delimiter: Brace,
@@ -524,58 +524,58 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
             Punct {
                 ch: '#',
                 spacing: Joint,
-                span: $DIR/inner-attrs.rs:29:5: 29:6 (#0),
+                span: $DIR/inner-attrs.rs:28:5: 28:6 (#0),
             },
             Punct {
                 ch: '!',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:29:6: 29:7 (#0),
+                span: $DIR/inner-attrs.rs:28:6: 28:7 (#0),
             },
             Group {
                 delimiter: Bracket,
                 stream: TokenStream [
                     Ident {
                         ident: "print_target_and_args",
-                        span: $DIR/inner-attrs.rs:29:8: 29:29 (#0),
+                        span: $DIR/inner-attrs.rs:28:8: 28:29 (#0),
                     },
                     Group {
                         delimiter: Parenthesis,
                         stream: TokenStream [
                             Ident {
                                 ident: "mod_fourth",
-                                span: $DIR/inner-attrs.rs:29:30: 29:40 (#0),
+                                span: $DIR/inner-attrs.rs:28:30: 28:40 (#0),
                             },
                         ],
-                        span: $DIR/inner-attrs.rs:29:29: 29:41 (#0),
+                        span: $DIR/inner-attrs.rs:28:29: 28:41 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:29:7: 29:42 (#0),
+                span: $DIR/inner-attrs.rs:28:7: 28:42 (#0),
             },
         ],
-        span: $DIR/inner-attrs.rs:27:16: 30:2 (#0),
+        span: $DIR/inner-attrs.rs:26:16: 29:2 (#0),
     },
 ]
 PRINT-ATTR_ARGS INPUT (DISPLAY): mod_fourth
 PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
     Ident {
         ident: "mod_fourth",
-        span: $DIR/inner-attrs.rs:29:30: 29:40 (#0),
+        span: $DIR/inner-attrs.rs:28:30: 28:40 (#0),
     },
 ]
 PRINT-ATTR INPUT (DISPLAY): mod inline_mod {}
 PRINT-ATTR INPUT (DEBUG): TokenStream [
     Ident {
         ident: "mod",
-        span: $DIR/inner-attrs.rs:27:1: 27:4 (#0),
+        span: $DIR/inner-attrs.rs:26:1: 26:4 (#0),
     },
     Ident {
         ident: "inline_mod",
-        span: $DIR/inner-attrs.rs:27:5: 27:15 (#0),
+        span: $DIR/inner-attrs.rs:26:5: 26:15 (#0),
     },
     Group {
         delimiter: Brace,
         stream: TokenStream [],
-        span: $DIR/inner-attrs.rs:27:16: 30:2 (#0),
+        span: $DIR/inner-attrs.rs:26:16: 29:2 (#0),
     },
 ]
 PRINT-DERIVE INPUT (DISPLAY): struct MyDerivePrint
@@ -585,63 +585,63 @@ PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): struct MyDerivePrint
 PRINT-DERIVE INPUT (DEBUG): TokenStream [
     Ident {
         ident: "struct",
-        span: $DIR/inner-attrs.rs:37:1: 37:7 (#0),
+        span: $DIR/inner-attrs.rs:36:1: 36:7 (#0),
     },
     Ident {
         ident: "MyDerivePrint",
-        span: $DIR/inner-attrs.rs:37:8: 37:21 (#0),
+        span: $DIR/inner-attrs.rs:36:8: 36:21 (#0),
     },
     Group {
         delimiter: Brace,
         stream: TokenStream [
             Ident {
                 ident: "field",
-                span: $DIR/inner-attrs.rs:38:5: 38:10 (#0),
+                span: $DIR/inner-attrs.rs:37:5: 37:10 (#0),
             },
             Punct {
                 ch: ':',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:38:10: 38:11 (#0),
+                span: $DIR/inner-attrs.rs:37:10: 37:11 (#0),
             },
             Group {
                 delimiter: Bracket,
                 stream: TokenStream [
                     Ident {
                         ident: "u8",
-                        span: $DIR/inner-attrs.rs:38:13: 38:15 (#0),
+                        span: $DIR/inner-attrs.rs:37:13: 37:15 (#0),
                     },
                     Punct {
                         ch: ';',
                         spacing: Alone,
-                        span: $DIR/inner-attrs.rs:38:15: 38:16 (#0),
+                        span: $DIR/inner-attrs.rs:37:15: 37:16 (#0),
                     },
                     Group {
                         delimiter: Brace,
                         stream: TokenStream [
                             Ident {
                                 ident: "match",
-                                span: $DIR/inner-attrs.rs:39:9: 39:14 (#0),
+                                span: $DIR/inner-attrs.rs:38:9: 38:14 (#0),
                             },
                             Ident {
                                 ident: "true",
-                                span: $DIR/inner-attrs.rs:39:15: 39:19 (#0),
+                                span: $DIR/inner-attrs.rs:38:15: 38:19 (#0),
                             },
                             Group {
                                 delimiter: Brace,
                                 stream: TokenStream [
                                     Ident {
                                         ident: "_",
-                                        span: $DIR/inner-attrs.rs:40:13: 40:14 (#0),
+                                        span: $DIR/inner-attrs.rs:39:13: 39:14 (#0),
                                     },
                                     Punct {
                                         ch: '=',
                                         spacing: Joint,
-                                        span: $DIR/inner-attrs.rs:40:15: 40:16 (#0),
+                                        span: $DIR/inner-attrs.rs:39:15: 39:16 (#0),
                                     },
                                     Punct {
                                         ch: '>',
                                         spacing: Alone,
-                                        span: $DIR/inner-attrs.rs:40:16: 40:17 (#0),
+                                        span: $DIR/inner-attrs.rs:39:16: 39:17 (#0),
                                     },
                                     Group {
                                         delimiter: Brace,
@@ -649,69 +649,69 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
                                             Punct {
                                                 ch: '#',
                                                 spacing: Joint,
-                                                span: $DIR/inner-attrs.rs:41:17: 41:18 (#0),
+                                                span: $DIR/inner-attrs.rs:40:17: 40:18 (#0),
                                             },
                                             Punct {
                                                 ch: '!',
                                                 spacing: Alone,
-                                                span: $DIR/inner-attrs.rs:41:18: 41:19 (#0),
+                                                span: $DIR/inner-attrs.rs:40:18: 40:19 (#0),
                                             },
                                             Group {
                                                 delimiter: Bracket,
                                                 stream: TokenStream [
                                                     Ident {
                                                         ident: "rustc_dummy",
-                                                        span: $DIR/inner-attrs.rs:41:41: 41:52 (#0),
+                                                        span: $DIR/inner-attrs.rs:40:41: 40:52 (#0),
                                                     },
                                                     Group {
                                                         delimiter: Parenthesis,
                                                         stream: TokenStream [
                                                             Ident {
                                                                 ident: "third",
-                                                                span: $DIR/inner-attrs.rs:41:53: 41:58 (#0),
+                                                                span: $DIR/inner-attrs.rs:40:53: 40:58 (#0),
                                                             },
                                                         ],
-                                                        span: $DIR/inner-attrs.rs:41:52: 41:59 (#0),
+                                                        span: $DIR/inner-attrs.rs:40:52: 40:59 (#0),
                                                     },
                                                 ],
-                                                span: $DIR/inner-attrs.rs:41:19: 41:61 (#0),
+                                                span: $DIR/inner-attrs.rs:40:19: 40:61 (#0),
                                             },
                                             Ident {
                                                 ident: "true",
-                                                span: $DIR/inner-attrs.rs:42:17: 42:21 (#0),
+                                                span: $DIR/inner-attrs.rs:41:17: 41:21 (#0),
                                             },
                                         ],
-                                        span: $DIR/inner-attrs.rs:40:18: 43:14 (#0),
+                                        span: $DIR/inner-attrs.rs:39:18: 42:14 (#0),
                                     },
                                 ],
-                                span: $DIR/inner-attrs.rs:39:20: 44:10 (#0),
+                                span: $DIR/inner-attrs.rs:38:20: 43:10 (#0),
                             },
                             Punct {
                                 ch: ';',
                                 spacing: Alone,
-                                span: $DIR/inner-attrs.rs:44:10: 44:11 (#0),
+                                span: $DIR/inner-attrs.rs:43:10: 43:11 (#0),
                             },
                             Literal {
                                 kind: Integer,
                                 symbol: "0",
                                 suffix: None,
-                                span: $DIR/inner-attrs.rs:45:9: 45:10 (#0),
+                                span: $DIR/inner-attrs.rs:44:9: 44:10 (#0),
                             },
                         ],
-                        span: $DIR/inner-attrs.rs:38:17: 46:6 (#0),
+                        span: $DIR/inner-attrs.rs:37:17: 45:6 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:38:12: 46:7 (#0),
+                span: $DIR/inner-attrs.rs:37:12: 45:7 (#0),
             },
         ],
-        span: $DIR/inner-attrs.rs:37:22: 47:2 (#0),
+        span: $DIR/inner-attrs.rs:36:22: 46:2 (#0),
     },
 ]
 PRINT-ATTR_ARGS INPUT (DISPLAY): tuple_attrs
 PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
     Ident {
         ident: "tuple_attrs",
-        span: $DIR/inner-attrs.rs:50:29: 50:40 (#0),
+        span: $DIR/inner-attrs.rs:49:29: 49:40 (#0),
     },
 ]
 PRINT-ATTR INPUT (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 });
@@ -724,23 +724,23 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
                 kind: Integer,
                 symbol: "3",
                 suffix: None,
-                span: $DIR/inner-attrs.rs:51:9: 51:10 (#0),
+                span: $DIR/inner-attrs.rs:50:9: 50:10 (#0),
             },
             Punct {
                 ch: ',',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:51:10: 51:11 (#0),
+                span: $DIR/inner-attrs.rs:50:10: 50:11 (#0),
             },
             Literal {
                 kind: Integer,
                 symbol: "4",
                 suffix: None,
-                span: $DIR/inner-attrs.rs:51:12: 51:13 (#0),
+                span: $DIR/inner-attrs.rs:50:12: 50:13 (#0),
             },
             Punct {
                 ch: ',',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:51:13: 51:14 (#0),
+                span: $DIR/inner-attrs.rs:50:13: 50:14 (#0),
             },
             Group {
                 delimiter: Brace,
@@ -748,85 +748,85 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
                     Punct {
                         ch: '#',
                         spacing: Joint,
-                        span: $DIR/inner-attrs.rs:52:13: 52:14 (#0),
+                        span: $DIR/inner-attrs.rs:51:13: 51:14 (#0),
                     },
                     Punct {
                         ch: '!',
                         spacing: Alone,
-                        span: $DIR/inner-attrs.rs:52:14: 52:15 (#0),
+                        span: $DIR/inner-attrs.rs:51:14: 51:15 (#0),
                     },
                     Group {
                         delimiter: Bracket,
                         stream: TokenStream [
                             Ident {
                                 ident: "cfg_attr",
-                                span: $DIR/inner-attrs.rs:52:16: 52:24 (#0),
+                                span: $DIR/inner-attrs.rs:51:16: 51:24 (#0),
                             },
                             Group {
                                 delimiter: Parenthesis,
                                 stream: TokenStream [
                                     Ident {
                                         ident: "not",
-                                        span: $DIR/inner-attrs.rs:52:25: 52:28 (#0),
+                                        span: $DIR/inner-attrs.rs:51:25: 51:28 (#0),
                                     },
                                     Group {
                                         delimiter: Parenthesis,
                                         stream: TokenStream [
                                             Ident {
                                                 ident: "FALSE",
-                                                span: $DIR/inner-attrs.rs:52:29: 52:34 (#0),
+                                                span: $DIR/inner-attrs.rs:51:29: 51:34 (#0),
                                             },
                                         ],
-                                        span: $DIR/inner-attrs.rs:52:28: 52:35 (#0),
+                                        span: $DIR/inner-attrs.rs:51:28: 51:35 (#0),
                                     },
                                     Punct {
                                         ch: ',',
                                         spacing: Alone,
-                                        span: $DIR/inner-attrs.rs:52:35: 52:36 (#0),
+                                        span: $DIR/inner-attrs.rs:51:35: 51:36 (#0),
                                     },
                                     Ident {
                                         ident: "rustc_dummy",
-                                        span: $DIR/inner-attrs.rs:52:37: 52:48 (#0),
+                                        span: $DIR/inner-attrs.rs:51:37: 51:48 (#0),
                                     },
                                     Group {
                                         delimiter: Parenthesis,
                                         stream: TokenStream [
                                             Ident {
                                                 ident: "innermost",
-                                                span: $DIR/inner-attrs.rs:52:49: 52:58 (#0),
+                                                span: $DIR/inner-attrs.rs:51:49: 51:58 (#0),
                                             },
                                         ],
-                                        span: $DIR/inner-attrs.rs:52:48: 52:59 (#0),
+                                        span: $DIR/inner-attrs.rs:51:48: 51:59 (#0),
                                     },
                                 ],
-                                span: $DIR/inner-attrs.rs:52:24: 52:60 (#0),
+                                span: $DIR/inner-attrs.rs:51:24: 51:60 (#0),
                             },
                         ],
-                        span: $DIR/inner-attrs.rs:52:15: 52:61 (#0),
+                        span: $DIR/inner-attrs.rs:51:15: 51:61 (#0),
                     },
                     Literal {
                         kind: Integer,
                         symbol: "5",
                         suffix: None,
-                        span: $DIR/inner-attrs.rs:53:13: 53:14 (#0),
+                        span: $DIR/inner-attrs.rs:52:13: 52:14 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:51:15: 54:10 (#0),
+                span: $DIR/inner-attrs.rs:50:15: 53:10 (#0),
             },
         ],
-        span: $DIR/inner-attrs.rs:50:43: 55:6 (#0),
+        span: $DIR/inner-attrs.rs:49:43: 54:6 (#0),
     },
     Punct {
         ch: ';',
         spacing: Alone,
-        span: $DIR/inner-attrs.rs:55:6: 55:7 (#0),
+        span: $DIR/inner-attrs.rs:54:6: 54:7 (#0),
     },
 ]
 PRINT-ATTR_ARGS INPUT (DISPLAY): tuple_attrs
 PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
     Ident {
         ident: "tuple_attrs",
-        span: $DIR/inner-attrs.rs:57:29: 57:40 (#0),
+        span: $DIR/inner-attrs.rs:56:29: 56:40 (#0),
     },
 ]
 PRINT-ATTR INPUT (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 });
@@ -839,23 +839,23 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
                 kind: Integer,
                 symbol: "3",
                 suffix: None,
-                span: $DIR/inner-attrs.rs:58:9: 58:10 (#0),
+                span: $DIR/inner-attrs.rs:57:9: 57:10 (#0),
             },
             Punct {
                 ch: ',',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:58:10: 58:11 (#0),
+                span: $DIR/inner-attrs.rs:57:10: 57:11 (#0),
             },
             Literal {
                 kind: Integer,
                 symbol: "4",
                 suffix: None,
-                span: $DIR/inner-attrs.rs:58:12: 58:13 (#0),
+                span: $DIR/inner-attrs.rs:57:12: 57:13 (#0),
             },
             Punct {
                 ch: ',',
                 spacing: Alone,
-                span: $DIR/inner-attrs.rs:58:13: 58:14 (#0),
+                span: $DIR/inner-attrs.rs:57:13: 57:14 (#0),
             },
             Group {
                 delimiter: Brace,
@@ -863,105 +863,105 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
                     Punct {
                         ch: '#',
                         spacing: Joint,
-                        span: $DIR/inner-attrs.rs:59:13: 59:14 (#0),
+                        span: $DIR/inner-attrs.rs:58:13: 58:14 (#0),
                     },
                     Punct {
                         ch: '!',
                         spacing: Alone,
-                        span: $DIR/inner-attrs.rs:59:14: 59:15 (#0),
+                        span: $DIR/inner-attrs.rs:58:14: 58:15 (#0),
                     },
                     Group {
                         delimiter: Bracket,
                         stream: TokenStream [
                             Ident {
                                 ident: "cfg_attr",
-                                span: $DIR/inner-attrs.rs:59:16: 59:24 (#0),
+                                span: $DIR/inner-attrs.rs:58:16: 58:24 (#0),
                             },
                             Group {
                                 delimiter: Parenthesis,
                                 stream: TokenStream [
                                     Ident {
                                         ident: "not",
-                                        span: $DIR/inner-attrs.rs:59:25: 59:28 (#0),
+                                        span: $DIR/inner-attrs.rs:58:25: 58:28 (#0),
                                     },
                                     Group {
                                         delimiter: Parenthesis,
                                         stream: TokenStream [
                                             Ident {
                                                 ident: "FALSE",
-                                                span: $DIR/inner-attrs.rs:59:29: 59:34 (#0),
+                                                span: $DIR/inner-attrs.rs:58:29: 58:34 (#0),
                                             },
                                         ],
-                                        span: $DIR/inner-attrs.rs:59:28: 59:35 (#0),
+                                        span: $DIR/inner-attrs.rs:58:28: 58:35 (#0),
                                     },
                                     Punct {
                                         ch: ',',
                                         spacing: Alone,
-                                        span: $DIR/inner-attrs.rs:59:35: 59:36 (#0),
+                                        span: $DIR/inner-attrs.rs:58:35: 58:36 (#0),
                                     },
                                     Ident {
                                         ident: "rustc_dummy",
-                                        span: $DIR/inner-attrs.rs:59:37: 59:48 (#0),
+                                        span: $DIR/inner-attrs.rs:58:37: 58:48 (#0),
                                     },
                                     Group {
                                         delimiter: Parenthesis,
                                         stream: TokenStream [
                                             Ident {
                                                 ident: "innermost",
-                                                span: $DIR/inner-attrs.rs:59:49: 59:58 (#0),
+                                                span: $DIR/inner-attrs.rs:58:49: 58:58 (#0),
                                             },
                                         ],
-                                        span: $DIR/inner-attrs.rs:59:48: 59:59 (#0),
+                                        span: $DIR/inner-attrs.rs:58:48: 58:59 (#0),
                                     },
                                 ],
-                                span: $DIR/inner-attrs.rs:59:24: 59:60 (#0),
+                                span: $DIR/inner-attrs.rs:58:24: 58:60 (#0),
                             },
                         ],
-                        span: $DIR/inner-attrs.rs:59:15: 59:61 (#0),
+                        span: $DIR/inner-attrs.rs:58:15: 58:61 (#0),
                     },
                     Literal {
                         kind: Integer,
                         symbol: "5",
                         suffix: None,
-                        span: $DIR/inner-attrs.rs:60:13: 60:14 (#0),
+                        span: $DIR/inner-attrs.rs:59:13: 59:14 (#0),
                     },
                 ],
-                span: $DIR/inner-attrs.rs:58:15: 61:10 (#0),
+                span: $DIR/inner-attrs.rs:57:15: 60:10 (#0),
             },
         ],
-        span: $DIR/inner-attrs.rs:57:43: 62:6 (#0),
+        span: $DIR/inner-attrs.rs:56:43: 61:6 (#0),
     },
     Punct {
         ch: ';',
         spacing: Alone,
-        span: $DIR/inner-attrs.rs:62:6: 62:7 (#0),
+        span: $DIR/inner-attrs.rs:61:6: 61:7 (#0),
     },
 ]
 PRINT-ATTR_ARGS INPUT (DISPLAY): tenth
 PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
     Ident {
         ident: "tenth",
-        span: $DIR/inner-attrs.rs:84:42: 84:47 (#0),
+        span: $DIR/inner-attrs.rs:87:42: 87:47 (#0),
     },
 ]
 PRINT-ATTR INPUT (DISPLAY): fn weird_extern() {}
 PRINT-ATTR INPUT (DEBUG): TokenStream [
     Ident {
         ident: "fn",
-        span: $DIR/inner-attrs.rs:83:5: 83:7 (#0),
+        span: $DIR/inner-attrs.rs:86:5: 86:7 (#0),
     },
     Ident {
         ident: "weird_extern",
-        span: $DIR/inner-attrs.rs:83:8: 83:20 (#0),
+        span: $DIR/inner-attrs.rs:86:8: 86:20 (#0),
     },
     Group {
         delimiter: Parenthesis,
         stream: TokenStream [],
-        span: $DIR/inner-attrs.rs:83:20: 83:22 (#0),
+        span: $DIR/inner-attrs.rs:86:20: 86:22 (#0),
     },
     Group {
         delimiter: Brace,
         stream: TokenStream [],
-        span: $DIR/inner-attrs.rs:83:23: 85:6 (#0),
+        span: $DIR/inner-attrs.rs:86:23: 88:6 (#0),
     },
 ]
diff --git a/tests/ui/regions/region-invariant-static-error-reporting.rs b/tests/ui/regions/region-invariant-static-error-reporting.rs
index e58eea3f61a..9792c101fa8 100644
--- a/tests/ui/regions/region-invariant-static-error-reporting.rs
+++ b/tests/ui/regions/region-invariant-static-error-reporting.rs
@@ -3,7 +3,7 @@
 // over time, but this test used to exhibit some pretty bogus messages
 // that were not remotely helpful.
 
-//@ error-pattern:requires that `'a` must outlive `'static`
+//@ dont-require-annotations: NOTE
 
 struct Invariant<'a>(Option<&'a mut &'a mut ()>);
 
@@ -14,6 +14,7 @@ fn unify<'a>(x: Option<Invariant<'a>>, f: fn(Invariant<'a>)) {
         x.unwrap()
     } else {
         mk_static() //~ ERROR lifetime may not live long enough
+                    //~| NOTE assignment requires that `'a` must outlive `'static`
     };
     f(bad);
 }
diff --git a/tests/ui/target-feature/forbidden-target-feature-flag-disable.rs b/tests/ui/target-feature/forbidden-target-feature-flag-disable.rs
index fda0b1c08cb..d394dbe7b15 100644
--- a/tests/ui/target-feature/forbidden-target-feature-flag-disable.rs
+++ b/tests/ui/target-feature/forbidden-target-feature-flag-disable.rs
@@ -4,7 +4,7 @@
 //@ compile-flags: -Ctarget-feature=-forced-atomics
 // For now this is just a warning.
 //@ build-pass
-//@error-pattern: unsound because it changes the ABI
+
 #![feature(no_core, lang_items)]
 #![no_core]
 
diff --git a/tests/ui/target-feature/tied-features-no-implication-1.rs b/tests/ui/target-feature/tied-features-no-implication-1.rs
index 0a98a7eeccf..63a1d77dae9 100644
--- a/tests/ui/target-feature/tied-features-no-implication-1.rs
+++ b/tests/ui/target-feature/tied-features-no-implication-1.rs
@@ -2,9 +2,7 @@
 //@ compile-flags: --crate-type=rlib --target=aarch64-unknown-linux-gnu
 //@ needs-llvm-components: aarch64
 //@[paca] compile-flags: -Ctarget-feature=+paca
-//@[paca] error-pattern: the target features paca, pacg must all be either enabled or disabled together
 //@[pacg] compile-flags: -Ctarget-feature=+pacg
-//@[paca] error-pattern: the target features paca, pacg must all be either enabled or disabled together
 #![feature(no_core, lang_items)]
 #![no_core]
 
diff --git a/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs b/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs
index 9304e20b429..6005bc96ad6 100644
--- a/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs
+++ b/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs
@@ -1,6 +1,7 @@
 //~ ERROR unknown lint: `test_unstable_lint`
+//~^ NOTE the `test_unstable_lint` lint is unstable
 //@ check-fail
 //@ compile-flags: -Dunknown_lints -Atest_unstable_lint
-//@ error-pattern: the `test_unstable_lint` lint is unstable
+//@ dont-require-annotations: NOTE
 
 fn main() {}
diff --git a/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs b/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs
index 76983419c68..c32a21a0163 100644
--- a/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs
+++ b/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs
@@ -1,6 +1,7 @@
 //~ WARN unknown lint: `test_unstable_lint`
+//~^ NOTE the `test_unstable_lint` lint is unstable
 //@ check-pass
 //@ compile-flags: -Wunknown_lints -Atest_unstable_lint
-//@ error-pattern: the `test_unstable_lint` lint is unstable
+//@ dont-require-annotations: NOTE
 
 fn main() {}