about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorThe Miri Cronjob Bot <miri@cron.bot>2025-01-26 05:11:44 +0000
committerThe Miri Cronjob Bot <miri@cron.bot>2025-01-26 05:11:44 +0000
commit06db6bba3b6f9853d692cc20ade7fbc121e27573 (patch)
treee52f559fa38a8bb7c6f1d26ef966b9884f7892d9 /tests
parent7209ae6dd021747401f6228318a10c8e7708efa0 (diff)
parent2f0ad2a71e4a4528bb80bcb24bf8fa4e50cb87c2 (diff)
downloadrust-06db6bba3b6f9853d692cc20ade7fbc121e27573.tar.gz
rust-06db6bba3b6f9853d692cc20ade7fbc121e27573.zip
Merge from rustc
Diffstat (limited to 'tests')
-rw-r--r--tests/codegen/optimize-attr-1.rs14
-rw-r--r--tests/mir-opt/optimize_none.rs32
-rwxr-xr-xtests/run-make/linker-warning/fake-linker.sh17
-rw-r--r--tests/run-make/linker-warning/rmake.rs87
-rw-r--r--tests/run-make/linker-warning/short-error.txt9
-rw-r--r--tests/run-make/rust-lld-by-default-beta-stable/rmake.rs9
-rw-r--r--tests/run-make/rust-lld-by-default-nightly/rmake.rs16
-rw-r--r--tests/run-make/rust-lld-custom-target/rmake.rs5
-rw-r--r--tests/run-make/rust-lld/rmake.rs13
-rw-r--r--tests/rustdoc-ui/ice-unresolved-import-100241.stderr4
-rw-r--r--tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr6
-rw-r--r--tests/rustdoc-ui/issues/issue-61732.rs2
-rw-r--r--tests/rustdoc-ui/issues/issue-61732.stderr6
-rw-r--r--tests/ui/attributes/check-builtin-attr-ice.stderr12
-rw-r--r--tests/ui/attributes/check-cfg_attr-ice.stderr52
-rw-r--r--tests/ui/attributes/field-attributes-vis-unresolved.stderr12
-rw-r--r--tests/ui/check-cfg/allow-same-level.rs16
-rw-r--r--tests/ui/check-cfg/allow-same-level.stderr14
-rw-r--r--tests/ui/check-cfg/cargo-build-script.stderr2
-rw-r--r--tests/ui/check-cfg/cargo-feature.none.stderr10
-rw-r--r--tests/ui/check-cfg/cargo-feature.rs1
-rw-r--r--tests/ui/check-cfg/cargo-feature.some.stderr10
-rw-r--r--tests/ui/check-cfg/cfg-value-for-cfg-name-duplicate.stderr2
-rw-r--r--tests/ui/check-cfg/cfg-value-for-cfg-name-multiple.stderr2
-rw-r--r--tests/ui/check-cfg/cfg-value-for-cfg-name.stderr1
-rw-r--r--tests/ui/check-cfg/compact-names.stderr1
-rw-r--r--tests/ui/check-cfg/exhaustive-names-values.empty_cfg.stderr1
-rw-r--r--tests/ui/check-cfg/exhaustive-names-values.feature.stderr2
-rw-r--r--tests/ui/check-cfg/exhaustive-names-values.full.stderr2
-rw-r--r--tests/ui/check-cfg/exhaustive-names.stderr1
-rw-r--r--tests/ui/check-cfg/mix.stderr2
-rw-r--r--tests/ui/check-cfg/raw-keywords.edition2015.stderr2
-rw-r--r--tests/ui/check-cfg/raw-keywords.edition2021.stderr2
-rw-r--r--tests/ui/check-cfg/report-in-external-macros.cargo.stderr2
-rw-r--r--tests/ui/check-cfg/report-in-external-macros.rustc.stderr2
-rw-r--r--tests/ui/check-cfg/stmt-no-ice.stderr1
-rw-r--r--tests/ui/check-cfg/unexpected-cfg-name.stderr1
-rw-r--r--tests/ui/check-cfg/well-known-names.rs7
-rw-r--r--tests/ui/check-cfg/well-known-names.stderr51
-rw-r--r--tests/ui/closures/2229_closure_analysis/issue-87987.rs27
-rw-r--r--tests/ui/closures/2229_closure_analysis/issue-87987.stderr14
-rw-r--r--tests/ui/closures/2229_closure_analysis/unresolvable-upvar-issue-87987.rs46
-rw-r--r--tests/ui/coherence/conflicting-impl-with-err.stderr12
-rw-r--r--tests/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr2
-rw-r--r--tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr12
-rw-r--r--tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr6
-rw-r--r--tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr6
-rw-r--r--tests/ui/consts/min_const_fn/recursive_const_stab_unmarked_crate_imports.stderr2
-rw-r--r--tests/ui/consts/min_const_fn/recursive_const_stab_unstable_if_unmarked.stderr2
-rw-r--r--tests/ui/delegation/bad-resolve.rs2
-rw-r--r--tests/ui/delegation/bad-resolve.stderr6
-rw-r--r--tests/ui/delegation/glob-bad-path.rs2
-rw-r--r--tests/ui/delegation/glob-bad-path.stderr4
-rw-r--r--tests/ui/deriving/do-not-suggest-calling-fn-in-derive-macro.rs8
-rw-r--r--tests/ui/deriving/do-not-suggest-calling-fn-in-derive-macro.stderr14
-rw-r--r--tests/ui/diagnostic-width/non-copy-type-moved.rs17
-rw-r--r--tests/ui/diagnostic-width/non-copy-type-moved.stderr20
-rw-r--r--tests/ui/dyn-compatibility/default-param-self-projection.rs17
-rw-r--r--tests/ui/dyn-compatibility/default-param-self-projection.stderr18
-rw-r--r--tests/ui/error-codes/E0393.stderr2
-rw-r--r--tests/ui/error-codes/E0432.stderr4
-rw-r--r--tests/ui/extern-flag/multiple-opts.stderr6
-rw-r--r--tests/ui/extern-flag/noprelude.stderr6
-rw-r--r--tests/ui/feature-gates/feature-gate-optimize_attribute.rs3
-rw-r--r--tests/ui/feature-gates/feature-gate-optimize_attribute.stderr14
-rw-r--r--tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs9
-rw-r--r--tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr336
-rw-r--r--tests/ui/foreign/stashed-issue-121451.rs2
-rw-r--r--tests/ui/foreign/stashed-issue-121451.stderr6
-rw-r--r--tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs4
-rw-r--r--tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.stderr10
-rw-r--r--tests/ui/hygiene/extern-prelude-from-opaque-fail.rs4
-rw-r--r--tests/ui/hygiene/extern-prelude-from-opaque-fail.stderr10
-rw-r--r--tests/ui/impl-trait/issue-72911.stderr12
-rw-r--r--tests/ui/impl-trait/stashed-diag-issue-121504.rs2
-rw-r--r--tests/ui/impl-trait/stashed-diag-issue-121504.stderr6
-rw-r--r--tests/ui/imports/extern-prelude-extern-crate-fail.rs2
-rw-r--r--tests/ui/imports/extern-prelude-extern-crate-fail.stderr4
-rw-r--r--tests/ui/imports/import-from-missing-star-2.stderr4
-rw-r--r--tests/ui/imports/import-from-missing-star-3.stderr8
-rw-r--r--tests/ui/imports/import-from-missing-star.stderr4
-rw-r--r--tests/ui/imports/import3.stderr4
-rw-r--r--tests/ui/imports/issue-109343.stderr4
-rw-r--r--tests/ui/imports/issue-1697.rs4
-rw-r--r--tests/ui/imports/issue-1697.stderr4
-rw-r--r--tests/ui/imports/issue-33464.stderr12
-rw-r--r--tests/ui/imports/issue-36881.stderr4
-rw-r--r--tests/ui/imports/issue-37887.stderr4
-rw-r--r--tests/ui/imports/issue-53269.stderr4
-rw-r--r--tests/ui/imports/issue-55457.stderr4
-rw-r--r--tests/ui/imports/issue-81413.stderr4
-rw-r--r--tests/ui/imports/tool-mod-child.rs4
-rw-r--r--tests/ui/imports/tool-mod-child.stderr20
-rw-r--r--tests/ui/imports/unresolved-imports-used.stderr16
-rw-r--r--tests/ui/issues/issue-22370.stderr2
-rw-r--r--tests/ui/issues/issue-33293.rs2
-rw-r--r--tests/ui/issues/issue-33293.stderr6
-rw-r--r--tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr4
-rw-r--r--tests/ui/lint/linker-warning-bin.rs6
-rw-r--r--tests/ui/lint/linker-warning.rs9
-rw-r--r--tests/ui/lint/linker-warning.stderr22
-rw-r--r--tests/ui/macros/builtin-prelude-no-accidents.rs6
-rw-r--r--tests/ui/macros/builtin-prelude-no-accidents.stderr15
-rw-r--r--tests/ui/macros/macro-inner-attributes.rs2
-rw-r--r--tests/ui/macros/macro-inner-attributes.stderr4
-rw-r--r--tests/ui/macros/macro_path_as_generic_bound.stderr6
-rw-r--r--tests/ui/macros/meta-item-absolute-path.stderr8
-rw-r--r--tests/ui/mir/issue-121103.rs4
-rw-r--r--tests/ui/mir/issue-121103.stderr12
-rw-r--r--tests/ui/modules_and_files_visibility/mod_file_disambig.rs2
-rw-r--r--tests/ui/modules_and_files_visibility/mod_file_disambig.stderr6
-rw-r--r--tests/ui/parser/const-param-decl-on-type-instead-of-impl.rs2
-rw-r--r--tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr6
-rw-r--r--tests/ui/parser/dyn-trait-compatibility.rs2
-rw-r--r--tests/ui/parser/dyn-trait-compatibility.stderr6
-rw-r--r--tests/ui/parser/mod_file_not_exist.rs3
-rw-r--r--tests/ui/parser/mod_file_not_exist.stderr6
-rw-r--r--tests/ui/parser/mod_file_not_exist_windows.rs3
-rw-r--r--tests/ui/parser/mod_file_not_exist_windows.stderr6
-rw-r--r--tests/ui/privacy/restricted/test.rs2
-rw-r--r--tests/ui/privacy/restricted/test.stderr6
-rw-r--r--tests/ui/resolve/112590-2.stderr16
-rw-r--r--tests/ui/resolve/bad-module.rs4
-rw-r--r--tests/ui/resolve/bad-module.stderr12
-rw-r--r--tests/ui/resolve/editions-crate-root-2015.rs4
-rw-r--r--tests/ui/resolve/editions-crate-root-2015.stderr12
-rw-r--r--tests/ui/resolve/export-fully-qualified-2018.rs2
-rw-r--r--tests/ui/resolve/export-fully-qualified-2018.stderr6
-rw-r--r--tests/ui/resolve/export-fully-qualified.rs2
-rw-r--r--tests/ui/resolve/export-fully-qualified.stderr6
-rw-r--r--tests/ui/resolve/extern-prelude-fail.stderr10
-rw-r--r--tests/ui/resolve/issue-101749-2.rs2
-rw-r--r--tests/ui/resolve/issue-101749-2.stderr6
-rw-r--r--tests/ui/resolve/issue-101749.fixed2
-rw-r--r--tests/ui/resolve/issue-101749.rs2
-rw-r--r--tests/ui/resolve/issue-101749.stderr5
-rw-r--r--tests/ui/resolve/issue-82865.rs2
-rw-r--r--tests/ui/resolve/issue-82865.stderr6
-rw-r--r--tests/ui/resolve/resolve-bad-visibility.stderr12
-rw-r--r--tests/ui/resolve/typo-suggestion-mistyped-in-path.rs4
-rw-r--r--tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr4
-rw-r--r--tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.stderr4
-rw-r--r--tests/ui/rust-2018/unresolved-asterisk-imports.stderr4
-rw-r--r--tests/ui/suggestions/crate-or-module-typo.rs4
-rw-r--r--tests/ui/suggestions/crate-or-module-typo.stderr10
-rw-r--r--tests/ui/suggestions/issue-112590-suggest-import.rs6
-rw-r--r--tests/ui/suggestions/issue-112590-suggest-import.stderr15
-rw-r--r--tests/ui/suggestions/undeclared-module-alloc.rs2
-rw-r--r--tests/ui/suggestions/undeclared-module-alloc.stderr4
-rw-r--r--tests/ui/tool-attributes/unknown-tool-name.rs2
-rw-r--r--tests/ui/tool-attributes/unknown-tool-name.stderr4
-rw-r--r--tests/ui/traits/const-traits/staged-api.stderr2
-rw-r--r--tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs1
-rw-r--r--tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.stderr20
-rw-r--r--tests/ui/traits/unspecified-self-in-trait-ref.stderr2
-rw-r--r--tests/ui/type/type-parameter-defaults-referencing-Self.stderr2
-rw-r--r--tests/ui/typeck/issue-120856.rs4
-rw-r--r--tests/ui/typeck/issue-120856.stderr12
-rw-r--r--tests/ui/typeck/path-to-method-sugg-unresolved-expr.cargo-invoked.stderr11
-rw-r--r--tests/ui/typeck/path-to-method-sugg-unresolved-expr.only-rustc.stderr11
-rw-r--r--tests/ui/typeck/path-to-method-sugg-unresolved-expr.rs8
-rw-r--r--tests/ui/typeck/path-to-method-sugg-unresolved-expr.stderr9
-rw-r--r--tests/ui/unresolved/unresolved-asterisk-imports.stderr4
-rw-r--r--tests/ui/unresolved/unresolved-import.rs4
-rw-r--r--tests/ui/unresolved/unresolved-import.stderr4
165 files changed, 1024 insertions, 616 deletions
diff --git a/tests/codegen/optimize-attr-1.rs b/tests/codegen/optimize-attr-1.rs
index 3aee44791e0..db6bdcf9a8b 100644
--- a/tests/codegen/optimize-attr-1.rs
+++ b/tests/codegen/optimize-attr-1.rs
@@ -37,11 +37,23 @@ pub fn speed() -> i32 {
     4 + 4
 }
 
+// CHECK-LABEL: define{{.*}}i32 @none
+// CHECK-SAME: [[NONE_ATTRS:#[0-9]+]]
+// SIZE-OPT: alloca
+// SPEED-OPT: alloca
+#[no_mangle]
+#[optimize(none)]
+pub fn none() -> i32 {
+    let arr = [0, 1, 2, 3, 4];
+    arr[4]
+}
+
 // NO-OPT-DAG: attributes [[SIZE_ATTRS]] = {{.*}}minsize{{.*}}optsize{{.*}}
 // SPEED-OPT-DAG: attributes [[SIZE_ATTRS]] = {{.*}}minsize{{.*}}optsize{{.*}}
 // SIZE-OPT-DAG: attributes [[NOTHING_ATTRS]] = {{.*}}optsize{{.*}}
 // SIZE-OPT-DAG: attributes [[SIZE_ATTRS]] = {{.*}}minsize{{.*}}optsize{{.*}}
+// CHECK-DAG: attributes [[NONE_ATTRS]] = {{.*}}noinline{{.*}}optnone{{.*}}
 
-// SIZE-OPT: attributes [[SPEED_ATTRS]]
+// SIZE-OPT-DAG: attributes [[SPEED_ATTRS]]
 // SIZE-OPT-NOT: minsize
 // SIZE-OPT-NOT: optsize
diff --git a/tests/mir-opt/optimize_none.rs b/tests/mir-opt/optimize_none.rs
new file mode 100644
index 00000000000..a5b541bd2b6
--- /dev/null
+++ b/tests/mir-opt/optimize_none.rs
@@ -0,0 +1,32 @@
+//@ revisions: NO-OPT SPEED-OPT
+//@[NO-OPT] compile-flags: -Copt-level=0
+//@[SPEED-OPT] compile-flags: -Copt-level=3 -Coverflow-checks=y
+
+#![feature(optimize_attribute)]
+
+#[optimize(none)]
+pub fn add_noopt() -> i32 {
+    // CHECK-LABEL: fn add_noopt(
+    // CHECK: AddWithOverflow(const 1_i32, const 2_i32);
+    // CHECK-NEXT: assert
+    1 + 2
+}
+
+#[optimize(none)]
+pub fn const_branch() -> i32 {
+    // CHECK-LABEL: fn const_branch(
+    // CHECK: switchInt(const true) -> [0: [[FALSE:bb[0-9]+]], otherwise: [[TRUE:bb[0-9]+]]];
+    // CHECK-NEXT: }
+    // CHECK: [[FALSE]]: {
+    // CHECK-NEXT: _0 = const 0
+    // CHECK-NEXT: goto
+    // CHECK-NEXT: }
+    // CHECK: [[TRUE]]: {
+    // CHECK-NEXT: _0 = const 1
+    // CHECK-NEXT: goto
+    // CHECK-NEXT: }
+
+    if true { 1 } else { 0 }
+}
+
+fn main() {}
diff --git a/tests/run-make/linker-warning/fake-linker.sh b/tests/run-make/linker-warning/fake-linker.sh
new file mode 100755
index 00000000000..ed4d472c3bf
--- /dev/null
+++ b/tests/run-make/linker-warning/fake-linker.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+code=0
+while ! [ $# = 0 ]; do
+    case "$1" in
+        run_make_info) echo "foo"
+            ;;
+        run_make_warn) echo "warning: bar" >&2
+            ;;
+        run_make_error) echo "error: baz" >&2; code=1
+            ;;
+        *) ;;   # rustc passes lots of args we don't care about
+    esac
+    shift
+done
+
+exit $code
diff --git a/tests/run-make/linker-warning/rmake.rs b/tests/run-make/linker-warning/rmake.rs
index 4d21c5ea569..1bd099d2aee 100644
--- a/tests/run-make/linker-warning/rmake.rs
+++ b/tests/run-make/linker-warning/rmake.rs
@@ -1,8 +1,19 @@
-use run_make_support::{Rustc, rustc};
+use run_make_support::{Rustc, diff, regex, rustc};
 
 fn run_rustc() -> Rustc {
     let mut rustc = rustc();
-    rustc.arg("main.rs").output("main").linker("./fake-linker");
+    rustc
+        .arg("main.rs")
+        // NOTE: `link-self-contained` can vary depending on config.toml.
+        // Make sure we use a consistent value.
+        .arg("-Clink-self-contained=-linker")
+        .arg("-Zunstable-options")
+        .output("main")
+        .linker("./fake-linker");
+    if run_make_support::target() == "x86_64-unknown-linux-gnu" {
+        // The value of `rust.lld` is different between CI and locally. Override it explicitly.
+        rustc.arg("-Clinker-flavor=gnu-cc");
+    }
     rustc
 }
 
@@ -10,19 +21,73 @@ fn main() {
     // first, compile our linker
     rustc().arg("fake-linker.rs").output("fake-linker").run();
 
-    // Make sure we don't show the linker args unless `--verbose` is passed
+    // Run rustc with our fake linker, and make sure it shows warnings
+    let warnings = run_rustc().link_arg("run_make_warn").run();
+    warnings.assert_stderr_contains("warning: linker stderr: bar");
+
+    // Make sure it shows stdout
     run_rustc()
-        .link_arg("run_make_error")
-        .verbose()
-        .run_fail()
-        .assert_stderr_contains_regex("fake-linker.*run_make_error")
+        .link_arg("run_make_info")
+        .run()
+        .assert_stderr_contains("warning: linker stdout: foo");
+
+    // Make sure we short-circuit this new path if the linker exits with an error
+    // (so the diagnostic is less verbose)
+    run_rustc().link_arg("run_make_error").run_fail().assert_stderr_contains("note: error: baz");
+
+    // Make sure we don't show the linker args unless `--verbose` is passed
+    let out = run_rustc().link_arg("run_make_error").verbose().run_fail();
+    out.assert_stderr_contains_regex("fake-linker.*run_make_error")
         .assert_stderr_not_contains("object files omitted")
+        .assert_stderr_contains(r".rcgu.o")
         .assert_stderr_contains_regex(r"lib(/|\\\\)libstd");
-    run_rustc()
-        .link_arg("run_make_error")
-        .run_fail()
-        .assert_stderr_contains("fake-linker")
+
+    let out = run_rustc().link_arg("run_make_error").run_fail();
+    out.assert_stderr_contains("fake-linker")
         .assert_stderr_contains("object files omitted")
         .assert_stderr_contains_regex(r"\{")
+        .assert_stderr_not_contains(r".rcgu.o")
         .assert_stderr_not_contains_regex(r"lib(/|\\\\)libstd");
+
+    // FIXME: we should have a version of this for mac and windows
+    if run_make_support::target() == "x86_64-unknown-linux-gnu" {
+        diff()
+            .expected_file("short-error.txt")
+            .actual_text("(linker error)", out.stderr())
+            .normalize(r#"/rustc[^/]*/"#, "/rustc/")
+            .normalize(
+                regex::escape(run_make_support::build_root().to_str().unwrap()),
+                "/build-root",
+            )
+            .run();
+    }
+
+    // Make sure we show linker warnings even across `-Z no-link`
+    rustc()
+        .arg("-Zno-link")
+        .input("-")
+        .stdin_buf("#![deny(linker_messages)] \n fn main() {}")
+        .run()
+        .assert_stderr_equals("");
+    rustc()
+        .arg("-Zlink-only")
+        .arg("rust_out.rlink")
+        .linker("./fake-linker")
+        .link_arg("run_make_warn")
+        .run_fail()
+        // NOTE: the error message here is quite bad (we don't have a source
+        // span, but still try to print the lint source). But `-Z link-only` is
+        // unstable and this still shows the linker warning itself so this is
+        // probably good enough.
+        .assert_stderr_contains("linker stderr: bar");
+
+    // Same thing, but with json output.
+    rustc()
+        .error_format("json")
+        .arg("-Zlink-only")
+        .arg("rust_out.rlink")
+        .linker("./fake-linker")
+        .link_arg("run_make_warn")
+        .run_fail()
+        .assert_stderr_contains(r#""$message_type":"diagnostic""#);
 }
diff --git a/tests/run-make/linker-warning/short-error.txt b/tests/run-make/linker-warning/short-error.txt
new file mode 100644
index 00000000000..dd3b742bbfd
--- /dev/null
+++ b/tests/run-make/linker-warning/short-error.txt
@@ -0,0 +1,9 @@
+error: linking with `./fake-linker` failed: exit status: 1
+  |
+  = note:  "./fake-linker" "-m64" "/tmp/rustc/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/build-root/test/run-make/linker-warning/rmake_out" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "main" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "run_make_error"
+  = note: some arguments are omitted. use `--verbose` to show all linker arguments
+  = note: error: baz
+          
+
+error: aborting due to 1 previous error
+
diff --git a/tests/run-make/rust-lld-by-default-beta-stable/rmake.rs b/tests/run-make/rust-lld-by-default-beta-stable/rmake.rs
index 2417a4274e4..d2f1e8b253a 100644
--- a/tests/run-make/rust-lld-by-default-beta-stable/rmake.rs
+++ b/tests/run-make/rust-lld-by-default-beta-stable/rmake.rs
@@ -12,11 +12,7 @@ use run_make_support::rustc;
 fn main() {
     // A regular compilation should not use rust-lld by default. We'll check that by asking the
     // linker to display its version number with a link-arg.
-    let output = rustc()
-        .env("RUSTC_LOG", "rustc_codegen_ssa::back::link=info")
-        .link_arg("-Wl,-v")
-        .input("main.rs")
-        .run();
+    let output = rustc().link_arg("-Wl,-v").input("main.rs").run();
     assert!(
         !find_lld_version_in_logs(output.stderr_utf8()),
         "the LLD version string should not be present in the output logs:\n{}",
@@ -25,6 +21,7 @@ fn main() {
 }
 
 fn find_lld_version_in_logs(stderr: String) -> bool {
-    let lld_version_re = Regex::new(r"^LLD [0-9]+\.[0-9]+\.[0-9]+").unwrap();
+    let lld_version_re =
+        Regex::new(r"^warning: linker stdout: LLD [0-9]+\.[0-9]+\.[0-9]+").unwrap();
     stderr.lines().any(|line| lld_version_re.is_match(line.trim()))
 }
diff --git a/tests/run-make/rust-lld-by-default-nightly/rmake.rs b/tests/run-make/rust-lld-by-default-nightly/rmake.rs
index 02bbe8227f0..a25a69b859b 100644
--- a/tests/run-make/rust-lld-by-default-nightly/rmake.rs
+++ b/tests/run-make/rust-lld-by-default-nightly/rmake.rs
@@ -12,11 +12,7 @@ use run_make_support::rustc;
 fn main() {
     // A regular compilation should use rust-lld by default. We'll check that by asking the linker
     // to display its version number with a link-arg.
-    let output = rustc()
-        .env("RUSTC_LOG", "rustc_codegen_ssa::back::link=info")
-        .link_arg("-Wl,-v")
-        .input("main.rs")
-        .run();
+    let output = rustc().link_arg("-Wl,-v").input("main.rs").run();
     assert!(
         find_lld_version_in_logs(output.stderr_utf8()),
         "the LLD version string should be present in the output logs:\n{}",
@@ -24,12 +20,7 @@ fn main() {
     );
 
     // But it can still be disabled by turning the linker feature off.
-    let output = rustc()
-        .env("RUSTC_LOG", "rustc_codegen_ssa::back::link=info")
-        .link_arg("-Wl,-v")
-        .arg("-Zlinker-features=-lld")
-        .input("main.rs")
-        .run();
+    let output = rustc().link_arg("-Wl,-v").arg("-Zlinker-features=-lld").input("main.rs").run();
     assert!(
         !find_lld_version_in_logs(output.stderr_utf8()),
         "the LLD version string should not be present in the output logs:\n{}",
@@ -38,6 +29,7 @@ fn main() {
 }
 
 fn find_lld_version_in_logs(stderr: String) -> bool {
-    let lld_version_re = Regex::new(r"^LLD [0-9]+\.[0-9]+\.[0-9]+").unwrap();
+    let lld_version_re =
+        Regex::new(r"^warning: linker stdout: LLD [0-9]+\.[0-9]+\.[0-9]+").unwrap();
     stderr.lines().any(|line| lld_version_re.is_match(line.trim()))
 }
diff --git a/tests/run-make/rust-lld-custom-target/rmake.rs b/tests/run-make/rust-lld-custom-target/rmake.rs
index a6f7c33793a..a6f936ba6e5 100644
--- a/tests/run-make/rust-lld-custom-target/rmake.rs
+++ b/tests/run-make/rust-lld-custom-target/rmake.rs
@@ -15,7 +15,6 @@ fn main() {
     // Compile to a custom target spec with rust-lld enabled by default. We'll check that by asking
     // the linker to display its version number with a link-arg.
     let output = rustc()
-        .env("RUSTC_LOG", "rustc_codegen_ssa::back::link=info")
         .crate_type("cdylib")
         .target("custom-target.json")
         .link_arg("-Wl,-v")
@@ -29,7 +28,6 @@ fn main() {
 
     // But it can also be disabled via linker features.
     let output = rustc()
-        .env("RUSTC_LOG", "rustc_codegen_ssa::back::link=info")
         .crate_type("cdylib")
         .target("custom-target.json")
         .arg("-Zlinker-features=-lld")
@@ -44,6 +42,7 @@ fn main() {
 }
 
 fn find_lld_version_in_logs(stderr: String) -> bool {
-    let lld_version_re = Regex::new(r"^LLD [0-9]+\.[0-9]+\.[0-9]+").unwrap();
+    let lld_version_re =
+        Regex::new(r"^warning: linker stdout: LLD [0-9]+\.[0-9]+\.[0-9]+").unwrap();
     stderr.lines().any(|line| lld_version_re.is_match(line.trim()))
 }
diff --git a/tests/run-make/rust-lld/rmake.rs b/tests/run-make/rust-lld/rmake.rs
index 1f311af1ed5..76b15ab1799 100644
--- a/tests/run-make/rust-lld/rmake.rs
+++ b/tests/run-make/rust-lld/rmake.rs
@@ -14,7 +14,6 @@ fn main() {
     // Opt-in to lld and the self-contained linker, to link with rust-lld. We'll check that by
     // asking the linker to display its version number with a link-arg.
     let output = rustc()
-        .env("RUSTC_LOG", "rustc_codegen_ssa::back::link=info")
         .arg("-Zlinker-features=+lld")
         .arg("-Clink-self-contained=+linker")
         .arg("-Zunstable-options")
@@ -28,12 +27,8 @@ fn main() {
     );
 
     // It should not be used when we explicitly opt-out of lld.
-    let output = rustc()
-        .env("RUSTC_LOG", "rustc_codegen_ssa::back::link=info")
-        .link_arg(linker_version_flag)
-        .arg("-Zlinker-features=-lld")
-        .input("main.rs")
-        .run();
+    let output =
+        rustc().link_arg(linker_version_flag).arg("-Zlinker-features=-lld").input("main.rs").run();
     assert!(
         !find_lld_version_in_logs(output.stderr_utf8()),
         "the LLD version string should not be present in the output logs:\n{}",
@@ -43,7 +38,6 @@ fn main() {
     // While we're here, also check that the last linker feature flag "wins" when passed multiple
     // times to rustc.
     let output = rustc()
-        .env("RUSTC_LOG", "rustc_codegen_ssa::back::link=info")
         .link_arg(linker_version_flag)
         .arg("-Clink-self-contained=+linker")
         .arg("-Zunstable-options")
@@ -60,6 +54,7 @@ fn main() {
 }
 
 fn find_lld_version_in_logs(stderr: String) -> bool {
-    let lld_version_re = Regex::new(r"^LLD [0-9]+\.[0-9]+\.[0-9]+").unwrap();
+    let lld_version_re =
+        Regex::new(r"^warning: linker std(out|err): LLD [0-9]+\.[0-9]+\.[0-9]+").unwrap();
     stderr.lines().any(|line| lld_version_re.is_match(line.trim()))
 }
diff --git a/tests/rustdoc-ui/ice-unresolved-import-100241.stderr b/tests/rustdoc-ui/ice-unresolved-import-100241.stderr
index 2eebedba9a5..a82847d381c 100644
--- a/tests/rustdoc-ui/ice-unresolved-import-100241.stderr
+++ b/tests/rustdoc-ui/ice-unresolved-import-100241.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `inner`
   --> $DIR/ice-unresolved-import-100241.rs:9:13
    |
 LL |     pub use inner::S;
-   |             ^^^^^ you might be missing crate `inner`
+   |             ^^^^^ use of unresolved module or unlinked crate `inner`
    |
-help: consider importing the `inner` crate
+help: you might be missing a crate named `inner`, add it to your project and import it in your code
    |
 LL + extern crate inner;
    |
diff --git a/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr b/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr
index e6894319213..dcdd230c25a 100644
--- a/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr
+++ b/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr
@@ -1,10 +1,10 @@
-error[E0433]: failed to resolve: you might be missing crate `unresolved_crate`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved_crate`
   --> $DIR/unresolved-import-recovery.rs:3:5
    |
 LL | use unresolved_crate::module::Name;
-   |     ^^^^^^^^^^^^^^^^ you might be missing crate `unresolved_crate`
+   |     ^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `unresolved_crate`
    |
-help: consider importing the `unresolved_crate` crate
+help: you might be missing a crate named `unresolved_crate`, add it to your project and import it in your code
    |
 LL + extern crate unresolved_crate;
    |
diff --git a/tests/rustdoc-ui/issues/issue-61732.rs b/tests/rustdoc-ui/issues/issue-61732.rs
index 3969ab92c32..d5d9ad5e463 100644
--- a/tests/rustdoc-ui/issues/issue-61732.rs
+++ b/tests/rustdoc-ui/issues/issue-61732.rs
@@ -1,4 +1,4 @@
 // This previously triggered an ICE.
 
 pub(in crate::r#mod) fn main() {}
-//~^ ERROR failed to resolve: you might be missing crate `r#mod`
+//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `r#mod`
diff --git a/tests/rustdoc-ui/issues/issue-61732.stderr b/tests/rustdoc-ui/issues/issue-61732.stderr
index 0aa7d558c30..c4e6997ab74 100644
--- a/tests/rustdoc-ui/issues/issue-61732.stderr
+++ b/tests/rustdoc-ui/issues/issue-61732.stderr
@@ -1,10 +1,10 @@
-error[E0433]: failed to resolve: you might be missing crate `r#mod`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `r#mod`
   --> $DIR/issue-61732.rs:3:15
    |
 LL | pub(in crate::r#mod) fn main() {}
-   |               ^^^^^ you might be missing crate `r#mod`
+   |               ^^^^^ use of unresolved module or unlinked crate `r#mod`
    |
-help: consider importing the `r#mod` crate
+help: you might be missing a crate named `r#mod`, add it to your project and import it in your code
    |
 LL + extern crate r#mod;
    |
diff --git a/tests/ui/attributes/check-builtin-attr-ice.stderr b/tests/ui/attributes/check-builtin-attr-ice.stderr
index 5a27da565a8..06a4769b2b4 100644
--- a/tests/ui/attributes/check-builtin-attr-ice.stderr
+++ b/tests/ui/attributes/check-builtin-attr-ice.stderr
@@ -1,20 +1,20 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `should_panic`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `should_panic`
   --> $DIR/check-builtin-attr-ice.rs:43:7
    |
 LL |     #[should_panic::skip]
-   |       ^^^^^^^^^^^^ use of undeclared crate or module `should_panic`
+   |       ^^^^^^^^^^^^ use of unresolved module or unlinked crate `should_panic`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `should_panic`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `should_panic`
   --> $DIR/check-builtin-attr-ice.rs:47:7
    |
 LL |     #[should_panic::a::b::c]
-   |       ^^^^^^^^^^^^ use of undeclared crate or module `should_panic`
+   |       ^^^^^^^^^^^^ use of unresolved module or unlinked crate `should_panic`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `deny`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `deny`
   --> $DIR/check-builtin-attr-ice.rs:55:7
    |
 LL |     #[deny::skip]
-   |       ^^^^ use of undeclared crate or module `deny`
+   |       ^^^^ use of unresolved module or unlinked crate `deny`
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/attributes/check-cfg_attr-ice.stderr b/tests/ui/attributes/check-cfg_attr-ice.stderr
index dbdf32597f7..bed3150bdc2 100644
--- a/tests/ui/attributes/check-cfg_attr-ice.stderr
+++ b/tests/ui/attributes/check-cfg_attr-ice.stderr
@@ -17,83 +17,83 @@ LL |         #[cfg_attr::no_such_thing]
    = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
   --> $DIR/check-cfg_attr-ice.rs:52:3
    |
 LL | #[cfg_attr::no_such_thing]
-   |   ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+   |   ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
   --> $DIR/check-cfg_attr-ice.rs:55:7
    |
 LL |     #[cfg_attr::no_such_thing]
-   |       ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+   |       ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
   --> $DIR/check-cfg_attr-ice.rs:57:17
    |
 LL |     GiveYouUp(#[cfg_attr::no_such_thing] u8),
-   |                 ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+   |                 ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
   --> $DIR/check-cfg_attr-ice.rs:64:11
    |
 LL |         #[cfg_attr::no_such_thing]
-   |           ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+   |           ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
   --> $DIR/check-cfg_attr-ice.rs:41:7
    |
 LL |     #[cfg_attr::no_such_thing]
-   |       ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+   |       ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
   --> $DIR/check-cfg_attr-ice.rs:43:15
    |
 LL |     fn from(#[cfg_attr::no_such_thing] any_other_guy: AnyOtherGuy) -> This {
-   |               ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+   |               ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
   --> $DIR/check-cfg_attr-ice.rs:45:11
    |
 LL |         #[cfg_attr::no_such_thing]
-   |           ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+   |           ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
   --> $DIR/check-cfg_attr-ice.rs:32:3
    |
 LL | #[cfg_attr::no_such_thing]
-   |   ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+   |   ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
   --> $DIR/check-cfg_attr-ice.rs:24:3
    |
 LL | #[cfg_attr::no_such_thing]
-   |   ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+   |   ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
   --> $DIR/check-cfg_attr-ice.rs:27:7
    |
 LL |     #[cfg_attr::no_such_thing]
-   |       ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+   |       ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
   --> $DIR/check-cfg_attr-ice.rs:16:3
    |
 LL | #[cfg_attr::no_such_thing]
-   |   ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+   |   ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
   --> $DIR/check-cfg_attr-ice.rs:19:7
    |
 LL |     #[cfg_attr::no_such_thing]
-   |       ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+   |       ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
   --> $DIR/check-cfg_attr-ice.rs:12:3
    |
 LL | #[cfg_attr::no_such_thing]
-   |   ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+   |   ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
 
 error: aborting due to 15 previous errors
 
diff --git a/tests/ui/attributes/field-attributes-vis-unresolved.stderr b/tests/ui/attributes/field-attributes-vis-unresolved.stderr
index f8610c08b02..d689b76eaf8 100644
--- a/tests/ui/attributes/field-attributes-vis-unresolved.stderr
+++ b/tests/ui/attributes/field-attributes-vis-unresolved.stderr
@@ -1,21 +1,21 @@
-error[E0433]: failed to resolve: you might be missing crate `nonexistent`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent`
   --> $DIR/field-attributes-vis-unresolved.rs:17:12
    |
 LL |     pub(in nonexistent) field: u8
-   |            ^^^^^^^^^^^ you might be missing crate `nonexistent`
+   |            ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent`
    |
-help: consider importing the `nonexistent` crate
+help: you might be missing a crate named `nonexistent`, add it to your project and import it in your code
    |
 LL + extern crate nonexistent;
    |
 
-error[E0433]: failed to resolve: you might be missing crate `nonexistent`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent`
   --> $DIR/field-attributes-vis-unresolved.rs:22:12
    |
 LL |     pub(in nonexistent) u8
-   |            ^^^^^^^^^^^ you might be missing crate `nonexistent`
+   |            ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent`
    |
-help: consider importing the `nonexistent` crate
+help: you might be missing a crate named `nonexistent`, add it to your project and import it in your code
    |
 LL + extern crate nonexistent;
    |
diff --git a/tests/ui/check-cfg/allow-same-level.rs b/tests/ui/check-cfg/allow-same-level.rs
index ff724174cea..5eef50e08e2 100644
--- a/tests/ui/check-cfg/allow-same-level.rs
+++ b/tests/ui/check-cfg/allow-same-level.rs
@@ -1,12 +1,24 @@
-// This test check that #[allow(unexpected_cfgs)] doesn't work if put on the same level
+// This test check that #[allow(unexpected_cfgs)] **doesn't work**
+// when put on the same level as the #[cfg] attribute.
+//
+// It should work, but due to interactions between how #[cfg]s are
+// expanded, the lint machinery and the check-cfg impl, we
+// miss the #[allow], althrough we probably shoudln't.
+//
+// cf. https://github.com/rust-lang/rust/issues/124735
 //
 //@ check-pass
 //@ no-auto-check-cfg
-//@ compile-flags: --check-cfg=cfg()
+//@ compile-flags: --check-cfg=cfg() --cfg=unknown_but_active_cfg
 
 #[allow(unexpected_cfgs)]
 #[cfg(FALSE)]
 //~^ WARNING unexpected `cfg` condition name
 fn bar() {}
 
+#[allow(unexpected_cfgs)]
+#[cfg(unknown_but_active_cfg)]
+//~^ WARNING unexpected `cfg` condition name
+fn bar() {}
+
 fn main() {}
diff --git a/tests/ui/check-cfg/allow-same-level.stderr b/tests/ui/check-cfg/allow-same-level.stderr
index 5d74b211654..a705cd4e5f0 100644
--- a/tests/ui/check-cfg/allow-same-level.stderr
+++ b/tests/ui/check-cfg/allow-same-level.stderr
@@ -1,13 +1,21 @@
 warning: unexpected `cfg` condition name: `FALSE`
-  --> $DIR/allow-same-level.rs:8:7
+  --> $DIR/allow-same-level.rs:15:7
    |
 LL | #[cfg(FALSE)]
    |       ^^^^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
    = help: to expect this configuration use `--check-cfg=cfg(FALSE)`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default
 
-warning: 1 warning emitted
+warning: unexpected `cfg` condition name: `unknown_but_active_cfg`
+  --> $DIR/allow-same-level.rs:20:7
+   |
+LL | #[cfg(unknown_but_active_cfg)]
+   |       ^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: to expect this configuration use `--check-cfg=cfg(unknown_but_active_cfg)`
+   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
+
+warning: 2 warnings emitted
 
diff --git a/tests/ui/check-cfg/cargo-build-script.stderr b/tests/ui/check-cfg/cargo-build-script.stderr
index fb48751bc1d..df0bc47571c 100644
--- a/tests/ui/check-cfg/cargo-build-script.stderr
+++ b/tests/ui/check-cfg/cargo-build-script.stderr
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `has_foo`
 LL | #[cfg(has_foo)]
    |       ^^^^^^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `has_bar`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
+   = help: expected names are: `has_bar` and 30 more
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
diff --git a/tests/ui/check-cfg/cargo-feature.none.stderr b/tests/ui/check-cfg/cargo-feature.none.stderr
index aa2a1ab8fb2..58813a1f677 100644
--- a/tests/ui/check-cfg/cargo-feature.none.stderr
+++ b/tests/ui/check-cfg/cargo-feature.none.stderr
@@ -1,5 +1,5 @@
 warning: unexpected `cfg` condition value: `serde`
-  --> $DIR/cargo-feature.rs:14:7
+  --> $DIR/cargo-feature.rs:15:7
    |
 LL | #[cfg(feature = "serde")]
    |       ^^^^^^^^^^^^^^^^^ help: remove the condition
@@ -10,7 +10,7 @@ LL | #[cfg(feature = "serde")]
    = note: `#[warn(unexpected_cfgs)]` on by default
 
 warning: unexpected `cfg` condition value: (none)
-  --> $DIR/cargo-feature.rs:18:7
+  --> $DIR/cargo-feature.rs:19:7
    |
 LL | #[cfg(feature)]
    |       ^^^^^^^ help: remove the condition
@@ -20,12 +20,12 @@ LL | #[cfg(feature)]
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
 
 warning: unexpected `cfg` condition name: `tokio_unstable`
-  --> $DIR/cargo-feature.rs:22:7
+  --> $DIR/cargo-feature.rs:23:7
    |
 LL | #[cfg(tokio_unstable)]
    |       ^^^^^^^^^^^^^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
+   = help: expected names are: `docsrs`, `feature`, and `test` and 30 more
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
@@ -34,7 +34,7 @@ LL | #[cfg(tokio_unstable)]
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
 
 warning: unexpected `cfg` condition name: `CONFIG_NVME`
-  --> $DIR/cargo-feature.rs:26:7
+  --> $DIR/cargo-feature.rs:27:7
    |
 LL | #[cfg(CONFIG_NVME = "m")]
    |       ^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/check-cfg/cargo-feature.rs b/tests/ui/check-cfg/cargo-feature.rs
index 13faf7f2820..a9380ddae1a 100644
--- a/tests/ui/check-cfg/cargo-feature.rs
+++ b/tests/ui/check-cfg/cargo-feature.rs
@@ -6,6 +6,7 @@
 //@ no-auto-check-cfg
 //@ revisions: some none
 //@ rustc-env:CARGO_CRATE_NAME=foo
+//@ compile-flags: --check-cfg=cfg(docsrs,test)
 //@ [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"))
diff --git a/tests/ui/check-cfg/cargo-feature.some.stderr b/tests/ui/check-cfg/cargo-feature.some.stderr
index c3ba123985b..5a12be81338 100644
--- a/tests/ui/check-cfg/cargo-feature.some.stderr
+++ b/tests/ui/check-cfg/cargo-feature.some.stderr
@@ -1,5 +1,5 @@
 warning: unexpected `cfg` condition value: `serde`
-  --> $DIR/cargo-feature.rs:14:7
+  --> $DIR/cargo-feature.rs:15:7
    |
 LL | #[cfg(feature = "serde")]
    |       ^^^^^^^^^^^^^^^^^
@@ -10,7 +10,7 @@ LL | #[cfg(feature = "serde")]
    = note: `#[warn(unexpected_cfgs)]` on by default
 
 warning: unexpected `cfg` condition value: (none)
-  --> $DIR/cargo-feature.rs:18:7
+  --> $DIR/cargo-feature.rs:19:7
    |
 LL | #[cfg(feature)]
    |       ^^^^^^^- help: specify a config value: `= "bitcode"`
@@ -20,12 +20,12 @@ LL | #[cfg(feature)]
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
 
 warning: unexpected `cfg` condition name: `tokio_unstable`
-  --> $DIR/cargo-feature.rs:22:7
+  --> $DIR/cargo-feature.rs:23:7
    |
 LL | #[cfg(tokio_unstable)]
    |       ^^^^^^^^^^^^^^
    |
-   = help: expected names are: `CONFIG_NVME`, `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
+   = help: expected names are: `CONFIG_NVME`, `docsrs`, `feature`, and `test` and 30 more
    = help: consider using a Cargo feature instead
    = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
             [lints.rust]
@@ -34,7 +34,7 @@ LL | #[cfg(tokio_unstable)]
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
 
 warning: unexpected `cfg` condition value: `m`
-  --> $DIR/cargo-feature.rs:26:7
+  --> $DIR/cargo-feature.rs:27:7
    |
 LL | #[cfg(CONFIG_NVME = "m")]
    |       ^^^^^^^^^^^^^^---
diff --git a/tests/ui/check-cfg/cfg-value-for-cfg-name-duplicate.stderr b/tests/ui/check-cfg/cfg-value-for-cfg-name-duplicate.stderr
index b7dc27f9ba9..7c276c58170 100644
--- a/tests/ui/check-cfg/cfg-value-for-cfg-name-duplicate.stderr
+++ b/tests/ui/check-cfg/cfg-value-for-cfg-name-duplicate.stderr
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `value`
 LL | #[cfg(value)]
    |       ^^^^^
    |
-   = help: expected names are: `bar`, `bee`, `clippy`, `cow`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `foo`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
+   = help: expected names are: `bar`, `bee`, `cow`, and `foo` and 30 more
    = help: to expect this configuration use `--check-cfg=cfg(value)`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default
diff --git a/tests/ui/check-cfg/cfg-value-for-cfg-name-multiple.stderr b/tests/ui/check-cfg/cfg-value-for-cfg-name-multiple.stderr
index d2af81d7787..9687a043e83 100644
--- a/tests/ui/check-cfg/cfg-value-for-cfg-name-multiple.stderr
+++ b/tests/ui/check-cfg/cfg-value-for-cfg-name-multiple.stderr
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `my_value`
 LL | #[cfg(my_value)]
    |       ^^^^^^^^
    |
-   = help: expected names are: `bar`, `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `foo`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
+   = help: expected names are: `bar` and `foo` and 30 more
    = help: to expect this configuration use `--check-cfg=cfg(my_value)`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default
diff --git a/tests/ui/check-cfg/cfg-value-for-cfg-name.stderr b/tests/ui/check-cfg/cfg-value-for-cfg-name.stderr
index 85bf66eb10c..883679ddf9c 100644
--- a/tests/ui/check-cfg/cfg-value-for-cfg-name.stderr
+++ b/tests/ui/check-cfg/cfg-value-for-cfg-name.stderr
@@ -4,7 +4,6 @@ warning: unexpected `cfg` condition name: `linux`
 LL | #[cfg(linux)]
    |       ^^^^^ help: found config with similar value: `target_os = "linux"`
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
    = help: to expect this configuration use `--check-cfg=cfg(linux)`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default
diff --git a/tests/ui/check-cfg/compact-names.stderr b/tests/ui/check-cfg/compact-names.stderr
index ef0a413bd0d..74ed0337e3b 100644
--- a/tests/ui/check-cfg/compact-names.stderr
+++ b/tests/ui/check-cfg/compact-names.stderr
@@ -4,7 +4,6 @@ warning: unexpected `cfg` condition name: `target_architecture`
 LL | #[cfg(target(os = "linux", architecture = "arm"))]
    |                            ^^^^^^^^^^^^^^^^^^^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
    = help: to expect this configuration use `--check-cfg=cfg(target_architecture, values("arm"))`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default
diff --git a/tests/ui/check-cfg/exhaustive-names-values.empty_cfg.stderr b/tests/ui/check-cfg/exhaustive-names-values.empty_cfg.stderr
index 23b6edacce7..7e77ba63a12 100644
--- a/tests/ui/check-cfg/exhaustive-names-values.empty_cfg.stderr
+++ b/tests/ui/check-cfg/exhaustive-names-values.empty_cfg.stderr
@@ -4,7 +4,6 @@ warning: unexpected `cfg` condition name: `unknown_key`
 LL | #[cfg(unknown_key = "value")]
    |       ^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
    = help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default
diff --git a/tests/ui/check-cfg/exhaustive-names-values.feature.stderr b/tests/ui/check-cfg/exhaustive-names-values.feature.stderr
index 804d7fb9163..10302f0a7e4 100644
--- a/tests/ui/check-cfg/exhaustive-names-values.feature.stderr
+++ b/tests/ui/check-cfg/exhaustive-names-values.feature.stderr
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `unknown_key`
 LL | #[cfg(unknown_key = "value")]
    |       ^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
+   = help: expected names are: `feature` and 30 more
    = help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default
diff --git a/tests/ui/check-cfg/exhaustive-names-values.full.stderr b/tests/ui/check-cfg/exhaustive-names-values.full.stderr
index 804d7fb9163..10302f0a7e4 100644
--- a/tests/ui/check-cfg/exhaustive-names-values.full.stderr
+++ b/tests/ui/check-cfg/exhaustive-names-values.full.stderr
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `unknown_key`
 LL | #[cfg(unknown_key = "value")]
    |       ^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
+   = help: expected names are: `feature` and 30 more
    = help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default
diff --git a/tests/ui/check-cfg/exhaustive-names.stderr b/tests/ui/check-cfg/exhaustive-names.stderr
index d134cfcfd29..4d56d24acaf 100644
--- a/tests/ui/check-cfg/exhaustive-names.stderr
+++ b/tests/ui/check-cfg/exhaustive-names.stderr
@@ -4,7 +4,6 @@ warning: unexpected `cfg` condition name: `unknown_key`
 LL | #[cfg(unknown_key = "value")]
    |       ^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
    = help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default
diff --git a/tests/ui/check-cfg/mix.stderr b/tests/ui/check-cfg/mix.stderr
index 76c7befd6d3..033aaef848f 100644
--- a/tests/ui/check-cfg/mix.stderr
+++ b/tests/ui/check-cfg/mix.stderr
@@ -44,7 +44,7 @@ warning: unexpected `cfg` condition name: `uu`
 LL | #[cfg_attr(uu, unix)]
    |            ^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
+   = help: expected names are: `feature` and 30 more
    = help: to expect this configuration use `--check-cfg=cfg(uu)`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
 
diff --git a/tests/ui/check-cfg/raw-keywords.edition2015.stderr b/tests/ui/check-cfg/raw-keywords.edition2015.stderr
index 3ad8ebac959..f19ded9cb67 100644
--- a/tests/ui/check-cfg/raw-keywords.edition2015.stderr
+++ b/tests/ui/check-cfg/raw-keywords.edition2015.stderr
@@ -14,7 +14,7 @@ warning: unexpected `cfg` condition name: `r#false`
 LL | #[cfg(r#false)]
    |       ^^^^^^^
    |
-   = help: expected names are: `async`, `clippy`, `debug_assertions`, `doc`, `doctest`, `edition2015`, `edition2021`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `r#true`, `ub_checks`, `unix`, and `windows`
+   = help: expected names are: `async`, `edition2015`, `edition2021`, and `r#true` and 30 more
    = help: to expect this configuration use `--check-cfg=cfg(r#false)`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
 
diff --git a/tests/ui/check-cfg/raw-keywords.edition2021.stderr b/tests/ui/check-cfg/raw-keywords.edition2021.stderr
index ff43a332697..6096148a259 100644
--- a/tests/ui/check-cfg/raw-keywords.edition2021.stderr
+++ b/tests/ui/check-cfg/raw-keywords.edition2021.stderr
@@ -14,7 +14,7 @@ warning: unexpected `cfg` condition name: `r#false`
 LL | #[cfg(r#false)]
    |       ^^^^^^^
    |
-   = help: expected names are: `r#async`, `clippy`, `debug_assertions`, `doc`, `doctest`, `edition2015`, `edition2021`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `r#true`, `ub_checks`, `unix`, and `windows`
+   = help: expected names are: `r#async`, `edition2015`, `edition2021`, and `r#true` and 30 more
    = help: to expect this configuration use `--check-cfg=cfg(r#false)`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
 
diff --git a/tests/ui/check-cfg/report-in-external-macros.cargo.stderr b/tests/ui/check-cfg/report-in-external-macros.cargo.stderr
index b82a09917f4..a6584d777a3 100644
--- a/tests/ui/check-cfg/report-in-external-macros.cargo.stderr
+++ b/tests/ui/check-cfg/report-in-external-macros.cargo.stderr
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `my_lib_cfg`
 LL |     cfg_macro::my_lib_macro!();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
+   = help: expected names are: `feature` and 30 more
    = note: using a cfg inside a macro will use the cfgs from the destination crate and not the ones from the defining crate
    = help: try referring to `cfg_macro::my_lib_macro` crate for guidance on how handle this unexpected cfg
    = help: the macro `cfg_macro::my_lib_macro` may come from an old version of the `cfg_macro` crate, try updating your dependency with `cargo update -p cfg_macro`
diff --git a/tests/ui/check-cfg/report-in-external-macros.rustc.stderr b/tests/ui/check-cfg/report-in-external-macros.rustc.stderr
index 85d84a1e1ee..914b5a0efe3 100644
--- a/tests/ui/check-cfg/report-in-external-macros.rustc.stderr
+++ b/tests/ui/check-cfg/report-in-external-macros.rustc.stderr
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `my_lib_cfg`
 LL |     cfg_macro::my_lib_macro!();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `feature`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
+   = help: expected names are: `feature` and 30 more
    = note: using a cfg inside a macro will use the cfgs from the destination crate and not the ones from the defining crate
    = help: try referring to `cfg_macro::my_lib_macro` crate for guidance on how handle this unexpected cfg
    = help: to expect this configuration use `--check-cfg=cfg(my_lib_cfg)`
diff --git a/tests/ui/check-cfg/stmt-no-ice.stderr b/tests/ui/check-cfg/stmt-no-ice.stderr
index d8c6b0f3cec..3cf43c6aece 100644
--- a/tests/ui/check-cfg/stmt-no-ice.stderr
+++ b/tests/ui/check-cfg/stmt-no-ice.stderr
@@ -4,7 +4,6 @@ warning: unexpected `cfg` condition name: `crossbeam_loom`
 LL |     #[cfg(crossbeam_loom)]
    |           ^^^^^^^^^^^^^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
    = help: to expect this configuration use `--check-cfg=cfg(crossbeam_loom)`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default
diff --git a/tests/ui/check-cfg/unexpected-cfg-name.stderr b/tests/ui/check-cfg/unexpected-cfg-name.stderr
index 4ca7209cc07..7708d9e3cd4 100644
--- a/tests/ui/check-cfg/unexpected-cfg-name.stderr
+++ b/tests/ui/check-cfg/unexpected-cfg-name.stderr
@@ -14,7 +14,6 @@ warning: unexpected `cfg` condition name: `test`
 LL | #[cfg(test)]
    |       ^^^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
    = help: to expect this configuration use `--check-cfg=cfg(test)`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
 
diff --git a/tests/ui/check-cfg/well-known-names.rs b/tests/ui/check-cfg/well-known-names.rs
index b84710ca839..39fa3a37d1a 100644
--- a/tests/ui/check-cfg/well-known-names.rs
+++ b/tests/ui/check-cfg/well-known-names.rs
@@ -2,7 +2,12 @@
 //
 //@ check-pass
 //@ no-auto-check-cfg
-//@ compile-flags: --check-cfg=cfg()
+//@ compile-flags: --check-cfg=cfg() -Zcheck-cfg-all-expected
+//@ normalize-stderr: "`, `" -> "`\n`"
+
+#[cfg(list_all_well_known_cfgs)]
+//~^ WARNING unexpected `cfg` condition name
+fn in_diagnostics() {}
 
 #[cfg(target_oz = "linux")]
 //~^ WARNING unexpected `cfg` condition name
diff --git a/tests/ui/check-cfg/well-known-names.stderr b/tests/ui/check-cfg/well-known-names.stderr
index 61d518627ba..4ff90261158 100644
--- a/tests/ui/check-cfg/well-known-names.stderr
+++ b/tests/ui/check-cfg/well-known-names.stderr
@@ -1,29 +1,66 @@
+warning: unexpected `cfg` condition name: `list_all_well_known_cfgs`
+  --> $DIR/well-known-names.rs:8:7
+   |
+LL | #[cfg(list_all_well_known_cfgs)]
+   |       ^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: expected names are: `clippy`
+`debug_assertions`
+`doc`
+`doctest`
+`fmt_debug`
+`miri`
+`overflow_checks`
+`panic`
+`proc_macro`
+`relocation_model`
+`rustfmt`
+`sanitize`
+`sanitizer_cfi_generalize_pointers`
+`sanitizer_cfi_normalize_integers`
+`target_abi`
+`target_arch`
+`target_endian`
+`target_env`
+`target_family`
+`target_feature`
+`target_has_atomic`
+`target_has_atomic_equal_alignment`
+`target_has_atomic_load_store`
+`target_os`
+`target_pointer_width`
+`target_thread_local`
+`target_vendor`
+`ub_checks`
+`unix`, and `windows`
+   = help: to expect this configuration use `--check-cfg=cfg(list_all_well_known_cfgs)`
+   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
+   = note: `#[warn(unexpected_cfgs)]` on by default
+
 warning: unexpected `cfg` condition name: `target_oz`
-  --> $DIR/well-known-names.rs:7:7
+  --> $DIR/well-known-names.rs:12:7
    |
 LL | #[cfg(target_oz = "linux")]
    |       ^^^^^^^^^^^^^^^^^^^
    |
    = help: to expect this configuration use `--check-cfg=cfg(target_oz, values("linux"))`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
-   = note: `#[warn(unexpected_cfgs)]` on by default
 help: there is a config with a similar name and value
    |
 LL | #[cfg(target_os = "linux")]
    |       ~~~~~~~~~
 
 warning: unexpected `cfg` condition name: `features`
-  --> $DIR/well-known-names.rs:14:7
+  --> $DIR/well-known-names.rs:19:7
    |
 LL | #[cfg(features = "foo")]
    |       ^^^^^^^^^^^^^^^^
    |
-   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `doctest`, `fmt_debug`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `ub_checks`, `unix`, and `windows`
    = help: to expect this configuration use `--check-cfg=cfg(features, values("foo"))`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
 
 warning: unexpected `cfg` condition name: `feature`
-  --> $DIR/well-known-names.rs:18:7
+  --> $DIR/well-known-names.rs:23:7
    |
 LL | #[cfg(feature = "foo")]
    |       ^^^^^^^^^^^^^^^
@@ -32,7 +69,7 @@ LL | #[cfg(feature = "foo")]
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
 
 warning: unexpected `cfg` condition name: `uniw`
-  --> $DIR/well-known-names.rs:22:7
+  --> $DIR/well-known-names.rs:27:7
    |
 LL | #[cfg(uniw)]
    |       ^^^^ help: there is a config with a similar name: `unix`
@@ -40,5 +77,5 @@ LL | #[cfg(uniw)]
    = help: to expect this configuration use `--check-cfg=cfg(uniw)`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
 
-warning: 4 warnings emitted
+warning: 5 warnings emitted
 
diff --git a/tests/ui/closures/2229_closure_analysis/issue-87987.rs b/tests/ui/closures/2229_closure_analysis/issue-87987.rs
deleted file mode 100644
index f79a8f1b571..00000000000
--- a/tests/ui/closures/2229_closure_analysis/issue-87987.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-//@ run-pass
-//@ edition:2021
-
-struct Props {
-    field_1: u32, //~ WARNING: fields `field_1` and `field_2` are never read
-    field_2: u32,
-}
-
-fn main() {
-    // Test 1
-    let props_2 = Props { field_1: 1, field_2: 1 };
-
-    let _ = || {
-        let _: Props = props_2;
-    };
-
-    // Test 2
-    let mut arr = [1, 3, 4, 5];
-
-    let mref = &mut arr;
-
-    let _c = || match arr {
-        [_, _, _, _] => println!("A"),
-    };
-
-    println!("{:#?}", mref);
-}
diff --git a/tests/ui/closures/2229_closure_analysis/issue-87987.stderr b/tests/ui/closures/2229_closure_analysis/issue-87987.stderr
deleted file mode 100644
index 5696a010c3f..00000000000
--- a/tests/ui/closures/2229_closure_analysis/issue-87987.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-warning: fields `field_1` and `field_2` are never read
-  --> $DIR/issue-87987.rs:5:5
-   |
-LL | struct Props {
-   |        ----- fields in this struct
-LL |     field_1: u32,
-   |     ^^^^^^^
-LL |     field_2: u32,
-   |     ^^^^^^^
-   |
-   = note: `#[warn(dead_code)]` on by default
-
-warning: 1 warning emitted
-
diff --git a/tests/ui/closures/2229_closure_analysis/unresolvable-upvar-issue-87987.rs b/tests/ui/closures/2229_closure_analysis/unresolvable-upvar-issue-87987.rs
new file mode 100644
index 00000000000..c501e034c97
--- /dev/null
+++ b/tests/ui/closures/2229_closure_analysis/unresolvable-upvar-issue-87987.rs
@@ -0,0 +1,46 @@
+//! When a closure syntactically captures a place, but doesn't actually capture
+//! it, make sure MIR building doesn't ICE when handling that place.
+//!
+//! Under the Rust 2021 disjoint capture rules, this sort of non-capture can
+//! occur when a place is only inspected by infallible non-binding patterns.
+
+// FIXME(#135985): On its own, this test should probably just be check-pass.
+// But there are few/no other tests that use non-binding array patterns and
+// invoke the later parts of the compiler, so building/running has some value.
+
+//@ run-pass
+//@ edition:2021
+
+#[expect(dead_code)]
+struct Props {
+    field_1: u32,
+    field_2: u32,
+}
+
+fn main() {
+    // Test 1
+    let props_2 = Props { field_1: 1, field_2: 1 };
+
+    let _ = || {
+        let _: Props = props_2;
+    };
+
+    // Test 2
+    let mut arr = [1, 3, 4, 5];
+
+    let mref = &mut arr;
+
+    // These array patterns don't need to inspect the array, so the array
+    // isn't captured.
+    let _c = || match arr {
+        [_, _, _, _] => println!("C"),
+    };
+    let _d = || match arr {
+        [_, .., _] => println!("D"),
+    };
+    let _e = || match arr {
+        [_, ..] => println!("E"),
+    };
+
+    println!("{:#?}", mref);
+}
diff --git a/tests/ui/coherence/conflicting-impl-with-err.stderr b/tests/ui/coherence/conflicting-impl-with-err.stderr
index 3009b452dc7..75a201797b5 100644
--- a/tests/ui/coherence/conflicting-impl-with-err.stderr
+++ b/tests/ui/coherence/conflicting-impl-with-err.stderr
@@ -1,14 +1,18 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `nope`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nope`
   --> $DIR/conflicting-impl-with-err.rs:4:11
    |
 LL | impl From<nope::Thing> for Error {
-   |           ^^^^ use of undeclared crate or module `nope`
+   |           ^^^^ use of unresolved module or unlinked crate `nope`
+   |
+   = help: you might be missing a crate named `nope`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `nope`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nope`
   --> $DIR/conflicting-impl-with-err.rs:5:16
    |
 LL |     fn from(_: nope::Thing) -> Self {
-   |                ^^^^ use of undeclared crate or module `nope`
+   |                ^^^^ use of unresolved module or unlinked crate `nope`
+   |
+   = help: you might be missing a crate named `nope`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr b/tests/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr
index 1de1c78faf6..a506f2a282b 100644
--- a/tests/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr
+++ b/tests/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr
@@ -4,7 +4,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL | const fn bar() -> u32 { foo() }
    |                         ^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
diff --git a/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr b/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr
index 899cec07ac7..26dedc49a39 100644
--- a/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr
+++ b/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr
@@ -4,7 +4,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL | const fn bar() -> u32 { foo() }
    |                         ^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -22,7 +22,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL | const fn bar2() -> u32 { foo2() }
    |                          ^^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -57,7 +57,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL |     foo()
    |     ^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -75,7 +75,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL | const fn bar2_gated() -> u32 { foo2_gated() }
    |                                ^^^^^^^^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -93,7 +93,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL |     pub(crate) const fn bar2_gated_stable_indirect() -> u32 { super::foo2_gated() }
    |                                                               ^^^^^^^^^^^^^^^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL +     #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -111,7 +111,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL | const fn stable_indirect() -> u32 { foo2_gated() }
    |                                     ^^^^^^^^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
diff --git a/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr b/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr
index 442a079020f..b61f7db6f43 100644
--- a/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr
+++ b/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr
@@ -4,7 +4,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL | const unsafe fn bar() -> u32 { unsafe { foo() } }
    |                                         ^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -22,7 +22,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } }
    |                                          ^^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -40,7 +40,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL | const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } }
    |                                                ^^^^^^^^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
diff --git a/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr b/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr
index ff37cba7b9a..fad8e396e9a 100644
--- a/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr
+++ b/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr
@@ -4,7 +4,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL | const unsafe fn bar() -> u32 { foo() }
    |                                ^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -22,7 +22,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL | const unsafe fn bar2() -> u32 { foo2() }
    |                                 ^^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -40,7 +40,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL | const unsafe fn bar2_gated() -> u32 { foo2_gated() }
    |                                       ^^^^^^^^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
diff --git a/tests/ui/consts/min_const_fn/recursive_const_stab_unmarked_crate_imports.stderr b/tests/ui/consts/min_const_fn/recursive_const_stab_unmarked_crate_imports.stderr
index a655c0faab6..bbe749f5958 100644
--- a/tests/ui/consts/min_const_fn/recursive_const_stab_unmarked_crate_imports.stderr
+++ b/tests/ui/consts/min_const_fn/recursive_const_stab_unmarked_crate_imports.stderr
@@ -4,7 +4,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL |     unstable_if_unmarked_const_fn_crate::not_stably_const();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
diff --git a/tests/ui/consts/min_const_fn/recursive_const_stab_unstable_if_unmarked.stderr b/tests/ui/consts/min_const_fn/recursive_const_stab_unstable_if_unmarked.stderr
index d4ba0f9df2d..9d7b81c822b 100644
--- a/tests/ui/consts/min_const_fn/recursive_const_stab_unstable_if_unmarked.stderr
+++ b/tests/ui/consts/min_const_fn/recursive_const_stab_unstable_if_unmarked.stderr
@@ -4,7 +4,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL |     not_stably_const();
    |     ^^^^^^^^^^^^^^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
diff --git a/tests/ui/delegation/bad-resolve.rs b/tests/ui/delegation/bad-resolve.rs
index f15e6aa81af..861f2b15da2 100644
--- a/tests/ui/delegation/bad-resolve.rs
+++ b/tests/ui/delegation/bad-resolve.rs
@@ -40,7 +40,7 @@ impl Trait for S {
 }
 
 mod prefix {}
-reuse unresolved_prefix::{a, b, c}; //~ ERROR use of undeclared crate or module `unresolved_prefix`
+reuse unresolved_prefix::{a, b, c}; //~ ERROR use of unresolved module or unlinked crate
 reuse prefix::{self, super, crate}; //~ ERROR `crate` in paths can only be used in start position
 
 fn main() {}
diff --git a/tests/ui/delegation/bad-resolve.stderr b/tests/ui/delegation/bad-resolve.stderr
index 32d2f3b26cb..966387e1d61 100644
--- a/tests/ui/delegation/bad-resolve.stderr
+++ b/tests/ui/delegation/bad-resolve.stderr
@@ -81,11 +81,13 @@ LL |     type Type;
 LL | impl Trait for S {
    | ^^^^^^^^^^^^^^^^ missing `Type` in implementation
 
-error[E0433]: failed to resolve: use of undeclared crate or module `unresolved_prefix`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved_prefix`
   --> $DIR/bad-resolve.rs:43:7
    |
 LL | reuse unresolved_prefix::{a, b, c};
-   |       ^^^^^^^^^^^^^^^^^ use of undeclared crate or module `unresolved_prefix`
+   |       ^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `unresolved_prefix`
+   |
+   = help: you might be missing a crate named `unresolved_prefix`
 
 error[E0433]: failed to resolve: `crate` in paths can only be used in start position
   --> $DIR/bad-resolve.rs:44:29
diff --git a/tests/ui/delegation/glob-bad-path.rs b/tests/ui/delegation/glob-bad-path.rs
index 7bc4f0153a3..4ac9d68e8dd 100644
--- a/tests/ui/delegation/glob-bad-path.rs
+++ b/tests/ui/delegation/glob-bad-path.rs
@@ -5,7 +5,7 @@ trait Trait {}
 struct S;
 
 impl Trait for u8 {
-    reuse unresolved::*; //~ ERROR failed to resolve: use of undeclared crate or module `unresolved`
+    reuse unresolved::*; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `unresolved`
     reuse S::*; //~ ERROR expected trait, found struct `S`
 }
 
diff --git a/tests/ui/delegation/glob-bad-path.stderr b/tests/ui/delegation/glob-bad-path.stderr
index 0c06364b3f0..15d9ca41203 100644
--- a/tests/ui/delegation/glob-bad-path.stderr
+++ b/tests/ui/delegation/glob-bad-path.stderr
@@ -4,11 +4,11 @@ error: expected trait, found struct `S`
 LL |     reuse S::*;
    |           ^ not a trait
 
-error[E0433]: failed to resolve: use of undeclared crate or module `unresolved`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved`
   --> $DIR/glob-bad-path.rs:8:11
    |
 LL |     reuse unresolved::*;
-   |           ^^^^^^^^^^ use of undeclared crate or module `unresolved`
+   |           ^^^^^^^^^^ use of unresolved module or unlinked crate `unresolved`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/deriving/do-not-suggest-calling-fn-in-derive-macro.rs b/tests/ui/deriving/do-not-suggest-calling-fn-in-derive-macro.rs
new file mode 100644
index 00000000000..76b93c0c947
--- /dev/null
+++ b/tests/ui/deriving/do-not-suggest-calling-fn-in-derive-macro.rs
@@ -0,0 +1,8 @@
+use std::rc::Rc;
+
+#[derive(PartialEq)] //~ NOTE in this expansion
+pub struct Function {
+    callback: Rc<dyn Fn()>, //~ ERROR binary operation `==` cannot be applied to type `Rc<dyn Fn()>`
+}
+
+fn main() {}
diff --git a/tests/ui/deriving/do-not-suggest-calling-fn-in-derive-macro.stderr b/tests/ui/deriving/do-not-suggest-calling-fn-in-derive-macro.stderr
new file mode 100644
index 00000000000..40464a49c34
--- /dev/null
+++ b/tests/ui/deriving/do-not-suggest-calling-fn-in-derive-macro.stderr
@@ -0,0 +1,14 @@
+error[E0369]: binary operation `==` cannot be applied to type `Rc<dyn Fn()>`
+  --> $DIR/do-not-suggest-calling-fn-in-derive-macro.rs:5:5
+   |
+LL | #[derive(PartialEq)]
+   |          --------- in this derive macro expansion
+LL | pub struct Function {
+LL |     callback: Rc<dyn Fn()>,
+   |     ^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0369`.
diff --git a/tests/ui/diagnostic-width/non-copy-type-moved.rs b/tests/ui/diagnostic-width/non-copy-type-moved.rs
new file mode 100644
index 00000000000..a5593ad7b2a
--- /dev/null
+++ b/tests/ui/diagnostic-width/non-copy-type-moved.rs
@@ -0,0 +1,17 @@
+//@ compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
+//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"
+type A = (String, String, String, String);
+type B = (A, A, A, A);
+type C = (B, B, B, B);
+type D = (C, C, C, C);
+
+trait Trait {}
+
+fn require_trait<T: Trait>() {}
+
+fn foo(x: D) {
+    let _a = x;
+    let _b = x; //~ ERROR use of moved value
+}
+
+fn main() {}
diff --git a/tests/ui/diagnostic-width/non-copy-type-moved.stderr b/tests/ui/diagnostic-width/non-copy-type-moved.stderr
new file mode 100644
index 00000000000..da9385a5b4d
--- /dev/null
+++ b/tests/ui/diagnostic-width/non-copy-type-moved.stderr
@@ -0,0 +1,20 @@
+error[E0382]: use of moved value: `x`
+  --> $DIR/non-copy-type-moved.rs:14:14
+   |
+LL | fn foo(x: D) {
+   |        - move occurs because `x` has type `((..., ..., ..., ...), ..., ..., ...)`, which does not implement the `Copy` trait
+LL |     let _a = x;
+   |              - value moved here
+LL |     let _b = x;
+   |              ^ value used here after move
+   |
+   = note: the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/non-copy-type-moved/non-copy-type-moved.long-type-hash.txt'
+   = note: consider using `--verbose` to print the full type name to the console
+help: consider cloning the value if the performance cost is acceptable
+   |
+LL |     let _a = x.clone();
+   |               ++++++++
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0382`.
diff --git a/tests/ui/dyn-compatibility/default-param-self-projection.rs b/tests/ui/dyn-compatibility/default-param-self-projection.rs
new file mode 100644
index 00000000000..a440cd735da
--- /dev/null
+++ b/tests/ui/dyn-compatibility/default-param-self-projection.rs
@@ -0,0 +1,17 @@
+trait A<C = <Self as D>::E> {}
+
+trait D {
+    type E;
+}
+
+impl A<()> for () {}
+impl D for () {
+    type E = ();
+}
+
+fn f() {
+    let B: &dyn A = &();
+    //~^ ERROR the type parameter `C` must be explicitly specified
+}
+
+fn main() {}
diff --git a/tests/ui/dyn-compatibility/default-param-self-projection.stderr b/tests/ui/dyn-compatibility/default-param-self-projection.stderr
new file mode 100644
index 00000000000..ea252a99b04
--- /dev/null
+++ b/tests/ui/dyn-compatibility/default-param-self-projection.stderr
@@ -0,0 +1,18 @@
+error[E0393]: the type parameter `C` must be explicitly specified
+  --> $DIR/default-param-self-projection.rs:13:17
+   |
+LL | trait A<C = <Self as D>::E> {}
+   | --------------------------- type parameter `C` must be specified for this
+...
+LL |     let B: &dyn A = &();
+   |                 ^
+   |
+   = note: because the parameter default references `Self`, the parameter must be specified on the object type
+help: set the type parameter to the desired type
+   |
+LL |     let B: &dyn A<C> = &();
+   |                  +++
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0393`.
diff --git a/tests/ui/error-codes/E0393.stderr b/tests/ui/error-codes/E0393.stderr
index 489398b7be5..4847aa2508d 100644
--- a/tests/ui/error-codes/E0393.stderr
+++ b/tests/ui/error-codes/E0393.stderr
@@ -7,7 +7,7 @@ LL |
 LL | fn together_we_will_rule_the_galaxy(son: &dyn A) {}
    |                                               ^
    |
-   = note: because of the default `Self` reference, type parameters must be specified on object types
+   = note: because the parameter default references `Self`, the parameter must be specified on the object type
 help: set the type parameter to the desired type
    |
 LL | fn together_we_will_rule_the_galaxy(son: &dyn A<T>) {}
diff --git a/tests/ui/error-codes/E0432.stderr b/tests/ui/error-codes/E0432.stderr
index 36fefc95897..4ff8b40d196 100644
--- a/tests/ui/error-codes/E0432.stderr
+++ b/tests/ui/error-codes/E0432.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `something`
   --> $DIR/E0432.rs:1:5
    |
 LL | use something::Foo;
-   |     ^^^^^^^^^ you might be missing crate `something`
+   |     ^^^^^^^^^ use of unresolved module or unlinked crate `something`
    |
-help: consider importing the `something` crate
+help: you might be missing a crate named `something`, add it to your project and import it in your code
    |
 LL + extern crate something;
    |
diff --git a/tests/ui/extern-flag/multiple-opts.stderr b/tests/ui/extern-flag/multiple-opts.stderr
index 0aaca5ee253..d0f38bad94c 100644
--- a/tests/ui/extern-flag/multiple-opts.stderr
+++ b/tests/ui/extern-flag/multiple-opts.stderr
@@ -1,8 +1,10 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `somedep`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `somedep`
   --> $DIR/multiple-opts.rs:19:5
    |
 LL |     somedep::somefun();
-   |     ^^^^^^^ use of undeclared crate or module `somedep`
+   |     ^^^^^^^ use of unresolved module or unlinked crate `somedep`
+   |
+   = help: you might be missing a crate named `somedep`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/extern-flag/noprelude.stderr b/tests/ui/extern-flag/noprelude.stderr
index 23b9b2fd94b..fbd84956f66 100644
--- a/tests/ui/extern-flag/noprelude.stderr
+++ b/tests/ui/extern-flag/noprelude.stderr
@@ -1,8 +1,10 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `somedep`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `somedep`
   --> $DIR/noprelude.rs:6:5
    |
 LL |     somedep::somefun();
-   |     ^^^^^^^ use of undeclared crate or module `somedep`
+   |     ^^^^^^^ use of unresolved module or unlinked crate `somedep`
+   |
+   = help: you might be missing a crate named `somedep`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/feature-gates/feature-gate-optimize_attribute.rs b/tests/ui/feature-gates/feature-gate-optimize_attribute.rs
index 7f9cada6a47..77cc307c9f4 100644
--- a/tests/ui/feature-gates/feature-gate-optimize_attribute.rs
+++ b/tests/ui/feature-gates/feature-gate-optimize_attribute.rs
@@ -6,6 +6,9 @@ fn size() {}
 #[optimize(speed)] //~ ERROR the `#[optimize]` attribute is an experimental feature
 fn speed() {}
 
+#[optimize(none)] //~ ERROR the `#[optimize]` attribute is an experimental feature
+fn none() {}
+
 #[optimize(banana)]
 //~^ ERROR the `#[optimize]` attribute is an experimental feature
 //~| ERROR E0722
diff --git a/tests/ui/feature-gates/feature-gate-optimize_attribute.stderr b/tests/ui/feature-gates/feature-gate-optimize_attribute.stderr
index ca8f4a078f0..4e6e4ac2703 100644
--- a/tests/ui/feature-gates/feature-gate-optimize_attribute.stderr
+++ b/tests/ui/feature-gates/feature-gate-optimize_attribute.stderr
@@ -21,6 +21,16 @@ LL | #[optimize(speed)]
 error[E0658]: the `#[optimize]` attribute is an experimental feature
   --> $DIR/feature-gate-optimize_attribute.rs:9:1
    |
+LL | #[optimize(none)]
+   | ^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #54882 <https://github.com/rust-lang/rust/issues/54882> for more information
+   = help: add `#![feature(optimize_attribute)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+
+error[E0658]: the `#[optimize]` attribute is an experimental feature
+  --> $DIR/feature-gate-optimize_attribute.rs:12:1
+   |
 LL | #[optimize(banana)]
    | ^^^^^^^^^^^^^^^^^^^
    |
@@ -29,12 +39,12 @@ LL | #[optimize(banana)]
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0722]: invalid argument
-  --> $DIR/feature-gate-optimize_attribute.rs:9:12
+  --> $DIR/feature-gate-optimize_attribute.rs:12:12
    |
 LL | #[optimize(banana)]
    |            ^^^^^^
 
-error: aborting due to 4 previous errors
+error: aborting due to 5 previous errors
 
 Some errors have detailed explanations: E0658, E0722.
 For more information about an error, try `rustc --explain E0658`.
diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
index 141927b4de8..a196b8ecdb3 100644
--- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
+++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
@@ -81,20 +81,11 @@
 #![crate_name = "0900"]
 #![crate_type = "bin"] // cannot pass "0800" here
 
-#![crate_id = "10"]
-//~^ WARN use of deprecated attribute
-//~| HELP remove this attribute
-//~| NOTE `#[warn(deprecated)]` on by default
-
 // FIXME(#44232) we should warn that this isn't used.
 #![feature(rust1)]
 //~^ WARN no longer requires an attribute to enable
 //~| NOTE `#[warn(stable_features)]` on by default
 
-#![no_start]
-//~^ WARN use of deprecated attribute
-//~| HELP remove this attribute
-
 // (cannot easily gating state of crate-level #[no_main]; but non crate-level is below at "0400")
 #![no_builtins]
 #![recursion_limit = "0200"]
diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
index 18fb75aafbb..1c6868dc95d 100644
--- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
+++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
@@ -1,5 +1,5 @@
 warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:400:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:391:17
    |
 LL |     mod inner { #![macro_escape] }
    |                 ^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL |     mod inner { #![macro_escape] }
    = help: try an outer attribute: `#[macro_use]`
 
 warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:397:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:388:1
    |
 LL | #[macro_escape]
    | ^^^^^^^^^^^^^^^
@@ -42,166 +42,152 @@ warning: unknown lint: `x5100`
 LL | #![deny(x5100)]
    |         ^^^^^
 
-warning: use of deprecated attribute `crate_id`: no longer used
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:84:1
-   |
-LL | #![crate_id = "10"]
-   | ^^^^^^^^^^^^^^^^^^^ help: remove this attribute
-   |
-   = note: `#[warn(deprecated)]` on by default
-
-warning: use of deprecated attribute `no_start`: no longer used
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:94:1
-   |
-LL | #![no_start]
-   | ^^^^^^^^^^^^ help: remove this attribute
-
 warning: unknown lint: `x5400`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:105:8
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:96:8
    |
 LL | #[warn(x5400)]
    |        ^^^^^
 
 warning: unknown lint: `x5400`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:108:25
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:99:25
    |
 LL |     mod inner { #![warn(x5400)] }
    |                         ^^^^^
 
 warning: unknown lint: `x5400`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:111:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:102:12
    |
 LL |     #[warn(x5400)] fn f() { }
    |            ^^^^^
 
 warning: unknown lint: `x5400`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:114:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:105:12
    |
 LL |     #[warn(x5400)] struct S;
    |            ^^^^^
 
 warning: unknown lint: `x5400`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:117:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:108:12
    |
 LL |     #[warn(x5400)] type T = S;
    |            ^^^^^
 
 warning: unknown lint: `x5400`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:120:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:111:12
    |
 LL |     #[warn(x5400)] impl S { }
    |            ^^^^^
 
 warning: unknown lint: `x5300`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:124:9
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:115:9
    |
 LL | #[allow(x5300)]
    |         ^^^^^
 
 warning: unknown lint: `x5300`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:127:26
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:118:26
    |
 LL |     mod inner { #![allow(x5300)] }
    |                          ^^^^^
 
 warning: unknown lint: `x5300`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:130:13
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:121:13
    |
 LL |     #[allow(x5300)] fn f() { }
    |             ^^^^^
 
 warning: unknown lint: `x5300`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:133:13
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:124:13
    |
 LL |     #[allow(x5300)] struct S;
    |             ^^^^^
 
 warning: unknown lint: `x5300`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:136:13
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:127:13
    |
 LL |     #[allow(x5300)] type T = S;
    |             ^^^^^
 
 warning: unknown lint: `x5300`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:139:13
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:130:13
    |
 LL |     #[allow(x5300)] impl S { }
    |             ^^^^^
 
 warning: unknown lint: `x5200`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:143:10
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:134:10
    |
 LL | #[forbid(x5200)]
    |          ^^^^^
 
 warning: unknown lint: `x5200`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:146:27
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:137:27
    |
 LL |     mod inner { #![forbid(x5200)] }
    |                           ^^^^^
 
 warning: unknown lint: `x5200`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:149:14
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:140:14
    |
 LL |     #[forbid(x5200)] fn f() { }
    |              ^^^^^
 
 warning: unknown lint: `x5200`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:152:14
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:143:14
    |
 LL |     #[forbid(x5200)] struct S;
    |              ^^^^^
 
 warning: unknown lint: `x5200`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:155:14
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:146:14
    |
 LL |     #[forbid(x5200)] type T = S;
    |              ^^^^^
 
 warning: unknown lint: `x5200`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:158:14
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:149:14
    |
 LL |     #[forbid(x5200)] impl S { }
    |              ^^^^^
 
 warning: unknown lint: `x5100`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:162:8
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:153:8
    |
 LL | #[deny(x5100)]
    |        ^^^^^
 
 warning: unknown lint: `x5100`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:165:25
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:156:25
    |
 LL |     mod inner { #![deny(x5100)] }
    |                         ^^^^^
 
 warning: unknown lint: `x5100`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:168:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:159:12
    |
 LL |     #[deny(x5100)] fn f() { }
    |            ^^^^^
 
 warning: unknown lint: `x5100`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:171:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:162:12
    |
 LL |     #[deny(x5100)] struct S;
    |            ^^^^^
 
 warning: unknown lint: `x5100`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:174:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:165:12
    |
 LL |     #[deny(x5100)] type T = S;
    |            ^^^^^
 
 warning: unknown lint: `x5100`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:177:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:168:12
    |
 LL |     #[deny(x5100)] impl S { }
    |            ^^^^^
 
 warning: `#[macro_export]` only has an effect on macro definitions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:198:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:189:1
    |
 LL | #[macro_export]
    | ^^^^^^^^^^^^^^^
@@ -213,13 +199,13 @@ LL | #![warn(unused_attributes, unknown_lints)]
    |         ^^^^^^^^^^^^^^^^^
 
 warning: `#[automatically_derived]` only has an effect on implementation blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:266:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:257:1
    |
 LL | #[automatically_derived]
    | ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: attribute should be applied to a free function, impl method or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:284:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:275:1
    |
 LL |   #[no_mangle]
    |   ^^^^^^^^^^^^
@@ -234,31 +220,31 @@ LL | | }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: `#[should_panic]` only has an effect on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:324:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:315:1
    |
 LL | #[should_panic]
    | ^^^^^^^^^^^^^^^
 
 warning: `#[ignore]` only has an effect on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:342:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:333:1
    |
 LL | #[ignore]
    | ^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:377:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:368:1
    |
 LL | #[reexport_test_harness_main = "2900"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:417:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:408:1
    |
 LL | #[no_std]
    | ^^^^^^^^^
 
 warning: attribute should be applied to a function definition
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:453:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:444:1
    |
 LL |   #[cold]
    |   ^^^^^^^
@@ -274,7 +260,7 @@ LL | | }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a foreign function or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:482:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:473:1
    |
 LL |   #[link_name = "1900"]
    |   ^^^^^^^^^^^^^^^^^^^^^
@@ -290,7 +276,7 @@ LL | | }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a function or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:521:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:1
    |
 LL |   #[link_section = "1800"]
    |   ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -306,7 +292,7 @@ LL | | }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:553:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:544:1
    |
 LL |   #[link()]
    |   ^^^^^^^^^
@@ -322,55 +308,55 @@ LL | | }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: `#[must_use]` has no effect when applied to a module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:604:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:595:1
    |
 LL | #[must_use]
    | ^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:617:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:608:1
    |
 LL | #[windows_subsystem = "windows"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:638:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:629:1
    |
 LL | #[crate_name = "0900"]
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:657:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:648:1
    |
 LL | #[crate_type = "0800"]
    | ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:676:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:1
    |
 LL | #[feature(x0600)]
    | ^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:1
    |
 LL | #[no_main]
    | ^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:715:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:1
    |
 LL | #[no_builtins]
    | ^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:734:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:1
    |
 LL | #[recursion_limit="0200"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:1
    |
 LL | #[type_length_limit="0100"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -432,109 +418,109 @@ LL | #![must_use]
    | ^^^^^^^^^^^^
 
 warning: `#[macro_use]` only has an effect on `extern crate` and modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:185:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:176:5
    |
 LL |     #[macro_use] fn f() { }
    |     ^^^^^^^^^^^^
 
 warning: `#[macro_use]` only has an effect on `extern crate` and modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:188:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:179:5
    |
 LL |     #[macro_use] struct S;
    |     ^^^^^^^^^^^^
 
 warning: `#[macro_use]` only has an effect on `extern crate` and modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:191:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:182:5
    |
 LL |     #[macro_use] type T = S;
    |     ^^^^^^^^^^^^
 
 warning: `#[macro_use]` only has an effect on `extern crate` and modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:194:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:185:5
    |
 LL |     #[macro_use] impl S { }
    |     ^^^^^^^^^^^^
 
 warning: `#[macro_export]` only has an effect on macro definitions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:201:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:192:17
    |
 LL |     mod inner { #![macro_export] }
    |                 ^^^^^^^^^^^^^^^^
 
 warning: `#[macro_export]` only has an effect on macro definitions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:204:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:195:5
    |
 LL |     #[macro_export] fn f() { }
    |     ^^^^^^^^^^^^^^^
 
 warning: `#[macro_export]` only has an effect on macro definitions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:207:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:198:5
    |
 LL |     #[macro_export] struct S;
    |     ^^^^^^^^^^^^^^^
 
 warning: `#[macro_export]` only has an effect on macro definitions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:210:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:201:5
    |
 LL |     #[macro_export] type T = S;
    |     ^^^^^^^^^^^^^^^
 
 warning: `#[macro_export]` only has an effect on macro definitions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:213:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:204:5
    |
 LL |     #[macro_export] impl S { }
    |     ^^^^^^^^^^^^^^^
 
 warning: `#[path]` only has an effect on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:253:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:244:5
    |
 LL |     #[path = "3800"] fn f() { }
    |     ^^^^^^^^^^^^^^^^
 
 warning: `#[path]` only has an effect on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:256:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:247:5
    |
 LL |     #[path = "3800"]  struct S;
    |     ^^^^^^^^^^^^^^^^
 
 warning: `#[path]` only has an effect on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:259:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:250:5
    |
 LL |     #[path = "3800"] type T = S;
    |     ^^^^^^^^^^^^^^^^
 
 warning: `#[path]` only has an effect on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:262:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:253:5
    |
 LL |     #[path = "3800"] impl S { }
    |     ^^^^^^^^^^^^^^^^
 
 warning: `#[automatically_derived]` only has an effect on implementation blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:269:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:260:17
    |
 LL |     mod inner { #![automatically_derived] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: `#[automatically_derived]` only has an effect on implementation blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:272:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:263:5
    |
 LL |     #[automatically_derived] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: `#[automatically_derived]` only has an effect on implementation blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:275:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:266:5
    |
 LL |     #[automatically_derived] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: `#[automatically_derived]` only has an effect on implementation blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:278:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:269:5
    |
 LL |     #[automatically_derived] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: attribute should be applied to a free function, impl method or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:289:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:280:17
    |
 LL |     mod inner { #![no_mangle] }
    |     ------------^^^^^^^^^^^^^-- not a free function, impl method or static
@@ -542,7 +528,7 @@ LL |     mod inner { #![no_mangle] }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a free function, impl method or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:296:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:287:5
    |
 LL |     #[no_mangle] struct S;
    |     ^^^^^^^^^^^^ --------- not a free function, impl method or static
@@ -550,7 +536,7 @@ LL |     #[no_mangle] struct S;
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a free function, impl method or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:301:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:292:5
    |
 LL |     #[no_mangle] type T = S;
    |     ^^^^^^^^^^^^ ----------- not a free function, impl method or static
@@ -558,7 +544,7 @@ LL |     #[no_mangle] type T = S;
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a free function, impl method or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:306:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:297:5
    |
 LL |     #[no_mangle] impl S { }
    |     ^^^^^^^^^^^^ ---------- not a free function, impl method or static
@@ -566,7 +552,7 @@ LL |     #[no_mangle] impl S { }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a free function, impl method or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:312:9
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:303:9
    |
 LL |         #[no_mangle] fn foo();
    |         ^^^^^^^^^^^^ --------- not a free function, impl method or static
@@ -574,7 +560,7 @@ LL |         #[no_mangle] fn foo();
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a free function, impl method or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:317:9
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:308:9
    |
 LL |         #[no_mangle] fn bar() {}
    |         ^^^^^^^^^^^^ ----------- not a free function, impl method or static
@@ -582,163 +568,163 @@ LL |         #[no_mangle] fn bar() {}
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: `#[should_panic]` only has an effect on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:327:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:318:17
    |
 LL |     mod inner { #![should_panic] }
    |                 ^^^^^^^^^^^^^^^^
 
 warning: `#[should_panic]` only has an effect on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:332:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:323:5
    |
 LL |     #[should_panic] struct S;
    |     ^^^^^^^^^^^^^^^
 
 warning: `#[should_panic]` only has an effect on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:335:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:326:5
    |
 LL |     #[should_panic] type T = S;
    |     ^^^^^^^^^^^^^^^
 
 warning: `#[should_panic]` only has an effect on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:338:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:329:5
    |
 LL |     #[should_panic] impl S { }
    |     ^^^^^^^^^^^^^^^
 
 warning: `#[ignore]` only has an effect on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:345:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:336:17
    |
 LL |     mod inner { #![ignore] }
    |                 ^^^^^^^^^^
 
 warning: `#[ignore]` only has an effect on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:350:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:341:5
    |
 LL |     #[ignore] struct S;
    |     ^^^^^^^^^
 
 warning: `#[ignore]` only has an effect on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:353:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:344:5
    |
 LL |     #[ignore] type T = S;
    |     ^^^^^^^^^
 
 warning: `#[ignore]` only has an effect on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:356:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:347:5
    |
 LL |     #[ignore] impl S { }
    |     ^^^^^^^^^
 
 warning: `#[no_implicit_prelude]` only has an effect on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:364:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:355:5
    |
 LL |     #[no_implicit_prelude] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: `#[no_implicit_prelude]` only has an effect on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:367:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:358:5
    |
 LL |     #[no_implicit_prelude] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: `#[no_implicit_prelude]` only has an effect on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:370:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:361:5
    |
 LL |     #[no_implicit_prelude] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: `#[no_implicit_prelude]` only has an effect on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:373:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:364:5
    |
 LL |     #[no_implicit_prelude] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:380:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:371:17
    |
 LL |     mod inner { #![reexport_test_harness_main="2900"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:383:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:374:5
    |
 LL |     #[reexport_test_harness_main = "2900"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:386:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:377:5
    |
 LL |     #[reexport_test_harness_main = "2900"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:389:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:380:5
    |
 LL |     #[reexport_test_harness_main = "2900"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:392:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:383:5
    |
 LL |     #[reexport_test_harness_main = "2900"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: `#[macro_escape]` only has an effect on `extern crate` and modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:404:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:395:5
    |
 LL |     #[macro_escape] fn f() { }
    |     ^^^^^^^^^^^^^^^
 
 warning: `#[macro_escape]` only has an effect on `extern crate` and modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:407:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:398:5
    |
 LL |     #[macro_escape] struct S;
    |     ^^^^^^^^^^^^^^^
 
 warning: `#[macro_escape]` only has an effect on `extern crate` and modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:410:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:5
    |
 LL |     #[macro_escape] type T = S;
    |     ^^^^^^^^^^^^^^^
 
 warning: `#[macro_escape]` only has an effect on `extern crate` and modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:413:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:404:5
    |
 LL |     #[macro_escape] impl S { }
    |     ^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:420:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:411:17
    |
 LL |     mod inner { #![no_std] }
    |                 ^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:423:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:414:5
    |
 LL |     #[no_std] fn f() { }
    |     ^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:417:5
    |
 LL |     #[no_std] struct S;
    |     ^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:429:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:420:5
    |
 LL |     #[no_std] type T = S;
    |     ^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:432:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:423:5
    |
 LL |     #[no_std] impl S { }
    |     ^^^^^^^^^
 
 warning: attribute should be applied to a function definition
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:459:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:450:17
    |
 LL |     mod inner { #![cold] }
    |     ------------^^^^^^^^-- not a function definition
@@ -746,7 +732,7 @@ LL |     mod inner { #![cold] }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a function definition
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:466:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:457:5
    |
 LL |     #[cold] struct S;
    |     ^^^^^^^ --------- not a function definition
@@ -754,7 +740,7 @@ LL |     #[cold] struct S;
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a function definition
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:471:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:5
    |
 LL |     #[cold] type T = S;
    |     ^^^^^^^ ----------- not a function definition
@@ -762,7 +748,7 @@ LL |     #[cold] type T = S;
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a function definition
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:467:5
    |
 LL |     #[cold] impl S { }
    |     ^^^^^^^ ---------- not a function definition
@@ -770,7 +756,7 @@ LL |     #[cold] impl S { }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a foreign function or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:488:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:479:5
    |
 LL |     #[link_name = "1900"]
    |     ^^^^^^^^^^^^^^^^^^^^^
@@ -780,13 +766,13 @@ LL |     extern "C" { }
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 help: try `#[link(name = "1900")]` instead
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:488:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:479:5
    |
 LL |     #[link_name = "1900"]
    |     ^^^^^^^^^^^^^^^^^^^^^
 
 warning: attribute should be applied to a foreign function or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:495:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:486:17
    |
 LL |     mod inner { #![link_name="1900"] }
    |     ------------^^^^^^^^^^^^^^^^^^^^-- not a foreign function or static
@@ -794,7 +780,7 @@ LL |     mod inner { #![link_name="1900"] }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a foreign function or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:500:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:491:5
    |
 LL |     #[link_name = "1900"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static
@@ -802,7 +788,7 @@ LL |     #[link_name = "1900"] fn f() { }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a foreign function or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:505:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:496:5
    |
 LL |     #[link_name = "1900"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^ --------- not a foreign function or static
@@ -810,7 +796,7 @@ LL |     #[link_name = "1900"] struct S;
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a foreign function or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:510:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:501:5
    |
 LL |     #[link_name = "1900"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^ ----------- not a foreign function or static
@@ -818,7 +804,7 @@ LL |     #[link_name = "1900"] type T = S;
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a foreign function or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:515:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:506:5
    |
 LL |     #[link_name = "1900"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static
@@ -826,7 +812,7 @@ LL |     #[link_name = "1900"] impl S { }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a function or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:527:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:518:17
    |
 LL |     mod inner { #![link_section="1800"] }
    |     ------------^^^^^^^^^^^^^^^^^^^^^^^-- not a function or static
@@ -834,7 +820,7 @@ LL |     mod inner { #![link_section="1800"] }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a function or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:534:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:525:5
    |
 LL |     #[link_section = "1800"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ --------- not a function or static
@@ -842,7 +828,7 @@ LL |     #[link_section = "1800"] struct S;
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a function or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:539:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:530:5
    |
 LL |     #[link_section = "1800"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ ----------- not a function or static
@@ -850,7 +836,7 @@ LL |     #[link_section = "1800"] type T = S;
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to a function or static
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:544:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:535:5
    |
 LL |     #[link_section = "1800"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ ---------- not a function or static
@@ -858,7 +844,7 @@ LL |     #[link_section = "1800"] impl S { }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:559:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:550:17
    |
 LL |     mod inner { #![link()] }
    |     ------------^^^^^^^^^^-- not an `extern` block
@@ -866,7 +852,7 @@ LL |     mod inner { #![link()] }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:564:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:555:5
    |
 LL |     #[link()] fn f() { }
    |     ^^^^^^^^^ ---------- not an `extern` block
@@ -874,7 +860,7 @@ LL |     #[link()] fn f() { }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:569:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:560:5
    |
 LL |     #[link()] struct S;
    |     ^^^^^^^^^ --------- not an `extern` block
@@ -882,7 +868,7 @@ LL |     #[link()] struct S;
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:574:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:565:5
    |
 LL |     #[link()] type T = S;
    |     ^^^^^^^^^ ----------- not an `extern` block
@@ -890,7 +876,7 @@ LL |     #[link()] type T = S;
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:579:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:570:5
    |
 LL |     #[link()] impl S { }
    |     ^^^^^^^^^ ---------- not an `extern` block
@@ -898,7 +884,7 @@ LL |     #[link()] impl S { }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:584:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:575:5
    |
 LL |     #[link()] extern "Rust" {}
    |     ^^^^^^^^^
@@ -906,270 +892,270 @@ LL |     #[link()] extern "Rust" {}
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: `#[must_use]` has no effect when applied to a module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:606:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:597:17
    |
 LL |     mod inner { #![must_use] }
    |                 ^^^^^^^^^^^^
 
 warning: `#[must_use]` has no effect when applied to a type alias
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:612:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:603:5
    |
 LL |     #[must_use] type T = S;
    |     ^^^^^^^^^^^
 
 warning: `#[must_use]` has no effect when applied to an implementation block
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:614:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:605:5
    |
 LL |     #[must_use] impl S { }
    |     ^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:620:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:611:17
    |
 LL |     mod inner { #![windows_subsystem="windows"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:623:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:614:5
    |
 LL |     #[windows_subsystem = "windows"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:626:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:617:5
    |
 LL |     #[windows_subsystem = "windows"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:629:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:620:5
    |
 LL |     #[windows_subsystem = "windows"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:632:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:623:5
    |
 LL |     #[windows_subsystem = "windows"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:641:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:632:17
    |
 LL |     mod inner { #![crate_name="0900"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:644:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:635:5
    |
 LL |     #[crate_name = "0900"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:647:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:638:5
    |
 LL |     #[crate_name = "0900"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:650:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:641:5
    |
 LL |     #[crate_name = "0900"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:653:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:644:5
    |
 LL |     #[crate_name = "0900"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:660:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:651:17
    |
 LL |     mod inner { #![crate_type="0800"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:654:5
    |
 LL |     #[crate_type = "0800"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:666:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:657:5
    |
 LL |     #[crate_type = "0800"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:669:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:660:5
    |
 LL |     #[crate_type = "0800"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:672:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:5
    |
 LL |     #[crate_type = "0800"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:670:17
    |
 LL |     mod inner { #![feature(x0600)] }
    |                 ^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:682:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:673:5
    |
 LL |     #[feature(x0600)] fn f() { }
    |     ^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:685:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:676:5
    |
 LL |     #[feature(x0600)] struct S;
    |     ^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:5
    |
 LL |     #[feature(x0600)] type T = S;
    |     ^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:682:5
    |
 LL |     #[feature(x0600)] impl S { }
    |     ^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:690:17
    |
 LL |     mod inner { #![no_main] }
    |                 ^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:702:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:693:5
    |
 LL |     #[no_main] fn f() { }
    |     ^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:705:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5
    |
 LL |     #[no_main] struct S;
    |     ^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5
    |
 LL |     #[no_main] type T = S;
    |     ^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:711:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:702:5
    |
 LL |     #[no_main] impl S { }
    |     ^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:709:17
    |
 LL |     mod inner { #![no_builtins] }
    |                 ^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:5
    |
 LL |     #[no_builtins] fn f() { }
    |     ^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:715:5
    |
 LL |     #[no_builtins] struct S;
    |     ^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:727:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:5
    |
 LL |     #[no_builtins] type T = S;
    |     ^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:730:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5
    |
 LL |     #[no_builtins] impl S { }
    |     ^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:17
    |
 LL |     mod inner { #![recursion_limit="0200"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:740:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:731:5
    |
 LL |     #[recursion_limit="0200"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:734:5
    |
 LL |     #[recursion_limit="0200"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:746:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:5
    |
 LL |     #[recursion_limit="0200"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:740:5
    |
 LL |     #[recursion_limit="0200"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:756:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:747:17
    |
 LL |     mod inner { #![type_length_limit="0100"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:5
    |
 LL |     #[type_length_limit="0100"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:762:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:5
    |
 LL |     #[type_length_limit="0100"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:765:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:756:5
    |
 LL |     #[type_length_limit="0100"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:768:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5
    |
 LL |     #[type_length_limit="0100"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:90:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:85:12
    |
 LL | #![feature(rust1)]
    |            ^^^^^
    |
    = note: `#[warn(stable_features)]` on by default
 
-warning: 173 warnings emitted
+warning: 171 warnings emitted
 
diff --git a/tests/ui/foreign/stashed-issue-121451.rs b/tests/ui/foreign/stashed-issue-121451.rs
index 97a4af37475..77a736739bf 100644
--- a/tests/ui/foreign/stashed-issue-121451.rs
+++ b/tests/ui/foreign/stashed-issue-121451.rs
@@ -1,4 +1,4 @@
 extern "C" fn _f() -> libc::uintptr_t {}
-//~^ ERROR failed to resolve: use of undeclared crate or module `libc`
+//~^ ERROR failed to resolve
 
 fn main() {}
diff --git a/tests/ui/foreign/stashed-issue-121451.stderr b/tests/ui/foreign/stashed-issue-121451.stderr
index 440d98d6f46..31dd3b4fb5e 100644
--- a/tests/ui/foreign/stashed-issue-121451.stderr
+++ b/tests/ui/foreign/stashed-issue-121451.stderr
@@ -1,8 +1,10 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `libc`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `libc`
   --> $DIR/stashed-issue-121451.rs:1:23
    |
 LL | extern "C" fn _f() -> libc::uintptr_t {}
-   |                       ^^^^ use of undeclared crate or module `libc`
+   |                       ^^^^ use of unresolved module or unlinked crate `libc`
+   |
+   = help: you might be missing a crate named `libc`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs b/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs
index aaf831d1983..71c33674b37 100644
--- a/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs
+++ b/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs
@@ -10,7 +10,7 @@ macro a() {
     mod u {
         // Late resolution.
         fn f() { my_core::mem::drop(0); }
-        //~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
+        //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core`
     }
 }
 
@@ -23,7 +23,7 @@ mod v {
 mod u {
     // Late resolution.
     fn f() { my_core::mem::drop(0); }
-    //~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
+    //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core`
 }
 
 fn main() {}
diff --git a/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.stderr b/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.stderr
index cc229764ad3..87ef07c27f5 100644
--- a/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.stderr
+++ b/tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.stderr
@@ -15,25 +15,27 @@ LL | a!();
    |
    = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0433]: failed to resolve: use of undeclared crate or module `my_core`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core`
   --> $DIR/extern-prelude-from-opaque-fail-2018.rs:12:18
    |
 LL |         fn f() { my_core::mem::drop(0); }
-   |                  ^^^^^^^ use of undeclared crate or module `my_core`
+   |                  ^^^^^^^ use of unresolved module or unlinked crate `my_core`
 ...
 LL | a!();
    | ---- in this macro invocation
    |
+   = help: you might be missing a crate named `my_core`
    = help: consider importing this module:
            std::mem
    = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0433]: failed to resolve: use of undeclared crate or module `my_core`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core`
   --> $DIR/extern-prelude-from-opaque-fail-2018.rs:25:14
    |
 LL |     fn f() { my_core::mem::drop(0); }
-   |              ^^^^^^^ use of undeclared crate or module `my_core`
+   |              ^^^^^^^ use of unresolved module or unlinked crate `my_core`
    |
+   = help: you might be missing a crate named `my_core`
 help: consider importing this module
    |
 LL +     use std::mem;
diff --git a/tests/ui/hygiene/extern-prelude-from-opaque-fail.rs b/tests/ui/hygiene/extern-prelude-from-opaque-fail.rs
index be3102aeab0..8265b73cc56 100644
--- a/tests/ui/hygiene/extern-prelude-from-opaque-fail.rs
+++ b/tests/ui/hygiene/extern-prelude-from-opaque-fail.rs
@@ -10,7 +10,7 @@ macro a() {
     mod u {
         // Late resolution.
         fn f() { my_core::mem::drop(0); }
-        //~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
+        //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core`
     }
 }
 
@@ -23,7 +23,7 @@ mod v {
 mod u {
     // Late resolution.
     fn f() { my_core::mem::drop(0); }
-    //~^ ERROR failed to resolve: use of undeclared crate or module `my_core`
+    //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core`
 }
 
 fn main() {}
diff --git a/tests/ui/hygiene/extern-prelude-from-opaque-fail.stderr b/tests/ui/hygiene/extern-prelude-from-opaque-fail.stderr
index 13b2827ef39..d36bc913095 100644
--- a/tests/ui/hygiene/extern-prelude-from-opaque-fail.stderr
+++ b/tests/ui/hygiene/extern-prelude-from-opaque-fail.stderr
@@ -15,25 +15,27 @@ LL | a!();
    |
    = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0433]: failed to resolve: use of undeclared crate or module `my_core`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core`
   --> $DIR/extern-prelude-from-opaque-fail.rs:12:18
    |
 LL |         fn f() { my_core::mem::drop(0); }
-   |                  ^^^^^^^ use of undeclared crate or module `my_core`
+   |                  ^^^^^^^ use of unresolved module or unlinked crate `my_core`
 ...
 LL | a!();
    | ---- in this macro invocation
    |
+   = help: you might be missing a crate named `my_core`
    = help: consider importing this module:
            my_core::mem
    = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0433]: failed to resolve: use of undeclared crate or module `my_core`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core`
   --> $DIR/extern-prelude-from-opaque-fail.rs:25:14
    |
 LL |     fn f() { my_core::mem::drop(0); }
-   |              ^^^^^^^ use of undeclared crate or module `my_core`
+   |              ^^^^^^^ use of unresolved module or unlinked crate `my_core`
    |
+   = help: you might be missing a crate named `my_core`
 help: consider importing this module
    |
 LL +     use my_core::mem;
diff --git a/tests/ui/impl-trait/issue-72911.stderr b/tests/ui/impl-trait/issue-72911.stderr
index 0e86561aa27..063b7f68dc0 100644
--- a/tests/ui/impl-trait/issue-72911.stderr
+++ b/tests/ui/impl-trait/issue-72911.stderr
@@ -1,14 +1,18 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `foo`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
   --> $DIR/issue-72911.rs:11:33
    |
 LL | fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint> {
-   |                                 ^^^ use of undeclared crate or module `foo`
+   |                                 ^^^ use of unresolved module or unlinked crate `foo`
+   |
+   = help: you might be missing a crate named `foo`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `foo`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
   --> $DIR/issue-72911.rs:16:41
    |
 LL | fn lint_files() -> impl Iterator<Item = foo::MissingItem> {
-   |                                         ^^^ use of undeclared crate or module `foo`
+   |                                         ^^^ use of unresolved module or unlinked crate `foo`
+   |
+   = help: you might be missing a crate named `foo`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/impl-trait/stashed-diag-issue-121504.rs b/tests/ui/impl-trait/stashed-diag-issue-121504.rs
index 4ac8ffe8931..84686ba4f7d 100644
--- a/tests/ui/impl-trait/stashed-diag-issue-121504.rs
+++ b/tests/ui/impl-trait/stashed-diag-issue-121504.rs
@@ -4,7 +4,7 @@ trait MyTrait {
     async fn foo(self) -> (Self, i32);
 }
 
-impl MyTrait for xyz::T { //~ ERROR failed to resolve: use of undeclared crate or module `xyz`
+impl MyTrait for xyz::T { //~ ERROR failed to resolve: use of unresolved module or unlinked crate `xyz`
     async fn foo(self, key: i32) -> (u32, i32) {
         (self, key)
     }
diff --git a/tests/ui/impl-trait/stashed-diag-issue-121504.stderr b/tests/ui/impl-trait/stashed-diag-issue-121504.stderr
index 6a881dc7f9f..41c6cc42555 100644
--- a/tests/ui/impl-trait/stashed-diag-issue-121504.stderr
+++ b/tests/ui/impl-trait/stashed-diag-issue-121504.stderr
@@ -1,8 +1,10 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `xyz`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `xyz`
   --> $DIR/stashed-diag-issue-121504.rs:7:18
    |
 LL | impl MyTrait for xyz::T {
-   |                  ^^^ use of undeclared crate or module `xyz`
+   |                  ^^^ use of unresolved module or unlinked crate `xyz`
+   |
+   = help: you might be missing a crate named `xyz`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/imports/extern-prelude-extern-crate-fail.rs b/tests/ui/imports/extern-prelude-extern-crate-fail.rs
index 2f018851d19..84751ecc02b 100644
--- a/tests/ui/imports/extern-prelude-extern-crate-fail.rs
+++ b/tests/ui/imports/extern-prelude-extern-crate-fail.rs
@@ -7,7 +7,7 @@ mod n {
 
 mod m {
     fn check() {
-        two_macros::m!(); //~ ERROR failed to resolve: use of undeclared crate or module `two_macros`
+        two_macros::m!(); //~ ERROR failed to resolve: use of unresolved module or unlinked crate `two_macros`
     }
 }
 
diff --git a/tests/ui/imports/extern-prelude-extern-crate-fail.stderr b/tests/ui/imports/extern-prelude-extern-crate-fail.stderr
index f7e37449eeb..ec53730afa0 100644
--- a/tests/ui/imports/extern-prelude-extern-crate-fail.stderr
+++ b/tests/ui/imports/extern-prelude-extern-crate-fail.stderr
@@ -9,11 +9,11 @@ LL | define_std_as_non_existent!();
    |
    = note: this error originates in the macro `define_std_as_non_existent` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0433]: failed to resolve: use of undeclared crate or module `two_macros`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `two_macros`
   --> $DIR/extern-prelude-extern-crate-fail.rs:10:9
    |
 LL |         two_macros::m!();
-   |         ^^^^^^^^^^ use of undeclared crate or module `two_macros`
+   |         ^^^^^^^^^^ use of unresolved module or unlinked crate `two_macros`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/imports/import-from-missing-star-2.stderr b/tests/ui/imports/import-from-missing-star-2.stderr
index dd35627c684..9fe2bdbcfa2 100644
--- a/tests/ui/imports/import-from-missing-star-2.stderr
+++ b/tests/ui/imports/import-from-missing-star-2.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `spam`
   --> $DIR/import-from-missing-star-2.rs:2:9
    |
 LL |     use spam::*;
-   |         ^^^^ you might be missing crate `spam`
+   |         ^^^^ use of unresolved module or unlinked crate `spam`
    |
-help: consider importing the `spam` crate
+help: you might be missing a crate named `spam`, add it to your project and import it in your code
    |
 LL + extern crate spam;
    |
diff --git a/tests/ui/imports/import-from-missing-star-3.stderr b/tests/ui/imports/import-from-missing-star-3.stderr
index 1e2412b0959..c0b2e5675d3 100644
--- a/tests/ui/imports/import-from-missing-star-3.stderr
+++ b/tests/ui/imports/import-from-missing-star-3.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `spam`
   --> $DIR/import-from-missing-star-3.rs:2:9
    |
 LL |     use spam::*;
-   |         ^^^^ you might be missing crate `spam`
+   |         ^^^^ use of unresolved module or unlinked crate `spam`
    |
-help: consider importing the `spam` crate
+help: you might be missing a crate named `spam`, add it to your project and import it in your code
    |
 LL + extern crate spam;
    |
@@ -13,9 +13,9 @@ error[E0432]: unresolved import `spam`
   --> $DIR/import-from-missing-star-3.rs:27:13
    |
 LL |         use spam::*;
-   |             ^^^^ you might be missing crate `spam`
+   |             ^^^^ use of unresolved module or unlinked crate `spam`
    |
-help: consider importing the `spam` crate
+help: you might be missing a crate named `spam`, add it to your project and import it in your code
    |
 LL + extern crate spam;
    |
diff --git a/tests/ui/imports/import-from-missing-star.stderr b/tests/ui/imports/import-from-missing-star.stderr
index c9bb9baeb4d..768e1ea1e2c 100644
--- a/tests/ui/imports/import-from-missing-star.stderr
+++ b/tests/ui/imports/import-from-missing-star.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `spam`
   --> $DIR/import-from-missing-star.rs:1:5
    |
 LL | use spam::*;
-   |     ^^^^ you might be missing crate `spam`
+   |     ^^^^ use of unresolved module or unlinked crate `spam`
    |
-help: consider importing the `spam` crate
+help: you might be missing a crate named `spam`, add it to your project and import it in your code
    |
 LL + extern crate spam;
    |
diff --git a/tests/ui/imports/import3.stderr b/tests/ui/imports/import3.stderr
index 157b5b63566..7f581146781 100644
--- a/tests/ui/imports/import3.stderr
+++ b/tests/ui/imports/import3.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `main`
   --> $DIR/import3.rs:2:5
    |
 LL | use main::bar;
-   |     ^^^^ you might be missing crate `main`
+   |     ^^^^ use of unresolved module or unlinked crate `main`
    |
-help: consider importing the `main` crate
+help: you might be missing a crate named `main`, add it to your project and import it in your code
    |
 LL + extern crate main;
    |
diff --git a/tests/ui/imports/issue-109343.stderr b/tests/ui/imports/issue-109343.stderr
index e66528e8df5..e1071e45b92 100644
--- a/tests/ui/imports/issue-109343.stderr
+++ b/tests/ui/imports/issue-109343.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `unresolved`
   --> $DIR/issue-109343.rs:4:9
    |
 LL | pub use unresolved::f;
-   |         ^^^^^^^^^^ you might be missing crate `unresolved`
+   |         ^^^^^^^^^^ use of unresolved module or unlinked crate `unresolved`
    |
-help: consider importing the `unresolved` crate
+help: you might be missing a crate named `unresolved`, add it to your project and import it in your code
    |
 LL + extern crate unresolved;
    |
diff --git a/tests/ui/imports/issue-1697.rs b/tests/ui/imports/issue-1697.rs
index 019237611df..3d3d4a17d6c 100644
--- a/tests/ui/imports/issue-1697.rs
+++ b/tests/ui/imports/issue-1697.rs
@@ -2,7 +2,7 @@
 
 use unresolved::*;
 //~^ ERROR unresolved import `unresolved` [E0432]
-//~| NOTE you might be missing crate `unresolved`
-//~| HELP consider importing the `unresolved` crate
+//~| NOTE use of unresolved module or unlinked crate `unresolved`
+//~| HELP you might be missing a crate named `unresolved`
 
 fn main() {}
diff --git a/tests/ui/imports/issue-1697.stderr b/tests/ui/imports/issue-1697.stderr
index ec0d94bd672..96e371c64f9 100644
--- a/tests/ui/imports/issue-1697.stderr
+++ b/tests/ui/imports/issue-1697.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `unresolved`
   --> $DIR/issue-1697.rs:3:5
    |
 LL | use unresolved::*;
-   |     ^^^^^^^^^^ you might be missing crate `unresolved`
+   |     ^^^^^^^^^^ use of unresolved module or unlinked crate `unresolved`
    |
-help: consider importing the `unresolved` crate
+help: you might be missing a crate named `unresolved`, add it to your project and import it in your code
    |
 LL + extern crate unresolved;
    |
diff --git a/tests/ui/imports/issue-33464.stderr b/tests/ui/imports/issue-33464.stderr
index 28fbcee401f..dba45184675 100644
--- a/tests/ui/imports/issue-33464.stderr
+++ b/tests/ui/imports/issue-33464.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `abc`
   --> $DIR/issue-33464.rs:3:5
    |
 LL | use abc::one_el;
-   |     ^^^ you might be missing crate `abc`
+   |     ^^^ use of unresolved module or unlinked crate `abc`
    |
-help: consider importing the `abc` crate
+help: you might be missing a crate named `abc`, add it to your project and import it in your code
    |
 LL + extern crate abc;
    |
@@ -13,9 +13,9 @@ error[E0432]: unresolved import `abc`
   --> $DIR/issue-33464.rs:5:5
    |
 LL | use abc::{a, bbb, cccccc};
-   |     ^^^ you might be missing crate `abc`
+   |     ^^^ use of unresolved module or unlinked crate `abc`
    |
-help: consider importing the `abc` crate
+help: you might be missing a crate named `abc`, add it to your project and import it in your code
    |
 LL + extern crate abc;
    |
@@ -24,9 +24,9 @@ error[E0432]: unresolved import `a_very_long_name`
   --> $DIR/issue-33464.rs:7:5
    |
 LL | use a_very_long_name::{el, el2};
-   |     ^^^^^^^^^^^^^^^^ you might be missing crate `a_very_long_name`
+   |     ^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `a_very_long_name`
    |
-help: consider importing the `a_very_long_name` crate
+help: you might be missing a crate named `a_very_long_name`, add it to your project and import it in your code
    |
 LL + extern crate a_very_long_name;
    |
diff --git a/tests/ui/imports/issue-36881.stderr b/tests/ui/imports/issue-36881.stderr
index 004836e072c..33d628f40da 100644
--- a/tests/ui/imports/issue-36881.stderr
+++ b/tests/ui/imports/issue-36881.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `issue_36881_aux`
   --> $DIR/issue-36881.rs:5:9
    |
 LL |     use issue_36881_aux::Foo;
-   |         ^^^^^^^^^^^^^^^ you might be missing crate `issue_36881_aux`
+   |         ^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `issue_36881_aux`
    |
-help: consider importing the `issue_36881_aux` crate
+help: you might be missing a crate named `issue_36881_aux`, add it to your project and import it in your code
    |
 LL + extern crate issue_36881_aux;
    |
diff --git a/tests/ui/imports/issue-37887.stderr b/tests/ui/imports/issue-37887.stderr
index cc191a17c29..b83ba273a01 100644
--- a/tests/ui/imports/issue-37887.stderr
+++ b/tests/ui/imports/issue-37887.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `test`
   --> $DIR/issue-37887.rs:3:9
    |
 LL |     use test::*;
-   |         ^^^^ you might be missing crate `test`
+   |         ^^^^ use of unresolved module or unlinked crate `test`
    |
-help: consider importing the `test` crate
+help: you might be missing a crate named `test`, add it to your project and import it in your code
    |
 LL + extern crate test;
    |
diff --git a/tests/ui/imports/issue-53269.stderr b/tests/ui/imports/issue-53269.stderr
index d25d85bf46f..c12fc0f378e 100644
--- a/tests/ui/imports/issue-53269.stderr
+++ b/tests/ui/imports/issue-53269.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `nonexistent_module`
   --> $DIR/issue-53269.rs:6:9
    |
 LL |     use nonexistent_module::mac;
-   |         ^^^^^^^^^^^^^^^^^^ you might be missing crate `nonexistent_module`
+   |         ^^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent_module`
    |
-help: consider importing the `nonexistent_module` crate
+help: you might be missing a crate named `nonexistent_module`, add it to your project and import it in your code
    |
 LL + extern crate nonexistent_module;
    |
diff --git a/tests/ui/imports/issue-55457.stderr b/tests/ui/imports/issue-55457.stderr
index 9c99b6a20de..472e46caf31 100644
--- a/tests/ui/imports/issue-55457.stderr
+++ b/tests/ui/imports/issue-55457.stderr
@@ -11,9 +11,9 @@ error[E0432]: unresolved import `non_existent`
   --> $DIR/issue-55457.rs:2:5
    |
 LL | use non_existent::non_existent;
-   |     ^^^^^^^^^^^^ you might be missing crate `non_existent`
+   |     ^^^^^^^^^^^^ use of unresolved module or unlinked crate `non_existent`
    |
-help: consider importing the `non_existent` crate
+help: you might be missing a crate named `non_existent`, add it to your project and import it in your code
    |
 LL + extern crate non_existent;
    |
diff --git a/tests/ui/imports/issue-81413.stderr b/tests/ui/imports/issue-81413.stderr
index aa1246c1d2f..257aca4455c 100644
--- a/tests/ui/imports/issue-81413.stderr
+++ b/tests/ui/imports/issue-81413.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `doesnt_exist`
   --> $DIR/issue-81413.rs:7:9
    |
 LL | pub use doesnt_exist::*;
-   |         ^^^^^^^^^^^^ you might be missing crate `doesnt_exist`
+   |         ^^^^^^^^^^^^ use of unresolved module or unlinked crate `doesnt_exist`
    |
-help: consider importing the `doesnt_exist` crate
+help: you might be missing a crate named `doesnt_exist`, add it to your project and import it in your code
    |
 LL + extern crate doesnt_exist;
    |
diff --git a/tests/ui/imports/tool-mod-child.rs b/tests/ui/imports/tool-mod-child.rs
index a8249ab01df..38bcdfb0249 100644
--- a/tests/ui/imports/tool-mod-child.rs
+++ b/tests/ui/imports/tool-mod-child.rs
@@ -1,7 +1,7 @@
 use clippy::a; //~ ERROR unresolved import `clippy`
-use clippy::a::b; //~ ERROR failed to resolve: you might be missing crate `clippy`
+use clippy::a::b; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `clippy`
 
 use rustdoc::a; //~ ERROR unresolved import `rustdoc`
-use rustdoc::a::b; //~ ERROR failed to resolve: you might be missing crate `rustdoc`
+use rustdoc::a::b; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `rustdoc`
 
 fn main() {}
diff --git a/tests/ui/imports/tool-mod-child.stderr b/tests/ui/imports/tool-mod-child.stderr
index ec110ccd75d..b0e446fcbf6 100644
--- a/tests/ui/imports/tool-mod-child.stderr
+++ b/tests/ui/imports/tool-mod-child.stderr
@@ -1,10 +1,10 @@
-error[E0433]: failed to resolve: you might be missing crate `clippy`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `clippy`
   --> $DIR/tool-mod-child.rs:2:5
    |
 LL | use clippy::a::b;
-   |     ^^^^^^ you might be missing crate `clippy`
+   |     ^^^^^^ use of unresolved module or unlinked crate `clippy`
    |
-help: consider importing the `clippy` crate
+help: you might be missing a crate named `clippy`, add it to your project and import it in your code
    |
 LL + extern crate clippy;
    |
@@ -13,20 +13,20 @@ error[E0432]: unresolved import `clippy`
   --> $DIR/tool-mod-child.rs:1:5
    |
 LL | use clippy::a;
-   |     ^^^^^^ you might be missing crate `clippy`
+   |     ^^^^^^ use of unresolved module or unlinked crate `clippy`
    |
-help: consider importing the `clippy` crate
+help: you might be missing a crate named `clippy`, add it to your project and import it in your code
    |
 LL + extern crate clippy;
    |
 
-error[E0433]: failed to resolve: you might be missing crate `rustdoc`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustdoc`
   --> $DIR/tool-mod-child.rs:5:5
    |
 LL | use rustdoc::a::b;
-   |     ^^^^^^^ you might be missing crate `rustdoc`
+   |     ^^^^^^^ use of unresolved module or unlinked crate `rustdoc`
    |
-help: consider importing the `rustdoc` crate
+help: you might be missing a crate named `rustdoc`, add it to your project and import it in your code
    |
 LL + extern crate rustdoc;
    |
@@ -35,9 +35,9 @@ error[E0432]: unresolved import `rustdoc`
   --> $DIR/tool-mod-child.rs:4:5
    |
 LL | use rustdoc::a;
-   |     ^^^^^^^ you might be missing crate `rustdoc`
+   |     ^^^^^^^ use of unresolved module or unlinked crate `rustdoc`
    |
-help: consider importing the `rustdoc` crate
+help: you might be missing a crate named `rustdoc`, add it to your project and import it in your code
    |
 LL + extern crate rustdoc;
    |
diff --git a/tests/ui/imports/unresolved-imports-used.stderr b/tests/ui/imports/unresolved-imports-used.stderr
index 4bf02ff6e3a..d39d2685217 100644
--- a/tests/ui/imports/unresolved-imports-used.stderr
+++ b/tests/ui/imports/unresolved-imports-used.stderr
@@ -14,9 +14,9 @@ error[E0432]: unresolved import `foo`
   --> $DIR/unresolved-imports-used.rs:11:5
    |
 LL | use foo::bar;
-   |     ^^^ you might be missing crate `foo`
+   |     ^^^ use of unresolved module or unlinked crate `foo`
    |
-help: consider importing the `foo` crate
+help: you might be missing a crate named `foo`, add it to your project and import it in your code
    |
 LL + extern crate foo;
    |
@@ -25,9 +25,9 @@ error[E0432]: unresolved import `baz`
   --> $DIR/unresolved-imports-used.rs:12:5
    |
 LL | use baz::*;
-   |     ^^^ you might be missing crate `baz`
+   |     ^^^ use of unresolved module or unlinked crate `baz`
    |
-help: consider importing the `baz` crate
+help: you might be missing a crate named `baz`, add it to your project and import it in your code
    |
 LL + extern crate baz;
    |
@@ -36,9 +36,9 @@ error[E0432]: unresolved import `foo2`
   --> $DIR/unresolved-imports-used.rs:14:5
    |
 LL | use foo2::bar2;
-   |     ^^^^ you might be missing crate `foo2`
+   |     ^^^^ use of unresolved module or unlinked crate `foo2`
    |
-help: consider importing the `foo2` crate
+help: you might be missing a crate named `foo2`, add it to your project and import it in your code
    |
 LL + extern crate foo2;
    |
@@ -47,9 +47,9 @@ error[E0432]: unresolved import `baz2`
   --> $DIR/unresolved-imports-used.rs:15:5
    |
 LL | use baz2::*;
-   |     ^^^^ you might be missing crate `baz2`
+   |     ^^^^ use of unresolved module or unlinked crate `baz2`
    |
-help: consider importing the `baz2` crate
+help: you might be missing a crate named `baz2`, add it to your project and import it in your code
    |
 LL + extern crate baz2;
    |
diff --git a/tests/ui/issues/issue-22370.stderr b/tests/ui/issues/issue-22370.stderr
index 3dc060963f9..b02d867eb7d 100644
--- a/tests/ui/issues/issue-22370.stderr
+++ b/tests/ui/issues/issue-22370.stderr
@@ -7,7 +7,7 @@ LL |
 LL | fn f(a: &dyn A) {}
    |              ^
    |
-   = note: because of the default `Self` reference, type parameters must be specified on object types
+   = note: because the parameter default references `Self`, the parameter must be specified on the object type
 help: set the type parameter to the desired type
    |
 LL | fn f(a: &dyn A<T>) {}
diff --git a/tests/ui/issues/issue-33293.rs b/tests/ui/issues/issue-33293.rs
index a6ef007d51f..115ae3aad20 100644
--- a/tests/ui/issues/issue-33293.rs
+++ b/tests/ui/issues/issue-33293.rs
@@ -1,6 +1,6 @@
 fn main() {
     match 0 {
         aaa::bbb(_) => ()
-        //~^ ERROR failed to resolve: use of undeclared crate or module `aaa`
+        //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `aaa`
     };
 }
diff --git a/tests/ui/issues/issue-33293.stderr b/tests/ui/issues/issue-33293.stderr
index 5badaa153f2..a82813194d7 100644
--- a/tests/ui/issues/issue-33293.stderr
+++ b/tests/ui/issues/issue-33293.stderr
@@ -1,8 +1,10 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `aaa`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `aaa`
   --> $DIR/issue-33293.rs:3:9
    |
 LL |         aaa::bbb(_) => ()
-   |         ^^^ use of undeclared crate or module `aaa`
+   |         ^^^ use of unresolved module or unlinked crate `aaa`
+   |
+   = help: you might be missing a crate named `aaa`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr b/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr
index f23f855c9e8..dab68258a47 100644
--- a/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr
+++ b/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr
@@ -13,9 +13,9 @@ error[E0432]: unresolved import `r#extern`
   --> $DIR/keyword-extern-as-identifier-use.rs:1:5
    |
 LL | use extern::foo;
-   |     ^^^^^^ you might be missing crate `r#extern`
+   |     ^^^^^^ use of unresolved module or unlinked crate `r#extern`
    |
-help: consider importing the `r#extern` crate
+help: you might be missing a crate named `r#extern`, add it to your project and import it in your code
    |
 LL + extern crate r#extern;
    |
diff --git a/tests/ui/lint/linker-warning-bin.rs b/tests/ui/lint/linker-warning-bin.rs
new file mode 100644
index 00000000000..ead0aa002bf
--- /dev/null
+++ b/tests/ui/lint/linker-warning-bin.rs
@@ -0,0 +1,6 @@
+//@ build-pass
+#![crate_type = "bin"]
+#![warn(unused_attributes)]
+#![allow(linker_messages)]
+
+fn main() {}
diff --git a/tests/ui/lint/linker-warning.rs b/tests/ui/lint/linker-warning.rs
new file mode 100644
index 00000000000..10e3f56ab95
--- /dev/null
+++ b/tests/ui/lint/linker-warning.rs
@@ -0,0 +1,9 @@
+//@ check-pass
+#![crate_type = "lib"]
+#![warn(unused_attributes)]
+#![allow(linker_messages)]
+//~^ WARNING unused attribute
+
+#[allow(linker_messages)]
+//~^ WARNING should be an inner attribute
+fn foo() {}
diff --git a/tests/ui/lint/linker-warning.stderr b/tests/ui/lint/linker-warning.stderr
new file mode 100644
index 00000000000..3a2c392fd03
--- /dev/null
+++ b/tests/ui/lint/linker-warning.stderr
@@ -0,0 +1,22 @@
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+  --> $DIR/linker-warning.rs:7:1
+   |
+LL | #[allow(linker_messages)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/linker-warning.rs:3:9
+   |
+LL | #![warn(unused_attributes)]
+   |         ^^^^^^^^^^^^^^^^^
+
+warning: unused attribute
+  --> $DIR/linker-warning.rs:4:1
+   |
+LL | #![allow(linker_messages)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
+   |
+   = note: the `linker_warnings` lint can only be controlled at the root of a crate that needs to be linked
+
+warning: 2 warnings emitted
+
diff --git a/tests/ui/macros/builtin-prelude-no-accidents.rs b/tests/ui/macros/builtin-prelude-no-accidents.rs
index 01691a82dd7..9bebcb75526 100644
--- a/tests/ui/macros/builtin-prelude-no-accidents.rs
+++ b/tests/ui/macros/builtin-prelude-no-accidents.rs
@@ -2,7 +2,7 @@
 // because macros with the same names are in prelude.
 
 fn main() {
-    env::current_dir; //~ ERROR use of undeclared crate or module `env`
-    type A = panic::PanicInfo; //~ ERROR use of undeclared crate or module `panic`
-    type B = vec::Vec<u8>; //~ ERROR use of undeclared crate or module `vec`
+    env::current_dir; //~ ERROR use of unresolved module or unlinked crate `env`
+    type A = panic::PanicInfo; //~ ERROR use of unresolved module or unlinked crate `panic`
+    type B = vec::Vec<u8>; //~ ERROR use of unresolved module or unlinked crate `vec`
 }
diff --git a/tests/ui/macros/builtin-prelude-no-accidents.stderr b/tests/ui/macros/builtin-prelude-no-accidents.stderr
index c1054230bc9..8c7095a6aed 100644
--- a/tests/ui/macros/builtin-prelude-no-accidents.stderr
+++ b/tests/ui/macros/builtin-prelude-no-accidents.stderr
@@ -1,31 +1,34 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `env`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `env`
   --> $DIR/builtin-prelude-no-accidents.rs:5:5
    |
 LL |     env::current_dir;
-   |     ^^^ use of undeclared crate or module `env`
+   |     ^^^ use of unresolved module or unlinked crate `env`
    |
+   = help: you might be missing a crate named `env`
 help: consider importing this module
    |
 LL + use std::env;
    |
 
-error[E0433]: failed to resolve: use of undeclared crate or module `panic`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `panic`
   --> $DIR/builtin-prelude-no-accidents.rs:6:14
    |
 LL |     type A = panic::PanicInfo;
-   |              ^^^^^ use of undeclared crate or module `panic`
+   |              ^^^^^ use of unresolved module or unlinked crate `panic`
    |
+   = help: you might be missing a crate named `panic`
 help: consider importing this module
    |
 LL + use std::panic;
    |
 
-error[E0433]: failed to resolve: use of undeclared crate or module `vec`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `vec`
   --> $DIR/builtin-prelude-no-accidents.rs:7:14
    |
 LL |     type B = vec::Vec<u8>;
-   |              ^^^ use of undeclared crate or module `vec`
+   |              ^^^ use of unresolved module or unlinked crate `vec`
    |
+   = help: you might be missing a crate named `vec`
 help: consider importing this module
    |
 LL + use std::vec;
diff --git a/tests/ui/macros/macro-inner-attributes.rs b/tests/ui/macros/macro-inner-attributes.rs
index 6dbfce21359..a1eb7cd15c4 100644
--- a/tests/ui/macros/macro-inner-attributes.rs
+++ b/tests/ui/macros/macro-inner-attributes.rs
@@ -15,6 +15,6 @@ test!(b,
 #[rustc_dummy]
 fn main() {
     a::bar();
-    //~^ ERROR failed to resolve: use of undeclared crate or module `a`
+    //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `a`
     b::bar();
 }
diff --git a/tests/ui/macros/macro-inner-attributes.stderr b/tests/ui/macros/macro-inner-attributes.stderr
index b6e10f45e38..947e33b08f4 100644
--- a/tests/ui/macros/macro-inner-attributes.stderr
+++ b/tests/ui/macros/macro-inner-attributes.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `a`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `a`
   --> $DIR/macro-inner-attributes.rs:17:5
    |
 LL |     a::bar();
-   |     ^ use of undeclared crate or module `a`
+   |     ^ use of unresolved module or unlinked crate `a`
    |
 help: there is a crate or module with a similar name
    |
diff --git a/tests/ui/macros/macro_path_as_generic_bound.stderr b/tests/ui/macros/macro_path_as_generic_bound.stderr
index e25ff57e57f..9fe4ad27aa0 100644
--- a/tests/ui/macros/macro_path_as_generic_bound.stderr
+++ b/tests/ui/macros/macro_path_as_generic_bound.stderr
@@ -1,8 +1,10 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `m`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `m`
   --> $DIR/macro_path_as_generic_bound.rs:7:6
    |
 LL | foo!(m::m2::A);
-   |      ^ use of undeclared crate or module `m`
+   |      ^ use of unresolved module or unlinked crate `m`
+   |
+   = help: you might be missing a crate named `m`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/macros/meta-item-absolute-path.stderr b/tests/ui/macros/meta-item-absolute-path.stderr
index af56d935284..8fa5e97899c 100644
--- a/tests/ui/macros/meta-item-absolute-path.stderr
+++ b/tests/ui/macros/meta-item-absolute-path.stderr
@@ -1,14 +1,14 @@
-error[E0433]: failed to resolve: you might be missing crate `Absolute`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `Absolute`
   --> $DIR/meta-item-absolute-path.rs:1:12
    |
 LL | #[derive(::Absolute)]
-   |            ^^^^^^^^ you might be missing crate `Absolute`
+   |            ^^^^^^^^ use of unresolved module or unlinked crate `Absolute`
 
-error[E0433]: failed to resolve: you might be missing crate `Absolute`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `Absolute`
   --> $DIR/meta-item-absolute-path.rs:1:12
    |
 LL | #[derive(::Absolute)]
-   |            ^^^^^^^^ you might be missing crate `Absolute`
+   |            ^^^^^^^^ use of unresolved module or unlinked crate `Absolute`
    |
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
diff --git a/tests/ui/mir/issue-121103.rs b/tests/ui/mir/issue-121103.rs
index e06361a6964..247c644c5bb 100644
--- a/tests/ui/mir/issue-121103.rs
+++ b/tests/ui/mir/issue-121103.rs
@@ -1,3 +1,3 @@
 fn main(_: <lib2::GenericType<42> as lib2::TypeFn>::Output) {}
-//~^ ERROR failed to resolve: use of undeclared crate or module `lib2`
-//~| ERROR failed to resolve: use of undeclared crate or module `lib2`
+//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `lib2`
+//~| ERROR failed to resolve: use of unresolved module or unlinked crate `lib2`
diff --git a/tests/ui/mir/issue-121103.stderr b/tests/ui/mir/issue-121103.stderr
index 913eee9e0c5..3565f6f0cde 100644
--- a/tests/ui/mir/issue-121103.stderr
+++ b/tests/ui/mir/issue-121103.stderr
@@ -1,14 +1,18 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `lib2`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `lib2`
   --> $DIR/issue-121103.rs:1:38
    |
 LL | fn main(_: <lib2::GenericType<42> as lib2::TypeFn>::Output) {}
-   |                                      ^^^^ use of undeclared crate or module `lib2`
+   |                                      ^^^^ use of unresolved module or unlinked crate `lib2`
+   |
+   = help: you might be missing a crate named `lib2`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `lib2`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `lib2`
   --> $DIR/issue-121103.rs:1:13
    |
 LL | fn main(_: <lib2::GenericType<42> as lib2::TypeFn>::Output) {}
-   |             ^^^^ use of undeclared crate or module `lib2`
+   |             ^^^^ use of unresolved module or unlinked crate `lib2`
+   |
+   = help: you might be missing a crate named `lib2`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/modules_and_files_visibility/mod_file_disambig.rs b/tests/ui/modules_and_files_visibility/mod_file_disambig.rs
index e5958af173b..1483e3e4630 100644
--- a/tests/ui/modules_and_files_visibility/mod_file_disambig.rs
+++ b/tests/ui/modules_and_files_visibility/mod_file_disambig.rs
@@ -2,5 +2,5 @@ mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` fou
 
 fn main() {
     assert_eq!(mod_file_aux::bar(), 10);
-    //~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux`
+    //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `mod_file_aux`
 }
diff --git a/tests/ui/modules_and_files_visibility/mod_file_disambig.stderr b/tests/ui/modules_and_files_visibility/mod_file_disambig.stderr
index a2c99396987..f82d613015f 100644
--- a/tests/ui/modules_and_files_visibility/mod_file_disambig.stderr
+++ b/tests/ui/modules_and_files_visibility/mod_file_disambig.stderr
@@ -6,11 +6,13 @@ LL | mod mod_file_disambig_aux;
    |
    = help: delete or rename one of them to remove the ambiguity
 
-error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `mod_file_aux`
   --> $DIR/mod_file_disambig.rs:4:16
    |
 LL |     assert_eq!(mod_file_aux::bar(), 10);
-   |                ^^^^^^^^^^^^ use of undeclared crate or module `mod_file_aux`
+   |                ^^^^^^^^^^^^ use of unresolved module or unlinked crate `mod_file_aux`
+   |
+   = help: you might be missing a crate named `mod_file_aux`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/parser/const-param-decl-on-type-instead-of-impl.rs b/tests/ui/parser/const-param-decl-on-type-instead-of-impl.rs
index 53e3c6f9605..3876fb41d23 100644
--- a/tests/ui/parser/const-param-decl-on-type-instead-of-impl.rs
+++ b/tests/ui/parser/const-param-decl-on-type-instead-of-impl.rs
@@ -11,5 +11,5 @@ fn banana(a: <T<const N: usize>>::BAR) {}
 fn chaenomeles() {
     path::path::Struct::<const N: usize>()
     //~^ ERROR unexpected `const` parameter declaration
-    //~| ERROR failed to resolve: use of undeclared crate or module `path`
+    //~| ERROR failed to resolve: use of unresolved module or unlinked crate `path`
 }
diff --git a/tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr b/tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr
index 96885d11ee0..104dbd02685 100644
--- a/tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr
+++ b/tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr
@@ -21,11 +21,13 @@ error: unexpected `const` parameter declaration
 LL |     path::path::Struct::<const N: usize>()
    |                          ^^^^^^^^^^^^^^ expected a `const` expression, not a parameter declaration
 
-error[E0433]: failed to resolve: use of undeclared crate or module `path`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `path`
   --> $DIR/const-param-decl-on-type-instead-of-impl.rs:12:5
    |
 LL |     path::path::Struct::<const N: usize>()
-   |     ^^^^ use of undeclared crate or module `path`
+   |     ^^^^ use of unresolved module or unlinked crate `path`
+   |
+   = help: you might be missing a crate named `path`
 
 error[E0412]: cannot find type `T` in this scope
   --> $DIR/const-param-decl-on-type-instead-of-impl.rs:8:15
diff --git a/tests/ui/parser/dyn-trait-compatibility.rs b/tests/ui/parser/dyn-trait-compatibility.rs
index 6341e053277..717b14c5941 100644
--- a/tests/ui/parser/dyn-trait-compatibility.rs
+++ b/tests/ui/parser/dyn-trait-compatibility.rs
@@ -1,7 +1,7 @@
 type A0 = dyn;
 //~^ ERROR cannot find type `dyn` in this scope
 type A1 = dyn::dyn;
-//~^ ERROR use of undeclared crate or module `dyn`
+//~^ ERROR use of unresolved module or unlinked crate `dyn`
 type A2 = dyn<dyn, dyn>;
 //~^ ERROR cannot find type `dyn` in this scope
 //~| ERROR cannot find type `dyn` in this scope
diff --git a/tests/ui/parser/dyn-trait-compatibility.stderr b/tests/ui/parser/dyn-trait-compatibility.stderr
index e34d855a9d4..08e0a50010a 100644
--- a/tests/ui/parser/dyn-trait-compatibility.stderr
+++ b/tests/ui/parser/dyn-trait-compatibility.stderr
@@ -40,11 +40,13 @@ error[E0412]: cannot find type `dyn` in this scope
 LL | type A3 = dyn<<dyn as dyn>::dyn>;
    |                ^^^ not found in this scope
 
-error[E0433]: failed to resolve: use of undeclared crate or module `dyn`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `dyn`
   --> $DIR/dyn-trait-compatibility.rs:3:11
    |
 LL | type A1 = dyn::dyn;
-   |           ^^^ use of undeclared crate or module `dyn`
+   |           ^^^ use of unresolved module or unlinked crate `dyn`
+   |
+   = help: you might be missing a crate named `dyn`
 
 error: aborting due to 8 previous errors
 
diff --git a/tests/ui/parser/mod_file_not_exist.rs b/tests/ui/parser/mod_file_not_exist.rs
index 80a17163087..e7727944147 100644
--- a/tests/ui/parser/mod_file_not_exist.rs
+++ b/tests/ui/parser/mod_file_not_exist.rs
@@ -5,5 +5,6 @@ mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
 
 fn main() {
     assert_eq!(mod_file_aux::bar(), 10);
-    //~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux`
+    //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `mod_file_aux`
+    //~| HELP you might be missing a crate named `mod_file_aux`
 }
diff --git a/tests/ui/parser/mod_file_not_exist.stderr b/tests/ui/parser/mod_file_not_exist.stderr
index c2f9d30d9ec..40041b11c8b 100644
--- a/tests/ui/parser/mod_file_not_exist.stderr
+++ b/tests/ui/parser/mod_file_not_exist.stderr
@@ -7,11 +7,13 @@ LL | mod not_a_real_file;
    = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs"
    = note: if there is a `mod not_a_real_file` elsewhere in the crate already, import it with `use crate::...` instead
 
-error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `mod_file_aux`
   --> $DIR/mod_file_not_exist.rs:7:16
    |
 LL |     assert_eq!(mod_file_aux::bar(), 10);
-   |                ^^^^^^^^^^^^ use of undeclared crate or module `mod_file_aux`
+   |                ^^^^^^^^^^^^ use of unresolved module or unlinked crate `mod_file_aux`
+   |
+   = help: you might be missing a crate named `mod_file_aux`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/parser/mod_file_not_exist_windows.rs b/tests/ui/parser/mod_file_not_exist_windows.rs
index 88780c0c24e..bb74684d994 100644
--- a/tests/ui/parser/mod_file_not_exist_windows.rs
+++ b/tests/ui/parser/mod_file_not_exist_windows.rs
@@ -5,5 +5,6 @@ mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
 
 fn main() {
     assert_eq!(mod_file_aux::bar(), 10);
-    //~^ ERROR failed to resolve: use of undeclared crate or module `mod_file_aux`
+    //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `mod_file_aux`
+    //~| HELP you might be missing a crate named `mod_file_aux`
 }
diff --git a/tests/ui/parser/mod_file_not_exist_windows.stderr b/tests/ui/parser/mod_file_not_exist_windows.stderr
index 53b09d8ca53..03c762d0ef2 100644
--- a/tests/ui/parser/mod_file_not_exist_windows.stderr
+++ b/tests/ui/parser/mod_file_not_exist_windows.stderr
@@ -7,11 +7,13 @@ LL | mod not_a_real_file;
    = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs"
    = note: if there is a `mod not_a_real_file` elsewhere in the crate already, import it with `use crate::...` instead
 
-error[E0433]: failed to resolve: use of undeclared crate or module `mod_file_aux`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `mod_file_aux`
   --> $DIR/mod_file_not_exist_windows.rs:7:16
    |
 LL |     assert_eq!(mod_file_aux::bar(), 10);
-   |                ^^^^^^^^^^^^ use of undeclared crate or module `mod_file_aux`
+   |                ^^^^^^^^^^^^ use of unresolved module or unlinked crate `mod_file_aux`
+   |
+   = help: you might be missing a crate named `mod_file_aux`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/privacy/restricted/test.rs b/tests/ui/privacy/restricted/test.rs
index 3fdfd191b36..b32b9327f07 100644
--- a/tests/ui/privacy/restricted/test.rs
+++ b/tests/ui/privacy/restricted/test.rs
@@ -47,6 +47,6 @@ fn main() {
 }
 
 mod pathological {
-    pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: you might be missing crate `bad`
+    pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: use of unresolved module or unlinked crate `bad`
     pub(in foo) mod m2 {} //~ ERROR visibilities can only be restricted to ancestor modules
 }
diff --git a/tests/ui/privacy/restricted/test.stderr b/tests/ui/privacy/restricted/test.stderr
index 5deaffbdbf3..2744b3708a8 100644
--- a/tests/ui/privacy/restricted/test.stderr
+++ b/tests/ui/privacy/restricted/test.stderr
@@ -1,10 +1,10 @@
-error[E0433]: failed to resolve: you might be missing crate `bad`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `bad`
   --> $DIR/test.rs:50:12
    |
 LL |     pub(in bad::path) mod m1 {}
-   |            ^^^ you might be missing crate `bad`
+   |            ^^^ use of unresolved module or unlinked crate `bad`
    |
-help: consider importing the `bad` crate
+help: you might be missing a crate named `bad`, add it to your project and import it in your code
    |
 LL + extern crate bad;
    |
diff --git a/tests/ui/resolve/112590-2.stderr b/tests/ui/resolve/112590-2.stderr
index 0db20249d27..b39b44396d7 100644
--- a/tests/ui/resolve/112590-2.stderr
+++ b/tests/ui/resolve/112590-2.stderr
@@ -14,12 +14,13 @@ LL -         let _: Vec<i32> = super::foo::baf::baz::MyVec::new();
 LL +         let _: Vec<i32> = MyVec::new();
    |
 
-error[E0433]: failed to resolve: use of undeclared crate or module `fox`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `fox`
   --> $DIR/112590-2.rs:18:27
    |
 LL |         let _: Vec<i32> = fox::bar::baz::MyVec::new();
-   |                           ^^^ use of undeclared crate or module `fox`
+   |                           ^^^ use of unresolved module or unlinked crate `fox`
    |
+   = help: you might be missing a crate named `fox`
 help: consider importing this struct through its public re-export
    |
 LL +     use foo::bar::baz::MyVec;
@@ -30,12 +31,13 @@ LL -         let _: Vec<i32> = fox::bar::baz::MyVec::new();
 LL +         let _: Vec<i32> = MyVec::new();
    |
 
-error[E0433]: failed to resolve: use of undeclared crate or module `vec`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `vec`
   --> $DIR/112590-2.rs:24:15
    |
 LL |     type _B = vec::Vec::<u8>;
-   |               ^^^ use of undeclared crate or module `vec`
+   |               ^^^ use of unresolved module or unlinked crate `vec`
    |
+   = help: you might be missing a crate named `vec`
 help: consider importing this module
    |
 LL + use std::vec;
@@ -57,14 +59,16 @@ LL -     let _t = std::sync_error::atomic::AtomicBool::new(true);
 LL +     let _t = AtomicBool::new(true);
    |
 
-error[E0433]: failed to resolve: use of undeclared crate or module `vec`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `vec`
   --> $DIR/112590-2.rs:23:24
    |
 LL |     let _t: Vec<i32> = vec::new();
    |                        ^^^
    |                        |
-   |                        use of undeclared crate or module `vec`
+   |                        use of unresolved module or unlinked crate `vec`
    |                        help: a struct with a similar name exists (notice the capitalization): `Vec`
+   |
+   = help: you might be missing a crate named `vec`
 
 error: aborting due to 5 previous errors
 
diff --git a/tests/ui/resolve/bad-module.rs b/tests/ui/resolve/bad-module.rs
index b23e97c2cf6..9fe06ab0f52 100644
--- a/tests/ui/resolve/bad-module.rs
+++ b/tests/ui/resolve/bad-module.rs
@@ -1,7 +1,7 @@
 fn main() {
     let foo = thing::len(Vec::new());
-    //~^ ERROR failed to resolve: use of undeclared crate or module `thing`
+    //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `thing`
 
     let foo = foo::bar::baz();
-    //~^ ERROR failed to resolve: use of undeclared crate or module `foo`
+    //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `foo`
 }
diff --git a/tests/ui/resolve/bad-module.stderr b/tests/ui/resolve/bad-module.stderr
index 558760c6793..0f597e126fd 100644
--- a/tests/ui/resolve/bad-module.stderr
+++ b/tests/ui/resolve/bad-module.stderr
@@ -1,14 +1,18 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `foo`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
   --> $DIR/bad-module.rs:5:15
    |
 LL |     let foo = foo::bar::baz();
-   |               ^^^ use of undeclared crate or module `foo`
+   |               ^^^ use of unresolved module or unlinked crate `foo`
+   |
+   = help: you might be missing a crate named `foo`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `thing`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `thing`
   --> $DIR/bad-module.rs:2:15
    |
 LL |     let foo = thing::len(Vec::new());
-   |               ^^^^^ use of undeclared crate or module `thing`
+   |               ^^^^^ use of unresolved module or unlinked crate `thing`
+   |
+   = help: you might be missing a crate named `thing`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/resolve/editions-crate-root-2015.rs b/tests/ui/resolve/editions-crate-root-2015.rs
index 869f4c82c8b..a2e19bfdf1c 100644
--- a/tests/ui/resolve/editions-crate-root-2015.rs
+++ b/tests/ui/resolve/editions-crate-root-2015.rs
@@ -2,10 +2,10 @@
 
 mod inner {
     fn global_inner(_: ::nonexistant::Foo) {
-        //~^ ERROR failed to resolve: you might be missing crate `nonexistant`
+        //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `nonexistant`
     }
     fn crate_inner(_: crate::nonexistant::Foo) {
-        //~^ ERROR failed to resolve: you might be missing crate `nonexistant`
+        //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `nonexistant`
     }
 
     fn bare_global(_: ::nonexistant) {
diff --git a/tests/ui/resolve/editions-crate-root-2015.stderr b/tests/ui/resolve/editions-crate-root-2015.stderr
index 7a842aca0fd..3d203c8ed96 100644
--- a/tests/ui/resolve/editions-crate-root-2015.stderr
+++ b/tests/ui/resolve/editions-crate-root-2015.stderr
@@ -1,21 +1,21 @@
-error[E0433]: failed to resolve: you might be missing crate `nonexistant`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistant`
   --> $DIR/editions-crate-root-2015.rs:4:26
    |
 LL |     fn global_inner(_: ::nonexistant::Foo) {
-   |                          ^^^^^^^^^^^ you might be missing crate `nonexistant`
+   |                          ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistant`
    |
-help: consider importing the `nonexistant` crate
+help: you might be missing a crate named `nonexistant`, add it to your project and import it in your code
    |
 LL + extern crate nonexistant;
    |
 
-error[E0433]: failed to resolve: you might be missing crate `nonexistant`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistant`
   --> $DIR/editions-crate-root-2015.rs:7:30
    |
 LL |     fn crate_inner(_: crate::nonexistant::Foo) {
-   |                              ^^^^^^^^^^^ you might be missing crate `nonexistant`
+   |                              ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistant`
    |
-help: consider importing the `nonexistant` crate
+help: you might be missing a crate named `nonexistant`, add it to your project and import it in your code
    |
 LL + extern crate nonexistant;
    |
diff --git a/tests/ui/resolve/export-fully-qualified-2018.rs b/tests/ui/resolve/export-fully-qualified-2018.rs
index 26e3044d8df..ce78b64bf25 100644
--- a/tests/ui/resolve/export-fully-qualified-2018.rs
+++ b/tests/ui/resolve/export-fully-qualified-2018.rs
@@ -5,7 +5,7 @@
 // want to change eventually.
 
 mod foo {
-    pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared crate or module `foo`
+    pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of unresolved module or unlinked crate `foo`
 
     fn baz() { }
 }
diff --git a/tests/ui/resolve/export-fully-qualified-2018.stderr b/tests/ui/resolve/export-fully-qualified-2018.stderr
index 378d9832a65..a985669b8b4 100644
--- a/tests/ui/resolve/export-fully-qualified-2018.stderr
+++ b/tests/ui/resolve/export-fully-qualified-2018.stderr
@@ -1,8 +1,10 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `foo`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
   --> $DIR/export-fully-qualified-2018.rs:8:20
    |
 LL |     pub fn bar() { foo::baz(); }
-   |                    ^^^ use of undeclared crate or module `foo`
+   |                    ^^^ use of unresolved module or unlinked crate `foo`
+   |
+   = help: you might be missing a crate named `foo`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/resolve/export-fully-qualified.rs b/tests/ui/resolve/export-fully-qualified.rs
index 6de33b7e191..0be3b81ebb8 100644
--- a/tests/ui/resolve/export-fully-qualified.rs
+++ b/tests/ui/resolve/export-fully-qualified.rs
@@ -5,7 +5,7 @@
 // want to change eventually.
 
 mod foo {
-    pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared crate or module `foo`
+    pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of unresolved module or unlinked crate `foo`
 
     fn baz() { }
 }
diff --git a/tests/ui/resolve/export-fully-qualified.stderr b/tests/ui/resolve/export-fully-qualified.stderr
index 869149d8d3c..e65483e57eb 100644
--- a/tests/ui/resolve/export-fully-qualified.stderr
+++ b/tests/ui/resolve/export-fully-qualified.stderr
@@ -1,8 +1,10 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `foo`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
   --> $DIR/export-fully-qualified.rs:8:20
    |
 LL |     pub fn bar() { foo::baz(); }
-   |                    ^^^ use of undeclared crate or module `foo`
+   |                    ^^^ use of unresolved module or unlinked crate `foo`
+   |
+   = help: you might be missing a crate named `foo`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/resolve/extern-prelude-fail.stderr b/tests/ui/resolve/extern-prelude-fail.stderr
index 77c10f5f995..199a31244c0 100644
--- a/tests/ui/resolve/extern-prelude-fail.stderr
+++ b/tests/ui/resolve/extern-prelude-fail.stderr
@@ -2,20 +2,20 @@ error[E0432]: unresolved import `extern_prelude`
   --> $DIR/extern-prelude-fail.rs:7:9
    |
 LL |     use extern_prelude::S;
-   |         ^^^^^^^^^^^^^^ you might be missing crate `extern_prelude`
+   |         ^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `extern_prelude`
    |
-help: consider importing the `extern_prelude` crate
+help: you might be missing a crate named `extern_prelude`, add it to your project and import it in your code
    |
 LL + extern crate extern_prelude;
    |
 
-error[E0433]: failed to resolve: you might be missing crate `extern_prelude`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `extern_prelude`
   --> $DIR/extern-prelude-fail.rs:8:15
    |
 LL |     let s = ::extern_prelude::S;
-   |               ^^^^^^^^^^^^^^ you might be missing crate `extern_prelude`
+   |               ^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `extern_prelude`
    |
-help: consider importing the `extern_prelude` crate
+help: you might be missing a crate named `extern_prelude`, add it to your project and import it in your code
    |
 LL + extern crate extern_prelude;
    |
diff --git a/tests/ui/resolve/issue-101749-2.rs b/tests/ui/resolve/issue-101749-2.rs
index 4d3d469447c..636ff07c71c 100644
--- a/tests/ui/resolve/issue-101749-2.rs
+++ b/tests/ui/resolve/issue-101749-2.rs
@@ -12,5 +12,5 @@ fn main() {
     let rect = Rectangle::new(3, 4);
     // `area` is not implemented for `Rectangle`, so this should not suggest
     let _ = rect::area();
-    //~^ ERROR failed to resolve: use of undeclared crate or module `rect`
+    //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `rect`
 }
diff --git a/tests/ui/resolve/issue-101749-2.stderr b/tests/ui/resolve/issue-101749-2.stderr
index 300aaf26cb7..96a20b4bf5a 100644
--- a/tests/ui/resolve/issue-101749-2.stderr
+++ b/tests/ui/resolve/issue-101749-2.stderr
@@ -1,8 +1,10 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `rect`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rect`
   --> $DIR/issue-101749-2.rs:14:13
    |
 LL |     let _ = rect::area();
-   |             ^^^^ use of undeclared crate or module `rect`
+   |             ^^^^ use of unresolved module or unlinked crate `rect`
+   |
+   = help: you might be missing a crate named `rect`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/resolve/issue-101749.fixed b/tests/ui/resolve/issue-101749.fixed
index 97815793d29..3244ad7a031 100644
--- a/tests/ui/resolve/issue-101749.fixed
+++ b/tests/ui/resolve/issue-101749.fixed
@@ -15,5 +15,5 @@ impl Rectangle {
 fn main() {
     let rect = Rectangle::new(3, 4);
     let _ = rect.area();
-    //~^ ERROR failed to resolve: use of undeclared crate or module `rect`
+    //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `rect`
 }
diff --git a/tests/ui/resolve/issue-101749.rs b/tests/ui/resolve/issue-101749.rs
index 994fc86778e..c977df41d2f 100644
--- a/tests/ui/resolve/issue-101749.rs
+++ b/tests/ui/resolve/issue-101749.rs
@@ -15,5 +15,5 @@ impl Rectangle {
 fn main() {
     let rect = Rectangle::new(3, 4);
     let _ = rect::area();
-    //~^ ERROR failed to resolve: use of undeclared crate or module `rect`
+    //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `rect`
 }
diff --git a/tests/ui/resolve/issue-101749.stderr b/tests/ui/resolve/issue-101749.stderr
index 05515b1b460..fedbf182ee8 100644
--- a/tests/ui/resolve/issue-101749.stderr
+++ b/tests/ui/resolve/issue-101749.stderr
@@ -1,9 +1,10 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `rect`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rect`
   --> $DIR/issue-101749.rs:17:13
    |
 LL |     let _ = rect::area();
-   |             ^^^^ use of undeclared crate or module `rect`
+   |             ^^^^ use of unresolved module or unlinked crate `rect`
    |
+   = help: you might be missing a crate named `rect`
 help: you may have meant to call an instance method
    |
 LL |     let _ = rect.area();
diff --git a/tests/ui/resolve/issue-82865.rs b/tests/ui/resolve/issue-82865.rs
index 29a898906e9..4dc12f2f589 100644
--- a/tests/ui/resolve/issue-82865.rs
+++ b/tests/ui/resolve/issue-82865.rs
@@ -2,7 +2,7 @@
 
 #![feature(decl_macro)]
 
-use x::y::z; //~ ERROR: failed to resolve: you might be missing crate `x`
+use x::y::z; //~ ERROR: failed to resolve: use of unresolved module or unlinked crate `x`
 
 macro mac () {
     Box::z //~ ERROR: no function or associated item
diff --git a/tests/ui/resolve/issue-82865.stderr b/tests/ui/resolve/issue-82865.stderr
index bc7e0f07981..090085460b0 100644
--- a/tests/ui/resolve/issue-82865.stderr
+++ b/tests/ui/resolve/issue-82865.stderr
@@ -1,10 +1,10 @@
-error[E0433]: failed to resolve: you might be missing crate `x`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `x`
   --> $DIR/issue-82865.rs:5:5
    |
 LL | use x::y::z;
-   |     ^ you might be missing crate `x`
+   |     ^ use of unresolved module or unlinked crate `x`
    |
-help: consider importing the `x` crate
+help: you might be missing a crate named `x`, add it to your project and import it in your code
    |
 LL + extern crate x;
    |
diff --git a/tests/ui/resolve/resolve-bad-visibility.stderr b/tests/ui/resolve/resolve-bad-visibility.stderr
index 281e5afb223..ac7e1c735b1 100644
--- a/tests/ui/resolve/resolve-bad-visibility.stderr
+++ b/tests/ui/resolve/resolve-bad-visibility.stderr
@@ -16,24 +16,24 @@ error[E0742]: visibilities can only be restricted to ancestor modules
 LL | pub(in std::vec) struct F;
    |        ^^^^^^^^
 
-error[E0433]: failed to resolve: you might be missing crate `nonexistent`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent`
   --> $DIR/resolve-bad-visibility.rs:7:8
    |
 LL | pub(in nonexistent) struct G;
-   |        ^^^^^^^^^^^ you might be missing crate `nonexistent`
+   |        ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent`
    |
-help: consider importing the `nonexistent` crate
+help: you might be missing a crate named `nonexistent`, add it to your project and import it in your code
    |
 LL + extern crate nonexistent;
    |
 
-error[E0433]: failed to resolve: you might be missing crate `too_soon`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `too_soon`
   --> $DIR/resolve-bad-visibility.rs:8:8
    |
 LL | pub(in too_soon) struct H;
-   |        ^^^^^^^^ you might be missing crate `too_soon`
+   |        ^^^^^^^^ use of unresolved module or unlinked crate `too_soon`
    |
-help: consider importing the `too_soon` crate
+help: you might be missing a crate named `too_soon`, add it to your project and import it in your code
    |
 LL + extern crate too_soon;
    |
diff --git a/tests/ui/resolve/typo-suggestion-mistyped-in-path.rs b/tests/ui/resolve/typo-suggestion-mistyped-in-path.rs
index 3ce17a14f14..188e2ca7f11 100644
--- a/tests/ui/resolve/typo-suggestion-mistyped-in-path.rs
+++ b/tests/ui/resolve/typo-suggestion-mistyped-in-path.rs
@@ -29,8 +29,8 @@ fn main() {
     //~| NOTE use of undeclared type `Struc`
 
     modul::foo();
-    //~^ ERROR failed to resolve: use of undeclared crate or module `modul`
-    //~| NOTE use of undeclared crate or module `modul`
+    //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `modul`
+    //~| NOTE use of unresolved module or unlinked crate `modul`
 
     module::Struc::foo();
     //~^ ERROR failed to resolve: could not find `Struc` in `module`
diff --git a/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr b/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr
index f4fb7fd955f..3ae134e43bc 100644
--- a/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr
+++ b/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr
@@ -30,11 +30,11 @@ LL |     Struc::foo();
    |     use of undeclared type `Struc`
    |     help: a struct with a similar name exists: `Struct`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `modul`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `modul`
   --> $DIR/typo-suggestion-mistyped-in-path.rs:31:5
    |
 LL |     modul::foo();
-   |     ^^^^^ use of undeclared crate or module `modul`
+   |     ^^^^^ use of unresolved module or unlinked crate `modul`
    |
 help: there is a crate or module with a similar name
    |
diff --git a/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.stderr b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.stderr
index 1047dbe1063..106268ac2c7 100644
--- a/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.stderr
+++ b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.stderr
@@ -2,7 +2,9 @@ error[E0432]: unresolved import `xcrate`
   --> $DIR/non-existent-1.rs:3:5
    |
 LL | use xcrate::S;
-   |     ^^^^^^ use of undeclared crate or module `xcrate`
+   |     ^^^^^^ use of unresolved module or unlinked crate `xcrate`
+   |
+   = help: you might be missing a crate named `xcrate`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/rust-2018/unresolved-asterisk-imports.stderr b/tests/ui/rust-2018/unresolved-asterisk-imports.stderr
index b6bf109824f..049d52893d4 100644
--- a/tests/ui/rust-2018/unresolved-asterisk-imports.stderr
+++ b/tests/ui/rust-2018/unresolved-asterisk-imports.stderr
@@ -2,7 +2,9 @@ error[E0432]: unresolved import `not_existing_crate`
   --> $DIR/unresolved-asterisk-imports.rs:3:5
    |
 LL | use not_existing_crate::*;
-   |     ^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `not_existing_crate`
+   |     ^^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `not_existing_crate`
+   |
+   = help: you might be missing a crate named `not_existing_crate`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/suggestions/crate-or-module-typo.rs b/tests/ui/suggestions/crate-or-module-typo.rs
index dbc0605c76b..393fc7a1f72 100644
--- a/tests/ui/suggestions/crate-or-module-typo.rs
+++ b/tests/ui/suggestions/crate-or-module-typo.rs
@@ -1,6 +1,6 @@
 //@ edition:2018
 
-use st::cell::Cell; //~ ERROR failed to resolve: use of undeclared crate or module `st`
+use st::cell::Cell; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `st`
 
 mod bar {
     pub fn bar() { bar::baz(); } //~ ERROR failed to resolve: function `bar` is not a crate or module
@@ -11,7 +11,7 @@ mod bar {
 use bas::bar; //~ ERROR unresolved import `bas`
 
 struct Foo {
-    bar: st::cell::Cell<bool> //~ ERROR failed to resolve: use of undeclared crate or module `st`
+    bar: st::cell::Cell<bool> //~ ERROR failed to resolve: use of unresolved module or unlinked crate `st`
 }
 
 fn main() {}
diff --git a/tests/ui/suggestions/crate-or-module-typo.stderr b/tests/ui/suggestions/crate-or-module-typo.stderr
index 084d0408a8e..75aa6e614b6 100644
--- a/tests/ui/suggestions/crate-or-module-typo.stderr
+++ b/tests/ui/suggestions/crate-or-module-typo.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `st`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `st`
   --> $DIR/crate-or-module-typo.rs:3:5
    |
 LL | use st::cell::Cell;
-   |     ^^ use of undeclared crate or module `st`
+   |     ^^ use of unresolved module or unlinked crate `st`
    |
 help: there is a crate or module with a similar name
    |
@@ -13,18 +13,18 @@ error[E0432]: unresolved import `bas`
   --> $DIR/crate-or-module-typo.rs:11:5
    |
 LL | use bas::bar;
-   |     ^^^ use of undeclared crate or module `bas`
+   |     ^^^ use of unresolved module or unlinked crate `bas`
    |
 help: there is a crate or module with a similar name
    |
 LL | use bar::bar;
    |     ~~~
 
-error[E0433]: failed to resolve: use of undeclared crate or module `st`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `st`
   --> $DIR/crate-or-module-typo.rs:14:10
    |
 LL |     bar: st::cell::Cell<bool>
-   |          ^^ use of undeclared crate or module `st`
+   |          ^^ use of unresolved module or unlinked crate `st`
    |
 help: there is a crate or module with a similar name
    |
diff --git a/tests/ui/suggestions/issue-112590-suggest-import.rs b/tests/ui/suggestions/issue-112590-suggest-import.rs
index 0938814c559..a7868b71919 100644
--- a/tests/ui/suggestions/issue-112590-suggest-import.rs
+++ b/tests/ui/suggestions/issue-112590-suggest-import.rs
@@ -1,8 +1,8 @@
 pub struct S;
 
-impl fmt::Debug for S { //~ ERROR failed to resolve: use of undeclared crate or module `fmt`
-    fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { //~ ERROR failed to resolve: use of undeclared crate or module `fmt`
-        //~^ ERROR failed to resolve: use of undeclared crate or module `fmt`
+impl fmt::Debug for S { //~ ERROR failed to resolve: use of unresolved module or unlinked crate `fmt`
+    fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { //~ ERROR failed to resolve: use of unresolved module or unlinked crate `fmt`
+        //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `fmt`
         Ok(())
     }
 }
diff --git a/tests/ui/suggestions/issue-112590-suggest-import.stderr b/tests/ui/suggestions/issue-112590-suggest-import.stderr
index aeac18c16f0..bbbd2c481c1 100644
--- a/tests/ui/suggestions/issue-112590-suggest-import.stderr
+++ b/tests/ui/suggestions/issue-112590-suggest-import.stderr
@@ -1,31 +1,34 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `fmt`
   --> $DIR/issue-112590-suggest-import.rs:3:6
    |
 LL | impl fmt::Debug for S {
-   |      ^^^ use of undeclared crate or module `fmt`
+   |      ^^^ use of unresolved module or unlinked crate `fmt`
    |
+   = help: you might be missing a crate named `fmt`
 help: consider importing this module
    |
 LL + use std::fmt;
    |
 
-error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `fmt`
   --> $DIR/issue-112590-suggest-import.rs:4:28
    |
 LL |     fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
-   |                            ^^^ use of undeclared crate or module `fmt`
+   |                            ^^^ use of unresolved module or unlinked crate `fmt`
    |
+   = help: you might be missing a crate named `fmt`
 help: consider importing this module
    |
 LL + use std::fmt;
    |
 
-error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `fmt`
   --> $DIR/issue-112590-suggest-import.rs:4:51
    |
 LL |     fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
-   |                                                   ^^^ use of undeclared crate or module `fmt`
+   |                                                   ^^^ use of unresolved module or unlinked crate `fmt`
    |
+   = help: you might be missing a crate named `fmt`
 help: consider importing this module
    |
 LL + use std::fmt;
diff --git a/tests/ui/suggestions/undeclared-module-alloc.rs b/tests/ui/suggestions/undeclared-module-alloc.rs
index e5f22369b94..a0bddc94471 100644
--- a/tests/ui/suggestions/undeclared-module-alloc.rs
+++ b/tests/ui/suggestions/undeclared-module-alloc.rs
@@ -1,5 +1,5 @@
 //@ edition:2018
 
-use alloc::rc::Rc; //~ ERROR failed to resolve: use of undeclared crate or module `alloc`
+use alloc::rc::Rc; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `alloc`
 
 fn main() {}
diff --git a/tests/ui/suggestions/undeclared-module-alloc.stderr b/tests/ui/suggestions/undeclared-module-alloc.stderr
index a439546492b..00e498aa9ba 100644
--- a/tests/ui/suggestions/undeclared-module-alloc.stderr
+++ b/tests/ui/suggestions/undeclared-module-alloc.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `alloc`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `alloc`
   --> $DIR/undeclared-module-alloc.rs:3:5
    |
 LL | use alloc::rc::Rc;
-   |     ^^^^^ use of undeclared crate or module `alloc`
+   |     ^^^^^ use of unresolved module or unlinked crate `alloc`
    |
    = help: add `extern crate alloc` to use the `alloc` crate
 
diff --git a/tests/ui/tool-attributes/unknown-tool-name.rs b/tests/ui/tool-attributes/unknown-tool-name.rs
index 73fca61c65d..ba21aecc230 100644
--- a/tests/ui/tool-attributes/unknown-tool-name.rs
+++ b/tests/ui/tool-attributes/unknown-tool-name.rs
@@ -1,2 +1,2 @@
-#[foo::bar] //~ ERROR failed to resolve: use of undeclared crate or module `foo`
+#[foo::bar] //~ ERROR failed to resolve: use of unresolved module or unlinked crate `foo`
 fn main() {}
diff --git a/tests/ui/tool-attributes/unknown-tool-name.stderr b/tests/ui/tool-attributes/unknown-tool-name.stderr
index 361d359a10e..9b636fcb0bd 100644
--- a/tests/ui/tool-attributes/unknown-tool-name.stderr
+++ b/tests/ui/tool-attributes/unknown-tool-name.stderr
@@ -1,8 +1,8 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `foo`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
   --> $DIR/unknown-tool-name.rs:1:3
    |
 LL | #[foo::bar]
-   |   ^^^ use of undeclared crate or module `foo`
+   |   ^^^ use of unresolved module or unlinked crate `foo`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/traits/const-traits/staged-api.stderr b/tests/ui/traits/const-traits/staged-api.stderr
index 29aafa4e0f3..acc93f747a8 100644
--- a/tests/ui/traits/const-traits/staged-api.stderr
+++ b/tests/ui/traits/const-traits/staged-api.stderr
@@ -106,7 +106,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
 LL |     const_context_not_const_stable();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
+   = help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
 help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
diff --git a/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs b/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs
index 6dcfc754448..6fcd67b4950 100644
--- a/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs
+++ b/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs
@@ -10,6 +10,7 @@ fn w<'a, T: 'a, F: Fn(&'a T)>() {
     let b: &dyn FromResidual = &();
     //~^ ERROR: the trait `FromResidual` is not dyn compatible
     //~| ERROR: the trait `FromResidual` is not dyn compatible
+    //~| ERROR the type parameter `R` must be explicitly specified
 }
 
 fn main() {}
diff --git a/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.stderr b/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.stderr
index 7040c067f5c..ae3762704c6 100644
--- a/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.stderr
+++ b/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.stderr
@@ -1,3 +1,18 @@
+error[E0393]: the type parameter `R` must be explicitly specified
+  --> $DIR/canonicalize-fresh-infer-vars-issue-103626.rs:10:17
+   |
+LL | trait FromResidual<R = <Self as Try>::Residual> {
+   | ----------------------------------------------- type parameter `R` must be specified for this
+...
+LL |     let b: &dyn FromResidual = &();
+   |                 ^^^^^^^^^^^^
+   |
+   = note: because the parameter default references `Self`, the parameter must be specified on the object type
+help: set the type parameter to the desired type
+   |
+LL |     let b: &dyn FromResidual<R> = &();
+   |                             +++
+
 error[E0038]: the trait `FromResidual` is not dyn compatible
   --> $DIR/canonicalize-fresh-infer-vars-issue-103626.rs:10:32
    |
@@ -45,6 +60,7 @@ help: alternatively, consider constraining `from_residual` so it does not apply
 LL |     fn from_residual(residual: R) -> Self where Self: Sized;
    |                                           +++++++++++++++++
 
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0038`.
+Some errors have detailed explanations: E0038, E0393.
+For more information about an error, try `rustc --explain E0038`.
diff --git a/tests/ui/traits/unspecified-self-in-trait-ref.stderr b/tests/ui/traits/unspecified-self-in-trait-ref.stderr
index 22dceadc10d..6f5ae786de6 100644
--- a/tests/ui/traits/unspecified-self-in-trait-ref.stderr
+++ b/tests/ui/traits/unspecified-self-in-trait-ref.stderr
@@ -97,7 +97,7 @@ LL | pub trait Bar<X=usize, A=Self> {
 LL |     let e = Bar::<usize>::lol();
    |             ^^^^^^^^^^^^ missing reference to `A`
    |
-   = note: because of the default `Self` reference, type parameters must be specified on object types
+   = note: because the parameter default references `Self`, the parameter must be specified on the object type
 
 error: aborting due to 5 previous errors; 5 warnings emitted
 
diff --git a/tests/ui/type/type-parameter-defaults-referencing-Self.stderr b/tests/ui/type/type-parameter-defaults-referencing-Self.stderr
index c81405f03f8..23f10c9262c 100644
--- a/tests/ui/type/type-parameter-defaults-referencing-Self.stderr
+++ b/tests/ui/type/type-parameter-defaults-referencing-Self.stderr
@@ -7,7 +7,7 @@ LL | trait Foo<T=Self> {
 LL | fn foo(x: &dyn Foo) { }
    |                ^^^
    |
-   = note: because of the default `Self` reference, type parameters must be specified on object types
+   = note: because the parameter default references `Self`, the parameter must be specified on the object type
 help: set the type parameter to the desired type
    |
 LL | fn foo(x: &dyn Foo<T>) { }
diff --git a/tests/ui/typeck/issue-120856.rs b/tests/ui/typeck/issue-120856.rs
index e435a0f9d8e..51dd63a6f89 100644
--- a/tests/ui/typeck/issue-120856.rs
+++ b/tests/ui/typeck/issue-120856.rs
@@ -1,5 +1,5 @@
 pub type Archived<T> = <m::Alias as n::Trait>::Archived;
-//~^ ERROR failed to resolve: use of undeclared crate or module `m`
-//~| ERROR failed to resolve: use of undeclared crate or module `n`
+//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `m`
+//~| ERROR failed to resolve: use of unresolved module or unlinked crate `n`
 
 fn main() {}
diff --git a/tests/ui/typeck/issue-120856.stderr b/tests/ui/typeck/issue-120856.stderr
index 1fc8b200473..e366744409f 100644
--- a/tests/ui/typeck/issue-120856.stderr
+++ b/tests/ui/typeck/issue-120856.stderr
@@ -1,20 +1,24 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `n`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `n`
   --> $DIR/issue-120856.rs:1:37
    |
 LL | pub type Archived<T> = <m::Alias as n::Trait>::Archived;
    |                                     ^
    |                                     |
-   |                                     use of undeclared crate or module `n`
+   |                                     use of unresolved module or unlinked crate `n`
    |                                     help: a trait with a similar name exists: `Fn`
+   |
+   = help: you might be missing a crate named `n`
 
-error[E0433]: failed to resolve: use of undeclared crate or module `m`
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `m`
   --> $DIR/issue-120856.rs:1:25
    |
 LL | pub type Archived<T> = <m::Alias as n::Trait>::Archived;
    |                         ^
    |                         |
-   |                         use of undeclared crate or module `m`
+   |                         use of unresolved module or unlinked crate `m`
    |                         help: a type parameter with a similar name exists: `T`
+   |
+   = help: you might be missing a crate named `m`
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/typeck/path-to-method-sugg-unresolved-expr.cargo-invoked.stderr b/tests/ui/typeck/path-to-method-sugg-unresolved-expr.cargo-invoked.stderr
new file mode 100644
index 00000000000..8a3b87b0d11
--- /dev/null
+++ b/tests/ui/typeck/path-to-method-sugg-unresolved-expr.cargo-invoked.stderr
@@ -0,0 +1,11 @@
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `page_size`
+  --> $DIR/path-to-method-sugg-unresolved-expr.rs:5:21
+   |
+LL |     let page_size = page_size::get();
+   |                     ^^^^^^^^^ use of unresolved module or unlinked crate `page_size`
+   |
+   = help: if you wanted to use a crate named `page_size`, use `cargo add page_size` to add it to your `Cargo.toml`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0433`.
diff --git a/tests/ui/typeck/path-to-method-sugg-unresolved-expr.only-rustc.stderr b/tests/ui/typeck/path-to-method-sugg-unresolved-expr.only-rustc.stderr
new file mode 100644
index 00000000000..34ed5c44d93
--- /dev/null
+++ b/tests/ui/typeck/path-to-method-sugg-unresolved-expr.only-rustc.stderr
@@ -0,0 +1,11 @@
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `page_size`
+  --> $DIR/path-to-method-sugg-unresolved-expr.rs:5:21
+   |
+LL |     let page_size = page_size::get();
+   |                     ^^^^^^^^^ use of unresolved module or unlinked crate `page_size`
+   |
+   = help: you might be missing a crate named `page_size`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0433`.
diff --git a/tests/ui/typeck/path-to-method-sugg-unresolved-expr.rs b/tests/ui/typeck/path-to-method-sugg-unresolved-expr.rs
index fb56b394493..7b4f62fea0c 100644
--- a/tests/ui/typeck/path-to-method-sugg-unresolved-expr.rs
+++ b/tests/ui/typeck/path-to-method-sugg-unresolved-expr.rs
@@ -1,4 +1,10 @@
+//@ revisions: only-rustc cargo-invoked
+//@[only-rustc] unset-rustc-env:CARGO_CRATE_NAME
+//@[cargo-invoked] rustc-env:CARGO_CRATE_NAME=foo
 fn main() {
     let page_size = page_size::get();
-    //~^ ERROR failed to resolve: use of undeclared crate or module `page_size`
+    //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `page_size`
+    //~| NOTE use of unresolved module or unlinked crate `page_size`
+    //@[cargo-invoked]~^^^ HELP if you wanted to use a crate named `page_size`, use `cargo add
+    //@[only-rustc]~^^^^ HELP you might be missing a crate named `page_size`
 }
diff --git a/tests/ui/typeck/path-to-method-sugg-unresolved-expr.stderr b/tests/ui/typeck/path-to-method-sugg-unresolved-expr.stderr
deleted file mode 100644
index 3e03c17f3b1..00000000000
--- a/tests/ui/typeck/path-to-method-sugg-unresolved-expr.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `page_size`
-  --> $DIR/path-to-method-sugg-unresolved-expr.rs:2:21
-   |
-LL |     let page_size = page_size::get();
-   |                     ^^^^^^^^^ use of undeclared crate or module `page_size`
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0433`.
diff --git a/tests/ui/unresolved/unresolved-asterisk-imports.stderr b/tests/ui/unresolved/unresolved-asterisk-imports.stderr
index ed01f3fdbea..e84f1975112 100644
--- a/tests/ui/unresolved/unresolved-asterisk-imports.stderr
+++ b/tests/ui/unresolved/unresolved-asterisk-imports.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `not_existing_crate`
   --> $DIR/unresolved-asterisk-imports.rs:1:5
    |
 LL | use not_existing_crate::*;
-   |     ^^^^^^^^^^^^^^^^^^ you might be missing crate `not_existing_crate`
+   |     ^^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `not_existing_crate`
    |
-help: consider importing the `not_existing_crate` crate
+help: you might be missing a crate named `not_existing_crate`, add it to your project and import it in your code
    |
 LL + extern crate not_existing_crate;
    |
diff --git a/tests/ui/unresolved/unresolved-import.rs b/tests/ui/unresolved/unresolved-import.rs
index ee520d65e6f..763e9496734 100644
--- a/tests/ui/unresolved/unresolved-import.rs
+++ b/tests/ui/unresolved/unresolved-import.rs
@@ -1,7 +1,7 @@
 use foo::bar;
 //~^ ERROR unresolved import `foo` [E0432]
-//~| NOTE you might be missing crate `foo`
-//~| HELP consider importing the `foo` crate
+//~| NOTE use of unresolved module or unlinked crate `foo`
+//~| HELP you might be missing a crate named `foo`
 //~| SUGGESTION extern crate foo;
 
 use bar::Baz as x;
diff --git a/tests/ui/unresolved/unresolved-import.stderr b/tests/ui/unresolved/unresolved-import.stderr
index a1ff2f19eb6..c65fe841001 100644
--- a/tests/ui/unresolved/unresolved-import.stderr
+++ b/tests/ui/unresolved/unresolved-import.stderr
@@ -2,9 +2,9 @@ error[E0432]: unresolved import `foo`
   --> $DIR/unresolved-import.rs:1:5
    |
 LL | use foo::bar;
-   |     ^^^ you might be missing crate `foo`
+   |     ^^^ use of unresolved module or unlinked crate `foo`
    |
-help: consider importing the `foo` crate
+help: you might be missing a crate named `foo`, add it to your project and import it in your code
    |
 LL + extern crate foo;
    |