about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-06-12 04:06:02 +0000
committerbors <bors@rust-lang.org>2025-06-12 04:06:02 +0000
commitfe5c95d4ae33ec9d7831921e448e2daf8264ea42 (patch)
tree3978100f2560bcb2c54061f04d7b0c3c41745560
parent14346303d760027e53214e705109a62c0f00b214 (diff)
parent240776176b7e1ea335a69a8e0181f4ad92d157fb (diff)
downloadrust-fe5c95d4ae33ec9d7831921e448e2daf8264ea42.tar.gz
rust-fe5c95d4ae33ec9d7831921e448e2daf8264ea42.zip
Auto merge of #142392 - matthiaskrgr:rollup-9jrfqnu, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#141307 (Add method to retrieve body of closure in stable-mir)
 - rust-lang/rust#142040 (transmutability: shift abstraction boundary)
 - rust-lang/rust#142066 (More simple 2015 edition test decoupling)
 - rust-lang/rust#142157 (rustc_resolve: Improve `resolve_const_param_in_non_trivial_anon_const` wording)
 - rust-lang/rust#142217 (`tests/ui`: A New Order [10/N])
 - rust-lang/rust#142219 (`tests/ui`: A New Order [11/N])
 - rust-lang/rust#142261 (use correct edition when warning for unsafe attributes)
 - rust-lang/rust#142303 (Assorted bootstrap cleanups (step 1))
 - rust-lang/rust#142318 (Cleanup `rust-src` remapping and real dir)
 - rust-lang/rust#142352 (compiler: Make `c_int_width` an integer)

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/type_.rs8
-rw-r--r--compiler/rustc_metadata/src/rmeta/decoder.rs29
-rw-r--r--compiler/rustc_parse/src/validate_attr.rs7
-rw-r--r--compiler/rustc_resolve/messages.ftl2
-rw-r--r--compiler/rustc_smir/src/stable_mir/ty.rs8
-rw-r--r--compiler/rustc_target/src/spec/base/xtensa.rs2
-rw-r--r--compiler/rustc_target/src/spec/json.rs8
-rw-r--r--compiler/rustc_target/src/spec/mod.rs20
-rw-r--r--compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs2
-rw-r--r--compiler/rustc_target/src/spec/targets/avr_none.rs2
-rw-r--r--compiler/rustc_target/src/spec/targets/msp430_none_elf.rs2
-rw-r--r--compiler/rustc_target/src/spec/targets/xtensa_esp32_espidf.rs2
-rw-r--r--compiler/rustc_target/src/spec/targets/xtensa_esp32s2_espidf.rs2
-rw-r--r--compiler/rustc_target/src/spec/targets/xtensa_esp32s3_espidf.rs2
-rw-r--r--compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs15
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/confirmation.rs143
-rw-r--r--compiler/rustc_transmute/src/layout/dfa.rs45
-rw-r--r--compiler/rustc_transmute/src/layout/mod.rs111
-rw-r--r--compiler/rustc_transmute/src/layout/tree.rs48
-rw-r--r--compiler/rustc_transmute/src/layout/tree/tests.rs16
-rw-r--r--compiler/rustc_transmute/src/lib.rs30
-rw-r--r--compiler/rustc_transmute/src/maybe_transmutable/mod.rs208
-rw-r--r--compiler/rustc_transmute/src/maybe_transmutable/query_context.rs21
-rw-r--r--compiler/rustc_transmute/src/maybe_transmutable/tests.rs57
-rw-r--r--src/bootstrap/src/core/build_steps/check.rs14
-rw-r--r--src/bootstrap/src/core/build_steps/clippy.rs6
-rw-r--r--src/bootstrap/src/core/build_steps/compile.rs119
-rw-r--r--src/bootstrap/src/core/build_steps/dist.rs24
-rw-r--r--src/bootstrap/src/core/build_steps/doc.rs22
-rw-r--r--src/bootstrap/src/core/build_steps/gcc.rs2
-rw-r--r--src/bootstrap/src/core/build_steps/install.rs6
-rw-r--r--src/bootstrap/src/core/build_steps/llvm.rs26
-rw-r--r--src/bootstrap/src/core/build_steps/perf.rs8
-rw-r--r--src/bootstrap/src/core/build_steps/run.rs4
-rw-r--r--src/bootstrap/src/core/build_steps/setup.rs2
-rw-r--r--src/bootstrap/src/core/build_steps/test.rs43
-rw-r--r--src/bootstrap/src/core/build_steps/tool.rs32
-rw-r--r--src/bootstrap/src/core/builder/mod.rs20
-rw-r--r--src/bootstrap/src/core/builder/tests.rs18
-rw-r--r--src/bootstrap/src/core/config/config.rs36
-rw-r--r--src/bootstrap/src/core/config/flags.rs2
-rw-r--r--src/bootstrap/src/core/config/toml/mod.rs2
-rw-r--r--src/bootstrap/src/core/config/toml/rust.rs6
-rw-r--r--src/bootstrap/src/core/config/toml/target.rs2
-rw-r--r--src/bootstrap/src/core/download.rs18
-rw-r--r--src/bootstrap/src/core/sanity.rs10
-rw-r--r--src/bootstrap/src/lib.rs28
-rw-r--r--src/bootstrap/src/utils/cc_detect.rs6
-rw-r--r--src/bootstrap/src/utils/cc_detect/tests.rs2
-rw-r--r--src/etc/completions/x.fish46
-rw-r--r--src/etc/completions/x.ps146
-rw-r--r--src/etc/completions/x.py.fish46
-rw-r--r--src/etc/completions/x.py.ps146
-rw-r--r--src/etc/completions/x.py.zsh46
-rw-r--r--src/etc/completions/x.zsh46
-rw-r--r--tests/ui-fulldeps/stable-mir/closure-generic-body.rs90
-rw-r--r--tests/ui-fulldeps/stable-mir/closure_body.rs90
-rw-r--r--tests/ui/auxiliary/typeid-intrinsic-aux1.rs6
-rw-r--r--tests/ui/auxiliary/typeid-intrinsic-aux2.rs6
-rw-r--r--tests/ui/box/empty-alloc-deref-rvalue.rs10
-rw-r--r--tests/ui/cfg/cfg-false-use-item.rs (renamed from tests/ui/filter-block-view-items.rs)2
-rw-r--r--tests/ui/const-generics/const-arg-in-const-arg.min.stderr8
-rw-r--r--tests/ui/const-generics/defaults/complex-generic-default-expr.min.stderr2
-rw-r--r--tests/ui/const-generics/early/const_arg_trivial_macro_expansion-4.stderr6
-rw-r--r--tests/ui/const-generics/early/macro_rules-braces.stderr8
-rw-r--r--tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces-2.stderr2
-rw-r--r--tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces.stderr2
-rw-r--r--tests/ui/const-generics/early/trivial-const-arg-nested-braces.stderr2
-rw-r--r--tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr4
-rw-r--r--tests/ui/const-generics/generic_const_exprs/bad-multiply.stderr2
-rw-r--r--tests/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr2
-rw-r--r--tests/ui/const-generics/generic_const_exprs/issue-72787.min.stderr8
-rw-r--r--tests/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr2
-rw-r--r--tests/ui/const-generics/generic_const_exprs/trivial-anon-const-use-cases.full.stderr13
-rw-r--r--tests/ui/const-generics/generic_const_exprs/trivial-anon-const-use-cases.min.stderr11
-rw-r--r--tests/ui/const-generics/generic_const_exprs/trivial-anon-const-use-cases.rs19
-rw-r--r--tests/ui/const-generics/issues/issue-68366.min.stderr2
-rw-r--r--tests/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr2
-rw-r--r--tests/ui/const-generics/issues/issue-80375.stderr2
-rw-r--r--tests/ui/const-generics/legacy-const-generics-bad.stderr2
-rw-r--r--tests/ui/const-generics/min_const_generics/complex-expression.stderr8
-rw-r--r--tests/ui/const-generics/repeat_expr_hack_gives_right_generics.stderr4
-rw-r--r--tests/ui/derives/copy-drop-mutually-exclusive.rs (renamed from tests/ui/exclusive-drop-and-copy.rs)2
-rw-r--r--tests/ui/derives/copy-drop-mutually-exclusive.stderr (renamed from tests/ui/exclusive-drop-and-copy.stderr)4
-rw-r--r--tests/ui/drop/explicit-drop-call-error.fixed (renamed from tests/ui/illegal-ufcs-drop.fixed)2
-rw-r--r--tests/ui/drop/explicit-drop-call-error.rs (renamed from tests/ui/illegal-ufcs-drop.rs)2
-rw-r--r--tests/ui/drop/explicit-drop-call-error.stderr (renamed from tests/ui/illegal-ufcs-drop.stderr)2
-rw-r--r--tests/ui/editions/unsafe-attr-edition-span.e2024.stderr24
-rw-r--r--tests/ui/editions/unsafe-attr-edition-span.rs27
-rw-r--r--tests/ui/empty-allocation-rvalue-non-null.rs7
-rw-r--r--tests/ui/empty-type-parameter-list.rs24
-rw-r--r--tests/ui/error-should-say-copy-not-pod.rs7
-rw-r--r--tests/ui/error-should-say-copy-not-pod.stderr22
-rw-r--r--tests/ui/explicit-i-suffix.rs13
-rw-r--r--tests/ui/ext-nonexistent.rs2
-rw-r--r--tests/ui/ext-nonexistent.stderr8
-rw-r--r--tests/ui/fact.rs26
-rw-r--r--tests/ui/fmt/format-macro-no-std.rs (renamed from tests/ui/format-no-std.rs)7
-rw-r--r--tests/ui/fun-indirect-call.rs9
-rw-r--r--tests/ui/future-incompatible-lint-group.rs15
-rw-r--r--tests/ui/generics/empty-generic-brackets-equiv.rs27
-rw-r--r--tests/ui/generics/empty-generic-brackets-equiv.stderr (renamed from tests/ui/empty-type-parameter-list.stderr)2
-rw-r--r--tests/ui/global-scope.rs13
-rw-r--r--tests/ui/hello.rs10
-rw-r--r--tests/ui/include-macros/parent_dir.rs2
-rw-r--r--tests/ui/include-macros/parent_dir.stderr17
-rw-r--r--tests/ui/lint/future-incompatible-lint-group.rs21
-rw-r--r--tests/ui/lint/future-incompatible-lint-group.stderr (renamed from tests/ui/future-incompatible-lint-group.stderr)18
-rw-r--r--tests/ui/macros/nested-macro-expansion.rs (renamed from tests/ui/ext-expand-inner-exprs.rs)2
-rw-r--r--tests/ui/methods/inherent-methods-same-name.rs (renamed from tests/ui/impl-inherent-non-conflict.rs)11
-rw-r--r--tests/ui/modules/impl-cross-module.rs (renamed from tests/ui/impl-not-adjacent-to-type.rs)2
-rw-r--r--tests/ui/resolve/auxiliary/issue-80079.rs2
-rw-r--r--tests/ui/resolve/auxiliary/privacy-struct-ctor.rs2
-rw-r--r--tests/ui/resolve/extern-prelude-fail.rs1
-rw-r--r--tests/ui/resolve/extern-prelude-fail.stderr4
-rw-r--r--tests/ui/resolve/global-scope-resolution.rs21
-rw-r--r--tests/ui/resolve/issue-42944.rs2
-rw-r--r--tests/ui/resolve/issue-5035.rs2
-rw-r--r--tests/ui/resolve/issue-5035.stderr6
-rw-r--r--tests/ui/resolve/nonexistent-macro.rs6
-rw-r--r--tests/ui/resolve/nonexistent-macro.stderr8
-rw-r--r--tests/ui/resolve/privacy-enum-ctor.rs4
-rw-r--r--tests/ui/resolve/privacy-enum-ctor.stderr38
-rw-r--r--tests/ui/resolve/privacy-struct-ctor.rs4
-rw-r--r--tests/ui/resolve/privacy-struct-ctor.stderr34
-rw-r--r--tests/ui/resolve/resolve-bad-visibility.rs1
-rw-r--r--tests/ui/resolve/resolve-bad-visibility.stderr10
-rw-r--r--tests/ui/resolve/suggest-builder-fn.rs2
-rw-r--r--tests/ui/resolve/unresolved-segments-visibility.rs2
-rw-r--r--tests/ui/resolve/unresolved-segments-visibility.stderr6
-rw-r--r--tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed1
-rw-r--r--tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs1
-rw-r--r--tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr8
-rw-r--r--tests/ui/rust-2018/edition-lint-nested-empty-paths.fixed1
-rw-r--r--tests/ui/rust-2018/edition-lint-nested-empty-paths.rs1
-rw-r--r--tests/ui/rust-2018/edition-lint-nested-empty-paths.stderr12
-rw-r--r--tests/ui/rust-2018/edition-lint-nested-paths.fixed1
-rw-r--r--tests/ui/rust-2018/edition-lint-nested-paths.rs1
-rw-r--r--tests/ui/rust-2018/edition-lint-nested-paths.stderr10
-rw-r--r--tests/ui/rust-2018/edition-lint-paths.fixed1
-rw-r--r--tests/ui/rust-2018/edition-lint-paths.rs1
-rw-r--r--tests/ui/rust-2018/edition-lint-paths.stderr20
-rw-r--r--tests/ui/rust-2018/extern-crate-rename.fixed1
-rw-r--r--tests/ui/rust-2018/extern-crate-rename.rs1
-rw-r--r--tests/ui/rust-2018/extern-crate-rename.stderr4
-rw-r--r--tests/ui/rust-2018/extern-crate-submod.fixed1
-rw-r--r--tests/ui/rust-2018/extern-crate-submod.rs1
-rw-r--r--tests/ui/rust-2018/extern-crate-submod.stderr4
-rw-r--r--tests/ui/rust-2018/try-ident.fixed1
-rw-r--r--tests/ui/rust-2018/try-ident.rs1
-rw-r--r--tests/ui/rust-2018/try-ident.stderr6
-rw-r--r--tests/ui/rust-2018/try-macro.fixed1
-rw-r--r--tests/ui/rust-2018/try-macro.rs1
-rw-r--r--tests/ui/rust-2018/try-macro.stderr4
-rw-r--r--tests/ui/self/self-shadowing-import.rs2
-rw-r--r--tests/ui/sepcomp/auxiliary/sepcomp_lib.rs4
-rw-r--r--tests/ui/sepcomp/sepcomp-extern.rs4
-rw-r--r--tests/ui/sepcomp/sepcomp-fns-backwards.rs4
-rw-r--r--tests/ui/sepcomp/sepcomp-fns.rs4
-rw-r--r--tests/ui/sepcomp/sepcomp-statics.rs4
-rw-r--r--tests/ui/sepcomp/sepcomp-unwind.rs4
-rw-r--r--tests/ui/shadowed-use-visibility.rs2
-rw-r--r--tests/ui/shadowed/shadowed-trait-methods.rs2
-rw-r--r--tests/ui/shadowed/shadowed-use-visibility.rs8
-rw-r--r--tests/ui/shadowed/shadowed-use-visibility.stderr14
-rw-r--r--tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs2
-rw-r--r--tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr4
-rw-r--r--tests/ui/span/dropck_arr_cycle_checked.rs2
-rw-r--r--tests/ui/span/dropck_vec_cycle_checked.rs2
-rw-r--r--tests/ui/span/vec-must-not-hide-type-from-dropck.rs2
-rw-r--r--tests/ui/span/visibility-ty-params.rs6
-rw-r--r--tests/ui/span/visibility-ty-params.stderr18
-rw-r--r--tests/ui/stability-attribute/auxiliary/pub-and-stability.rs (renamed from tests/ui/auxiliary/pub-and-stability.rs)0
-rw-r--r--tests/ui/stability-attribute/stability-privacy-interaction.rs (renamed from tests/ui/explore-issue-38412.rs)34
-rw-r--r--tests/ui/stability-attribute/stability-privacy-interaction.stderr (renamed from tests/ui/explore-issue-38412.stderr)42
-rw-r--r--tests/ui/static/auxiliary/static_priv_by_default.rs10
-rw-r--r--tests/ui/static/static-extern-type.rs4
-rw-r--r--tests/ui/statics/auxiliary/static_fn_inline_xc_aux.rs2
-rw-r--r--tests/ui/statics/auxiliary/static_fn_trait_xc_aux.rs2
-rw-r--r--tests/ui/statics/static-impl.rs4
-rw-r--r--tests/ui/structs-enums/issue-2718-a.rs2
-rw-r--r--tests/ui/structs-enums/namespaced-enum-glob-import.rs2
-rw-r--r--tests/ui/suggestions/dyn-incompatible-trait-should-use-self.rs7
-rw-r--r--tests/ui/suggestions/dyn-incompatible-trait-should-use-self.stderr40
-rw-r--r--tests/ui/suggestions/ice-unwrap-probe-many-result-125876.rs1
-rw-r--r--tests/ui/suggestions/ice-unwrap-probe-many-result-125876.stderr8
-rw-r--r--tests/ui/suggestions/issue-116434-2015.rs2
-rw-r--r--tests/ui/suggestions/issue-116434-2015.stderr14
-rw-r--r--tests/ui/suggestions/issue-61963.rs1
-rw-r--r--tests/ui/suggestions/issue-61963.stderr6
-rw-r--r--tests/ui/suggestions/missing-lifetime-specifier.rs10
-rw-r--r--tests/ui/suggestions/missing-lifetime-specifier.stderr55
-rw-r--r--tests/ui/symbol-names/impl1.rs2
-rw-r--r--tests/ui/symbol-names/issue-53912.rs10
-rw-r--r--tests/ui/symbol-names/issue-60925.rs10
-rw-r--r--tests/ui/threads-sendsync/thread-local-syntax.rs2
-rw-r--r--tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.fixed1
-rw-r--r--tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.rs1
-rw-r--r--tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr2
-rw-r--r--tests/ui/traits/auxiliary/traitimpl.rs2
-rw-r--r--tests/ui/traits/const-traits/inherent-impl.rs2
-rw-r--r--tests/ui/traits/const-traits/inherent-impl.stderr4
-rw-r--r--tests/ui/traits/const-traits/mbe-dyn-const-2015.rs1
-rw-r--r--tests/ui/traits/impl-2.rs2
-rw-r--r--tests/ui/traits/item-privacy.rs18
-rw-r--r--tests/ui/traits/static-method-overwriting.rs4
-rw-r--r--tests/ui/transmutability/references/reject_extension.stderr2
-rw-r--r--tests/ui/transmutability/references/unit-to-u8.stderr2
-rw-r--r--tests/ui/transmutability/references/unsafecell.rs12
-rw-r--r--tests/ui/transmutability/references/unsafecell.stderr32
-rw-r--r--tests/ui/tuple/tuple-struct-fields/test.rs2
-rw-r--r--tests/ui/tuple/tuple-struct-fields/test2.rs2
-rw-r--r--tests/ui/tuple/tuple-struct-fields/test3.rs2
-rw-r--r--tests/ui/type/auxiliary/crate_a1.rs4
-rw-r--r--tests/ui/type/auxiliary/crate_a2.rs2
-rw-r--r--tests/ui/type/issue-7607-2.rs2
-rw-r--r--tests/ui/type/type-mismatch-same-crate-name.stderr2
-rw-r--r--tests/ui/underscore-imports/basic.rs24
-rw-r--r--tests/ui/underscore-imports/basic.stderr12
-rw-r--r--tests/ui/unresolved/unresolved-import-recovery.rs2
-rw-r--r--tests/ui/unresolved/unresolved-import-recovery.stderr6
-rw-r--r--tests/ui/unsized/unsized3-rpass.rs4
-rw-r--r--tests/ui/use/use-mod/use-mod-4.rs2
-rw-r--r--tests/ui/use/use-mod/use-mod-4.stderr20
-rw-r--r--tests/ui/warnings/no-explicit-path-issue-122509.rs4
-rw-r--r--tests/ui/weird-exprs.rs2
-rw-r--r--tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs10
-rw-r--r--tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr90
228 files changed, 1648 insertions, 1393 deletions
diff --git a/compiler/rustc_codegen_ssa/src/traits/type_.rs b/compiler/rustc_codegen_ssa/src/traits/type_.rs
index c3fc21a9285..70331b72353 100644
--- a/compiler/rustc_codegen_ssa/src/traits/type_.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/type_.rs
@@ -44,10 +44,10 @@ pub trait DerivedTypeCodegenMethods<'tcx>:
     BaseTypeCodegenMethods + MiscCodegenMethods<'tcx> + HasTyCtxt<'tcx> + HasTypingEnv<'tcx>
 {
     fn type_int(&self) -> Self::Type {
-        match &self.sess().target.c_int_width[..] {
-            "16" => self.type_i16(),
-            "32" => self.type_i32(),
-            "64" => self.type_i64(),
+        match &self.sess().target.c_int_width {
+            16 => self.type_i16(),
+            32 => self.type_i32(),
+            64 => self.type_i64(),
             width => bug!("Unsupported c_int_width: {}", width),
         }
     }
diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs
index 1dae858b7ef..1953eef8170 100644
--- a/compiler/rustc_metadata/src/rmeta/decoder.rs
+++ b/compiler/rustc_metadata/src/rmeta/decoder.rs
@@ -1649,34 +1649,7 @@ impl<'a> CrateMetadataRef<'a> {
                         old_name
                     && let Ok(rest) = virtual_name.strip_prefix(virtual_dir)
                 {
-                    // The std library crates are in
-                    // `$sysroot/lib/rustlib/src/rust/library`, whereas other crates
-                    // may be in `$sysroot/lib/rustlib/src/rust/` directly. So we
-                    // detect crates from the std libs and handle them specially.
-                    const STD_LIBS: &[&str] = &[
-                        "core",
-                        "alloc",
-                        "std",
-                        "test",
-                        "term",
-                        "unwind",
-                        "proc_macro",
-                        "panic_abort",
-                        "panic_unwind",
-                        "profiler_builtins",
-                        "rtstartup",
-                        "rustc-std-workspace-core",
-                        "rustc-std-workspace-alloc",
-                        "rustc-std-workspace-std",
-                        "backtrace",
-                    ];
-                    let is_std_lib = STD_LIBS.iter().any(|l| rest.starts_with(l));
-
-                    let new_path = if is_std_lib {
-                        real_dir.join("library").join(rest)
-                    } else {
-                        real_dir.join(rest)
-                    };
+                    let new_path = real_dir.join(rest);
 
                     debug!(
                         "try_to_translate_virtual_to_real: `{}` -> `{}`",
diff --git a/compiler/rustc_parse/src/validate_attr.rs b/compiler/rustc_parse/src/validate_attr.rs
index 378cbb84637..555ab3cdb2b 100644
--- a/compiler/rustc_parse/src/validate_attr.rs
+++ b/compiler/rustc_parse/src/validate_attr.rs
@@ -180,9 +180,14 @@ pub fn check_attribute_safety(
             let diag_span = attr_item.span();
 
             // Attributes can be safe in earlier editions, and become unsafe in later ones.
+            //
+            // Use the span of the attribute's name to determine the edition: the span of the
+            // attribute as a whole may be inaccurate if it was emitted by a macro.
+            //
+            // See https://github.com/rust-lang/rust/issues/142182.
             let emit_error = match unsafe_since {
                 None => true,
-                Some(unsafe_since) => attr.span.edition() >= unsafe_since,
+                Some(unsafe_since) => path_span.edition() >= unsafe_since,
             };
 
             if emit_error {
diff --git a/compiler/rustc_resolve/messages.ftl b/compiler/rustc_resolve/messages.ftl
index 38cdfa72a14..58942474e32 100644
--- a/compiler/rustc_resolve/messages.ftl
+++ b/compiler/rustc_resolve/messages.ftl
@@ -119,7 +119,7 @@ resolve_const_param_in_enum_discriminant =
     const parameters may not be used in enum discriminant values
 
 resolve_const_param_in_non_trivial_anon_const =
-    const parameters may only be used as standalone arguments, i.e. `{$name}`
+    const parameters may only be used as standalone arguments here, i.e. `{$name}`
 
 resolve_constructor_private_if_any_field_private =
     a constructor is private if any of the fields is private
diff --git a/compiler/rustc_smir/src/stable_mir/ty.rs b/compiler/rustc_smir/src/stable_mir/ty.rs
index 4461b4ae125..45936857d33 100644
--- a/compiler/rustc_smir/src/stable_mir/ty.rs
+++ b/compiler/rustc_smir/src/stable_mir/ty.rs
@@ -743,6 +743,14 @@ crate_def! {
     pub ClosureDef;
 }
 
+impl ClosureDef {
+    /// Retrieves the body of the closure definition. Returns None if the body
+    /// isn't available.
+    pub fn body(&self) -> Option<Body> {
+        with(|ctx| ctx.has_body(self.0).then(|| ctx.mir_body(self.0)))
+    }
+}
+
 crate_def! {
     #[derive(Serialize)]
     pub CoroutineDef;
diff --git a/compiler/rustc_target/src/spec/base/xtensa.rs b/compiler/rustc_target/src/spec/base/xtensa.rs
index 47a532dfdd4..a7cc748973c 100644
--- a/compiler/rustc_target/src/spec/base/xtensa.rs
+++ b/compiler/rustc_target/src/spec/base/xtensa.rs
@@ -6,7 +6,7 @@ pub(crate) fn opts() -> TargetOptions {
     TargetOptions {
         os: "none".into(),
         endian: Endian::Little,
-        c_int_width: "32".into(),
+        c_int_width: 32,
         linker_flavor: LinkerFlavor::Gnu(Cc::Yes, Lld::No),
         executables: true,
         panic_strategy: PanicStrategy::Abort,
diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs
index 039056a5a25..6c716f87125 100644
--- a/compiler/rustc_target/src/spec/json.rs
+++ b/compiler/rustc_target/src/spec/json.rs
@@ -80,6 +80,12 @@ impl Target {
                     base.$key_name = s;
                 }
             } );
+            ($key_name:ident = $json_name:expr, u64 as $int_ty:ty) => ( {
+                let name = $json_name;
+                if let Some(s) = obj.remove(name).and_then(|b| b.as_u64()) {
+                    base.$key_name = s as $int_ty;
+                }
+            } );
             ($key_name:ident, bool) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
                 if let Some(s) = obj.remove(&name).and_then(|b| b.as_bool()) {
@@ -554,7 +560,7 @@ impl Target {
             }
         }
 
-        key!(c_int_width = "target-c-int-width");
+        key!(c_int_width = "target-c-int-width", u64 as u16);
         key!(c_enum_min_bits, Option<u64>); // if None, matches c_int_width
         key!(os);
         key!(env);
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
index 6ceb5e80f21..c360fe63a00 100644
--- a/compiler/rustc_target/src/spec/mod.rs
+++ b/compiler/rustc_target/src/spec/mod.rs
@@ -2213,18 +2213,10 @@ impl Target {
             });
         }
 
-        dl.c_enum_min_size = self
-            .c_enum_min_bits
-            .map_or_else(
-                || {
-                    self.c_int_width
-                        .parse()
-                        .map_err(|_| String::from("failed to parse c_int_width"))
-                },
-                Ok,
-            )
-            .and_then(|i| Integer::from_size(Size::from_bits(i)))
-            .map_err(|err| TargetDataLayoutErrors::InvalidBitsSize { err })?;
+        dl.c_enum_min_size = Integer::from_size(Size::from_bits(
+            self.c_enum_min_bits.unwrap_or(self.c_int_width as _),
+        ))
+        .map_err(|err| TargetDataLayoutErrors::InvalidBitsSize { err })?;
 
         Ok(dl)
     }
@@ -2286,7 +2278,7 @@ pub struct TargetOptions {
     /// Used as the `target_endian` `cfg` variable. Defaults to little endian.
     pub endian: Endian,
     /// Width of c_int type. Defaults to "32".
-    pub c_int_width: StaticCow<str>,
+    pub c_int_width: u16,
     /// OS name to use for conditional compilation (`target_os`). Defaults to "none".
     /// "none" implies a bare metal target without `std` library.
     /// A couple of targets having `std` also use "unknown" as an `os` value,
@@ -2783,7 +2775,7 @@ impl Default for TargetOptions {
     fn default() -> TargetOptions {
         TargetOptions {
             endian: Endian::Little,
-            c_int_width: "32".into(),
+            c_int_width: 32,
             os: "none".into(),
             env: "".into(),
             abi: "".into(),
diff --git a/compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs
index 6a83835059e..4902dc37d13 100644
--- a/compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs
@@ -31,7 +31,7 @@ pub(crate) fn target() -> Target {
         options: TargetOptions {
             os: "vita".into(),
             endian: Endian::Little,
-            c_int_width: "32".into(),
+            c_int_width: 32,
             env: "newlib".into(),
             vendor: "sony".into(),
             abi: "eabihf".into(),
diff --git a/compiler/rustc_target/src/spec/targets/avr_none.rs b/compiler/rustc_target/src/spec/targets/avr_none.rs
index 91d3197d099..07ed2a37803 100644
--- a/compiler/rustc_target/src/spec/targets/avr_none.rs
+++ b/compiler/rustc_target/src/spec/targets/avr_none.rs
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
         llvm_target: "avr-unknown-unknown".into(),
         pointer_width: 16,
         options: TargetOptions {
-            c_int_width: "16".into(),
+            c_int_width: 16,
             exe_suffix: ".elf".into(),
             linker: Some("avr-gcc".into()),
             eh_frame_header: false,
diff --git a/compiler/rustc_target/src/spec/targets/msp430_none_elf.rs b/compiler/rustc_target/src/spec/targets/msp430_none_elf.rs
index b067ac1e54a..caf77bb8669 100644
--- a/compiler/rustc_target/src/spec/targets/msp430_none_elf.rs
+++ b/compiler/rustc_target/src/spec/targets/msp430_none_elf.rs
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
         arch: "msp430".into(),
 
         options: TargetOptions {
-            c_int_width: "16".into(),
+            c_int_width: 16,
 
             // The LLVM backend currently can't generate object files. To
             // workaround this LLVM generates assembly files which then we feed
diff --git a/compiler/rustc_target/src/spec/targets/xtensa_esp32_espidf.rs b/compiler/rustc_target/src/spec/targets/xtensa_esp32_espidf.rs
index c5b4d472fad..8a6773811e8 100644
--- a/compiler/rustc_target/src/spec/targets/xtensa_esp32_espidf.rs
+++ b/compiler/rustc_target/src/spec/targets/xtensa_esp32_espidf.rs
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
 
         options: TargetOptions {
             endian: Endian::Little,
-            c_int_width: "32".into(),
+            c_int_width: 32,
             families: cvs!["unix"],
             os: "espidf".into(),
             env: "newlib".into(),
diff --git a/compiler/rustc_target/src/spec/targets/xtensa_esp32s2_espidf.rs b/compiler/rustc_target/src/spec/targets/xtensa_esp32s2_espidf.rs
index cffdaa90727..f38d771f257 100644
--- a/compiler/rustc_target/src/spec/targets/xtensa_esp32s2_espidf.rs
+++ b/compiler/rustc_target/src/spec/targets/xtensa_esp32s2_espidf.rs
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
 
         options: TargetOptions {
             endian: Endian::Little,
-            c_int_width: "32".into(),
+            c_int_width: 32,
             families: cvs!["unix"],
             os: "espidf".into(),
             env: "newlib".into(),
diff --git a/compiler/rustc_target/src/spec/targets/xtensa_esp32s3_espidf.rs b/compiler/rustc_target/src/spec/targets/xtensa_esp32s3_espidf.rs
index 2e4afc00541..4ec6e319fd4 100644
--- a/compiler/rustc_target/src/spec/targets/xtensa_esp32s3_espidf.rs
+++ b/compiler/rustc_target/src/spec/targets/xtensa_esp32s3_espidf.rs
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
 
         options: TargetOptions {
             endian: Endian::Little,
-            c_int_width: "32".into(),
+            c_int_width: 32,
             families: cvs!["unix"],
             os: "espidf".into(),
             env: "newlib".into(),
diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs
index fc5be111144..0c88bd3dcbc 100644
--- a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs
+++ b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs
@@ -2558,32 +2558,31 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
                         rustc_transmute::Reason::SrcIsNotYetSupported => {
                             format!("analyzing the transmutability of `{src}` is not yet supported")
                         }
-
                         rustc_transmute::Reason::DstIsNotYetSupported => {
                             format!("analyzing the transmutability of `{dst}` is not yet supported")
                         }
-
                         rustc_transmute::Reason::DstIsBitIncompatible => {
                             format!(
                                 "at least one value of `{src}` isn't a bit-valid value of `{dst}`"
                             )
                         }
-
                         rustc_transmute::Reason::DstUninhabited => {
                             format!("`{dst}` is uninhabited")
                         }
-
                         rustc_transmute::Reason::DstMayHaveSafetyInvariants => {
                             format!("`{dst}` may carry safety invariants")
                         }
                         rustc_transmute::Reason::DstIsTooBig => {
                             format!("the size of `{src}` is smaller than the size of `{dst}`")
                         }
-                        rustc_transmute::Reason::DstRefIsTooBig { src, dst } => {
-                            let src_size = src.size;
-                            let dst_size = dst.size;
+                        rustc_transmute::Reason::DstRefIsTooBig {
+                            src,
+                            src_size,
+                            dst,
+                            dst_size,
+                        } => {
                             format!(
-                                "the referent size of `{src}` ({src_size} bytes) \
+                                "the size of `{src}` ({src_size} bytes) \
                         is smaller than that of `{dst}` ({dst_size} bytes)"
                             )
                         }
diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
index 7acf0f990d1..786afd7cf48 100644
--- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
@@ -9,13 +9,12 @@
 
 use std::ops::ControlFlow;
 
-use rustc_ast::Mutability;
 use rustc_data_structures::stack::ensure_sufficient_stack;
 use rustc_hir::lang_items::LangItem;
 use rustc_infer::infer::{DefineOpaqueTypes, HigherRankedType, InferOk};
 use rustc_infer::traits::ObligationCauseCode;
 use rustc_middle::traits::{BuiltinImplSource, SignatureMismatchData};
-use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt, Upcast, elaborate};
+use rustc_middle::ty::{self, GenericArgsRef, Region, Ty, TyCtxt, Upcast, elaborate};
 use rustc_middle::{bug, span_bug};
 use rustc_span::def_id::DefId;
 use thin_vec::thin_vec;
@@ -286,99 +285,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
     ) -> Result<PredicateObligations<'tcx>, SelectionError<'tcx>> {
         use rustc_transmute::{Answer, Assume, Condition};
 
-        /// Generate sub-obligations for reference-to-reference transmutations.
-        fn reference_obligations<'tcx>(
-            tcx: TyCtxt<'tcx>,
-            obligation: &PolyTraitObligation<'tcx>,
-            (src_lifetime, src_ty, src_mut): (ty::Region<'tcx>, Ty<'tcx>, Mutability),
-            (dst_lifetime, dst_ty, dst_mut): (ty::Region<'tcx>, Ty<'tcx>, Mutability),
-            assume: Assume,
-        ) -> PredicateObligations<'tcx> {
-            let make_transmute_obl = |src, dst| {
-                let transmute_trait = obligation.predicate.def_id();
-                let assume = obligation.predicate.skip_binder().trait_ref.args.const_at(2);
-                let trait_ref = ty::TraitRef::new(
-                    tcx,
-                    transmute_trait,
-                    [
-                        ty::GenericArg::from(dst),
-                        ty::GenericArg::from(src),
-                        ty::GenericArg::from(assume),
-                    ],
-                );
-                Obligation::with_depth(
-                    tcx,
-                    obligation.cause.clone(),
-                    obligation.recursion_depth + 1,
-                    obligation.param_env,
-                    trait_ref,
-                )
-            };
-
-            let make_freeze_obl = |ty| {
-                let trait_ref = ty::TraitRef::new(
-                    tcx,
-                    tcx.require_lang_item(LangItem::Freeze, obligation.cause.span),
-                    [ty::GenericArg::from(ty)],
-                );
-                Obligation::with_depth(
-                    tcx,
-                    obligation.cause.clone(),
-                    obligation.recursion_depth + 1,
-                    obligation.param_env,
-                    trait_ref,
-                )
-            };
-
-            let make_outlives_obl = |target, region| {
-                let outlives = ty::OutlivesPredicate(target, region);
-                Obligation::with_depth(
-                    tcx,
-                    obligation.cause.clone(),
-                    obligation.recursion_depth + 1,
-                    obligation.param_env,
-                    outlives,
-                )
-            };
-
-            // Given a transmutation from `&'a (mut) Src` and `&'dst (mut) Dst`,
-            // it is always the case that `Src` must be transmutable into `Dst`,
-            // and that that `'src` must outlive `'dst`.
-            let mut obls = PredicateObligations::with_capacity(1);
-            obls.push(make_transmute_obl(src_ty, dst_ty));
-            if !assume.lifetimes {
-                obls.push(make_outlives_obl(src_lifetime, dst_lifetime));
-            }
-
-            // Given a transmutation from `&Src`, both `Src` and `Dst` must be
-            // `Freeze`, otherwise, using the transmuted value could lead to
-            // data races.
-            if src_mut == Mutability::Not {
-                obls.extend([make_freeze_obl(src_ty), make_freeze_obl(dst_ty)])
-            }
-
-            // Given a transmutation into `&'dst mut Dst`, it also must be the
-            // case that `Dst` is transmutable into `Src`. For example,
-            // transmuting bool -> u8 is OK as long as you can't update that u8
-            // to be > 1, because you could later transmute the u8 back to a
-            // bool and get undefined behavior. It also must be the case that
-            // `'dst` lives exactly as long as `'src`.
-            if dst_mut == Mutability::Mut {
-                obls.push(make_transmute_obl(dst_ty, src_ty));
-                if !assume.lifetimes {
-                    obls.push(make_outlives_obl(dst_lifetime, src_lifetime));
-                }
-            }
-
-            obls
-        }
-
         /// Flatten the `Condition` tree into a conjunction of obligations.
         #[instrument(level = "debug", skip(tcx, obligation))]
         fn flatten_answer_tree<'tcx>(
             tcx: TyCtxt<'tcx>,
             obligation: &PolyTraitObligation<'tcx>,
-            cond: Condition<rustc_transmute::layout::rustc::Ref<'tcx>>,
+            cond: Condition<Region<'tcx>, Ty<'tcx>>,
             assume: Assume,
         ) -> PredicateObligations<'tcx> {
             match cond {
@@ -388,13 +300,50 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
                     .into_iter()
                     .flat_map(|cond| flatten_answer_tree(tcx, obligation, cond, assume))
                     .collect(),
-                Condition::IfTransmutable { src, dst } => reference_obligations(
-                    tcx,
-                    obligation,
-                    (src.lifetime, src.ty, src.mutability),
-                    (dst.lifetime, dst.ty, dst.mutability),
-                    assume,
-                ),
+                Condition::Immutable { ty } => {
+                    let trait_ref = ty::TraitRef::new(
+                        tcx,
+                        tcx.require_lang_item(LangItem::Freeze, obligation.cause.span),
+                        [ty::GenericArg::from(ty)],
+                    );
+                    thin_vec![Obligation::with_depth(
+                        tcx,
+                        obligation.cause.clone(),
+                        obligation.recursion_depth + 1,
+                        obligation.param_env,
+                        trait_ref,
+                    )]
+                }
+                Condition::Outlives { long, short } => {
+                    let outlives = ty::OutlivesPredicate(long, short);
+                    thin_vec![Obligation::with_depth(
+                        tcx,
+                        obligation.cause.clone(),
+                        obligation.recursion_depth + 1,
+                        obligation.param_env,
+                        outlives,
+                    )]
+                }
+                Condition::Transmutable { src, dst } => {
+                    let transmute_trait = obligation.predicate.def_id();
+                    let assume = obligation.predicate.skip_binder().trait_ref.args.const_at(2);
+                    let trait_ref = ty::TraitRef::new(
+                        tcx,
+                        transmute_trait,
+                        [
+                            ty::GenericArg::from(dst),
+                            ty::GenericArg::from(src),
+                            ty::GenericArg::from(assume),
+                        ],
+                    );
+                    thin_vec![Obligation::with_depth(
+                        tcx,
+                        obligation.cause.clone(),
+                        obligation.recursion_depth + 1,
+                        obligation.param_env,
+                        trait_ref,
+                    )]
+                }
             }
         }
 
diff --git a/compiler/rustc_transmute/src/layout/dfa.rs b/compiler/rustc_transmute/src/layout/dfa.rs
index 6d072c336af..6fc40ce42d8 100644
--- a/compiler/rustc_transmute/src/layout/dfa.rs
+++ b/compiler/rustc_transmute/src/layout/dfa.rs
@@ -2,32 +2,35 @@ use std::fmt;
 use std::iter::Peekable;
 use std::sync::atomic::{AtomicU32, Ordering};
 
-use super::{Byte, Ref, Tree, Uninhabited};
+use super::{Byte, Reference, Region, Tree, Type, Uninhabited};
 use crate::{Map, Set};
 
 #[derive(PartialEq)]
 #[cfg_attr(test, derive(Clone))]
-pub(crate) struct Dfa<R>
+pub(crate) struct Dfa<R, T>
 where
-    R: Ref,
+    R: Region,
+    T: Type,
 {
-    pub(crate) transitions: Map<State, Transitions<R>>,
+    pub(crate) transitions: Map<State, Transitions<R, T>>,
     pub(crate) start: State,
     pub(crate) accept: State,
 }
 
 #[derive(PartialEq, Clone, Debug)]
-pub(crate) struct Transitions<R>
+pub(crate) struct Transitions<R, T>
 where
-    R: Ref,
+    R: Region,
+    T: Type,
 {
     byte_transitions: EdgeSet<State>,
-    ref_transitions: Map<R, State>,
+    ref_transitions: Map<Reference<R, T>, State>,
 }
 
-impl<R> Default for Transitions<R>
+impl<R, T> Default for Transitions<R, T>
 where
-    R: Ref,
+    R: Region,
+    T: Type,
 {
     fn default() -> Self {
         Self { byte_transitions: EdgeSet::empty(), ref_transitions: Map::default() }
@@ -51,9 +54,10 @@ impl fmt::Debug for State {
     }
 }
 
-impl<R> Dfa<R>
+impl<R, T> Dfa<R, T>
 where
-    R: Ref,
+    R: Region,
+    T: Type,
 {
     #[cfg(test)]
     pub(crate) fn bool() -> Self {
@@ -64,7 +68,7 @@ where
     }
 
     pub(crate) fn unit() -> Self {
-        let transitions: Map<State, Transitions<R>> = Map::default();
+        let transitions: Map<State, Transitions<R, T>> = Map::default();
         let start = State::new();
         let accept = start;
 
@@ -78,21 +82,21 @@ where
         })
     }
 
-    pub(crate) fn from_ref(r: R) -> Self {
+    pub(crate) fn from_ref(r: Reference<R, T>) -> Self {
         Self::from_transitions(|accept| Transitions {
             byte_transitions: EdgeSet::empty(),
             ref_transitions: [(r, accept)].into_iter().collect(),
         })
     }
 
-    fn from_transitions(f: impl FnOnce(State) -> Transitions<R>) -> Self {
+    fn from_transitions(f: impl FnOnce(State) -> Transitions<R, T>) -> Self {
         let start = State::new();
         let accept = State::new();
 
         Self { transitions: [(start, f(accept))].into_iter().collect(), start, accept }
     }
 
-    pub(crate) fn from_tree(tree: Tree<!, R>) -> Result<Self, Uninhabited> {
+    pub(crate) fn from_tree(tree: Tree<!, R, T>) -> Result<Self, Uninhabited> {
         Ok(match tree {
             Tree::Byte(b) => Self::from_byte(b),
             Tree::Ref(r) => Self::from_ref(r),
@@ -125,7 +129,7 @@ where
         let start = self.start;
         let accept = other.accept;
 
-        let mut transitions: Map<State, Transitions<R>> = self.transitions;
+        let mut transitions: Map<State, Transitions<R, T>> = self.transitions;
 
         for (source, transition) in other.transitions {
             let fix_state = |state| if state == other.start { self.accept } else { state };
@@ -169,7 +173,7 @@ where
         };
 
         let start = mapped((Some(a.start), Some(b.start)));
-        let mut transitions: Map<State, Transitions<R>> = Map::default();
+        let mut transitions: Map<State, Transitions<R, T>> = Map::default();
         let empty_transitions = Transitions::default();
 
         struct WorkQueue {
@@ -257,7 +261,7 @@ where
             .flat_map(|transitions| transitions.byte_transitions.iter())
     }
 
-    pub(crate) fn refs_from(&self, start: State) -> impl Iterator<Item = (R, State)> {
+    pub(crate) fn refs_from(&self, start: State) -> impl Iterator<Item = (Reference<R, T>, State)> {
         self.transitions
             .get(&start)
             .into_iter()
@@ -297,9 +301,10 @@ where
 }
 
 /// Serialize the DFA using the Graphviz DOT format.
-impl<R> fmt::Debug for Dfa<R>
+impl<R, T> fmt::Debug for Dfa<R, T>
 where
-    R: Ref,
+    R: Region,
+    T: Type,
 {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         writeln!(f, "digraph {{")?;
diff --git a/compiler/rustc_transmute/src/layout/mod.rs b/compiler/rustc_transmute/src/layout/mod.rs
index c08bf440734..acbce258f39 100644
--- a/compiler/rustc_transmute/src/layout/mod.rs
+++ b/compiler/rustc_transmute/src/layout/mod.rs
@@ -78,16 +78,41 @@ impl From<u8> for Byte {
     }
 }
 
+/// A reference, i.e., `&'region T` or `&'region mut T`.
+#[derive(Debug, Hash, Eq, PartialEq, Ord, PartialOrd, Clone, Copy)]
+pub(crate) struct Reference<R, T>
+where
+    R: Region,
+    T: Type,
+{
+    pub(crate) region: R,
+    pub(crate) is_mut: bool,
+    pub(crate) referent: T,
+    pub(crate) referent_size: usize,
+    pub(crate) referent_align: usize,
+}
+
+impl<R, T> fmt::Display for Reference<R, T>
+where
+    R: Region,
+    T: Type,
+{
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.write_str("&")?;
+        if self.is_mut {
+            f.write_str("mut ")?;
+        }
+        self.referent.fmt(f)
+    }
+}
+
 pub(crate) trait Def: Debug + Hash + Eq + PartialEq + Copy + Clone {
     fn has_safety_invariants(&self) -> bool;
 }
-pub trait Ref: Debug + Hash + Eq + PartialEq + Copy + Clone {
-    fn min_align(&self) -> usize;
 
-    fn size(&self) -> usize;
+pub(crate) trait Region: Debug + Hash + Eq + PartialEq + Copy + Clone {}
 
-    fn is_mutable(&self) -> bool;
-}
+pub(crate) trait Type: Debug + Hash + Eq + PartialEq + Copy + Clone {}
 
 impl Def for ! {
     fn has_safety_invariants(&self) -> bool {
@@ -95,79 +120,21 @@ impl Def for ! {
     }
 }
 
-impl Ref for ! {
-    fn min_align(&self) -> usize {
-        unreachable!()
-    }
-    fn size(&self) -> usize {
-        unreachable!()
-    }
-    fn is_mutable(&self) -> bool {
-        unreachable!()
-    }
-}
+impl Region for ! {}
 
-#[cfg(test)]
-impl<const N: usize> Ref for [(); N] {
-    fn min_align(&self) -> usize {
-        N
-    }
+impl Type for ! {}
 
-    fn size(&self) -> usize {
-        N
-    }
+#[cfg(test)]
+impl Region for usize {}
 
-    fn is_mutable(&self) -> bool {
-        false
-    }
-}
+#[cfg(test)]
+impl Type for () {}
 
 #[cfg(feature = "rustc")]
 pub mod rustc {
-    use std::fmt::{self, Write};
-
     use rustc_abi::Layout;
-    use rustc_middle::mir::Mutability;
     use rustc_middle::ty::layout::{HasTyCtxt, LayoutCx, LayoutError};
-    use rustc_middle::ty::{self, Ty};
-
-    /// A reference in the layout.
-    #[derive(Debug, Hash, Eq, PartialEq, Clone, Copy)]
-    pub struct Ref<'tcx> {
-        pub lifetime: ty::Region<'tcx>,
-        pub ty: Ty<'tcx>,
-        pub mutability: Mutability,
-        pub align: usize,
-        pub size: usize,
-    }
-
-    impl<'tcx> super::Ref for Ref<'tcx> {
-        fn min_align(&self) -> usize {
-            self.align
-        }
-
-        fn size(&self) -> usize {
-            self.size
-        }
-
-        fn is_mutable(&self) -> bool {
-            match self.mutability {
-                Mutability::Mut => true,
-                Mutability::Not => false,
-            }
-        }
-    }
-    impl<'tcx> Ref<'tcx> {}
-
-    impl<'tcx> fmt::Display for Ref<'tcx> {
-        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-            f.write_char('&')?;
-            if self.mutability == Mutability::Mut {
-                f.write_str("mut ")?;
-            }
-            self.ty.fmt(f)
-        }
-    }
+    use rustc_middle::ty::{self, Region, Ty};
 
     /// A visibility node in the layout.
     #[derive(Debug, Hash, Eq, PartialEq, Clone, Copy)]
@@ -187,6 +154,10 @@ pub mod rustc {
         }
     }
 
+    impl<'tcx> super::Region for Region<'tcx> {}
+
+    impl<'tcx> super::Type for Ty<'tcx> {}
+
     pub(crate) fn layout_of<'tcx>(
         cx: LayoutCx<'tcx>,
         ty: Ty<'tcx>,
diff --git a/compiler/rustc_transmute/src/layout/tree.rs b/compiler/rustc_transmute/src/layout/tree.rs
index ff665695b5a..372b4f5353a 100644
--- a/compiler/rustc_transmute/src/layout/tree.rs
+++ b/compiler/rustc_transmute/src/layout/tree.rs
@@ -1,6 +1,6 @@
 use std::ops::{ControlFlow, RangeInclusive};
 
-use super::{Byte, Def, Ref};
+use super::{Byte, Def, Reference, Region, Type};
 
 #[cfg(test)]
 mod tests;
@@ -15,10 +15,11 @@ mod tests;
 /// 2. A `Seq` is never directly nested beneath another `Seq`.
 /// 3. `Seq`s and `Alt`s with a single member do not exist.
 #[derive(Clone, Debug, Hash, PartialEq, Eq)]
-pub(crate) enum Tree<D, R>
+pub(crate) enum Tree<D, R, T>
 where
     D: Def,
-    R: Ref,
+    R: Region,
+    T: Type,
 {
     /// A sequence of successive layouts.
     Seq(Vec<Self>),
@@ -27,7 +28,7 @@ where
     /// A definition node.
     Def(D),
     /// A reference node.
-    Ref(R),
+    Ref(Reference<R, T>),
     /// A byte node.
     Byte(Byte),
 }
@@ -48,10 +49,11 @@ impl From<rustc_abi::Endian> for Endian {
     }
 }
 
-impl<D, R> Tree<D, R>
+impl<D, R, T> Tree<D, R, T>
 where
     D: Def,
-    R: Ref,
+    R: Region,
+    T: Type,
 {
     /// A `Tree` consisting only of a definition node.
     pub(crate) fn def(def: D) -> Self {
@@ -138,7 +140,7 @@ where
 
     /// Remove all `Def` nodes, and all branches of the layout for which `f`
     /// produces `true`.
-    pub(crate) fn prune<F>(self, f: &F) -> Tree<!, R>
+    pub(crate) fn prune<F>(self, f: &F) -> Tree<!, R, T>
     where
         F: Fn(D) -> bool,
     {
@@ -198,13 +200,13 @@ where
 
     /// Produces a `Tree` where each of the trees in `trees` are sequenced one
     /// after another.
-    pub(crate) fn seq<const N: usize>(trees: [Tree<D, R>; N]) -> Self {
+    pub(crate) fn seq<const N: usize>(trees: [Tree<D, R, T>; N]) -> Self {
         trees.into_iter().fold(Tree::unit(), Self::then)
     }
 
     /// Produces a `Tree` where each of the trees in `trees` are accepted as
     /// alternative layouts.
-    pub(crate) fn alt<const N: usize>(trees: [Tree<D, R>; N]) -> Self {
+    pub(crate) fn alt<const N: usize>(trees: [Tree<D, R, T>; N]) -> Self {
         trees.into_iter().fold(Tree::uninhabited(), Self::or)
     }
 
@@ -251,11 +253,14 @@ pub(crate) mod rustc {
         FieldIdx, FieldsShape, Layout, Size, TagEncoding, TyAndLayout, VariantIdx, Variants,
     };
     use rustc_middle::ty::layout::{HasTyCtxt, LayoutCx, LayoutError};
-    use rustc_middle::ty::{self, AdtDef, AdtKind, List, ScalarInt, Ty, TyCtxt, TypeVisitableExt};
+    use rustc_middle::ty::{
+        self, AdtDef, AdtKind, List, Region, ScalarInt, Ty, TyCtxt, TypeVisitableExt,
+    };
     use rustc_span::ErrorGuaranteed;
 
     use super::Tree;
-    use crate::layout::rustc::{Def, Ref, layout_of};
+    use crate::layout::Reference;
+    use crate::layout::rustc::{Def, layout_of};
 
     #[derive(Debug, Copy, Clone)]
     pub(crate) enum Err {
@@ -281,7 +286,7 @@ pub(crate) mod rustc {
         }
     }
 
-    impl<'tcx> Tree<Def<'tcx>, Ref<'tcx>> {
+    impl<'tcx> Tree<Def<'tcx>, Region<'tcx>, Ty<'tcx>> {
         pub(crate) fn from_ty(ty: Ty<'tcx>, cx: LayoutCx<'tcx>) -> Result<Self, Err> {
             use rustc_abi::HasDataLayout;
             let layout = layout_of(cx, ty)?;
@@ -353,16 +358,17 @@ pub(crate) mod rustc {
                     }
                 }
 
-                ty::Ref(lifetime, ty, mutability) => {
+                ty::Ref(region, ty, mutability) => {
                     let layout = layout_of(cx, *ty)?;
-                    let align = layout.align.abi.bytes_usize();
-                    let size = layout.size.bytes_usize();
-                    Ok(Tree::Ref(Ref {
-                        lifetime: *lifetime,
-                        ty: *ty,
-                        mutability: *mutability,
-                        align,
-                        size,
+                    let referent_align = layout.align.abi.bytes_usize();
+                    let referent_size = layout.size.bytes_usize();
+
+                    Ok(Tree::Ref(Reference {
+                        region: *region,
+                        is_mut: mutability.is_mut(),
+                        referent: *ty,
+                        referent_align,
+                        referent_size,
                     }))
                 }
 
diff --git a/compiler/rustc_transmute/src/layout/tree/tests.rs b/compiler/rustc_transmute/src/layout/tree/tests.rs
index 8c3dbbe37ab..bc47b19c681 100644
--- a/compiler/rustc_transmute/src/layout/tree/tests.rs
+++ b/compiler/rustc_transmute/src/layout/tree/tests.rs
@@ -20,13 +20,13 @@ mod prune {
 
         #[test]
         fn seq_1() {
-            let layout: Tree<Def, !> = Tree::def(Def::NoSafetyInvariants).then(Tree::byte(0x00));
+            let layout: Tree<Def, !, !> = Tree::def(Def::NoSafetyInvariants).then(Tree::byte(0x00));
             assert_eq!(layout.prune(&|d| matches!(d, Def::HasSafetyInvariants)), Tree::byte(0x00));
         }
 
         #[test]
         fn seq_2() {
-            let layout: Tree<Def, !> =
+            let layout: Tree<Def, !, !> =
                 Tree::byte(0x00).then(Tree::def(Def::NoSafetyInvariants)).then(Tree::byte(0x01));
 
             assert_eq!(
@@ -41,7 +41,7 @@ mod prune {
 
         #[test]
         fn invisible_def() {
-            let layout: Tree<Def, !> = Tree::def(Def::HasSafetyInvariants);
+            let layout: Tree<Def, !, !> = Tree::def(Def::HasSafetyInvariants);
             assert_eq!(
                 layout.prune(&|d| matches!(d, Def::HasSafetyInvariants)),
                 Tree::uninhabited()
@@ -50,7 +50,7 @@ mod prune {
 
         #[test]
         fn invisible_def_in_seq_len_2() {
-            let layout: Tree<Def, !> =
+            let layout: Tree<Def, !, !> =
                 Tree::def(Def::NoSafetyInvariants).then(Tree::def(Def::HasSafetyInvariants));
             assert_eq!(
                 layout.prune(&|d| matches!(d, Def::HasSafetyInvariants)),
@@ -60,7 +60,7 @@ mod prune {
 
         #[test]
         fn invisible_def_in_seq_len_3() {
-            let layout: Tree<Def, !> = Tree::def(Def::NoSafetyInvariants)
+            let layout: Tree<Def, !, !> = Tree::def(Def::NoSafetyInvariants)
                 .then(Tree::byte(0x00))
                 .then(Tree::def(Def::HasSafetyInvariants));
             assert_eq!(
@@ -75,20 +75,20 @@ mod prune {
 
         #[test]
         fn visible_def() {
-            let layout: Tree<Def, !> = Tree::def(Def::NoSafetyInvariants);
+            let layout: Tree<Def, !, !> = Tree::def(Def::NoSafetyInvariants);
             assert_eq!(layout.prune(&|d| matches!(d, Def::HasSafetyInvariants)), Tree::unit());
         }
 
         #[test]
         fn visible_def_in_seq_len_2() {
-            let layout: Tree<Def, !> =
+            let layout: Tree<Def, !, !> =
                 Tree::def(Def::NoSafetyInvariants).then(Tree::def(Def::NoSafetyInvariants));
             assert_eq!(layout.prune(&|d| matches!(d, Def::HasSafetyInvariants)), Tree::unit());
         }
 
         #[test]
         fn visible_def_in_seq_len_3() {
-            let layout: Tree<Def, !> = Tree::def(Def::NoSafetyInvariants)
+            let layout: Tree<Def, !, !> = Tree::def(Def::NoSafetyInvariants)
                 .then(Tree::byte(0x00))
                 .then(Tree::def(Def::NoSafetyInvariants));
             assert_eq!(layout.prune(&|d| matches!(d, Def::HasSafetyInvariants)), Tree::byte(0x00));
diff --git a/compiler/rustc_transmute/src/lib.rs b/compiler/rustc_transmute/src/lib.rs
index ce18dad5517..36281ff16bc 100644
--- a/compiler/rustc_transmute/src/lib.rs
+++ b/compiler/rustc_transmute/src/lib.rs
@@ -19,23 +19,29 @@ pub struct Assume {
 /// Either transmutation is allowed, we have an error, or we have an optional
 /// Condition that must hold.
 #[derive(Debug, Hash, Eq, PartialEq, Clone)]
-pub enum Answer<R> {
+pub enum Answer<R, T> {
     Yes,
-    No(Reason<R>),
-    If(Condition<R>),
+    No(Reason<T>),
+    If(Condition<R, T>),
 }
 
 /// A condition which must hold for safe transmutation to be possible.
 #[derive(Debug, Hash, Eq, PartialEq, Clone)]
-pub enum Condition<R> {
+pub enum Condition<R, T> {
     /// `Src` is transmutable into `Dst`, if `src` is transmutable into `dst`.
-    IfTransmutable { src: R, dst: R },
+    Transmutable { src: T, dst: T },
+
+    /// The region `long` must outlive `short`.
+    Outlives { long: R, short: R },
+
+    /// The `ty` is immutable.
+    Immutable { ty: T },
 
     /// `Src` is transmutable into `Dst`, if all of the enclosed requirements are met.
-    IfAll(Vec<Condition<R>>),
+    IfAll(Vec<Condition<R, T>>),
 
     /// `Src` is transmutable into `Dst` if any of the enclosed requirements are met.
-    IfAny(Vec<Condition<R>>),
+    IfAny(Vec<Condition<R, T>>),
 }
 
 /// Answers "why wasn't the source type transmutable into the destination type?"
@@ -53,12 +59,16 @@ pub enum Reason<T> {
     DstMayHaveSafetyInvariants,
     /// `Dst` is larger than `Src`, and the excess bytes were not exclusively uninitialized.
     DstIsTooBig,
-    /// A referent of `Dst` is larger than a referent in `Src`.
+    /// `Dst` is larger `Src`.
     DstRefIsTooBig {
         /// The referent of the source type.
         src: T,
+        /// The size of the source type's referent.
+        src_size: usize,
         /// The too-large referent of the destination type.
         dst: T,
+        /// The size of the destination type's referent.
+        dst_size: usize,
     },
     /// Src should have a stricter alignment than Dst, but it does not.
     DstHasStricterAlignment { src_min_align: usize, dst_min_align: usize },
@@ -79,7 +89,7 @@ pub enum Reason<T> {
 #[cfg(feature = "rustc")]
 mod rustc {
     use rustc_hir::lang_items::LangItem;
-    use rustc_middle::ty::{Const, Ty, TyCtxt};
+    use rustc_middle::ty::{Const, Region, Ty, TyCtxt};
 
     use super::*;
 
@@ -105,7 +115,7 @@ mod rustc {
             &mut self,
             types: Types<'tcx>,
             assume: crate::Assume,
-        ) -> crate::Answer<crate::layout::rustc::Ref<'tcx>> {
+        ) -> crate::Answer<Region<'tcx>, Ty<'tcx>> {
             crate::maybe_transmutable::MaybeTransmutableQuery::new(
                 types.src, types.dst, assume, self.tcx,
             )
diff --git a/compiler/rustc_transmute/src/maybe_transmutable/mod.rs b/compiler/rustc_transmute/src/maybe_transmutable/mod.rs
index f76abe50ed3..062de4b5d08 100644
--- a/compiler/rustc_transmute/src/maybe_transmutable/mod.rs
+++ b/compiler/rustc_transmute/src/maybe_transmutable/mod.rs
@@ -5,7 +5,7 @@ pub(crate) mod query_context;
 #[cfg(test)]
 mod tests;
 
-use crate::layout::{self, Def, Dfa, Ref, Tree, dfa, union};
+use crate::layout::{self, Def, Dfa, Reference, Tree, dfa, union};
 use crate::maybe_transmutable::query_context::QueryContext;
 use crate::{Answer, Condition, Map, Reason};
 
@@ -41,7 +41,10 @@ mod rustc {
         /// This method begins by converting `src` and `dst` from `Ty`s to `Tree`s,
         /// then computes an answer using those trees.
         #[instrument(level = "debug", skip(self), fields(src = ?self.src, dst = ?self.dst))]
-        pub(crate) fn answer(self) -> Answer<<TyCtxt<'tcx> as QueryContext>::Ref> {
+        pub(crate) fn answer(
+            self,
+        ) -> Answer<<TyCtxt<'tcx> as QueryContext>::Region, <TyCtxt<'tcx> as QueryContext>::Type>
+        {
             let Self { src, dst, assume, context } = self;
 
             let layout_cx = LayoutCx::new(context, TypingEnv::fully_monomorphized());
@@ -67,7 +70,11 @@ mod rustc {
     }
 }
 
-impl<C> MaybeTransmutableQuery<Tree<<C as QueryContext>::Def, <C as QueryContext>::Ref>, C>
+impl<C>
+    MaybeTransmutableQuery<
+        Tree<<C as QueryContext>::Def, <C as QueryContext>::Region, <C as QueryContext>::Type>,
+        C,
+    >
 where
     C: QueryContext,
 {
@@ -77,7 +84,7 @@ where
     /// then converts `src` and `dst` to `Dfa`s, and computes an answer using those DFAs.
     #[inline(always)]
     #[instrument(level = "debug", skip(self), fields(src = ?self.src, dst = ?self.dst))]
-    pub(crate) fn answer(self) -> Answer<<C as QueryContext>::Ref> {
+    pub(crate) fn answer(self) -> Answer<<C as QueryContext>::Region, <C as QueryContext>::Type> {
         let Self { src, dst, assume, context } = self;
 
         // Unconditionally remove all `Def` nodes from `src`, without pruning away the
@@ -130,12 +137,12 @@ where
     }
 }
 
-impl<C> MaybeTransmutableQuery<Dfa<<C as QueryContext>::Ref>, C>
+impl<C> MaybeTransmutableQuery<Dfa<<C as QueryContext>::Region, <C as QueryContext>::Type>, C>
 where
     C: QueryContext,
 {
     /// Answers whether a `Dfa` is transmutable into another `Dfa`.
-    pub(crate) fn answer(self) -> Answer<<C as QueryContext>::Ref> {
+    pub(crate) fn answer(self) -> Answer<<C as QueryContext>::Region, <C as QueryContext>::Type> {
         self.answer_memo(&mut Map::default(), self.src.start, self.dst.start)
     }
 
@@ -143,10 +150,13 @@ where
     #[instrument(level = "debug", skip(self))]
     fn answer_memo(
         &self,
-        cache: &mut Map<(dfa::State, dfa::State), Answer<<C as QueryContext>::Ref>>,
+        cache: &mut Map<
+            (dfa::State, dfa::State),
+            Answer<<C as QueryContext>::Region, <C as QueryContext>::Type>,
+        >,
         src_state: dfa::State,
         dst_state: dfa::State,
-    ) -> Answer<<C as QueryContext>::Ref> {
+    ) -> Answer<<C as QueryContext>::Region, <C as QueryContext>::Type> {
         if let Some(answer) = cache.get(&(src_state, dst_state)) {
             answer.clone()
         } else {
@@ -160,10 +170,13 @@ where
 
     fn answer_impl(
         &self,
-        cache: &mut Map<(dfa::State, dfa::State), Answer<<C as QueryContext>::Ref>>,
+        cache: &mut Map<
+            (dfa::State, dfa::State),
+            Answer<<C as QueryContext>::Region, <C as QueryContext>::Type>,
+        >,
         src_state: dfa::State,
         dst_state: dfa::State,
-    ) -> Answer<<C as QueryContext>::Ref> {
+    ) -> Answer<<C as QueryContext>::Region, <C as QueryContext>::Type> {
         debug!(?src_state, ?dst_state);
         debug!(src = ?self.src);
         debug!(dst = ?self.dst);
@@ -247,27 +260,51 @@ where
                     // ...there exists a reference transition out of `dst_state`...
                     Quantifier::ThereExists.apply(self.dst.refs_from(dst_state).map(
                         |(dst_ref, dst_state_prime)| {
-                            if !src_ref.is_mutable() && dst_ref.is_mutable() {
+                            if !src_ref.is_mut && dst_ref.is_mut {
                                 Answer::No(Reason::DstIsMoreUnique)
                             } else if !self.assume.alignment
-                                && src_ref.min_align() < dst_ref.min_align()
+                                && src_ref.referent_align < dst_ref.referent_align
                             {
                                 Answer::No(Reason::DstHasStricterAlignment {
-                                    src_min_align: src_ref.min_align(),
-                                    dst_min_align: dst_ref.min_align(),
+                                    src_min_align: src_ref.referent_align,
+                                    dst_min_align: dst_ref.referent_align,
+                                })
+                            } else if dst_ref.referent_size > src_ref.referent_size {
+                                Answer::No(Reason::DstRefIsTooBig {
+                                    src: src_ref.referent,
+                                    src_size: src_ref.referent_size,
+                                    dst: dst_ref.referent,
+                                    dst_size: dst_ref.referent_size,
                                 })
-                            } else if dst_ref.size() > src_ref.size() {
-                                Answer::No(Reason::DstRefIsTooBig { src: src_ref, dst: dst_ref })
                             } else {
-                                // ...such that `src` is transmutable into `dst`, if
-                                // `src_ref` is transmutability into `dst_ref`.
-                                and(
-                                    Answer::If(Condition::IfTransmutable {
-                                        src: src_ref,
-                                        dst: dst_ref,
-                                    }),
-                                    self.answer_memo(cache, src_state_prime, dst_state_prime),
-                                )
+                                let mut conditions = Vec::with_capacity(4);
+                                let mut is_transmutable =
+                                    |src: Reference<_, _>, dst: Reference<_, _>| {
+                                        conditions.push(Condition::Transmutable {
+                                            src: src.referent,
+                                            dst: dst.referent,
+                                        });
+                                        if !self.assume.lifetimes {
+                                            conditions.push(Condition::Outlives {
+                                                long: src.region,
+                                                short: dst.region,
+                                            });
+                                        }
+                                    };
+
+                                is_transmutable(src_ref, dst_ref);
+
+                                if dst_ref.is_mut {
+                                    is_transmutable(dst_ref, src_ref);
+                                } else {
+                                    conditions.push(Condition::Immutable { ty: dst_ref.referent });
+                                }
+
+                                Answer::If(Condition::IfAll(conditions)).and(self.answer_memo(
+                                    cache,
+                                    src_state_prime,
+                                    dst_state_prime,
+                                ))
                             }
                         },
                     ))
@@ -275,67 +312,65 @@ where
             );
 
             if self.assume.validity {
-                or(bytes_answer, refs_answer)
+                bytes_answer.or(refs_answer)
             } else {
-                and(bytes_answer, refs_answer)
+                bytes_answer.and(refs_answer)
             }
         }
     }
 }
 
-fn and<R>(lhs: Answer<R>, rhs: Answer<R>) -> Answer<R>
-where
-    R: PartialEq,
-{
-    match (lhs, rhs) {
-        // If both are errors, then we should return the more specific one
-        (Answer::No(Reason::DstIsBitIncompatible), Answer::No(reason))
-        | (Answer::No(reason), Answer::No(_))
-        // If either is an error, return it
-        | (Answer::No(reason), _) | (_, Answer::No(reason)) => Answer::No(reason),
-        // If only one side has a condition, pass it along
-        | (Answer::Yes, other) | (other, Answer::Yes) => other,
-        // If both sides have IfAll conditions, merge them
-        (Answer::If(Condition::IfAll(mut lhs)), Answer::If(Condition::IfAll(ref mut rhs))) => {
-            lhs.append(rhs);
-            Answer::If(Condition::IfAll(lhs))
-        }
-        // If only one side is an IfAll, add the other Condition to it
-        (Answer::If(cond), Answer::If(Condition::IfAll(mut conds)))
-        | (Answer::If(Condition::IfAll(mut conds)), Answer::If(cond)) => {
-            conds.push(cond);
-            Answer::If(Condition::IfAll(conds))
+impl<R, T> Answer<R, T> {
+    fn and(self, rhs: Answer<R, T>) -> Answer<R, T> {
+        let lhs = self;
+        match (lhs, rhs) {
+            // If both are errors, then we should return the more specific one
+            (Answer::No(Reason::DstIsBitIncompatible), Answer::No(reason))
+            | (Answer::No(reason), Answer::No(_))
+            // If either is an error, return it
+            | (Answer::No(reason), _) | (_, Answer::No(reason)) => Answer::No(reason),
+            // If only one side has a condition, pass it along
+            | (Answer::Yes, other) | (other, Answer::Yes) => other,
+            // If both sides have IfAll conditions, merge them
+            (Answer::If(Condition::IfAll(mut lhs)), Answer::If(Condition::IfAll(ref mut rhs))) => {
+                lhs.append(rhs);
+                Answer::If(Condition::IfAll(lhs))
+            }
+            // If only one side is an IfAll, add the other Condition to it
+            (Answer::If(cond), Answer::If(Condition::IfAll(mut conds)))
+            | (Answer::If(Condition::IfAll(mut conds)), Answer::If(cond)) => {
+                conds.push(cond);
+                Answer::If(Condition::IfAll(conds))
+            }
+            // Otherwise, both lhs and rhs conditions can be combined in a parent IfAll
+            (Answer::If(lhs), Answer::If(rhs)) => Answer::If(Condition::IfAll(vec![lhs, rhs])),
         }
-        // Otherwise, both lhs and rhs conditions can be combined in a parent IfAll
-        (Answer::If(lhs), Answer::If(rhs)) => Answer::If(Condition::IfAll(vec![lhs, rhs])),
     }
-}
 
-fn or<R>(lhs: Answer<R>, rhs: Answer<R>) -> Answer<R>
-where
-    R: PartialEq,
-{
-    match (lhs, rhs) {
-        // If both are errors, then we should return the more specific one
-        (Answer::No(Reason::DstIsBitIncompatible), Answer::No(reason))
-        | (Answer::No(reason), Answer::No(_)) => Answer::No(reason),
-        // Otherwise, errors can be ignored for the rest of the pattern matching
-        (Answer::No(_), other) | (other, Answer::No(_)) => or(other, Answer::Yes),
-        // If only one side has a condition, pass it along
-        (Answer::Yes, other) | (other, Answer::Yes) => other,
-        // If both sides have IfAny conditions, merge them
-        (Answer::If(Condition::IfAny(mut lhs)), Answer::If(Condition::IfAny(ref mut rhs))) => {
-            lhs.append(rhs);
-            Answer::If(Condition::IfAny(lhs))
-        }
-        // If only one side is an IfAny, add the other Condition to it
-        (Answer::If(cond), Answer::If(Condition::IfAny(mut conds)))
-        | (Answer::If(Condition::IfAny(mut conds)), Answer::If(cond)) => {
-            conds.push(cond);
-            Answer::If(Condition::IfAny(conds))
+    fn or(self, rhs: Answer<R, T>) -> Answer<R, T> {
+        let lhs = self;
+        match (lhs, rhs) {
+            // If both are errors, then we should return the more specific one
+            (Answer::No(Reason::DstIsBitIncompatible), Answer::No(reason))
+            | (Answer::No(reason), Answer::No(_)) => Answer::No(reason),
+            // Otherwise, errors can be ignored for the rest of the pattern matching
+            (Answer::No(_), other) | (other, Answer::No(_)) => other.or(Answer::Yes),
+            // If only one side has a condition, pass it along
+            (Answer::Yes, other) | (other, Answer::Yes) => other,
+            // If both sides have IfAny conditions, merge them
+            (Answer::If(Condition::IfAny(mut lhs)), Answer::If(Condition::IfAny(ref mut rhs))) => {
+                lhs.append(rhs);
+                Answer::If(Condition::IfAny(lhs))
+            }
+            // If only one side is an IfAny, add the other Condition to it
+            (Answer::If(cond), Answer::If(Condition::IfAny(mut conds)))
+            | (Answer::If(Condition::IfAny(mut conds)), Answer::If(cond)) => {
+                conds.push(cond);
+                Answer::If(Condition::IfAny(conds))
+            }
+            // Otherwise, both lhs and rhs conditions can be combined in a parent IfAny
+            (Answer::If(lhs), Answer::If(rhs)) => Answer::If(Condition::IfAny(vec![lhs, rhs])),
         }
-        // Otherwise, both lhs and rhs conditions can be combined in a parent IfAny
-        (Answer::If(lhs), Answer::If(rhs)) => Answer::If(Condition::IfAny(vec![lhs, rhs])),
     }
 }
 
@@ -345,24 +380,25 @@ enum Quantifier {
 }
 
 impl Quantifier {
-    fn apply<R, I>(&self, iter: I) -> Answer<R>
+    fn apply<R, T, I>(&self, iter: I) -> Answer<R, T>
     where
-        R: layout::Ref,
-        I: IntoIterator<Item = Answer<R>>,
+        R: layout::Region,
+        T: layout::Type,
+        I: IntoIterator<Item = Answer<R, T>>,
     {
         use std::ops::ControlFlow::{Break, Continue};
 
         let (init, try_fold_f): (_, fn(_, _) -> _) = match self {
             Self::ThereExists => {
-                (Answer::No(Reason::DstIsBitIncompatible), |accum: Answer<R>, next| {
-                    match or(accum, next) {
-                        Answer::Yes => Break(Answer::Yes),
-                        maybe => Continue(maybe),
-                    }
+                (Answer::No(Reason::DstIsBitIncompatible), |accum: Answer<R, T>, next| match accum
+                    .or(next)
+                {
+                    Answer::Yes => Break(Answer::Yes),
+                    maybe => Continue(maybe),
                 })
             }
-            Self::ForAll => (Answer::Yes, |accum: Answer<R>, next| {
-                let answer = and(accum, next);
+            Self::ForAll => (Answer::Yes, |accum: Answer<R, T>, next| {
+                let answer = accum.and(next);
                 match answer {
                     Answer::No(_) => Break(answer),
                     maybe => Continue(maybe),
diff --git a/compiler/rustc_transmute/src/maybe_transmutable/query_context.rs b/compiler/rustc_transmute/src/maybe_transmutable/query_context.rs
index 214da101be3..6be0cb11904 100644
--- a/compiler/rustc_transmute/src/maybe_transmutable/query_context.rs
+++ b/compiler/rustc_transmute/src/maybe_transmutable/query_context.rs
@@ -3,7 +3,8 @@ use crate::layout;
 /// Context necessary to answer the question "Are these types transmutable?".
 pub(crate) trait QueryContext {
     type Def: layout::Def;
-    type Ref: layout::Ref;
+    type Region: layout::Region;
+    type Type: layout::Type;
 }
 
 #[cfg(test)]
@@ -12,9 +13,9 @@ pub(crate) mod test {
 
     use super::QueryContext;
 
-    pub(crate) struct UltraMinimal<R = !>(PhantomData<R>);
+    pub(crate) struct UltraMinimal<R = !, T = !>(PhantomData<(R, T)>);
 
-    impl<R> Default for UltraMinimal<R> {
+    impl<R, T> Default for UltraMinimal<R, T> {
         fn default() -> Self {
             Self(PhantomData)
         }
@@ -32,20 +33,26 @@ pub(crate) mod test {
         }
     }
 
-    impl<R: crate::layout::Ref> QueryContext for UltraMinimal<R> {
+    impl<R, T> QueryContext for UltraMinimal<R, T>
+    where
+        R: crate::layout::Region,
+        T: crate::layout::Type,
+    {
         type Def = Def;
-        type Ref = R;
+        type Region = R;
+        type Type = T;
     }
 }
 
 #[cfg(feature = "rustc")]
 mod rustc {
-    use rustc_middle::ty::TyCtxt;
+    use rustc_middle::ty::{Region, Ty, TyCtxt};
 
     use super::*;
 
     impl<'tcx> super::QueryContext for TyCtxt<'tcx> {
         type Def = layout::rustc::Def<'tcx>;
-        type Ref = layout::rustc::Ref<'tcx>;
+        type Region = Region<'tcx>;
+        type Type = Ty<'tcx>;
     }
 }
diff --git a/compiler/rustc_transmute/src/maybe_transmutable/tests.rs b/compiler/rustc_transmute/src/maybe_transmutable/tests.rs
index 0227ad71ae6..8440ace2608 100644
--- a/compiler/rustc_transmute/src/maybe_transmutable/tests.rs
+++ b/compiler/rustc_transmute/src/maybe_transmutable/tests.rs
@@ -3,17 +3,17 @@ extern crate test;
 use itertools::Itertools;
 
 use super::query_context::test::{Def, UltraMinimal};
-use crate::{Answer, Assume, Reason, layout};
+use crate::{Answer, Assume, Condition, Reason, layout};
 
-type Tree = layout::Tree<Def, !>;
-type Dfa = layout::Dfa<!>;
+type Tree = layout::Tree<Def, !, !>;
+type Dfa = layout::Dfa<!, !>;
 
 trait Representation {
-    fn is_transmutable(src: Self, dst: Self, assume: Assume) -> Answer<!>;
+    fn is_transmutable(src: Self, dst: Self, assume: Assume) -> Answer<!, !>;
 }
 
 impl Representation for Tree {
-    fn is_transmutable(src: Self, dst: Self, assume: Assume) -> Answer<!> {
+    fn is_transmutable(src: Self, dst: Self, assume: Assume) -> Answer<!, !> {
         crate::maybe_transmutable::MaybeTransmutableQuery::new(
             src,
             dst,
@@ -25,7 +25,7 @@ impl Representation for Tree {
 }
 
 impl Representation for Dfa {
-    fn is_transmutable(src: Self, dst: Self, assume: Assume) -> Answer<!> {
+    fn is_transmutable(src: Self, dst: Self, assume: Assume) -> Answer<!, !> {
         crate::maybe_transmutable::MaybeTransmutableQuery::new(
             src,
             dst,
@@ -40,7 +40,7 @@ fn is_transmutable<R: Representation + Clone>(
     src: &R,
     dst: &R,
     assume: Assume,
-) -> crate::Answer<!> {
+) -> crate::Answer<!, !> {
     let src = src.clone();
     let dst = dst.clone();
     // The only dimension of the transmutability analysis we want to test
@@ -53,7 +53,7 @@ mod safety {
     use super::*;
     use crate::Answer;
 
-    const DST_HAS_SAFETY_INVARIANTS: Answer<!> =
+    const DST_HAS_SAFETY_INVARIANTS: Answer<!, !> =
         Answer::No(crate::Reason::DstMayHaveSafetyInvariants);
 
     #[test]
@@ -177,14 +177,15 @@ mod bool {
 
     #[test]
     fn should_permit_validity_expansion_and_reject_contraction() {
-        let b0 = layout::Tree::<Def, !>::byte(0);
-        let b1 = layout::Tree::<Def, !>::byte(1);
-        let b2 = layout::Tree::<Def, !>::byte(2);
+        let b0 = layout::Tree::<Def, !, !>::byte(0);
+        let b1 = layout::Tree::<Def, !, !>::byte(1);
+        let b2 = layout::Tree::<Def, !, !>::byte(2);
 
         let alts = [b0, b1, b2];
 
         let into_layout = |alts: Vec<_>| {
-            alts.into_iter().fold(layout::Tree::<Def, !>::uninhabited(), layout::Tree::<Def, !>::or)
+            alts.into_iter()
+                .fold(layout::Tree::<Def, !, !>::uninhabited(), layout::Tree::<Def, !, !>::or)
         };
 
         let into_set = |alts: Vec<_>| {
@@ -277,7 +278,7 @@ mod alt {
 
     #[test]
     fn should_permit_identity_transmutation() {
-        type Tree = layout::Tree<Def, !>;
+        type Tree = layout::Tree<Def, !, !>;
 
         let x = Tree::Seq(vec![Tree::byte(0), Tree::byte(0)]);
         let y = Tree::Seq(vec![Tree::bool(), Tree::byte(1)]);
@@ -331,7 +332,7 @@ mod char {
     fn should_permit_valid_transmutation() {
         for order in [Endian::Big, Endian::Little] {
             use Answer::*;
-            let char_layout = layout::Tree::<Def, !>::char(order);
+            let char_layout = layout::Tree::<Def, !, !>::char(order);
 
             // `char`s can be in the following ranges:
             // - [0, 0xD7FF]
@@ -353,7 +354,7 @@ mod char {
                 (0xFFFFFFFF, no),
             ] {
                 let src_layout =
-                    layout::tree::Tree::<Def, !>::from_big_endian(order, src.to_be_bytes());
+                    layout::tree::Tree::<Def, !, !>::from_big_endian(order, src.to_be_bytes());
 
                 let a = is_transmutable(&src_layout, &char_layout, Assume::default());
                 assert_eq!(a, answer, "endian:{order:?},\nsrc:{src:x}");
@@ -371,7 +372,7 @@ mod nonzero {
     #[test]
     fn should_permit_identity_transmutation() {
         for width in NONZERO_BYTE_WIDTHS {
-            let layout = layout::Tree::<Def, !>::nonzero(width);
+            let layout = layout::Tree::<Def, !, !>::nonzero(width);
             assert_eq!(is_transmutable(&layout, &layout, Assume::default()), Answer::Yes);
         }
     }
@@ -381,8 +382,8 @@ mod nonzero {
         for width in NONZERO_BYTE_WIDTHS {
             use Answer::*;
 
-            let num = layout::Tree::<Def, !>::number(width);
-            let nz = layout::Tree::<Def, !>::nonzero(width);
+            let num = layout::Tree::<Def, !, !>::number(width);
+            let nz = layout::Tree::<Def, !, !>::nonzero(width);
 
             let a = is_transmutable(&num, &nz, Assume::default());
             assert_eq!(a, No(Reason::DstIsBitIncompatible), "width:{width}");
@@ -395,13 +396,23 @@ mod nonzero {
 
 mod r#ref {
     use super::*;
+    use crate::layout::Reference;
 
     #[test]
     fn should_permit_identity_transmutation() {
-        type Tree = crate::layout::Tree<Def, [(); 1]>;
+        type Tree = crate::layout::Tree<Def, usize, ()>;
 
         for validity in [false, true] {
-            let layout = Tree::Seq(vec![Tree::byte(0x00), Tree::Ref([()])]);
+            let layout = Tree::Seq(vec![
+                Tree::byte(0x00),
+                Tree::Ref(Reference {
+                    region: 42,
+                    is_mut: false,
+                    referent: (),
+                    referent_size: 0,
+                    referent_align: 1,
+                }),
+            ]);
 
             let assume = Assume { validity, ..Assume::default() };
 
@@ -414,7 +425,11 @@ mod r#ref {
             .answer();
             assert_eq!(
                 answer,
-                Answer::If(crate::Condition::IfTransmutable { src: [()], dst: [()] })
+                Answer::If(Condition::IfAll(vec![
+                    Condition::Transmutable { src: (), dst: () },
+                    Condition::Outlives { long: 42, short: 42 },
+                    Condition::Immutable { ty: () },
+                ]))
             );
         }
     }
diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs
index 911a51b0e16..f47873590a1 100644
--- a/src/bootstrap/src/core/build_steps/check.rs
+++ b/src/bootstrap/src/core/build_steps/check.rs
@@ -89,7 +89,7 @@ impl Step for Std {
         let stage = self.custom_stage.unwrap_or(builder.top_stage);
 
         let target = self.target;
-        let compiler = builder.compiler(stage, builder.config.build);
+        let compiler = builder.compiler(stage, builder.config.host_target);
 
         if stage == 0 {
             let mut is_explicitly_called =
@@ -244,7 +244,7 @@ impl Step for Rustc {
     /// the `compiler` targeting the `target` architecture. The artifacts
     /// created will also be linked into the sysroot directory.
     fn run(self, builder: &Builder<'_>) {
-        let compiler = builder.compiler(builder.top_stage, builder.config.build);
+        let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
         let target = self.target;
 
         if compiler.stage != 0 {
@@ -327,7 +327,7 @@ impl Step for CodegenBackend {
             return;
         }
 
-        let compiler = builder.compiler(builder.top_stage, builder.config.build);
+        let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
         let target = self.target;
         let backend = self.backend;
 
@@ -382,7 +382,7 @@ impl Step for RustAnalyzer {
     }
 
     fn run(self, builder: &Builder<'_>) {
-        let compiler = builder.compiler(builder.top_stage, builder.config.build);
+        let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
         let target = self.target;
 
         builder.ensure(Rustc::new(target, builder));
@@ -448,7 +448,7 @@ impl Step for Compiletest {
 
         let compiler = builder.compiler(
             if mode == Mode::ToolBootstrap { 0 } else { builder.top_stage },
-            builder.config.build,
+            builder.config.host_target,
         );
 
         if mode != Mode::ToolBootstrap {
@@ -527,7 +527,7 @@ fn run_tool_check_step(
     path: &str,
 ) {
     let display_name = path.rsplit('/').next().unwrap();
-    let compiler = builder.compiler(builder.top_stage, builder.config.build);
+    let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
 
     builder.ensure(Rustc::new(target, builder));
 
@@ -614,7 +614,7 @@ impl Step for CoverageDump {
         // Make sure we haven't forgotten any fields, if there are any.
         let Self {} = self;
         let display_name = "coverage-dump";
-        let host = builder.config.build;
+        let host = builder.config.host_target;
         let target = host;
         let mode = Mode::ToolBootstrap;
 
diff --git a/src/bootstrap/src/core/build_steps/clippy.rs b/src/bootstrap/src/core/build_steps/clippy.rs
index 0652c08ff49..788a3b9601d 100644
--- a/src/bootstrap/src/core/build_steps/clippy.rs
+++ b/src/bootstrap/src/core/build_steps/clippy.rs
@@ -144,7 +144,7 @@ impl Step for Std {
         builder.require_submodule("library/stdarch", None);
 
         let target = self.target;
-        let compiler = builder.compiler(builder.top_stage, builder.config.build);
+        let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
 
         let mut cargo = builder::Cargo::new(
             builder,
@@ -204,7 +204,7 @@ impl Step for Rustc {
     /// This will lint the compiler for a particular stage of the build using
     /// the `compiler` targeting the `target` architecture.
     fn run(self, builder: &Builder<'_>) {
-        let compiler = builder.compiler(builder.top_stage, builder.config.build);
+        let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
         let target = self.target;
 
         if !builder.download_rustc() {
@@ -285,7 +285,7 @@ macro_rules! lint_any {
             }
 
             fn run(self, builder: &Builder<'_>) -> Self::Output {
-                let compiler = builder.compiler(builder.top_stage, builder.config.build);
+                let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
                 let target = self.target;
 
                 if !builder.download_rustc() {
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index 5ecce31fe15..560925abba6 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -35,6 +35,7 @@ use crate::utils::helpers::{
 };
 use crate::{CLang, Compiler, DependencyType, FileType, GitRepo, LLVM_TOOLS, Mode, debug, trace};
 
+/// Build a standard library for the given `target` using the given `compiler`.
 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 pub struct Std {
     pub target: TargetSelection,
@@ -159,7 +160,7 @@ impl Step for Std {
         let compiler = if builder.download_rustc() && self.force_recompile {
             // When there are changes in the library tree with CI-rustc, we want to build
             // the stageN library and that requires using stageN-1 compiler.
-            builder.compiler(self.compiler.stage.saturating_sub(1), builder.config.build)
+            builder.compiler(self.compiler.stage.saturating_sub(1), builder.config.host_target)
         } else {
             self.compiler
         };
@@ -301,7 +302,7 @@ impl Step for Std {
 
         builder.ensure(StdLink::from_std(
             self,
-            builder.compiler(compiler.stage, builder.config.build),
+            builder.compiler(compiler.stage, builder.config.host_target),
         ));
     }
 }
@@ -960,11 +961,18 @@ fn cp_rustc_component_to_ci_sysroot(builder: &Builder<'_>, sysroot: &Path, conte
     }
 }
 
+/// Build rustc using the passed `build_compiler`.
+///
+/// - Makes sure that `build_compiler` has a standard library prepared for its host target,
+///   so that it can compile build scripts and proc macros when building this `rustc`.
+/// - Makes sure that `build_compiler` has a standard library prepared for `target`,
+///   so that the built `rustc` can *link to it* and use it at runtime.
 #[derive(Debug, PartialOrd, Ord, Clone, PartialEq, Eq, Hash)]
 pub struct Rustc {
+    /// The target on which rustc will run (its host).
     pub target: TargetSelection,
-    /// The **previous** compiler used to compile this compiler.
-    pub compiler: Compiler,
+    /// The **previous** compiler used to compile this rustc.
+    pub build_compiler: Compiler,
     /// Whether to build a subset of crates, rather than the whole compiler.
     ///
     /// This should only be requested by the user, not used within bootstrap itself.
@@ -974,8 +982,8 @@ pub struct Rustc {
 }
 
 impl Rustc {
-    pub fn new(compiler: Compiler, target: TargetSelection) -> Self {
-        Self { target, compiler, crates: Default::default() }
+    pub fn new(build_compiler: Compiler, target: TargetSelection) -> Self {
+        Self { target, build_compiler, crates: Default::default() }
     }
 }
 
@@ -1007,7 +1015,7 @@ impl Step for Rustc {
     fn make_run(run: RunConfig<'_>) {
         let crates = run.cargo_crates_in_set();
         run.builder.ensure(Rustc {
-            compiler: run
+            build_compiler: run
                 .builder
                 .compiler(run.builder.top_stage.saturating_sub(1), run.build_triple()),
             target: run.target,
@@ -1018,7 +1026,7 @@ impl Step for Rustc {
     /// Builds the compiler.
     ///
     /// This will build the compiler for a particular stage of the build using
-    /// the `compiler` targeting the `target` architecture. The artifacts
+    /// the `build_compiler` targeting the `target` architecture. The artifacts
     /// created will also be linked into the sysroot directory.
     #[cfg_attr(
         feature = "tracing",
@@ -1026,54 +1034,58 @@ impl Step for Rustc {
             level = "debug",
             name = "Rustc::run",
             skip_all,
-            fields(previous_compiler = ?self.compiler, target = ?self.target),
+            fields(previous_compiler = ?self.build_compiler, target = ?self.target),
         ),
     )]
     fn run(self, builder: &Builder<'_>) -> u32 {
-        let compiler = self.compiler;
+        let build_compiler = self.build_compiler;
         let target = self.target;
 
         // NOTE: the ABI of the stage0 compiler is different from the ABI of the downloaded compiler,
         // so its artifacts can't be reused.
-        if builder.download_rustc() && compiler.stage != 0 {
-            trace!(stage = compiler.stage, "`download_rustc` requested");
+        if builder.download_rustc() && build_compiler.stage != 0 {
+            trace!(stage = build_compiler.stage, "`download_rustc` requested");
 
-            let sysroot = builder.ensure(Sysroot { compiler, force_recompile: false });
+            let sysroot =
+                builder.ensure(Sysroot { compiler: build_compiler, force_recompile: false });
             cp_rustc_component_to_ci_sysroot(
                 builder,
                 &sysroot,
                 builder.config.ci_rustc_dev_contents(),
             );
-            return compiler.stage;
+            return build_compiler.stage;
         }
 
-        builder.ensure(Std::new(compiler, target));
+        // Build a standard library for `target` using the `build_compiler`.
+        // This will be the standard library that the rustc which we build *links to*.
+        builder.ensure(Std::new(build_compiler, target));
 
-        if builder.config.keep_stage.contains(&compiler.stage) {
-            trace!(stage = compiler.stage, "`keep-stage` requested");
+        if builder.config.keep_stage.contains(&build_compiler.stage) {
+            trace!(stage = build_compiler.stage, "`keep-stage` requested");
 
             builder.info("WARNING: Using a potentially old librustc. This may not behave well.");
             builder.info("WARNING: Use `--keep-stage-std` if you want to rebuild the compiler when it changes");
-            builder.ensure(RustcLink::from_rustc(self, compiler));
+            builder.ensure(RustcLink::from_rustc(self, build_compiler));
 
-            return compiler.stage;
+            return build_compiler.stage;
         }
 
-        let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
-        if compiler_to_use != compiler {
+        let compiler_to_use =
+            builder.compiler_for(build_compiler.stage, build_compiler.host, target);
+        if compiler_to_use != build_compiler {
             builder.ensure(Rustc::new(compiler_to_use, target));
             let msg = if compiler_to_use.host == target {
                 format!(
                     "Uplifting rustc (stage{} -> stage{})",
                     compiler_to_use.stage,
-                    compiler.stage + 1
+                    build_compiler.stage + 1
                 )
             } else {
                 format!(
                     "Uplifting rustc (stage{}:{} -> stage{}:{})",
                     compiler_to_use.stage,
                     compiler_to_use.host,
-                    compiler.stage + 1,
+                    build_compiler.stage + 1,
                     target
                 )
             };
@@ -1082,22 +1094,26 @@ impl Step for Rustc {
             return compiler_to_use.stage;
         }
 
-        // Ensure that build scripts and proc macros have a std / libproc_macro to link against.
+        // Build a standard library for the current host target using the `build_compiler`.
+        // This standard library will be used when building `rustc` for compiling
+        // build scripts and proc macros.
+        // If we are not cross-compiling, the Std build above will be the same one as the one we
+        // prepare here.
         builder.ensure(Std::new(
-            builder.compiler(self.compiler.stage, builder.config.build),
-            builder.config.build,
+            builder.compiler(self.build_compiler.stage, builder.config.host_target),
+            builder.config.host_target,
         ));
 
         let mut cargo = builder::Cargo::new(
             builder,
-            compiler,
+            build_compiler,
             Mode::Rustc,
             SourceType::InTree,
             target,
             Kind::Build,
         );
 
-        rustc_cargo(builder, &mut cargo, target, &compiler, &self.crates);
+        rustc_cargo(builder, &mut cargo, target, &build_compiler, &self.crates);
 
         // NB: all RUSTFLAGS should be added to `rustc_cargo()` so they will be
         // consistently applied by check/doc/test modes too.
@@ -1106,19 +1122,19 @@ impl Step for Rustc {
             cargo.arg("-p").arg(krate);
         }
 
-        if builder.build.config.enable_bolt_settings && compiler.stage == 1 {
+        if builder.build.config.enable_bolt_settings && build_compiler.stage == 1 {
             // Relocations are required for BOLT to work.
             cargo.env("RUSTC_BOLT_LINK_FLAGS", "1");
         }
 
         let _guard = builder.msg_sysroot_tool(
             Kind::Build,
-            compiler.stage,
+            build_compiler.stage,
             format_args!("compiler artifacts{}", crate_description(&self.crates)),
-            compiler.host,
+            build_compiler.host,
             target,
         );
-        let stamp = build_stamp::librustc_stamp(builder, compiler, target);
+        let stamp = build_stamp::librustc_stamp(builder, build_compiler, target);
         run_cargo(
             builder,
             cargo,
@@ -1150,10 +1166,10 @@ impl Step for Rustc {
 
         builder.ensure(RustcLink::from_rustc(
             self,
-            builder.compiler(compiler.stage, builder.config.build),
+            builder.compiler(build_compiler.stage, builder.config.host_target),
         ));
 
-        compiler.stage
+        build_compiler.stage
     }
 }
 
@@ -1161,7 +1177,7 @@ pub fn rustc_cargo(
     builder: &Builder<'_>,
     cargo: &mut Cargo,
     target: TargetSelection,
-    compiler: &Compiler,
+    build_compiler: &Compiler,
     crates: &[String],
 ) {
     cargo
@@ -1190,11 +1206,11 @@ pub fn rustc_cargo(
     // We want to link against registerEnzyme and in the future we want to use additional
     // functionality from Enzyme core. For that we need to link against Enzyme.
     if builder.config.llvm_enzyme {
-        let arch = builder.build.build;
+        let arch = builder.build.host_target;
         let enzyme_dir = builder.build.out.join(arch).join("enzyme").join("lib");
         cargo.rustflag("-L").rustflag(enzyme_dir.to_str().expect("Invalid path"));
 
-        if let Some(llvm_config) = builder.llvm_config(builder.config.build) {
+        if let Some(llvm_config) = builder.llvm_config(builder.config.host_target) {
             let llvm_version_major = llvm::get_llvm_version_major(builder, &llvm_config);
             cargo.rustflag("-l").rustflag(&format!("Enzyme-{llvm_version_major}"));
         }
@@ -1208,7 +1224,7 @@ pub fn rustc_cargo(
         cargo.rustflag("-Zdefault-visibility=protected");
     }
 
-    if is_lto_stage(compiler) {
+    if is_lto_stage(build_compiler) {
         match builder.config.rust_lto {
             RustcLto::Thin | RustcLto::Fat => {
                 // Since using LTO for optimizing dylibs is currently experimental,
@@ -1241,7 +1257,7 @@ pub fn rustc_cargo(
     // is already on by default in MSVC optimized builds, which is interpreted as --icf=all:
     // https://github.com/llvm/llvm-project/blob/3329cec2f79185bafd678f310fafadba2a8c76d2/lld/COFF/Driver.cpp#L1746
     // https://github.com/rust-lang/rust/blob/f22819bcce4abaff7d1246a56eec493418f9f4ee/compiler/rustc_codegen_ssa/src/back/linker.rs#L827
-    if builder.config.lld_mode.is_used() && !compiler.host.is_msvc() {
+    if builder.config.lld_mode.is_used() && !build_compiler.host.is_msvc() {
         cargo.rustflag("-Clink-args=-Wl,--icf=all");
     }
 
@@ -1249,7 +1265,7 @@ pub fn rustc_cargo(
         panic!("Cannot use and generate PGO profiles at the same time");
     }
     let is_collecting = if let Some(path) = &builder.config.rust_profile_generate {
-        if compiler.stage == 1 {
+        if build_compiler.stage == 1 {
             cargo.rustflag(&format!("-Cprofile-generate={path}"));
             // Apparently necessary to avoid overflowing the counters during
             // a Cargo build profile
@@ -1259,7 +1275,7 @@ pub fn rustc_cargo(
             false
         }
     } else if let Some(path) = &builder.config.rust_profile_use {
-        if compiler.stage == 1 {
+        if build_compiler.stage == 1 {
             cargo.rustflag(&format!("-Cprofile-use={path}"));
             if builder.is_verbose() {
                 cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
@@ -1284,20 +1300,20 @@ pub fn rustc_cargo(
     // useful.
     // This is only performed for non-incremental builds, as ccache cannot deal with these.
     if let Some(ref ccache) = builder.config.ccache
-        && compiler.stage == 0
+        && build_compiler.stage == 0
         && !builder.config.incremental
     {
         cargo.env("RUSTC_WRAPPER", ccache);
     }
 
-    rustc_cargo_env(builder, cargo, target, compiler.stage);
+    rustc_cargo_env(builder, cargo, target, build_compiler.stage);
 }
 
 pub fn rustc_cargo_env(
     builder: &Builder<'_>,
     cargo: &mut Cargo,
     target: TargetSelection,
-    stage: u32,
+    build_stage: u32,
 ) {
     // Set some configuration variables picked up by build scripts and
     // the compiler alike
@@ -1364,7 +1380,7 @@ pub fn rustc_cargo_env(
             crate::core::build_steps::llvm::prebuilt_llvm_config(builder, target, false)
                 .should_build();
         // `top_stage == stage` might be false for `check --stage 1`, if we are building the stage 1 compiler
-        let can_skip_build = builder.kind == Kind::Check && builder.top_stage == stage;
+        let can_skip_build = builder.kind == Kind::Check && builder.top_stage == build_stage;
         let should_skip_build = building_is_expensive && can_skip_build;
         if !should_skip_build {
             rustc_llvm_env(builder, cargo, target)
@@ -1475,7 +1491,7 @@ impl RustcLink {
     fn from_rustc(rustc: Rustc, host_compiler: Compiler) -> Self {
         Self {
             compiler: host_compiler,
-            previous_stage_compiler: rustc.compiler,
+            previous_stage_compiler: rustc.build_compiler,
             target: rustc.target,
             crates: rustc.crates,
         }
@@ -1813,7 +1829,7 @@ impl Step for Sysroot {
         // If we're downloading a compiler from CI, we can use the same compiler for all stages other than 0.
         if builder.download_rustc() && compiler.stage != 0 {
             assert_eq!(
-                builder.config.build, compiler.host,
+                builder.config.host_target, compiler.host,
                 "Cross-compiling is not yet supported with `download-rustc`",
             );
 
@@ -1967,7 +1983,7 @@ impl Step for Assemble {
         if target_compiler.stage == 0 {
             trace!("stage 0 build compiler is always available, simply returning");
             assert_eq!(
-                builder.config.build, target_compiler.host,
+                builder.config.host_target, target_compiler.host,
                 "Cannot obtain compiler for non-native build triple at stage 0"
             );
             // The stage 0 compiler for the build triple is always pre-built.
@@ -2080,15 +2096,16 @@ impl Step for Assemble {
         debug!(
             "ensuring build compiler is available: compiler(stage = {}, host = {:?})",
             target_compiler.stage - 1,
-            builder.config.build,
+            builder.config.host_target,
         );
-        let mut build_compiler = builder.compiler(target_compiler.stage - 1, builder.config.build);
+        let mut build_compiler =
+            builder.compiler(target_compiler.stage - 1, builder.config.host_target);
 
         // Build enzyme
         if builder.config.llvm_enzyme && !builder.config.dry_run() {
             debug!("`llvm_enzyme` requested");
             let enzyme_install = builder.ensure(llvm::Enzyme { target: build_compiler.host });
-            let llvm_config = builder.llvm_config(builder.config.build).unwrap();
+            let llvm_config = builder.llvm_config(builder.config.host_target).unwrap();
             let llvm_version_major = llvm::get_llvm_version_major(builder, &llvm_config);
             let lib_ext = std::env::consts::DLL_EXTENSION;
             let libenzyme = format!("libEnzyme-{llvm_version_major}");
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
index 7aa9e6cc2b5..e0f632eda0e 100644
--- a/src/bootstrap/src/core/build_steps/dist.rs
+++ b/src/bootstrap/src/core/build_steps/dist.rs
@@ -422,7 +422,7 @@ impl Step for Rustc {
             }
 
             let ra_proc_macro_srv_compiler =
-                builder.compiler_for(compiler.stage, builder.config.build, compiler.host);
+                builder.compiler_for(compiler.stage, builder.config.host_target, compiler.host);
             builder.ensure(compile::Rustc::new(ra_proc_macro_srv_compiler, compiler.host));
 
             if let Some(ra_proc_macro_srv) = builder.ensure_if_default(
@@ -696,7 +696,7 @@ impl Step for Std {
         run.builder.ensure(Std {
             compiler: run.builder.compiler_for(
                 run.builder.top_stage,
-                run.builder.config.build,
+                run.builder.config.host_target,
                 run.target,
             ),
             target: run.target,
@@ -748,7 +748,7 @@ impl Step for RustcDev {
         run.builder.ensure(RustcDev {
             compiler: run.builder.compiler_for(
                 run.builder.top_stage,
-                run.builder.config.build,
+                run.builder.config.host_target,
                 run.target,
             ),
             target: run.target,
@@ -815,7 +815,7 @@ impl Step for Analysis {
             // through the sysroot uplifting.
             compiler: run.builder.compiler_for(
                 run.builder.top_stage,
-                run.builder.config.build,
+                run.builder.config.host_target,
                 run.target,
             ),
             target: run.target,
@@ -1168,7 +1168,7 @@ impl Step for Cargo {
         run.builder.ensure(Cargo {
             compiler: run.builder.compiler_for(
                 run.builder.top_stage,
-                run.builder.config.build,
+                run.builder.config.host_target,
                 run.target,
             ),
             target: run.target,
@@ -1224,7 +1224,7 @@ impl Step for RustAnalyzer {
         run.builder.ensure(RustAnalyzer {
             compiler: run.builder.compiler_for(
                 run.builder.top_stage,
-                run.builder.config.build,
+                run.builder.config.host_target,
                 run.target,
             ),
             target: run.target,
@@ -1268,7 +1268,7 @@ impl Step for Clippy {
         run.builder.ensure(Clippy {
             compiler: run.builder.compiler_for(
                 run.builder.top_stage,
-                run.builder.config.build,
+                run.builder.config.host_target,
                 run.target,
             ),
             target: run.target,
@@ -1317,7 +1317,7 @@ impl Step for Miri {
         run.builder.ensure(Miri {
             compiler: run.builder.compiler_for(
                 run.builder.top_stage,
-                run.builder.config.build,
+                run.builder.config.host_target,
                 run.target,
             ),
             target: run.target,
@@ -1462,7 +1462,7 @@ impl Step for Rustfmt {
         run.builder.ensure(Rustfmt {
             compiler: run.builder.compiler_for(
                 run.builder.top_stage,
-                run.builder.config.build,
+                run.builder.config.host_target,
                 run.target,
             ),
             target: run.target,
@@ -1507,7 +1507,7 @@ impl Step for Extended {
     fn make_run(run: RunConfig<'_>) {
         run.builder.ensure(Extended {
             stage: run.builder.top_stage,
-            host: run.builder.config.build,
+            host: run.builder.config.host_target,
             target: run.target,
         });
     }
@@ -2157,7 +2157,7 @@ fn maybe_install_llvm(
         cmd.arg("--libfiles");
         builder.verbose(|| println!("running {cmd:?}"));
         let files = cmd.run_capture_stdout(builder).stdout();
-        let build_llvm_out = &builder.llvm_out(builder.config.build);
+        let build_llvm_out = &builder.llvm_out(builder.config.host_target);
         let target_llvm_out = &builder.llvm_out(target);
         for file in files.trim_end().split(' ') {
             // If we're not using a custom LLVM, make sure we package for the target.
@@ -2341,7 +2341,7 @@ impl Step for LlvmBitcodeLinker {
         run.builder.ensure(LlvmBitcodeLinker {
             compiler: run.builder.compiler_for(
                 run.builder.top_stage,
-                run.builder.config.build,
+                run.builder.config.host_target,
                 run.target,
             ),
             target: run.target,
diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs
index 7fccf85a0ea..215c155651a 100644
--- a/src/bootstrap/src/core/build_steps/doc.rs
+++ b/src/bootstrap/src/core/build_steps/doc.rs
@@ -209,7 +209,7 @@ impl Step for TheBook {
 
     fn make_run(run: RunConfig<'_>) {
         run.builder.ensure(TheBook {
-            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
+            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
             target: run.target,
         });
     }
@@ -329,7 +329,7 @@ impl Step for Standalone {
 
     fn make_run(run: RunConfig<'_>) {
         run.builder.ensure(Standalone {
-            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
+            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
             target: run.target,
         });
     }
@@ -431,7 +431,7 @@ impl Step for Releases {
 
     fn make_run(run: RunConfig<'_>) {
         run.builder.ensure(Releases {
-            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
+            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
             target: run.target,
         });
     }
@@ -449,7 +449,7 @@ impl Step for Releases {
         t!(fs::create_dir_all(&out));
 
         builder.ensure(Standalone {
-            compiler: builder.compiler(builder.top_stage, builder.config.build),
+            compiler: builder.compiler(builder.top_stage, builder.config.host_target),
             target,
         });
 
@@ -700,7 +700,7 @@ fn doc_std(
     extra_args: &[&str],
     requested_crates: &[String],
 ) {
-    let compiler = builder.compiler(stage, builder.config.build);
+    let compiler = builder.compiler(stage, builder.config.host_target);
 
     let target_doc_dir_name = if format == DocumentationFormat::Json { "json-doc" } else { "doc" };
     let target_dir = builder.stage_out(compiler, Mode::Std).join(target).join(target_doc_dir_name);
@@ -803,8 +803,8 @@ impl Step for Rustc {
 
         // Build the standard library, so that proc-macros can use it.
         // (Normally, only the metadata would be necessary, but proc-macros are special since they run at compile-time.)
-        let compiler = builder.compiler(stage, builder.config.build);
-        builder.ensure(compile::Std::new(compiler, builder.config.build));
+        let compiler = builder.compiler(stage, builder.config.host_target);
+        builder.ensure(compile::Std::new(compiler, builder.config.host_target));
 
         let _guard = builder.msg_sysroot_tool(
             Kind::Doc,
@@ -946,7 +946,7 @@ macro_rules! tool_doc {
                 let out = builder.compiler_doc_out(target);
                 t!(fs::create_dir_all(&out));
 
-                let compiler = builder.compiler(stage, builder.config.build);
+                let compiler = builder.compiler(stage, builder.config.host_target);
                 builder.ensure(compile::Std::new(compiler, target));
 
                 if true $(&& $rustc_tool)? {
@@ -1174,7 +1174,7 @@ impl Step for RustcBook {
 
     fn make_run(run: RunConfig<'_>) {
         run.builder.ensure(RustcBook {
-            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
+            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
             target: run.target,
             validate: false,
         });
@@ -1261,7 +1261,7 @@ impl Step for Reference {
 
     fn make_run(run: RunConfig<'_>) {
         run.builder.ensure(Reference {
-            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
+            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
             target: run.target,
         });
     }
@@ -1272,7 +1272,7 @@ impl Step for Reference {
 
         // This is needed for generating links to the standard library using
         // the mdbook-spec plugin.
-        builder.ensure(compile::Std::new(self.compiler, builder.config.build));
+        builder.ensure(compile::Std::new(self.compiler, builder.config.host_target));
 
         // Run rustbook/mdbook to generate the HTML pages.
         builder.ensure(RustbookSrc {
diff --git a/src/bootstrap/src/core/build_steps/gcc.rs b/src/bootstrap/src/core/build_steps/gcc.rs
index ee8bd8286da..899e3fd9a45 100644
--- a/src/bootstrap/src/core/build_steps/gcc.rs
+++ b/src/bootstrap/src/core/build_steps/gcc.rs
@@ -285,7 +285,7 @@ pub fn add_cg_gcc_cargo_flags(cargo: &mut Cargo, gcc: &GccOutput) {
 /// The absolute path to the downloaded GCC artifacts.
 #[cfg(not(test))]
 fn ci_gcc_root(config: &crate::Config) -> PathBuf {
-    config.out.join(config.build).join("ci-gcc")
+    config.out.join(config.host_target).join("ci-gcc")
 }
 
 /// Detect whether GCC sources have been modified locally or not.
diff --git a/src/bootstrap/src/core/build_steps/install.rs b/src/bootstrap/src/core/build_steps/install.rs
index 5419540aa2e..4434d6658eb 100644
--- a/src/bootstrap/src/core/build_steps/install.rs
+++ b/src/bootstrap/src/core/build_steps/install.rs
@@ -73,7 +73,7 @@ fn install_sh(
     let prefix = default_path(&builder.config.prefix, "/usr/local");
     let sysconfdir = prefix.join(default_path(&builder.config.sysconfdir, "/etc"));
     let destdir_env = env::var_os("DESTDIR").map(PathBuf::from);
-    let is_cygwin = builder.config.build.is_cygwin();
+    let is_cygwin = builder.config.host_target.is_cygwin();
 
     // Sanity checks on the write access of user.
     //
@@ -187,7 +187,7 @@ macro_rules! install {
 
             fn make_run(run: RunConfig<'_>) {
                 run.builder.ensure($name {
-                    compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
+                    compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
                     target: run.target,
                 });
             }
@@ -246,7 +246,7 @@ install!((self, builder, _config),
             );
         }
     };
-    LlvmTools, alias = "llvm-tools", _config.llvm_tools_enabled && _config.llvm_enabled(_config.build), only_hosts: true, {
+    LlvmTools, alias = "llvm-tools", _config.llvm_tools_enabled && _config.llvm_enabled(_config.host_target), only_hosts: true, {
         if let Some(tarball) = builder.ensure(dist::LlvmTools { target: self.target }) {
             install_sh(builder, "llvm-tools", self.compiler.stage, Some(self.target), &tarball);
         } else {
diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs
index 2b7703000cb..8f2f143c352 100644
--- a/src/bootstrap/src/core/build_steps/llvm.rs
+++ b/src/bootstrap/src/core/build_steps/llvm.rs
@@ -132,14 +132,14 @@ pub fn prebuilt_llvm_config(
     let build_llvm_config = if let Some(build_llvm_config) = builder
         .config
         .target_config
-        .get(&builder.config.build)
+        .get(&builder.config.host_target)
         .and_then(|config| config.llvm_config.clone())
     {
         build_llvm_config
     } else {
-        let mut llvm_config_ret_dir = builder.llvm_out(builder.config.build);
+        let mut llvm_config_ret_dir = builder.llvm_out(builder.config.host_target);
         llvm_config_ret_dir.push("bin");
-        llvm_config_ret_dir.join(exe("llvm-config", builder.config.build))
+        llvm_config_ret_dir.join(exe("llvm-config", builder.config.host_target))
     };
 
     let llvm_cmake_dir = out_dir.join("lib/cmake/llvm");
@@ -235,8 +235,8 @@ pub(crate) fn is_ci_llvm_available_for_target(config: &Config, asserts: bool) ->
         ("x86_64-unknown-netbsd", false),
     ];
 
-    if !supported_platforms.contains(&(&*config.build.triple, asserts))
-        && (asserts || !supported_platforms.contains(&(&*config.build.triple, true)))
+    if !supported_platforms.contains(&(&*config.host_target.triple, asserts))
+        && (asserts || !supported_platforms.contains(&(&*config.host_target.triple, true)))
     {
         return false;
     }
@@ -480,7 +480,7 @@ impl Step for Llvm {
         // https://llvm.org/docs/HowToCrossCompileLLVM.html
         if !builder.config.is_host_target(target) {
             let LlvmResult { llvm_config, .. } =
-                builder.ensure(Llvm { target: builder.config.build });
+                builder.ensure(Llvm { target: builder.config.host_target });
             if !builder.config.dry_run() {
                 let llvm_bindir =
                     command(&llvm_config).arg("--bindir").run_capture_stdout(builder).stdout();
@@ -494,7 +494,8 @@ impl Step for Llvm {
             }
             cfg.define("LLVM_CONFIG_PATH", llvm_config);
             if builder.config.llvm_clang {
-                let build_bin = builder.llvm_out(builder.config.build).join("build").join("bin");
+                let build_bin =
+                    builder.llvm_out(builder.config.host_target).join("build").join("bin");
                 let clang_tblgen = build_bin.join("clang-tblgen").with_extension(EXE_EXTENSION);
                 if !builder.config.dry_run() && !clang_tblgen.exists() {
                     panic!("unable to find {}", clang_tblgen.display());
@@ -628,7 +629,7 @@ fn configure_cmake(
     if builder.ninja() {
         cfg.generator("Ninja");
     }
-    cfg.target(&target.triple).host(&builder.config.build.triple);
+    cfg.target(&target.triple).host(&builder.config.host_target.triple);
 
     if !builder.config.is_host_target(target) {
         cfg.define("CMAKE_CROSSCOMPILING", "True");
@@ -813,7 +814,7 @@ fn configure_cmake(
         ldflags.push_all(flags);
     }
 
-    if let Some(flags) = get_var("LDFLAGS", &builder.config.build.triple, &target.triple) {
+    if let Some(flags) = get_var("LDFLAGS", &builder.config.host_target.triple, &target.triple) {
         ldflags.push_all(&flags);
     }
 
@@ -1135,7 +1136,8 @@ impl Step for Sanitizers {
             return runtimes;
         }
 
-        let LlvmResult { llvm_config, .. } = builder.ensure(Llvm { target: builder.config.build });
+        let LlvmResult { llvm_config, .. } =
+            builder.ensure(Llvm { target: builder.config.host_target });
 
         static STAMP_HASH_MEMO: OnceLock<String> = OnceLock::new();
         let smart_stamp_hash = STAMP_HASH_MEMO.get_or_init(|| {
@@ -1345,7 +1347,7 @@ impl Step for CrtBeginEnd {
         cfg.cargo_metadata(false)
             .out_dir(&out_dir)
             .target(&self.target.triple)
-            .host(&builder.config.build.triple)
+            .host(&builder.config.host_target.triple)
             .warnings(false)
             .debug(false)
             .opt_level(3)
@@ -1424,7 +1426,7 @@ impl Step for Libunwind {
                 cfg.archiver(ar);
             }
             cfg.target(&self.target.triple);
-            cfg.host(&builder.config.build.triple);
+            cfg.host(&builder.config.host_target.triple);
             cfg.warnings(false);
             cfg.debug(false);
             // get_compiler() need set opt_level first.
diff --git a/src/bootstrap/src/core/build_steps/perf.rs b/src/bootstrap/src/core/build_steps/perf.rs
index 14c7b7cf5e9..c43043b48f4 100644
--- a/src/bootstrap/src/core/build_steps/perf.rs
+++ b/src/bootstrap/src/core/build_steps/perf.rs
@@ -136,8 +136,8 @@ impl Display for Scenario {
 /// Performs profiling using `rustc-perf` on a built version of the compiler.
 pub fn perf(builder: &Builder<'_>, args: &PerfArgs) {
     let collector = builder.ensure(RustcPerf {
-        compiler: builder.compiler(0, builder.config.build),
-        target: builder.config.build,
+        compiler: builder.compiler(0, builder.config.host_target),
+        target: builder.config.host_target,
     });
 
     let is_profiling = match &args.cmd {
@@ -151,8 +151,8 @@ pub fn perf(builder: &Builder<'_>, args: &PerfArgs) {
 Consider setting `rust.debuginfo-level = 1` in `bootstrap.toml`."#);
     }
 
-    let compiler = builder.compiler(builder.top_stage, builder.config.build);
-    builder.ensure(Std::new(compiler, builder.config.build));
+    let compiler = builder.compiler(builder.top_stage, builder.config.host_target);
+    builder.ensure(Std::new(compiler, builder.config.host_target));
 
     if let Some(opts) = args.cmd.shared_opts()
         && opts.profiles.contains(&Profile::Doc)
diff --git a/src/bootstrap/src/core/build_steps/run.rs b/src/bootstrap/src/core/build_steps/run.rs
index 6ef1b13abcd..b3104ae05e8 100644
--- a/src/bootstrap/src/core/build_steps/run.rs
+++ b/src/bootstrap/src/core/build_steps/run.rs
@@ -116,7 +116,7 @@ impl Step for Miri {
     }
 
     fn run(self, builder: &Builder<'_>) {
-        let host = builder.build.build;
+        let host = builder.build.host_target;
         let target = self.target;
 
         // `x run` uses stage 0 by default but miri does not work well with stage 0.
@@ -448,7 +448,7 @@ impl Step for Rustfmt {
     }
 
     fn run(self, builder: &Builder<'_>) {
-        let host = builder.build.build;
+        let host = builder.build.host_target;
 
         // `x run` uses stage 0 by default but rustfmt does not work well with stage 0.
         // Change the stage to 1 if it's not set explicitly.
diff --git a/src/bootstrap/src/core/build_steps/setup.rs b/src/bootstrap/src/core/build_steps/setup.rs
index 25adfdf1601..86b7456d7b4 100644
--- a/src/bootstrap/src/core/build_steps/setup.rs
+++ b/src/bootstrap/src/core/build_steps/setup.rs
@@ -260,7 +260,7 @@ impl Step for Link {
         }
 
         let stage_path =
-            ["build", config.build.rustc_target_arg(), "stage1"].join(MAIN_SEPARATOR_STR);
+            ["build", config.host_target.rustc_target_arg(), "stage1"].join(MAIN_SEPARATOR_STR);
 
         if stage_dir_exists(&stage_path[..]) && !config.dry_run() {
             attempt_toolchain_link(builder, &stage_path[..]);
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
index dddce8fe05d..ebb926d81ce 100644
--- a/src/bootstrap/src/core/build_steps/test.rs
+++ b/src/bootstrap/src/core/build_steps/test.rs
@@ -70,7 +70,7 @@ impl Step for CrateBootstrap {
     }
 
     fn run(self, builder: &Builder<'_>) {
-        let bootstrap_host = builder.config.build;
+        let bootstrap_host = builder.config.host_target;
         let compiler = builder.compiler(0, bootstrap_host);
         let mut path = self.path.to_str().unwrap();
 
@@ -128,7 +128,7 @@ You can skip linkcheck with --skip src/tools/linkchecker"
         builder.info(&format!("Linkcheck ({host})"));
 
         // Test the linkchecker itself.
-        let bootstrap_host = builder.config.build;
+        let bootstrap_host = builder.config.host_target;
         let compiler = builder.compiler(0, bootstrap_host);
 
         let cargo = tool::prepare_tool_cargo(
@@ -525,7 +525,7 @@ impl Step for Miri {
 
     /// Runs `cargo test` for miri.
     fn run(self, builder: &Builder<'_>) {
-        let host = builder.build.build;
+        let host = builder.build.host_target;
         let target = self.target;
         let stage = builder.top_stage;
         if stage == 0 {
@@ -637,7 +637,7 @@ impl Step for CargoMiri {
 
     /// Tests `cargo miri test`.
     fn run(self, builder: &Builder<'_>) {
-        let host = builder.build.build;
+        let host = builder.build.host_target;
         let target = self.target;
         let stage = builder.top_stage;
         if stage == 0 {
@@ -915,7 +915,7 @@ impl Step for RustdocJSStd {
             Kind::Test,
             builder.top_stage,
             "rustdoc-js-std",
-            builder.config.build,
+            builder.config.host_target,
             self.target,
         );
         command.run(builder);
@@ -1607,7 +1607,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
             // At stage 0 (stage - 1) we are using the stage0 compiler. Using `self.target` can lead
             // finding an incorrect compiler path on cross-targets, as the stage 0 is always equal to
             // `build.build` in the configuration.
-            let build = builder.build.build;
+            let build = builder.build.host_target;
             compiler = builder.compiler(compiler.stage - 1, build);
             let test_stage = compiler.stage + 1;
             (test_stage, format!("stage{test_stage}-{build}"))
@@ -1729,7 +1729,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
         cmd.arg("--mode").arg(mode);
         cmd.arg("--target").arg(target.rustc_target_arg());
         cmd.arg("--host").arg(&*compiler.host.triple);
-        cmd.arg("--llvm-filecheck").arg(builder.llvm_filecheck(builder.config.build));
+        cmd.arg("--llvm-filecheck").arg(builder.llvm_filecheck(builder.config.host_target));
 
         if builder.build.config.llvm_enzyme {
             cmd.arg("--has-enzyme");
@@ -1900,7 +1900,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
         let mut copts_passed = false;
         if builder.config.llvm_enabled(compiler.host) {
             let llvm::LlvmResult { llvm_config, .. } =
-                builder.ensure(llvm::Llvm { target: builder.config.build });
+                builder.ensure(llvm::Llvm { target: builder.config.host_target });
             if !builder.config.dry_run() {
                 let llvm_version = get_llvm_version(builder, &llvm_config);
                 let llvm_components =
@@ -1947,7 +1947,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
                 // If LLD is available, add it to the PATH
                 if builder.config.lld_enabled {
                     let lld_install_root =
-                        builder.ensure(llvm::Lld { target: builder.config.build });
+                        builder.ensure(llvm::Lld { target: builder.config.host_target });
 
                     let lld_bin_path = lld_install_root.join("bin");
 
@@ -2202,7 +2202,7 @@ impl BookTest {
             let mut lib_paths = vec![];
             for dep in self.dependencies {
                 let mode = Mode::ToolRustc;
-                let target = builder.config.build;
+                let target = builder.config.host_target;
                 let cargo = tool::prepare_tool_cargo(
                     builder,
                     compiler,
@@ -2384,7 +2384,7 @@ impl Step for ErrorIndex {
         // error_index_generator depends on librustdoc. Use the compiler that
         // is normally used to build rustdoc for other tests (like compiletest
         // tests in tests/rustdoc) so that it shares the same artifacts.
-        let compiler = run.builder.compiler(run.builder.top_stage, run.builder.config.build);
+        let compiler = run.builder.compiler(run.builder.top_stage, run.builder.config.host_target);
         run.builder.ensure(ErrorIndex { compiler });
     }
 
@@ -2983,7 +2983,7 @@ impl Step for Distcheck {
             .arg("--enable-vendor")
             .current_dir(&dir)
             .run(builder);
-        command(helpers::make(&builder.config.build.triple))
+        command(helpers::make(&builder.config.host_target.triple))
             .arg("check")
             .current_dir(&dir)
             .run(builder);
@@ -3024,7 +3024,7 @@ impl Step for Bootstrap {
 
     /// Tests the build system itself.
     fn run(self, builder: &Builder<'_>) {
-        let host = builder.config.build;
+        let host = builder.config.host_target;
         let compiler = builder.compiler(0, host);
         let _guard = builder.msg(Kind::Test, 0, "bootstrap", host, host);
 
@@ -3035,7 +3035,7 @@ impl Step for Bootstrap {
         check_bootstrap
             .args(["-m", "unittest", "bootstrap_test.py"])
             .env("BUILD_DIR", &builder.out)
-            .env("BUILD_PLATFORM", builder.build.build.triple)
+            .env("BUILD_PLATFORM", builder.build.host_target.triple)
             .env("BOOTSTRAP_TEST_RUSTC_BIN", &builder.initial_rustc)
             .env("BOOTSTRAP_TEST_CARGO_BIN", &builder.initial_cargo)
             .current_dir(builder.src.join("src/bootstrap/"));
@@ -3090,8 +3090,11 @@ impl Step for TierCheck {
     }
 
     fn make_run(run: RunConfig<'_>) {
-        let compiler =
-            run.builder.compiler_for(run.builder.top_stage, run.builder.build.build, run.target);
+        let compiler = run.builder.compiler_for(
+            run.builder.top_stage,
+            run.builder.build.host_target,
+            run.target,
+        );
         run.builder.ensure(TierCheck { compiler });
     }
 
@@ -3142,7 +3145,7 @@ impl Step for LintDocs {
 
     fn make_run(run: RunConfig<'_>) {
         run.builder.ensure(LintDocs {
-            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
+            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
             target: run.target,
         });
     }
@@ -3168,7 +3171,7 @@ impl Step for RustInstaller {
 
     /// Ensure the version placeholder replacement tool builds
     fn run(self, builder: &Builder<'_>) {
-        let bootstrap_host = builder.config.build;
+        let bootstrap_host = builder.config.host_target;
         let compiler = builder.compiler(0, bootstrap_host);
         let cargo = tool::prepare_tool_cargo(
             builder,
@@ -3270,7 +3273,7 @@ impl Step for TestHelpers {
         cfg.cargo_metadata(false)
             .out_dir(&dst)
             .target(&target.triple)
-            .host(&builder.config.build.triple)
+            .host(&builder.config.host_target.triple)
             .opt_level(0)
             .warnings(false)
             .debug(false)
@@ -3560,7 +3563,7 @@ impl Step for TestFloatParse {
     }
 
     fn run(self, builder: &Builder<'_>) {
-        let bootstrap_host = builder.config.build;
+        let bootstrap_host = builder.config.host_target;
         let compiler = builder.compiler(builder.top_stage, bootstrap_host);
         let path = self.path.to_str().unwrap();
         let crate_name = self.path.iter().next_back().unwrap().to_str().unwrap();
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
index 717accb399a..680718f0552 100644
--- a/src/bootstrap/src/core/build_steps/tool.rs
+++ b/src/bootstrap/src/core/build_steps/tool.rs
@@ -341,14 +341,14 @@ pub(crate) fn get_tool_rustc_compiler(
 
     if builder.download_rustc() && target_compiler.stage == 1 {
         // We shouldn't drop to stage0 compiler when using CI rustc.
-        return builder.compiler(1, builder.config.build);
+        return builder.compiler(1, builder.config.host_target);
     }
 
     // Similar to `compile::Assemble`, build with the previous stage's compiler. Otherwise
     // we'd have stageN/bin/rustc and stageN/bin/$rustc_tool be effectively different stage
     // compilers, which isn't what we want. Rustc tools should be linked in the same way as the
     // compiler it's paired with, so it must be built with the previous stage compiler.
-    builder.compiler(target_compiler.stage.saturating_sub(1), builder.config.build)
+    builder.compiler(target_compiler.stage.saturating_sub(1), builder.config.host_target)
 }
 
 /// Links a built tool binary with the given `name` from the build directory to the
@@ -389,8 +389,8 @@ macro_rules! bootstrap_tool {
                 match tool {
                     $(Tool::$name =>
                         self.ensure($name {
-                            compiler: self.compiler(0, self.config.build),
-                            target: self.config.build,
+                            compiler: self.compiler(0, self.config.host_target),
+                            target: self.config.host_target,
                         }).tool_path,
                     )+
                 }
@@ -414,7 +414,7 @@ macro_rules! bootstrap_tool {
             fn make_run(run: RunConfig<'_>) {
                 run.builder.ensure($name {
                     // snapshot compiler
-                    compiler: run.builder.compiler(0, run.builder.config.build),
+                    compiler: run.builder.compiler(0, run.builder.config.host_target),
                     target: run.target,
                 });
             }
@@ -531,7 +531,7 @@ impl Step for RustcPerf {
 
     fn make_run(run: RunConfig<'_>) {
         run.builder.ensure(RustcPerf {
-            compiler: run.builder.compiler(0, run.builder.config.build),
+            compiler: run.builder.compiler(0, run.builder.config.host_target),
             target: run.target,
         });
     }
@@ -572,7 +572,7 @@ impl ErrorIndex {
     pub fn command(builder: &Builder<'_>) -> BootstrapCommand {
         // Error-index-generator links with the rustdoc library, so we need to add `rustc_lib_paths`
         // for rustc_private and libLLVM.so, and `sysroot_lib` for libstd, etc.
-        let host = builder.config.build;
+        let host = builder.config.host_target;
         let compiler = builder.compiler_for(builder.top_stage, host, host);
         let mut cmd = command(builder.ensure(ErrorIndex { compiler }).tool_path);
         let mut dylib_paths = builder.rustc_lib_paths(compiler);
@@ -595,7 +595,7 @@ impl Step for ErrorIndex {
         // src/tools/error-index-generator` which almost nobody does.
         // Normally, `x.py test` or `x.py doc` will use the
         // `ErrorIndex::command` function instead.
-        let compiler = run.builder.compiler(run.builder.top_stage, run.builder.config.build);
+        let compiler = run.builder.compiler(run.builder.top_stage, run.builder.config.host_target);
         run.builder.ensure(ErrorIndex { compiler });
     }
 
@@ -630,7 +630,7 @@ impl Step for RemoteTestServer {
 
     fn make_run(run: RunConfig<'_>) {
         run.builder.ensure(RemoteTestServer {
-            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
+            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
             target: run.target,
         });
     }
@@ -787,7 +787,7 @@ impl Step for Cargo {
 
     fn make_run(run: RunConfig<'_>) {
         run.builder.ensure(Cargo {
-            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
+            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
             target: run.target,
         });
     }
@@ -905,7 +905,7 @@ impl Step for RustAnalyzer {
 
     fn make_run(run: RunConfig<'_>) {
         run.builder.ensure(RustAnalyzer {
-            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
+            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
             target: run.target,
         });
     }
@@ -950,7 +950,7 @@ impl Step for RustAnalyzerProcMacroSrv {
 
     fn make_run(run: RunConfig<'_>) {
         run.builder.ensure(RustAnalyzerProcMacroSrv {
-            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
+            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
             target: run.target,
         });
     }
@@ -1003,7 +1003,7 @@ impl Step for LlvmBitcodeLinker {
 
     fn make_run(run: RunConfig<'_>) {
         run.builder.ensure(LlvmBitcodeLinker {
-            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
+            compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
             extra_features: Vec::new(),
             target: run.target,
         });
@@ -1141,7 +1141,7 @@ macro_rules! tool_extended {
 
             fn make_run(run: RunConfig<'_>) {
                 run.builder.ensure($name {
-                    compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
+                    compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target),
                     target: run.target,
                 });
             }
@@ -1283,7 +1283,7 @@ impl Step for TestFloatParse {
     }
 
     fn run(self, builder: &Builder<'_>) -> ToolBuildResult {
-        let bootstrap_host = builder.config.build;
+        let bootstrap_host = builder.config.host_target;
         let compiler = builder.compiler(builder.top_stage, bootstrap_host);
 
         builder.ensure(ToolBuild {
@@ -1306,7 +1306,7 @@ impl Builder<'_> {
     /// `host`.
     pub fn tool_cmd(&self, tool: Tool) -> BootstrapCommand {
         let mut cmd = command(self.tool_exe(tool));
-        let compiler = self.compiler(0, self.config.build);
+        let compiler = self.compiler(0, self.config.host_target);
         let host = &compiler.host;
         // Prepares the `cmd` provided to be able to run the `compiler` provided.
         //
diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs
index 8b1520de3a8..887db683f78 100644
--- a/src/bootstrap/src/core/builder/mod.rs
+++ b/src/bootstrap/src/core/builder/mod.rs
@@ -137,7 +137,7 @@ pub struct RunConfig<'a> {
 
 impl RunConfig<'_> {
     pub fn build_triple(&self) -> TargetSelection {
-        self.builder.build.build
+        self.builder.build.host_target
     }
 
     /// Return a list of crate names selected by `run.paths`.
@@ -1297,10 +1297,10 @@ impl<'a> Builder<'a> {
     ) -> Compiler {
         let mut resolved_compiler = if self.build.force_use_stage2(stage) {
             trace!(target: "COMPILER_FOR", ?stage, "force_use_stage2");
-            self.compiler(2, self.config.build)
+            self.compiler(2, self.config.host_target)
         } else if self.build.force_use_stage1(stage, target) {
             trace!(target: "COMPILER_FOR", ?stage, "force_use_stage1");
-            self.compiler(1, self.config.build)
+            self.compiler(1, self.config.host_target)
         } else {
             trace!(target: "COMPILER_FOR", ?stage, ?host, "no force, fallback to `compiler()`");
             self.compiler(stage, host)
@@ -1358,7 +1358,7 @@ impl<'a> Builder<'a> {
     /// Windows.
     pub fn libdir_relative(&self, compiler: Compiler) -> &Path {
         if compiler.is_snapshot(self) {
-            libdir(self.config.build).as_ref()
+            libdir(self.config.host_target).as_ref()
         } else {
             match self.config.libdir_relative() {
                 Some(relative_libdir) if compiler.stage >= 1 => relative_libdir,
@@ -1439,9 +1439,10 @@ impl<'a> Builder<'a> {
             return cmd;
         }
 
-        let _ = self.ensure(tool::Clippy { compiler: run_compiler, target: self.build.build });
-        let cargo_clippy =
-            self.ensure(tool::CargoClippy { compiler: run_compiler, target: self.build.build });
+        let _ =
+            self.ensure(tool::Clippy { compiler: run_compiler, target: self.build.host_target });
+        let cargo_clippy = self
+            .ensure(tool::CargoClippy { compiler: run_compiler, target: self.build.host_target });
         let mut dylib_path = helpers::dylib_path();
         dylib_path.insert(0, self.sysroot(run_compiler).join("lib"));
 
@@ -1454,9 +1455,10 @@ impl<'a> Builder<'a> {
     pub fn cargo_miri_cmd(&self, run_compiler: Compiler) -> BootstrapCommand {
         assert!(run_compiler.stage > 0, "miri can not be invoked at stage 0");
         // Prepare the tools
-        let miri = self.ensure(tool::Miri { compiler: run_compiler, target: self.build.build });
+        let miri =
+            self.ensure(tool::Miri { compiler: run_compiler, target: self.build.host_target });
         let cargo_miri =
-            self.ensure(tool::CargoMiri { compiler: run_compiler, target: self.build.build });
+            self.ensure(tool::CargoMiri { compiler: run_compiler, target: self.build.host_target });
         // Invoke cargo-miri, make sure it can find miri and cargo.
         let mut cmd = command(cargo_miri.tool_path);
         cmd.env("MIRI", &miri.tool_path);
diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs
index a264d772c56..a26a96f2815 100644
--- a/src/bootstrap/src/core/builder/tests.rs
+++ b/src/bootstrap/src/core/builder/tests.rs
@@ -46,7 +46,7 @@ fn configure_with_args(cmd: &[String], host: &[&str], target: &[&str]) -> Config
         .join(&thread::current().name().unwrap_or("unknown").replace(":", "-"));
     t!(fs::create_dir_all(&dir));
     config.out = dir;
-    config.build = TargetSelection::from_user(TEST_TRIPLE_1);
+    config.host_target = TargetSelection::from_user(TEST_TRIPLE_1);
     config.hosts = host.iter().map(|s| TargetSelection::from_user(s)).collect();
     config.targets = target.iter().map(|s| TargetSelection::from_user(s)).collect();
     config
@@ -1102,7 +1102,7 @@ fn test_prebuilt_llvm_config_path_resolution() {
     let actual = drop_win_disk_prefix_if_present(actual);
     assert_eq!(expected, actual);
 
-    let actual = prebuilt_llvm_config(&builder, builder.config.build, false)
+    let actual = prebuilt_llvm_config(&builder, builder.config.host_target, false)
         .llvm_result()
         .llvm_config
         .clone();
@@ -1120,15 +1120,15 @@ fn test_prebuilt_llvm_config_path_resolution() {
     let build = Build::new(config.clone());
     let builder = Builder::new(&build);
 
-    let actual = prebuilt_llvm_config(&builder, builder.config.build, false)
+    let actual = prebuilt_llvm_config(&builder, builder.config.host_target, false)
         .llvm_result()
         .llvm_config
         .clone();
     let expected = builder
         .out
-        .join(builder.config.build)
+        .join(builder.config.host_target)
         .join("llvm/bin")
-        .join(exe("llvm-config", builder.config.build));
+        .join(exe("llvm-config", builder.config.host_target));
     assert_eq!(expected, actual);
 
     let config = configure(
@@ -1143,15 +1143,15 @@ fn test_prebuilt_llvm_config_path_resolution() {
         let build = Build::new(config.clone());
         let builder = Builder::new(&build);
 
-        let actual = prebuilt_llvm_config(&builder, builder.config.build, false)
+        let actual = prebuilt_llvm_config(&builder, builder.config.host_target, false)
             .llvm_result()
             .llvm_config
             .clone();
         let expected = builder
             .out
-            .join(builder.config.build)
+            .join(builder.config.host_target)
             .join("ci-llvm/bin")
-            .join(exe("llvm-config", builder.config.build));
+            .join(exe("llvm-config", builder.config.host_target));
         assert_eq!(expected, actual);
     }
 }
@@ -1163,7 +1163,7 @@ fn test_is_builder_target() {
 
     for (target1, target2) in [(target1, target2), (target2, target1)] {
         let mut config = configure("build", &[], &[]);
-        config.build = target1;
+        config.host_target = target1;
         let build = Build::new(config);
         let builder = Builder::new(&build);
 
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 860aa120326..6aff376bde3 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -221,7 +221,7 @@ pub struct Config {
 
     pub reproducible_artifacts: Vec<String>,
 
-    pub build: TargetSelection,
+    pub host_target: TargetSelection,
     pub hosts: Vec<TargetSelection>,
     pub targets: Vec<TargetSelection>,
     pub local_rebuild: bool,
@@ -346,7 +346,7 @@ impl Config {
             stderr_is_tty: std::io::stderr().is_terminal(),
 
             // set by build.rs
-            build: TargetSelection::from_user(env!("BUILD_TRIPLE")),
+            host_target: TargetSelection::from_user(env!("BUILD_TRIPLE")),
 
             src: {
                 let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
@@ -727,7 +727,7 @@ impl Config {
         config.jobs = Some(threads_from_config(flags.jobs.unwrap_or(jobs.unwrap_or(0))));
 
         if let Some(file_build) = build {
-            config.build = TargetSelection::from_user(&file_build);
+            config.host_target = TargetSelection::from_user(&file_build);
         };
 
         set(&mut config.out, flags.build_dir.or_else(|| build_dir.map(PathBuf::from)));
@@ -753,10 +753,10 @@ impl Config {
             config.download_beta_toolchain();
             config
                 .out
-                .join(config.build)
+                .join(config.host_target)
                 .join("stage0")
                 .join("bin")
-                .join(exe("rustc", config.build))
+                .join(exe("rustc", config.host_target))
         };
 
         config.initial_sysroot = t!(PathBuf::from_str(
@@ -777,7 +777,7 @@ impl Config {
             cargo
         } else {
             config.download_beta_toolchain();
-            config.initial_sysroot.join("bin").join(exe("cargo", config.build))
+            config.initial_sysroot.join("bin").join(exe("cargo", config.host_target))
         };
 
         // NOTE: it's important this comes *after* we set `initial_rustc` just above.
@@ -792,7 +792,7 @@ impl Config {
         } else if let Some(file_host) = host {
             file_host.iter().map(|h| TargetSelection::from_user(h)).collect()
         } else {
-            vec![config.build]
+            vec![config.host_target]
         };
         config.targets = if let Some(TargetSelectionList(arg_target)) = flags.target {
             arg_target
@@ -926,17 +926,19 @@ impl Config {
         }
 
         if config.llvm_from_ci {
-            let triple = &config.build.triple;
+            let triple = &config.host_target.triple;
             let ci_llvm_bin = config.ci_llvm_root().join("bin");
             let build_target = config
                 .target_config
-                .entry(config.build)
+                .entry(config.host_target)
                 .or_insert_with(|| Target::from_triple(triple));
 
             check_ci_llvm!(build_target.llvm_config);
             check_ci_llvm!(build_target.llvm_filecheck);
-            build_target.llvm_config = Some(ci_llvm_bin.join(exe("llvm-config", config.build)));
-            build_target.llvm_filecheck = Some(ci_llvm_bin.join(exe("FileCheck", config.build)));
+            build_target.llvm_config =
+                Some(ci_llvm_bin.join(exe("llvm-config", config.host_target)));
+            build_target.llvm_filecheck =
+                Some(ci_llvm_bin.join(exe("FileCheck", config.host_target)));
         }
 
         config.apply_dist_config(toml.dist);
@@ -953,7 +955,7 @@ impl Config {
             );
         }
 
-        if config.lld_enabled && config.is_system_llvm(config.build) {
+        if config.lld_enabled && config.is_system_llvm(config.host_target) {
             eprintln!(
                 "Warning: LLD is enabled when using external llvm-config. LLD will not be built and copied to the sysroot."
             );
@@ -1147,13 +1149,13 @@ impl Config {
     /// The absolute path to the downloaded LLVM artifacts.
     pub(crate) fn ci_llvm_root(&self) -> PathBuf {
         assert!(self.llvm_from_ci);
-        self.out.join(self.build).join("ci-llvm")
+        self.out.join(self.host_target).join("ci-llvm")
     }
 
     /// Directory where the extracted `rustc-dev` component is stored.
     pub(crate) fn ci_rustc_dir(&self) -> PathBuf {
         assert!(self.download_rustc());
-        self.out.join(self.build).join("ci-rustc")
+        self.out.join(self.host_target).join("ci-rustc")
     }
 
     /// Determine whether llvm should be linked dynamically.
@@ -1237,7 +1239,7 @@ impl Config {
                         // Check the config compatibility
                         // FIXME: this doesn't cover `--set` flags yet.
                         let res = check_incompatible_options_for_ci_rustc(
-                            self.build,
+                            self.host_target,
                             current_config_toml,
                             ci_config_toml,
                         );
@@ -1473,7 +1475,7 @@ impl Config {
         debug_assertions_requested: bool,
         llvm_assertions: bool,
     ) -> Option<String> {
-        if !is_download_ci_available(&self.build.triple, llvm_assertions) {
+        if !is_download_ci_available(&self.host_target.triple, llvm_assertions) {
             return None;
         }
 
@@ -1709,7 +1711,7 @@ impl Config {
 
     /// Checks if the given target is the same as the host target.
     pub fn is_host_target(&self, target: TargetSelection) -> bool {
-        self.build == target
+        self.host_target == target
     }
 
     /// Returns `true` if this is an external version of LLVM not managed by bootstrap.
diff --git a/src/bootstrap/src/core/config/flags.rs b/src/bootstrap/src/core/config/flags.rs
index bc4fa73a362..ea0251e209a 100644
--- a/src/bootstrap/src/core/config/flags.rs
+++ b/src/bootstrap/src/core/config/flags.rs
@@ -59,7 +59,7 @@ pub struct Flags {
     pub build_dir: Option<PathBuf>,
 
     #[arg(global = true, long, value_hint = clap::ValueHint::Other, value_name = "BUILD")]
-    /// build target of the stage0 compiler
+    /// host target of the stage0 compiler
     pub build: Option<String>,
 
     #[arg(global = true, long, value_hint = clap::ValueHint::Other, value_name = "HOST", value_parser = target_selection_list)]
diff --git a/src/bootstrap/src/core/config/toml/mod.rs b/src/bootstrap/src/core/config/toml/mod.rs
index ac4e249e580..01eb243159c 100644
--- a/src/bootstrap/src/core/config/toml/mod.rs
+++ b/src/bootstrap/src/core/config/toml/mod.rs
@@ -147,7 +147,7 @@ impl Config {
         }
 
         let builder_config_path =
-            self.out.join(self.build.triple).join(build_name).join(BUILDER_CONFIG_FILENAME);
+            self.out.join(self.host_target.triple).join(build_name).join(BUILDER_CONFIG_FILENAME);
         Self::get_toml(&builder_config_path)
     }
 
diff --git a/src/bootstrap/src/core/config/toml/rust.rs b/src/bootstrap/src/core/config/toml/rust.rs
index bb18fa802af..642f2f2271d 100644
--- a/src/bootstrap/src/core/config/toml/rust.rs
+++ b/src/bootstrap/src/core/config/toml/rust.rs
@@ -621,13 +621,13 @@ impl Config {
         //   thus, disabled
         // - similarly, lld will not be built nor used by default when explicitly asked not to, e.g.
         //   when the config sets `rust.lld = false`
-        if self.build.triple == "x86_64-unknown-linux-gnu"
-            && self.hosts == [self.build]
+        if self.host_target.triple == "x86_64-unknown-linux-gnu"
+            && self.hosts == [self.host_target]
             && (self.channel == "dev" || self.channel == "nightly")
         {
             let no_llvm_config = self
                 .target_config
-                .get(&self.build)
+                .get(&self.host_target)
                 .is_some_and(|target_config| target_config.llvm_config.is_none());
             let enable_lld = self.llvm_from_ci || no_llvm_config;
             // Prefer the config setting in case an explicit opt-out is needed.
diff --git a/src/bootstrap/src/core/config/toml/target.rs b/src/bootstrap/src/core/config/toml/target.rs
index b8fc3e74c35..b9f6780ca3f 100644
--- a/src/bootstrap/src/core/config/toml/target.rs
+++ b/src/bootstrap/src/core/config/toml/target.rs
@@ -101,7 +101,7 @@ impl Config {
                 let mut target = Target::from_triple(&triple);
 
                 if let Some(ref s) = cfg.llvm_config {
-                    if self.download_rustc_commit.is_some() && triple == *self.build.triple {
+                    if self.download_rustc_commit.is_some() && triple == *self.host_target.triple {
                         panic!(
                             "setting llvm_config for the host is incompatible with download-rustc"
                         );
diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs
index f349b9a87ed..88a58e580e6 100644
--- a/src/bootstrap/src/core/download.rs
+++ b/src/bootstrap/src/core/download.rs
@@ -256,7 +256,7 @@ impl Config {
         }
         curl.arg(url);
         if !self.check_run(&mut curl) {
-            if self.build.contains("windows-msvc") {
+            if self.host_target.contains("windows-msvc") {
                 eprintln!("Fallback to PowerShell");
                 for _ in 0..3 {
                     let powershell = command("PowerShell.exe").allow_failure().args([
@@ -411,7 +411,7 @@ impl Config {
 
         let date = &self.stage0_metadata.compiler.date;
         let version = &self.stage0_metadata.compiler.version;
-        let host = self.build;
+        let host = self.host_target;
 
         let clippy_stamp =
             BuildStamp::new(&self.initial_sysroot).with_prefix("clippy").add_stamp(date);
@@ -449,7 +449,7 @@ impl Config {
         let VersionMetadata { date, version } = self.stage0_metadata.rustfmt.as_ref()?;
         let channel = format!("{version}-{date}");
 
-        let host = self.build;
+        let host = self.host_target;
         let bin_root = self.out.join(host).join("rustfmt");
         let rustfmt_path = bin_root.join("bin").join(exe("rustfmt", host));
         let rustfmt_stamp = BuildStamp::new(&bin_root).with_prefix("rustfmt").add_stamp(channel);
@@ -557,11 +557,11 @@ impl Config {
         extra_components: &[&str],
         download_component: fn(&Config, String, &str, &str),
     ) {
-        let host = self.build.triple;
+        let host = self.host_target.triple;
         let bin_root = self.out.join(host).join(sysroot);
         let rustc_stamp = BuildStamp::new(&bin_root).with_prefix("rustc").add_stamp(stamp_key);
 
-        if !bin_root.join("bin").join(exe("rustc", self.build)).exists()
+        if !bin_root.join("bin").join(exe("rustc", self.host_target)).exists()
             || !rustc_stamp.is_up_to_date()
         {
             if bin_root.exists() {
@@ -630,7 +630,7 @@ impl Config {
             t!(fs::create_dir_all(&cache_dir));
         }
 
-        let bin_root = self.out.join(self.build).join(destination);
+        let bin_root = self.out.join(self.host_target).join(destination);
         let tarball = cache_dir.join(&filename);
         let (base_url, url, should_verify) = match mode {
             DownloadSource::CI => {
@@ -759,7 +759,7 @@ download-rustc = false
             let now = std::time::SystemTime::now();
             let file_times = fs::FileTimes::new().set_accessed(now).set_modified(now);
 
-            let llvm_config = llvm_root.join("bin").join(exe("llvm-config", self.build));
+            let llvm_config = llvm_root.join("bin").join(exe("llvm-config", self.host_target));
             t!(crate::utils::helpers::set_file_times(llvm_config, file_times));
 
             if self.should_fix_bins_and_dylibs() {
@@ -814,7 +814,7 @@ download-rustc = false
             &self.stage0_metadata.config.artifacts_server
         };
         let version = self.artifact_version_part(llvm_sha);
-        let filename = format!("rust-dev-{}-{}.tar.xz", version, self.build.triple);
+        let filename = format!("rust-dev-{}-{}.tar.xz", version, self.host_target.triple);
         let tarball = rustc_cache.join(&filename);
         if !tarball.exists() {
             let help_on_error = "ERROR: failed to download llvm from ci
@@ -844,7 +844,7 @@ download-rustc = false
         }
         let base = &self.stage0_metadata.config.artifacts_server;
         let version = self.artifact_version_part(gcc_sha);
-        let filename = format!("gcc-{version}-{}.tar.xz", self.build.triple);
+        let filename = format!("gcc-{version}-{}.tar.xz", self.host_target.triple);
         let tarball = gcc_cache.join(&filename);
         if !tarball.exists() {
             let help_on_error = "ERROR: failed to download gcc from ci
diff --git a/src/bootstrap/src/core/sanity.rs b/src/bootstrap/src/core/sanity.rs
index b7bbd294f0e..ef776e21943 100644
--- a/src/bootstrap/src/core/sanity.rs
+++ b/src/bootstrap/src/core/sanity.rs
@@ -109,9 +109,9 @@ pub fn check(build: &mut Build) {
 
     // Ensure that a compatible version of libstdc++ is available on the system when using `llvm.download-ci-llvm`.
     #[cfg(not(test))]
-    if !build.config.dry_run() && !build.build.is_msvc() && build.config.llvm_from_ci {
+    if !build.config.dry_run() && !build.host_target.is_msvc() && build.config.llvm_from_ci {
         let builder = Builder::new(build);
-        let libcxx_version = builder.ensure(tool::LibcxxVersionTool { target: build.build });
+        let libcxx_version = builder.ensure(tool::LibcxxVersionTool { target: build.host_target });
 
         match libcxx_version {
             tool::LibcxxVersion::Gnu(version) => {
@@ -237,7 +237,7 @@ than building it.
         }
 
         // skip check for cross-targets
-        if skip_target_sanity && target != &build.build {
+        if skip_target_sanity && target != &build.host_target {
             continue;
         }
 
@@ -308,7 +308,7 @@ than building it.
 
             if build.config.llvm_enabled(*host) {
                 // Externally configured LLVM requires FileCheck to exist
-                let filecheck = build.llvm_filecheck(build.build);
+                let filecheck = build.llvm_filecheck(build.host_target);
                 if !filecheck.starts_with(&build.out)
                     && !filecheck.exists()
                     && build.config.codegen_tests
@@ -333,7 +333,7 @@ than building it.
         }
 
         // skip check for cross-targets
-        if skip_target_sanity && target != &build.build {
+        if skip_target_sanity && target != &build.host_target {
             continue;
         }
 
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index 88d5d026820..25e59bfe3a8 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -175,7 +175,7 @@ pub struct Build {
     verbosity: usize,
 
     /// Build triple for the pre-compiled snapshot compiler.
-    build: TargetSelection,
+    host_target: TargetSelection,
     /// Which triples to produce a compiler toolchain for.
     hosts: Vec<TargetSelection>,
     /// Which triples to build libraries (core/alloc/std/test/proc_macro) for.
@@ -420,7 +420,7 @@ impl Build {
         if bootstrap_out.ends_with("deps") {
             bootstrap_out.pop();
         }
-        if !bootstrap_out.join(exe("rustc", config.build)).exists() && !cfg!(test) {
+        if !bootstrap_out.join(exe("rustc", config.host_target)).exists() && !cfg!(test) {
             // this restriction can be lifted whenever https://github.com/rust-lang/rfcs/pull/3028 is implemented
             panic!(
                 "`rustc` not found in {}, run `cargo build --bins` before `cargo run`",
@@ -436,7 +436,9 @@ impl Build {
             initial_lld,
             initial_relative_libdir,
             initial_rustc: config.initial_rustc.clone(),
-            initial_rustdoc: config.initial_rustc.with_file_name(exe("rustdoc", config.build)),
+            initial_rustdoc: config
+                .initial_rustc
+                .with_file_name(exe("rustdoc", config.host_target)),
             initial_cargo: config.initial_cargo.clone(),
             initial_sysroot: config.initial_sysroot.clone(),
             local_rebuild: config.local_rebuild,
@@ -444,7 +446,7 @@ impl Build {
             doc_tests: config.cmd.doc_tests(),
             verbosity: config.verbose,
 
-            build: config.build,
+            host_target: config.host_target,
             hosts: config.hosts.clone(),
             targets: config.targets.clone(),
 
@@ -521,7 +523,7 @@ impl Build {
         }
 
         // Create symbolic link to use host sysroot from a consistent path (e.g., in the rust-analyzer config file).
-        let build_triple = build.out.join(build.build);
+        let build_triple = build.out.join(build.host_target);
         t!(fs::create_dir_all(&build_triple));
         let host = build.out.join("host");
         if host.is_symlink() {
@@ -932,7 +934,7 @@ impl Build {
 
     /// Returns the libdir of the snapshot compiler.
     fn rustc_snapshot_libdir(&self) -> PathBuf {
-        self.rustc_snapshot_sysroot().join(libdir(self.config.build))
+        self.rustc_snapshot_sysroot().join(libdir(self.config.host_target))
     }
 
     /// Returns the sysroot of the snapshot compiler.
@@ -973,7 +975,7 @@ impl Build {
         what: impl Display,
         target: impl Into<Option<TargetSelection>>,
     ) -> Option<gha::Group> {
-        self.msg(Kind::Clippy, self.config.stage, what, self.config.build, target)
+        self.msg(Kind::Clippy, self.config.stage, what, self.config.host_target, target)
     }
 
     #[must_use = "Groups should not be dropped until the Step finishes running"]
@@ -988,7 +990,7 @@ impl Build {
             Kind::Check,
             custom_stage.unwrap_or(self.config.stage),
             what,
-            self.config.build,
+            self.config.host_target,
             target,
         )
     }
@@ -1246,7 +1248,7 @@ impl Build {
             Some(self.cc(target))
         } else if self.config.lld_mode.is_used()
             && self.is_lld_direct_linker(target)
-            && self.build == target
+            && self.host_target == target
         {
             match self.config.lld_mode {
                 LldMode::SelfContained => Some(self.initial_lld.clone()),
@@ -1400,7 +1402,7 @@ impl Build {
 
     /// Path to the python interpreter to use
     fn python(&self) -> &Path {
-        if self.config.build.ends_with("apple-darwin") {
+        if self.config.host_target.ends_with("apple-darwin") {
             // Force /usr/bin/python3 on macOS for LLDB tests because we're loading the
             // LLDB plugin's compiled module which only works with the system python
             // (namely not Homebrew-installed python)
@@ -1440,7 +1442,7 @@ impl Build {
         !self.config.full_bootstrap
             && !self.config.download_rustc()
             && stage >= 2
-            && (self.hosts.contains(&target) || target == self.build)
+            && (self.hosts.contains(&target) || target == self.host_target)
     }
 
     /// Checks whether the `compiler` compiling for `target` should be forced to
@@ -1877,7 +1879,7 @@ to download LLVM rather than building it.
         // In these cases we automatically enable Ninja if we find it in the
         // environment.
         if !self.config.ninja_in_file
-            && self.config.build.is_msvc()
+            && self.config.host_target.is_msvc()
             && cmd_finder.maybe_have("ninja").is_some()
         {
             return true;
@@ -1946,7 +1948,7 @@ impl Compiler {
 
     /// Returns `true` if this is a snapshot compiler for `build`'s configuration
     pub fn is_snapshot(&self, build: &Build) -> bool {
-        self.stage == 0 && self.host == build.build
+        self.stage == 0 && self.host == build.host_target
     }
 
     /// Indicates whether the compiler was forced to use a specific stage.
diff --git a/src/bootstrap/src/utils/cc_detect.rs b/src/bootstrap/src/utils/cc_detect.rs
index 5c9e30706ee..851bb38074e 100644
--- a/src/bootstrap/src/utils/cc_detect.rs
+++ b/src/bootstrap/src/utils/cc_detect.rs
@@ -39,7 +39,7 @@ fn new_cc_build(build: &Build, target: TargetSelection) -> cc::Build {
         // Compress debuginfo
         .flag_if_supported("-gz")
         .target(&target.triple)
-        .host(&build.build.triple);
+        .host(&build.host_target.triple);
     match build.crt_static(target) {
         Some(a) => {
             cfg.static_crt(a);
@@ -70,7 +70,7 @@ pub fn find(build: &Build) {
         | crate::Subcommand::Suggest { .. }
         | crate::Subcommand::Format { .. }
         | crate::Subcommand::Setup { .. } => {
-            build.hosts.iter().cloned().chain(iter::once(build.build)).collect()
+            build.hosts.iter().cloned().chain(iter::once(build.host_target)).collect()
         }
 
         _ => {
@@ -81,7 +81,7 @@ pub fn find(build: &Build) {
                 .iter()
                 .chain(&build.hosts)
                 .cloned()
-                .chain(iter::once(build.build))
+                .chain(iter::once(build.host_target))
                 .collect()
         }
     };
diff --git a/src/bootstrap/src/utils/cc_detect/tests.rs b/src/bootstrap/src/utils/cc_detect/tests.rs
index 225fb7619b5..1f50738959f 100644
--- a/src/bootstrap/src/utils/cc_detect/tests.rs
+++ b/src/bootstrap/src/utils/cc_detect/tests.rs
@@ -155,7 +155,7 @@ fn test_find() {
     build.targets.push(target1.clone());
     build.hosts.push(target2.clone());
     find(&build);
-    for t in build.hosts.iter().chain(build.targets.iter()).chain(iter::once(&build.build)) {
+    for t in build.hosts.iter().chain(build.targets.iter()).chain(iter::once(&build.host_target)) {
         assert!(build.cc.borrow().contains_key(t), "CC not set for target {}", t.triple);
     }
 }
diff --git a/src/etc/completions/x.fish b/src/etc/completions/x.fish
index 10a4e684e33..a030f45830e 100644
--- a/src/etc/completions/x.fish
+++ b/src/etc/completions/x.fish
@@ -26,7 +26,7 @@ end
 
 complete -c x -n "__fish_x_needs_command" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_needs_command" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_needs_command" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_needs_command" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_needs_command" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_needs_command" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_needs_command" -l exclude -d 'build paths to exclude' -r -F
@@ -78,7 +78,7 @@ complete -c x -n "__fish_x_needs_command" -a "vendor" -d 'Vendor dependencies'
 complete -c x -n "__fish_x_needs_command" -a "perf" -d 'Perform profiling and benchmarking of the compiler using `rustc-perf`'
 complete -c x -n "__fish_x_using_subcommand build" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand build" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand build" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand build" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand build" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand build" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand build" -l exclude -d 'build paths to exclude' -r -F
@@ -113,7 +113,7 @@ complete -c x -n "__fish_x_using_subcommand build" -l skip-std-check-if-no-downl
 complete -c x -n "__fish_x_using_subcommand build" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x -n "__fish_x_using_subcommand check" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand check" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand check" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand check" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand check" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand check" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand check" -l exclude -d 'build paths to exclude' -r -F
@@ -153,7 +153,7 @@ complete -c x -n "__fish_x_using_subcommand clippy" -s W -d 'clippy lints to war
 complete -c x -n "__fish_x_using_subcommand clippy" -s F -d 'clippy lints to forbid' -r
 complete -c x -n "__fish_x_using_subcommand clippy" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand clippy" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand clippy" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand clippy" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand clippy" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand clippy" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand clippy" -l exclude -d 'build paths to exclude' -r -F
@@ -191,7 +191,7 @@ complete -c x -n "__fish_x_using_subcommand clippy" -l skip-std-check-if-no-down
 complete -c x -n "__fish_x_using_subcommand clippy" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x -n "__fish_x_using_subcommand fix" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand fix" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand fix" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand fix" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand fix" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand fix" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand fix" -l exclude -d 'build paths to exclude' -r -F
@@ -226,7 +226,7 @@ complete -c x -n "__fish_x_using_subcommand fix" -l skip-std-check-if-no-downloa
 complete -c x -n "__fish_x_using_subcommand fix" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x -n "__fish_x_using_subcommand fmt" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand fmt" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand fmt" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand fmt" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand fmt" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand fmt" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand fmt" -l exclude -d 'build paths to exclude' -r -F
@@ -263,7 +263,7 @@ complete -c x -n "__fish_x_using_subcommand fmt" -l skip-std-check-if-no-downloa
 complete -c x -n "__fish_x_using_subcommand fmt" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x -n "__fish_x_using_subcommand doc" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand doc" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand doc" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand doc" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand doc" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand doc" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand doc" -l exclude -d 'build paths to exclude' -r -F
@@ -306,7 +306,7 @@ complete -c x -n "__fish_x_using_subcommand test" -l pass -d 'force {check,build
 complete -c x -n "__fish_x_using_subcommand test" -l run -d 'whether to execute run-* tests' -r
 complete -c x -n "__fish_x_using_subcommand test" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand test" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand test" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand test" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand test" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand test" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand test" -l exclude -d 'build paths to exclude' -r -F
@@ -350,7 +350,7 @@ complete -c x -n "__fish_x_using_subcommand test" -s h -l help -d 'Print help (s
 complete -c x -n "__fish_x_using_subcommand miri" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r
 complete -c x -n "__fish_x_using_subcommand miri" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand miri" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand miri" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand miri" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand miri" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand miri" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand miri" -l exclude -d 'build paths to exclude' -r -F
@@ -389,7 +389,7 @@ complete -c x -n "__fish_x_using_subcommand miri" -s h -l help -d 'Print help (s
 complete -c x -n "__fish_x_using_subcommand bench" -l test-args -r
 complete -c x -n "__fish_x_using_subcommand bench" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand bench" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand bench" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand bench" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand bench" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand bench" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand bench" -l exclude -d 'build paths to exclude' -r -F
@@ -425,7 +425,7 @@ complete -c x -n "__fish_x_using_subcommand bench" -s h -l help -d 'Print help (
 complete -c x -n "__fish_x_using_subcommand clean" -l stage -d 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used' -r
 complete -c x -n "__fish_x_using_subcommand clean" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand clean" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand clean" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand clean" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand clean" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand clean" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand clean" -l exclude -d 'build paths to exclude' -r -F
@@ -460,7 +460,7 @@ complete -c x -n "__fish_x_using_subcommand clean" -l skip-std-check-if-no-downl
 complete -c x -n "__fish_x_using_subcommand clean" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x -n "__fish_x_using_subcommand dist" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand dist" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand dist" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand dist" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand dist" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand dist" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand dist" -l exclude -d 'build paths to exclude' -r -F
@@ -495,7 +495,7 @@ complete -c x -n "__fish_x_using_subcommand dist" -l skip-std-check-if-no-downlo
 complete -c x -n "__fish_x_using_subcommand dist" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x -n "__fish_x_using_subcommand install" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand install" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand install" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand install" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand install" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand install" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand install" -l exclude -d 'build paths to exclude' -r -F
@@ -531,7 +531,7 @@ complete -c x -n "__fish_x_using_subcommand install" -s h -l help -d 'Print help
 complete -c x -n "__fish_x_using_subcommand run" -l args -d 'arguments for the tool' -r
 complete -c x -n "__fish_x_using_subcommand run" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand run" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand run" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand run" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand run" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand run" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand run" -l exclude -d 'build paths to exclude' -r -F
@@ -566,7 +566,7 @@ complete -c x -n "__fish_x_using_subcommand run" -l skip-std-check-if-no-downloa
 complete -c x -n "__fish_x_using_subcommand run" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x -n "__fish_x_using_subcommand setup" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand setup" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand setup" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand setup" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand setup" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand setup" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand setup" -l exclude -d 'build paths to exclude' -r -F
@@ -601,7 +601,7 @@ complete -c x -n "__fish_x_using_subcommand setup" -l skip-std-check-if-no-downl
 complete -c x -n "__fish_x_using_subcommand setup" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x -n "__fish_x_using_subcommand suggest" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand suggest" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand suggest" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand suggest" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand suggest" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand suggest" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand suggest" -l exclude -d 'build paths to exclude' -r -F
@@ -638,7 +638,7 @@ complete -c x -n "__fish_x_using_subcommand suggest" -s h -l help -d 'Print help
 complete -c x -n "__fish_x_using_subcommand vendor" -l sync -d 'Additional `Cargo.toml` to sync and vendor' -r -F
 complete -c x -n "__fish_x_using_subcommand vendor" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand vendor" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand vendor" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand vendor" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand vendor" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand vendor" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand vendor" -l exclude -d 'build paths to exclude' -r -F
@@ -674,7 +674,7 @@ complete -c x -n "__fish_x_using_subcommand vendor" -l skip-std-check-if-no-down
 complete -c x -n "__fish_x_using_subcommand vendor" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l exclude -d 'build paths to exclude' -r -F
@@ -718,7 +718,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l skip -d 'build paths to skip' -r -F
@@ -756,7 +756,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from samply" -l skip -d 'build paths to skip' -r -F
@@ -794,7 +794,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l skip -d 'build paths to skip' -r -F
@@ -832,7 +832,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l skip -d 'build paths to skip' -r -F
@@ -866,7 +866,7 @@ complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_fro
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l config -d 'TOML configuration file for build' -r -F
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l host -d 'host targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l target -d 'target targets to build' -r -f
 complete -c x -n "__fish_x_using_subcommand perf; and __fish_seen_subcommand_from compare" -l exclude -d 'build paths to exclude' -r -F
diff --git a/src/etc/completions/x.ps1 b/src/etc/completions/x.ps1
index 23d8fe0cdd3..a891a9db332 100644
--- a/src/etc/completions/x.ps1
+++ b/src/etc/completions/x.ps1
@@ -23,7 +23,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
         'x' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -82,7 +82,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
         'x;build' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -124,7 +124,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
         'x;check' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -171,7 +171,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
             [CompletionResult]::new('-F', '-F ', [CompletionResultType]::ParameterName, 'clippy lints to forbid')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -216,7 +216,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
         'x;fix' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -258,7 +258,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
         'x;fmt' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -302,7 +302,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
         'x;doc' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -352,7 +352,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
             [CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'whether to execute run-* tests')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -403,7 +403,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
             [CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -449,7 +449,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
             [CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'test-args')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -492,7 +492,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
             [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -534,7 +534,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
         'x;dist' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -576,7 +576,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
         'x;install' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -619,7 +619,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
             [CompletionResult]::new('--args', '--args', [CompletionResultType]::ParameterName, 'arguments for the tool')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -661,7 +661,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
         'x;setup' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -703,7 +703,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
         'x;suggest' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -747,7 +747,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
             [CompletionResult]::new('--sync', '--sync', [CompletionResultType]::ParameterName, 'Additional `Cargo.toml` to sync and vendor')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -790,7 +790,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
         'x;perf' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -841,7 +841,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
             [CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@@ -886,7 +886,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
             [CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@@ -931,7 +931,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
             [CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@@ -976,7 +976,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
             [CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@@ -1017,7 +1017,7 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock {
         'x;perf;compare' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
diff --git a/src/etc/completions/x.py.fish b/src/etc/completions/x.py.fish
index 1fc5bb12cfb..e6326fcb0bb 100644
--- a/src/etc/completions/x.py.fish
+++ b/src/etc/completions/x.py.fish
@@ -26,7 +26,7 @@ end
 
 complete -c x.py -n "__fish_x.py_needs_command" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_needs_command" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_needs_command" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_needs_command" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_needs_command" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_needs_command" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_needs_command" -l exclude -d 'build paths to exclude' -r -F
@@ -78,7 +78,7 @@ complete -c x.py -n "__fish_x.py_needs_command" -a "vendor" -d 'Vendor dependenc
 complete -c x.py -n "__fish_x.py_needs_command" -a "perf" -d 'Perform profiling and benchmarking of the compiler using `rustc-perf`'
 complete -c x.py -n "__fish_x.py_using_subcommand build" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand build" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand build" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand build" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand build" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand build" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand build" -l exclude -d 'build paths to exclude' -r -F
@@ -113,7 +113,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand build" -l skip-std-check-if-no
 complete -c x.py -n "__fish_x.py_using_subcommand build" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_x.py_using_subcommand check" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand check" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand check" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand check" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand check" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand check" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand check" -l exclude -d 'build paths to exclude' -r -F
@@ -153,7 +153,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s W -d 'clippy lints
 complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s F -d 'clippy lints to forbid' -r
 complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l exclude -d 'build paths to exclude' -r -F
@@ -191,7 +191,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand clippy" -l skip-std-check-if-n
 complete -c x.py -n "__fish_x.py_using_subcommand clippy" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_x.py_using_subcommand fix" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand fix" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand fix" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand fix" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand fix" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand fix" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand fix" -l exclude -d 'build paths to exclude' -r -F
@@ -226,7 +226,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand fix" -l skip-std-check-if-no-d
 complete -c x.py -n "__fish_x.py_using_subcommand fix" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l exclude -d 'build paths to exclude' -r -F
@@ -263,7 +263,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand fmt" -l skip-std-check-if-no-d
 complete -c x.py -n "__fish_x.py_using_subcommand fmt" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_x.py_using_subcommand doc" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand doc" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand doc" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand doc" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand doc" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand doc" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand doc" -l exclude -d 'build paths to exclude' -r -F
@@ -306,7 +306,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand test" -l pass -d 'force {check
 complete -c x.py -n "__fish_x.py_using_subcommand test" -l run -d 'whether to execute run-* tests' -r
 complete -c x.py -n "__fish_x.py_using_subcommand test" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand test" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand test" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand test" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand test" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand test" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand test" -l exclude -d 'build paths to exclude' -r -F
@@ -350,7 +350,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand test" -s h -l help -d 'Print h
 complete -c x.py -n "__fish_x.py_using_subcommand miri" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r
 complete -c x.py -n "__fish_x.py_using_subcommand miri" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand miri" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand miri" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand miri" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand miri" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand miri" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand miri" -l exclude -d 'build paths to exclude' -r -F
@@ -389,7 +389,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand miri" -s h -l help -d 'Print h
 complete -c x.py -n "__fish_x.py_using_subcommand bench" -l test-args -r
 complete -c x.py -n "__fish_x.py_using_subcommand bench" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand bench" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand bench" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand bench" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand bench" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand bench" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand bench" -l exclude -d 'build paths to exclude' -r -F
@@ -425,7 +425,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand bench" -s h -l help -d 'Print
 complete -c x.py -n "__fish_x.py_using_subcommand clean" -l stage -d 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used' -r
 complete -c x.py -n "__fish_x.py_using_subcommand clean" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand clean" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand clean" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand clean" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand clean" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand clean" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand clean" -l exclude -d 'build paths to exclude' -r -F
@@ -460,7 +460,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand clean" -l skip-std-check-if-no
 complete -c x.py -n "__fish_x.py_using_subcommand clean" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_x.py_using_subcommand dist" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand dist" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand dist" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand dist" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand dist" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand dist" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand dist" -l exclude -d 'build paths to exclude' -r -F
@@ -495,7 +495,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand dist" -l skip-std-check-if-no-
 complete -c x.py -n "__fish_x.py_using_subcommand dist" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_x.py_using_subcommand install" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand install" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand install" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand install" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand install" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand install" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand install" -l exclude -d 'build paths to exclude' -r -F
@@ -531,7 +531,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand install" -s h -l help -d 'Prin
 complete -c x.py -n "__fish_x.py_using_subcommand run" -l args -d 'arguments for the tool' -r
 complete -c x.py -n "__fish_x.py_using_subcommand run" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand run" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand run" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand run" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand run" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand run" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand run" -l exclude -d 'build paths to exclude' -r -F
@@ -566,7 +566,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand run" -l skip-std-check-if-no-d
 complete -c x.py -n "__fish_x.py_using_subcommand run" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_x.py_using_subcommand setup" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand setup" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand setup" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand setup" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand setup" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand setup" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand setup" -l exclude -d 'build paths to exclude' -r -F
@@ -601,7 +601,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand setup" -l skip-std-check-if-no
 complete -c x.py -n "__fish_x.py_using_subcommand setup" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l exclude -d 'build paths to exclude' -r -F
@@ -638,7 +638,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand suggest" -s h -l help -d 'Prin
 complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l sync -d 'Additional `Cargo.toml` to sync and vendor' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l exclude -d 'build paths to exclude' -r -F
@@ -674,7 +674,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l skip-std-check-if-n
 complete -c x.py -n "__fish_x.py_using_subcommand vendor" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and not __fish_seen_subcommand_from eprintln samply cachegrind benchmark compare" -l exclude -d 'build paths to exclude' -r -F
@@ -718,7 +718,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from eprintln" -l skip -d 'build paths to skip' -r -F
@@ -756,7 +756,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from samply" -l skip -d 'build paths to skip' -r -F
@@ -794,7 +794,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from cachegrind" -l skip -d 'build paths to skip' -r -F
@@ -832,7 +832,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l profiles -d 'Select the profiles that should be benchmarked' -r -f -a "{Check\t'',Debug\t'',Doc\t'',Opt\t'',Clippy\t''}"
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -l skip -d 'build paths to skip' -r -F
@@ -866,7 +866,7 @@ complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcomma
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from benchmark" -s h -l help -d 'Print help (see more with \'--help\')'
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l config -d 'TOML configuration file for build' -r -F
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)"
-complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l build -d 'build target of the stage0 compiler' -r -f
+complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l build -d 'host target of the stage0 compiler' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l host -d 'host targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l target -d 'target targets to build' -r -f
 complete -c x.py -n "__fish_x.py_using_subcommand perf; and __fish_seen_subcommand_from compare" -l exclude -d 'build paths to exclude' -r -F
diff --git a/src/etc/completions/x.py.ps1 b/src/etc/completions/x.py.ps1
index 5d224ac6df4..ee3373b9e75 100644
--- a/src/etc/completions/x.py.ps1
+++ b/src/etc/completions/x.py.ps1
@@ -23,7 +23,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
         'x.py' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -82,7 +82,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
         'x.py;build' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -124,7 +124,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
         'x.py;check' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -171,7 +171,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('-F', '-F ', [CompletionResultType]::ParameterName, 'clippy lints to forbid')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -216,7 +216,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
         'x.py;fix' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -258,7 +258,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
         'x.py;fmt' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -302,7 +302,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
         'x.py;doc' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -352,7 +352,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'whether to execute run-* tests')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -403,7 +403,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -449,7 +449,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--test-args', '--test-args', [CompletionResultType]::ParameterName, 'test-args')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -492,7 +492,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -534,7 +534,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
         'x.py;dist' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -576,7 +576,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
         'x.py;install' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -619,7 +619,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--args', '--args', [CompletionResultType]::ParameterName, 'arguments for the tool')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -661,7 +661,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
         'x.py;setup' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -703,7 +703,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
         'x.py;suggest' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -747,7 +747,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--sync', '--sync', [CompletionResultType]::ParameterName, 'Additional `Cargo.toml` to sync and vendor')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -790,7 +790,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
         'x.py;perf' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
@@ -841,7 +841,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@@ -886,7 +886,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@@ -931,7 +931,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@@ -976,7 +976,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
             [CompletionResult]::new('--profiles', '--profiles', [CompletionResultType]::ParameterName, 'Select the profiles that should be benchmarked')
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip')
@@ -1017,7 +1017,7 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock {
         'x.py;perf;compare' {
             [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build')
             [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`')
-            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'build target of the stage0 compiler')
+            [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler')
             [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build')
             [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build')
             [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude')
diff --git a/src/etc/completions/x.py.zsh b/src/etc/completions/x.py.zsh
index bc55280d038..6dc05708199 100644
--- a/src/etc/completions/x.py.zsh
+++ b/src/etc/completions/x.py.zsh
@@ -17,7 +17,7 @@ _x.py() {
     _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -69,7 +69,7 @@ _x.py() {
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -113,7 +113,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -162,7 +162,7 @@ _arguments "${_arguments_options[@]}" : \
 '*-F+[clippy lints to forbid]:LINT:_default' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -209,7 +209,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -253,7 +253,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -299,7 +299,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -351,7 +351,7 @@ _arguments "${_arguments_options[@]}" : \
 '--run=[whether to execute run-* tests]:auto | always | never:_default' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -404,7 +404,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--test-args=[extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)]:ARGS:_default' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -452,7 +452,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--test-args=[]:TEST_ARGS:_default' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -497,7 +497,7 @@ _arguments "${_arguments_options[@]}" : \
 '--stage=[Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used]:N:_default' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -541,7 +541,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -585,7 +585,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -630,7 +630,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--args=[arguments for the tool]:ARGS:_default' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -674,7 +674,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -719,7 +719,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -765,7 +765,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--sync=[Additional \`Cargo.toml\` to sync and vendor]:SYNC:_files' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -810,7 +810,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -867,7 +867,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--skip=[build paths to skip]:PATH:_files' \
@@ -914,7 +914,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--skip=[build paths to skip]:PATH:_files' \
@@ -961,7 +961,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--skip=[build paths to skip]:PATH:_files' \
@@ -1008,7 +1008,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--skip=[build paths to skip]:PATH:_files' \
@@ -1052,7 +1052,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
diff --git a/src/etc/completions/x.zsh b/src/etc/completions/x.zsh
index 2e3094fc379..869884bf1dc 100644
--- a/src/etc/completions/x.zsh
+++ b/src/etc/completions/x.zsh
@@ -17,7 +17,7 @@ _x() {
     _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -69,7 +69,7 @@ _x() {
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -113,7 +113,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -162,7 +162,7 @@ _arguments "${_arguments_options[@]}" : \
 '*-F+[clippy lints to forbid]:LINT:_default' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -209,7 +209,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -253,7 +253,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -299,7 +299,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -351,7 +351,7 @@ _arguments "${_arguments_options[@]}" : \
 '--run=[whether to execute run-* tests]:auto | always | never:_default' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -404,7 +404,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--test-args=[extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)]:ARGS:_default' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -452,7 +452,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--test-args=[]:TEST_ARGS:_default' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -497,7 +497,7 @@ _arguments "${_arguments_options[@]}" : \
 '--stage=[Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used]:N:_default' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -541,7 +541,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -585,7 +585,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -630,7 +630,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--args=[arguments for the tool]:ARGS:_default' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -674,7 +674,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -719,7 +719,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -765,7 +765,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--sync=[Additional \`Cargo.toml\` to sync and vendor]:SYNC:_files' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -810,7 +810,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
@@ -867,7 +867,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--skip=[build paths to skip]:PATH:_files' \
@@ -914,7 +914,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--skip=[build paths to skip]:PATH:_files' \
@@ -961,7 +961,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--skip=[build paths to skip]:PATH:_files' \
@@ -1008,7 +1008,7 @@ _arguments "${_arguments_options[@]}" : \
 '*--profiles=[Select the profiles that should be benchmarked]:PROFILES:(Check Debug Doc Opt Clippy)' \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--skip=[build paths to skip]:PATH:_files' \
@@ -1052,7 +1052,7 @@ _arguments "${_arguments_options[@]}" : \
 _arguments "${_arguments_options[@]}" : \
 '--config=[TOML configuration file for build]:FILE:_files' \
 '--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \
-'--build=[build target of the stage0 compiler]:BUILD:' \
+'--build=[host target of the stage0 compiler]:BUILD:' \
 '--host=[host targets to build]:HOST:' \
 '--target=[target targets to build]:TARGET:' \
 '*--exclude=[build paths to exclude]:PATH:_files' \
diff --git a/tests/ui-fulldeps/stable-mir/closure-generic-body.rs b/tests/ui-fulldeps/stable-mir/closure-generic-body.rs
new file mode 100644
index 00000000000..2a23345a9d3
--- /dev/null
+++ b/tests/ui-fulldeps/stable-mir/closure-generic-body.rs
@@ -0,0 +1,90 @@
+//@ run-pass
+//! Tests stable mir API for retrieving the body of a closure.
+
+//@ ignore-stage1
+//@ ignore-cross-compile
+//@ ignore-remote
+//@ edition: 2021
+
+#![feature(rustc_private)]
+#![feature(assert_matches)]
+
+extern crate rustc_middle;
+#[macro_use]
+extern crate rustc_smir;
+extern crate rustc_driver;
+extern crate rustc_interface;
+extern crate stable_mir;
+
+use std::io::Write;
+use std::ops::ControlFlow;
+
+use stable_mir::mir::{Body, ConstOperand, Operand, TerminatorKind};
+use stable_mir::ty::{FnDef, RigidTy, TyKind};
+
+const CRATE_NAME: &str = "crate_closure_body";
+
+fn test_closure_body() -> ControlFlow<()> {
+    let crate_items = stable_mir::all_local_items();
+    for item in crate_items {
+        let item_ty = item.ty();
+        match &item_ty.kind() {
+            TyKind::RigidTy(RigidTy::Closure(closure_def, _)) => {
+                let closure_body = closure_def.body().unwrap();
+                check_incr_closure_body(closure_body);
+            }
+            _ => {}
+        }
+    }
+
+    ControlFlow::Continue(())
+}
+
+fn check_incr_closure_body(body: Body) {
+    let first_block = &body.blocks[0];
+    let TerminatorKind::Call { func: Operand::Constant(ConstOperand { const_, .. }), .. } =
+        &first_block.terminator.kind
+    else {
+        panic!("expected Call Terminator, got: ");
+    };
+
+    let TyKind::RigidTy(RigidTy::FnDef(FnDef(def_id), ..), ..) = const_.ty().kind() else {
+        panic!("expected FnDef");
+    };
+
+    assert_eq!(def_id.name(), "id");
+}
+
+fn main() {
+    let path = "closure_body.rs";
+    generate_input(&path).unwrap();
+    let args = &[
+        "rustc".to_string(),
+        "-Cpanic=abort".to_string(),
+        "--crate-name".to_string(),
+        CRATE_NAME.to_string(),
+        path.to_string(),
+    ];
+    run!(args, test_closure_body).unwrap();
+}
+
+fn generate_input(path: &str) -> std::io::Result<()> {
+    let mut file = std::fs::File::create(path)?;
+    write!(
+        file,
+        r#"
+        fn id<T>(y: T) -> T {{
+            y
+        }}
+
+        fn main() {{
+            let cl_id= |x| {{
+                id(x)
+            }};
+
+            let _= cl_id(5);
+        }}
+    "#
+    )?;
+    Ok(())
+}
diff --git a/tests/ui-fulldeps/stable-mir/closure_body.rs b/tests/ui-fulldeps/stable-mir/closure_body.rs
new file mode 100644
index 00000000000..7ed0dabd2c3
--- /dev/null
+++ b/tests/ui-fulldeps/stable-mir/closure_body.rs
@@ -0,0 +1,90 @@
+//@ run-pass
+//! Tests stable mir API for retrieving the body of a closure.
+
+//@ ignore-stage1
+//@ ignore-cross-compile
+//@ ignore-remote
+//@ edition: 2021
+
+#![feature(rustc_private)]
+#![feature(assert_matches)]
+
+extern crate rustc_middle;
+#[macro_use]
+extern crate rustc_smir;
+extern crate rustc_driver;
+extern crate rustc_interface;
+extern crate stable_mir;
+
+use std::io::Write;
+use std::ops::ControlFlow;
+
+use stable_mir::mir::{Body, ConstOperand, Operand, TerminatorKind};
+use stable_mir::ty::{FnDef, RigidTy, TyKind};
+
+const CRATE_NAME: &str = "crate_closure_body";
+
+fn test_closure_body() -> ControlFlow<()> {
+    let crate_items = stable_mir::all_local_items();
+    for item in crate_items {
+        let item_ty = item.ty();
+        match &item_ty.kind() {
+            TyKind::RigidTy(RigidTy::Closure(closure_def, _)) => {
+                let closure_body = closure_def.body().unwrap();
+                check_incr_closure_body(closure_body);
+            }
+            _ => {}
+        }
+    }
+
+    ControlFlow::Continue(())
+}
+
+fn check_incr_closure_body(body: Body) {
+    let first_block = &body.blocks[0];
+    let TerminatorKind::Call { func: Operand::Constant(ConstOperand { const_, .. }), .. } =
+        &first_block.terminator.kind
+    else {
+        panic!("expected Call Terminator, got: ");
+    };
+
+    let TyKind::RigidTy(RigidTy::FnDef(FnDef(def_id), ..), ..) = const_.ty().kind() else {
+        panic!("expected FnDef");
+    };
+
+    assert_eq!(def_id.name(), "incr");
+}
+
+fn main() {
+    let path = "closure_body.rs";
+    generate_input(&path).unwrap();
+    let args = &[
+        "rustc".to_string(),
+        "-Cpanic=abort".to_string(),
+        "--crate-name".to_string(),
+        CRATE_NAME.to_string(),
+        path.to_string(),
+    ];
+    run!(args, test_closure_body).unwrap();
+}
+
+fn generate_input(path: &str) -> std::io::Result<()> {
+    let mut file = std::fs::File::create(path)?;
+    write!(
+        file,
+        r#"
+        fn incr(y: i32) -> i32 {{
+            y + 1
+        }}
+
+        fn main() {{
+            let cl_incr = |x: i32| {{
+                incr(x)
+            }};
+
+            let _= cl_incr(5);
+        }}
+    "#
+    )?;
+    Ok(())
+}
diff --git a/tests/ui/auxiliary/typeid-intrinsic-aux1.rs b/tests/ui/auxiliary/typeid-intrinsic-aux1.rs
index 281c079682f..a028008c6ae 100644
--- a/tests/ui/auxiliary/typeid-intrinsic-aux1.rs
+++ b/tests/ui/auxiliary/typeid-intrinsic-aux1.rs
@@ -9,9 +9,9 @@ pub struct E(Result<&'static str, isize>);
 pub type F = Option<isize>;
 pub type G = usize;
 pub type H = &'static str;
-pub type I = Box<Fn()>;
-pub type I32Iterator = Iterator<Item=i32>;
-pub type U32Iterator = Iterator<Item=u32>;
+pub type I = Box<dyn Fn()>;
+pub type I32Iterator = dyn Iterator<Item=i32>;
+pub type U32Iterator = dyn Iterator<Item=u32>;
 
 pub fn id_A() -> TypeId { TypeId::of::<A>() }
 pub fn id_B() -> TypeId { TypeId::of::<B>() }
diff --git a/tests/ui/auxiliary/typeid-intrinsic-aux2.rs b/tests/ui/auxiliary/typeid-intrinsic-aux2.rs
index 281c079682f..a028008c6ae 100644
--- a/tests/ui/auxiliary/typeid-intrinsic-aux2.rs
+++ b/tests/ui/auxiliary/typeid-intrinsic-aux2.rs
@@ -9,9 +9,9 @@ pub struct E(Result<&'static str, isize>);
 pub type F = Option<isize>;
 pub type G = usize;
 pub type H = &'static str;
-pub type I = Box<Fn()>;
-pub type I32Iterator = Iterator<Item=i32>;
-pub type U32Iterator = Iterator<Item=u32>;
+pub type I = Box<dyn Fn()>;
+pub type I32Iterator = dyn Iterator<Item=i32>;
+pub type U32Iterator = dyn Iterator<Item=u32>;
 
 pub fn id_A() -> TypeId { TypeId::of::<A>() }
 pub fn id_B() -> TypeId { TypeId::of::<B>() }
diff --git a/tests/ui/box/empty-alloc-deref-rvalue.rs b/tests/ui/box/empty-alloc-deref-rvalue.rs
new file mode 100644
index 00000000000..507a753467a
--- /dev/null
+++ b/tests/ui/box/empty-alloc-deref-rvalue.rs
@@ -0,0 +1,10 @@
+//! Smoke test: dereferencing boxed zero-sized types (ZSTs) should not crash.
+//!
+//! Originally a regression test of github.com/rust-lang/rust/issues/13360
+//! but repurposed for a smoke test.
+
+//@ run-pass
+
+pub fn main() {
+    let _: () = *Box::new(());
+}
diff --git a/tests/ui/filter-block-view-items.rs b/tests/ui/cfg/cfg-false-use-item.rs
index cb599c27264..d37b48cdedb 100644
--- a/tests/ui/filter-block-view-items.rs
+++ b/tests/ui/cfg/cfg-false-use-item.rs
@@ -1,3 +1,5 @@
+//! Test that use items with cfg(false) are properly filtered out
+
 //@ run-pass
 
 pub fn main() {
diff --git a/tests/ui/const-generics/const-arg-in-const-arg.min.stderr b/tests/ui/const-generics/const-arg-in-const-arg.min.stderr
index 16512cb69e2..ebb3e821e07 100644
--- a/tests/ui/const-generics/const-arg-in-const-arg.min.stderr
+++ b/tests/ui/const-generics/const-arg-in-const-arg.min.stderr
@@ -13,7 +13,7 @@ error: generic parameters may not be used in const operations
 LL |     let _: [u8; bar::<N>()];
    |                       ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -58,7 +58,7 @@ error: generic parameters may not be used in const operations
 LL |     let _ = [0; bar::<N>()];
    |                       ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -112,7 +112,7 @@ error: generic parameters may not be used in const operations
 LL |     let _: Foo<{ bar::<N>() }>;
    |                        ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -166,7 +166,7 @@ error: generic parameters may not be used in const operations
 LL |     let _ = Foo::<{ bar::<N>() }>;
    |                           ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
diff --git a/tests/ui/const-generics/defaults/complex-generic-default-expr.min.stderr b/tests/ui/const-generics/defaults/complex-generic-default-expr.min.stderr
index 199546c0883..e41e488371a 100644
--- a/tests/ui/const-generics/defaults/complex-generic-default-expr.min.stderr
+++ b/tests/ui/const-generics/defaults/complex-generic-default-expr.min.stderr
@@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
 LL | struct Foo<const N: usize, const M: usize = { N + 1 }>;
    |                                               ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
diff --git a/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-4.stderr b/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-4.stderr
index 4722968b203..a1aee041b1f 100644
--- a/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-4.stderr
+++ b/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-4.stderr
@@ -7,7 +7,7 @@ LL |         N
 LL | fn foo<const N: usize>() -> Foo<{ arg!{} arg!{} }> { loop {} }
    |                                   ------ in this macro invocation
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
    = note: this error originates in the macro `arg` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -20,7 +20,7 @@ LL |         N
 LL | fn foo<const N: usize>() -> Foo<{ arg!{} arg!{} }> { loop {} }
    |                                          ------ in this macro invocation
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
    = note: this error originates in the macro `arg` (in Nightly builds, run with -Z macro-backtrace for more info)
 
@@ -30,7 +30,7 @@ error: generic parameters may not be used in const operations
 LL | fn bar<const N: usize>() -> [(); { empty!{}; N }] { loop {} }
    |                                              ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: aborting due to 3 previous errors
diff --git a/tests/ui/const-generics/early/macro_rules-braces.stderr b/tests/ui/const-generics/early/macro_rules-braces.stderr
index 32695066801..30efa18982b 100644
--- a/tests/ui/const-generics/early/macro_rules-braces.stderr
+++ b/tests/ui/const-generics/early/macro_rules-braces.stderr
@@ -26,7 +26,7 @@ error: generic parameters may not be used in const operations
 LL |     let _: foo!({{ N }});
    |                    ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -35,7 +35,7 @@ error: generic parameters may not be used in const operations
 LL |     let _: bar!({ N });
    |                   ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -44,7 +44,7 @@ error: generic parameters may not be used in const operations
 LL |     let _: baz!({{ N }});
    |                    ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -53,7 +53,7 @@ error: generic parameters may not be used in const operations
 LL |     let _: biz!({ N });
    |                   ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: aborting due to 6 previous errors
diff --git a/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces-2.stderr b/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces-2.stderr
index e40d05924b1..d68715b4d8b 100644
--- a/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces-2.stderr
+++ b/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces-2.stderr
@@ -7,7 +7,7 @@ LL |         N
 LL | fn foo<const N: usize>() -> A<{{ y!() }}> {
    |                                  ---- in this macro invocation
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
    = note: this error originates in the macro `y` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces.stderr b/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces.stderr
index b91d6c7a024..1171b359f17 100644
--- a/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces.stderr
+++ b/tests/ui/const-generics/early/trivial-const-arg-macro-nested-braces.stderr
@@ -7,7 +7,7 @@ LL |         { N }
 LL | fn foo<const N: usize>() -> A<{ y!() }> {
    |                                 ---- in this macro invocation
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
    = note: this error originates in the macro `y` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/tests/ui/const-generics/early/trivial-const-arg-nested-braces.stderr b/tests/ui/const-generics/early/trivial-const-arg-nested-braces.stderr
index d60516ba4bc..b812e3333d9 100644
--- a/tests/ui/const-generics/early/trivial-const-arg-nested-braces.stderr
+++ b/tests/ui/const-generics/early/trivial-const-arg-nested-braces.stderr
@@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
 LL | fn foo<const N: usize>() -> A<{ { N } }> {
    |                                   ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr b/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr
index a8b6f06ab1c..1f93c4f8909 100644
--- a/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr
@@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
 LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
    |                                                ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -13,7 +13,7 @@ error: generic parameters may not be used in const operations
 LL |     arr: [u8; CFG.arr_size],
    |               ^^^ cannot perform const operation using `CFG`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `CFG`
+   = help: const parameters may only be used as standalone arguments here, i.e. `CFG`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: `Config` is forbidden as the type of a const generic parameter
diff --git a/tests/ui/const-generics/generic_const_exprs/bad-multiply.stderr b/tests/ui/const-generics/generic_const_exprs/bad-multiply.stderr
index a8d6cebabe7..7719831e20c 100644
--- a/tests/ui/const-generics/generic_const_exprs/bad-multiply.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/bad-multiply.stderr
@@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
 LL |     SmallVec<{ D * 2 }>:,
    |                ^ cannot perform const operation using `D`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `D`
+   = help: const parameters may only be used as standalone arguments here, i.e. `D`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error[E0747]: constant provided when a type was expected
diff --git a/tests/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr b/tests/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr
index 9c4e3d8583c..3208bbbd86b 100644
--- a/tests/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr
@@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
 LL | type Arr<const N: usize> = [u8; N - 1];
    |                                 ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-72787.min.stderr b/tests/ui/const-generics/generic_const_exprs/issue-72787.min.stderr
index 2454b311921..cccf6dc6ae0 100644
--- a/tests/ui/const-generics/generic_const_exprs/issue-72787.min.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/issue-72787.min.stderr
@@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
 LL |     Condition<{ LHS <= RHS }>: True
    |                 ^^^ cannot perform const operation using `LHS`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `LHS`
+   = help: const parameters may only be used as standalone arguments here, i.e. `LHS`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -13,7 +13,7 @@ error: generic parameters may not be used in const operations
 LL |     Condition<{ LHS <= RHS }>: True
    |                        ^^^ cannot perform const operation using `RHS`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `RHS`
+   = help: const parameters may only be used as standalone arguments here, i.e. `RHS`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -22,7 +22,7 @@ error: generic parameters may not be used in const operations
 LL |     IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
    |                         ^ cannot perform const operation using `I`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `I`
+   = help: const parameters may only be used as standalone arguments here, i.e. `I`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -31,7 +31,7 @@ error: generic parameters may not be used in const operations
 LL |     IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
    |                                    ^ cannot perform const operation using `J`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `J`
+   = help: const parameters may only be used as standalone arguments here, i.e. `J`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: aborting due to 4 previous errors
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr b/tests/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr
index c504464127a..f91a2a30286 100644
--- a/tests/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr
@@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
 LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
    |                 ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/const-generics/generic_const_exprs/trivial-anon-const-use-cases.full.stderr b/tests/ui/const-generics/generic_const_exprs/trivial-anon-const-use-cases.full.stderr
new file mode 100644
index 00000000000..586ac63016c
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/trivial-anon-const-use-cases.full.stderr
@@ -0,0 +1,13 @@
+error: unconstrained generic constant
+  --> $DIR/trivial-anon-const-use-cases.rs:14:12
+   |
+LL |     stuff: [u8; { S + 1 }], // `S + 1` is NOT a valid const expression in this context.
+   |            ^^^^^^^^^^^^^^^
+   |
+help: try adding a `where` bound
+   |
+LL | struct Y<const S: usize> where [(); { S + 1 }]: {
+   |                          ++++++++++++++++++++++
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/const-generics/generic_const_exprs/trivial-anon-const-use-cases.min.stderr b/tests/ui/const-generics/generic_const_exprs/trivial-anon-const-use-cases.min.stderr
new file mode 100644
index 00000000000..6a868e95c89
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/trivial-anon-const-use-cases.min.stderr
@@ -0,0 +1,11 @@
+error: generic parameters may not be used in const operations
+  --> $DIR/trivial-anon-const-use-cases.rs:14:19
+   |
+LL |     stuff: [u8; { S + 1 }], // `S + 1` is NOT a valid const expression in this context.
+   |                   ^ cannot perform const operation using `S`
+   |
+   = help: const parameters may only be used as standalone arguments here, i.e. `S`
+   = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/const-generics/generic_const_exprs/trivial-anon-const-use-cases.rs b/tests/ui/const-generics/generic_const_exprs/trivial-anon-const-use-cases.rs
new file mode 100644
index 00000000000..b1fd4cbc661
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/trivial-anon-const-use-cases.rs
@@ -0,0 +1,19 @@
+//! Regression test for <https://github.com/rust-lang/rust/issues/79429>.
+
+//@ revisions: full min
+#![cfg_attr(full, feature(generic_const_exprs))]
+#![cfg_attr(full, allow(incomplete_features))]
+
+struct X<const S: usize>;
+
+impl<const S: usize> X<S> {
+    const LEN: usize = S + 1; // `S + 1` is a valid const expression in this context.
+}
+
+struct Y<const S: usize> {
+    stuff: [u8; { S + 1 }], // `S + 1` is NOT a valid const expression in this context.
+    //[min]~^ ERROR generic parameters may not be used in const operations
+    //[full]~^^ ERROR unconstrained generic constant
+}
+
+fn main() {}
diff --git a/tests/ui/const-generics/issues/issue-68366.min.stderr b/tests/ui/const-generics/issues/issue-68366.min.stderr
index 10b5a06682f..4d721e958cb 100644
--- a/tests/ui/const-generics/issues/issue-68366.min.stderr
+++ b/tests/ui/const-generics/issues/issue-68366.min.stderr
@@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
 LL | impl <const N: usize> Collatz<{Some(N)}> {}
    |                                     ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: `Option<usize>` is forbidden as the type of a const generic parameter
diff --git a/tests/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr b/tests/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr
index da2fbc52a6c..e58c894a270 100644
--- a/tests/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr
+++ b/tests/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr
@@ -13,7 +13,7 @@ error: generic parameters may not be used in const operations
 LL | fn const_param<const N: usize>() -> [u8; N + 1] {
    |                                          ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: aborting due to 2 previous errors
diff --git a/tests/ui/const-generics/issues/issue-80375.stderr b/tests/ui/const-generics/issues/issue-80375.stderr
index 015196f8605..9a15e0380a1 100644
--- a/tests/ui/const-generics/issues/issue-80375.stderr
+++ b/tests/ui/const-generics/issues/issue-80375.stderr
@@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
 LL | struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
    |                                         ^^^^^ cannot perform const operation using `COUNT`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `COUNT`
+   = help: const parameters may only be used as standalone arguments here, i.e. `COUNT`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/const-generics/legacy-const-generics-bad.stderr b/tests/ui/const-generics/legacy-const-generics-bad.stderr
index 3a5fa417075..a8681d62053 100644
--- a/tests/ui/const-generics/legacy-const-generics-bad.stderr
+++ b/tests/ui/const-generics/legacy-const-generics-bad.stderr
@@ -16,7 +16,7 @@ error: generic parameters may not be used in const operations
 LL |     legacy_const_generics::foo(0, N + 1, 2);
    |                                   ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: aborting due to 2 previous errors
diff --git a/tests/ui/const-generics/min_const_generics/complex-expression.stderr b/tests/ui/const-generics/min_const_generics/complex-expression.stderr
index 3affdcf9b03..35039bb4109 100644
--- a/tests/ui/const-generics/min_const_generics/complex-expression.stderr
+++ b/tests/ui/const-generics/min_const_generics/complex-expression.stderr
@@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
 LL | struct Break0<const N: usize>([u8; { N + 1 }]);
    |                                      ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -13,7 +13,7 @@ error: generic parameters may not be used in const operations
 LL | struct Break1<const N: usize>([u8; { { N } }]);
    |                                        ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -22,7 +22,7 @@ error: generic parameters may not be used in const operations
 LL |     let _: [u8; N + 1];
    |                 ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -31,7 +31,7 @@ error: generic parameters may not be used in const operations
 LL |     let _ = [0; N + 1];
    |                 ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
diff --git a/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.stderr b/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.stderr
index ead6c621d60..fe32fbcc87d 100644
--- a/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.stderr
+++ b/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.stderr
@@ -4,7 +4,7 @@ error: generic parameters may not be used in const operations
 LL |     bar::<{ [1; N] }>();
    |                 ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
@@ -13,7 +13,7 @@ error: generic parameters may not be used in const operations
 LL |     bar::<{ [1; { N + 1 }] }>();
    |                   ^ cannot perform const operation using `N`
    |
-   = help: const parameters may only be used as standalone arguments, i.e. `N`
+   = help: const parameters may only be used as standalone arguments here, i.e. `N`
    = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: aborting due to 2 previous errors
diff --git a/tests/ui/exclusive-drop-and-copy.rs b/tests/ui/derives/copy-drop-mutually-exclusive.rs
index 210ecaed756..5147605910d 100644
--- a/tests/ui/exclusive-drop-and-copy.rs
+++ b/tests/ui/derives/copy-drop-mutually-exclusive.rs
@@ -1,4 +1,4 @@
-// issue #20126
+//! Regression test for issue #20126: Copy and Drop traits are mutually exclusive
 
 #[derive(Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented
 struct Foo;
diff --git a/tests/ui/exclusive-drop-and-copy.stderr b/tests/ui/derives/copy-drop-mutually-exclusive.stderr
index 340ca89c396..771bbc92569 100644
--- a/tests/ui/exclusive-drop-and-copy.stderr
+++ b/tests/ui/derives/copy-drop-mutually-exclusive.stderr
@@ -1,11 +1,11 @@
 error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
-  --> $DIR/exclusive-drop-and-copy.rs:3:10
+  --> $DIR/copy-drop-mutually-exclusive.rs:3:10
    |
 LL | #[derive(Copy, Clone)]
    |          ^^^^ `Copy` not allowed on types with destructors
 
 error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
-  --> $DIR/exclusive-drop-and-copy.rs:10:10
+  --> $DIR/copy-drop-mutually-exclusive.rs:10:10
    |
 LL | #[derive(Copy, Clone)]
    |          ^^^^ `Copy` not allowed on types with destructors
diff --git a/tests/ui/illegal-ufcs-drop.fixed b/tests/ui/drop/explicit-drop-call-error.fixed
index 2b1c967ed1e..f2f0245df96 100644
--- a/tests/ui/illegal-ufcs-drop.fixed
+++ b/tests/ui/drop/explicit-drop-call-error.fixed
@@ -1,3 +1,5 @@
+//! Test error for explicit destructor method calls via UFCS
+
 //@ run-rustfix
 
 #![allow(dropping_references)]
diff --git a/tests/ui/illegal-ufcs-drop.rs b/tests/ui/drop/explicit-drop-call-error.rs
index 99dda0dab34..e41c806bd1e 100644
--- a/tests/ui/illegal-ufcs-drop.rs
+++ b/tests/ui/drop/explicit-drop-call-error.rs
@@ -1,3 +1,5 @@
+//! Test error for explicit destructor method calls via UFCS
+
 //@ run-rustfix
 
 #![allow(dropping_references)]
diff --git a/tests/ui/illegal-ufcs-drop.stderr b/tests/ui/drop/explicit-drop-call-error.stderr
index 4f214a12747..95d5c31ab6d 100644
--- a/tests/ui/illegal-ufcs-drop.stderr
+++ b/tests/ui/drop/explicit-drop-call-error.stderr
@@ -1,5 +1,5 @@
 error[E0040]: explicit use of destructor method
-  --> $DIR/illegal-ufcs-drop.rs:12:5
+  --> $DIR/explicit-drop-call-error.rs:14:5
    |
 LL |     Drop::drop(&mut Foo)
    |     ^^^^^^^^^^
diff --git a/tests/ui/editions/unsafe-attr-edition-span.e2024.stderr b/tests/ui/editions/unsafe-attr-edition-span.e2024.stderr
new file mode 100644
index 00000000000..28871a1cce4
--- /dev/null
+++ b/tests/ui/editions/unsafe-attr-edition-span.e2024.stderr
@@ -0,0 +1,24 @@
+error: unsafe attribute used without unsafe
+  --> $DIR/unsafe-attr-edition-span.rs:21:3
+   |
+LL | #[no_mangle]
+   |   ^^^^^^^^^ usage of unsafe attribute
+   |
+help: wrap the attribute in `unsafe(...)`
+   |
+LL | #[unsafe(no_mangle)]
+   |   +++++++         +
+
+error: unsafe attribute used without unsafe
+  --> $DIR/unsafe-attr-edition-span.rs:25:7
+   |
+LL |     #[no_mangle]
+   |       ^^^^^^^^^ usage of unsafe attribute
+   |
+help: wrap the attribute in `unsafe(...)`
+   |
+LL |     #[unsafe(no_mangle)]
+   |       +++++++         +
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/editions/unsafe-attr-edition-span.rs b/tests/ui/editions/unsafe-attr-edition-span.rs
new file mode 100644
index 00000000000..bc44b34063c
--- /dev/null
+++ b/tests/ui/editions/unsafe-attr-edition-span.rs
@@ -0,0 +1,27 @@
+// Tests that the correct span is used to determine the edition of an attribute that was safe to use
+// in earlier editions, but has become `unsafe` in later editions.
+//
+// Determining the correct edition is non-trivial because of macro expansion. For instance,
+// the `thread_local!` macro (defined in std and hence using the most recent edition) parses the
+// attribute, and then re-emits it. Therefore, the span of the `#` token starting the
+// `#[no_mangle]` attribute has std's edition, while the attribute name has the edition of this
+// file, which may be different.
+
+//@ revisions: e2015 e2018 e2021 e2024
+
+//@[e2018] edition:2018
+//@[e2021] edition:2021
+//@[e2024] edition:2024
+//
+//@[e2015] check-pass
+//@[e2018] check-pass
+//@[e2021] check-pass
+#![crate_type = "lib"]
+
+#[no_mangle] //[e2024]~ ERROR unsafe attribute used without unsafe
+static TEST_OUTSIDE: usize = 0;
+
+thread_local! {
+    #[no_mangle]//[e2024]~ ERROR unsafe attribute used without unsafe
+    static TEST: usize = 0;
+}
diff --git a/tests/ui/empty-allocation-rvalue-non-null.rs b/tests/ui/empty-allocation-rvalue-non-null.rs
deleted file mode 100644
index 0cd4fde73ed..00000000000
--- a/tests/ui/empty-allocation-rvalue-non-null.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-//@ run-pass
-
-#![allow(unused_variables)]
-
-pub fn main() {
-    let x: () = *Box::new(());
-}
diff --git a/tests/ui/empty-type-parameter-list.rs b/tests/ui/empty-type-parameter-list.rs
deleted file mode 100644
index e8d6b2a9964..00000000000
--- a/tests/ui/empty-type-parameter-list.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-//@ run-pass
-// Test that empty type parameter list (<>) is synonymous with
-// no type parameters at all
-
-struct S<>;
-trait T<> {} //~ WARN trait `T` is never used
-enum E<> { V }
-impl<> T<> for S<> {}
-impl T for E {}
-fn foo<>() {}
-fn bar() {}
-
-fn main() {
-    let _ = S;
-    let _ = S::<>;
-    let _ = E::V;
-    let _ = E::<>::V;
-    foo();
-    foo::<>();
-
-    // Test that we can supply <> to non generic things
-    bar::<>();
-    let _: i32<>;
-}
diff --git a/tests/ui/error-should-say-copy-not-pod.rs b/tests/ui/error-should-say-copy-not-pod.rs
deleted file mode 100644
index 40c4730ef69..00000000000
--- a/tests/ui/error-should-say-copy-not-pod.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-// Tests that the error message uses the word Copy, not Pod.
-
-fn check_bound<T:Copy>(_: T) {}
-
-fn main() {
-    check_bound("nocopy".to_string()); //~ ERROR : Copy` is not satisfied
-}
diff --git a/tests/ui/error-should-say-copy-not-pod.stderr b/tests/ui/error-should-say-copy-not-pod.stderr
deleted file mode 100644
index 6aa129fa29b..00000000000
--- a/tests/ui/error-should-say-copy-not-pod.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0277]: the trait bound `String: Copy` is not satisfied
-  --> $DIR/error-should-say-copy-not-pod.rs:6:17
-   |
-LL |     check_bound("nocopy".to_string());
-   |     ----------- ^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
-   |     |
-   |     required by a bound introduced by this call
-   |
-note: required by a bound in `check_bound`
-  --> $DIR/error-should-say-copy-not-pod.rs:3:18
-   |
-LL | fn check_bound<T:Copy>(_: T) {}
-   |                  ^^^^ required by this bound in `check_bound`
-help: consider removing this method call, as the receiver has type `&'static str` and `&'static str: Copy` trivially holds
-   |
-LL -     check_bound("nocopy".to_string());
-LL +     check_bound("nocopy");
-   |
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/explicit-i-suffix.rs b/tests/ui/explicit-i-suffix.rs
deleted file mode 100644
index 0a6ed49ae27..00000000000
--- a/tests/ui/explicit-i-suffix.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-//@ run-pass
-
-#![allow(unused_must_use)]
-
-pub fn main() {
-    let x: isize = 8;
-    let y = 9;
-    x + y;
-
-    let q: isize = -8;
-    let r = -9;
-    q + r;
-}
diff --git a/tests/ui/ext-nonexistent.rs b/tests/ui/ext-nonexistent.rs
deleted file mode 100644
index 1293324b67e..00000000000
--- a/tests/ui/ext-nonexistent.rs
+++ /dev/null
@@ -1,2 +0,0 @@
-fn main() { iamnotanextensionthatexists!(""); }
-//~^ ERROR cannot find macro `iamnotanextensionthatexists` in this scope
diff --git a/tests/ui/ext-nonexistent.stderr b/tests/ui/ext-nonexistent.stderr
deleted file mode 100644
index edb59bba6e5..00000000000
--- a/tests/ui/ext-nonexistent.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: cannot find macro `iamnotanextensionthatexists` in this scope
-  --> $DIR/ext-nonexistent.rs:1:13
-   |
-LL | fn main() { iamnotanextensionthatexists!(""); }
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/fact.rs b/tests/ui/fact.rs
deleted file mode 100644
index e94c12da013..00000000000
--- a/tests/ui/fact.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-//@ run-pass
-
-fn f(x: isize) -> isize {
-    // println!("in f:");
-
-    println!("{}", x);
-    if x == 1 {
-        // println!("bottoming out");
-
-        return 1;
-    } else {
-        // println!("recurring");
-
-        let y: isize = x * f(x - 1);
-        // println!("returned");
-
-        println!("{}", y);
-        return y;
-    }
-}
-
-pub fn main() {
-    assert_eq!(f(5), 120);
-    // println!("all done");
-
-}
diff --git a/tests/ui/format-no-std.rs b/tests/ui/fmt/format-macro-no-std.rs
index 657b210a9a0..d096b4de013 100644
--- a/tests/ui/format-no-std.rs
+++ b/tests/ui/fmt/format-macro-no-std.rs
@@ -1,3 +1,5 @@
+//! Test format! macro functionality in no_std environment
+
 //@ run-pass
 //@ ignore-emscripten no no_std executables
 //@ ignore-wasm different `main` convention
@@ -9,7 +11,8 @@
 // Import global allocator and panic handler.
 extern crate std as other;
 
-#[macro_use] extern crate alloc;
+#[macro_use]
+extern crate alloc;
 
 use alloc::string::ToString;
 
@@ -21,7 +24,7 @@ extern "C" fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ff
     let s = format!("test");
     assert_eq!(s, "test".to_string());
 
-    let s = format!("{test}", test=3_isize);
+    let s = format!("{test}", test = 3_isize);
     assert_eq!(s, "3".to_string());
 
     let s = format!("hello {}", "world");
diff --git a/tests/ui/fun-indirect-call.rs b/tests/ui/fun-indirect-call.rs
deleted file mode 100644
index 7919be07f7e..00000000000
--- a/tests/ui/fun-indirect-call.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-//@ run-pass
-
-fn f() -> isize { return 42; }
-
-pub fn main() {
-    let g: fn() -> isize = f;
-    let i: isize = g();
-    assert_eq!(i, 42);
-}
diff --git a/tests/ui/future-incompatible-lint-group.rs b/tests/ui/future-incompatible-lint-group.rs
deleted file mode 100644
index ed2c47bb609..00000000000
--- a/tests/ui/future-incompatible-lint-group.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Ensure that the future_incompatible lint group only includes
-// lints for changes that are not tied to an edition
-#![deny(future_incompatible)]
-
-// Error since this is a `future_incompatible` lint
-macro_rules! m { ($i) => {} } //~ ERROR missing fragment specifier
-                              //~| WARN this was previously accepted
-
-trait Tr {
-    // Warn only since this is not a `future_incompatible` lint
-    fn f(u8) {} //~ WARN anonymous parameters are deprecated
-                //~| WARN this is accepted in the current edition
-}
-
-fn main() {}
diff --git a/tests/ui/generics/empty-generic-brackets-equiv.rs b/tests/ui/generics/empty-generic-brackets-equiv.rs
new file mode 100644
index 00000000000..d84498a60f8
--- /dev/null
+++ b/tests/ui/generics/empty-generic-brackets-equiv.rs
@@ -0,0 +1,27 @@
+//! Test that empty type parameter list <> is equivalent to no type parameters
+//!
+//! Checks` that empty angle brackets <> are syntactically valid and equivalent
+//! to omitting type parameters entirely across various language constructs.
+
+//@ run-pass
+
+struct S<>;
+trait T<> {} //~ WARN trait `T` is never used
+enum E<> {
+    V
+}
+impl<> T<> for S<> {}
+impl T for E {}
+fn foo<>() {}
+fn bar() {}
+fn main() {
+    let _ = S;
+    let _ = S::<>;
+    let _ = E::V;
+    let _ = E::<>::V;
+    foo();
+    foo::<>();
+    // Test that we can supply <> to non-generic things
+    bar::<>();
+    let _: i32<>;
+}
diff --git a/tests/ui/empty-type-parameter-list.stderr b/tests/ui/generics/empty-generic-brackets-equiv.stderr
index 31a5015e993..151ee4697b4 100644
--- a/tests/ui/empty-type-parameter-list.stderr
+++ b/tests/ui/generics/empty-generic-brackets-equiv.stderr
@@ -1,5 +1,5 @@
 warning: trait `T` is never used
-  --> $DIR/empty-type-parameter-list.rs:6:7
+  --> $DIR/empty-generic-brackets-equiv.rs:9:7
    |
 LL | trait T<> {}
    |       ^
diff --git a/tests/ui/global-scope.rs b/tests/ui/global-scope.rs
deleted file mode 100644
index 33b56bca940..00000000000
--- a/tests/ui/global-scope.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-//@ run-pass
-
-pub fn f() -> isize { return 1; }
-
-pub mod foo {
-    pub fn f() -> isize { return 2; }
-    pub fn g() {
-        assert_eq!(f(), 2);
-        assert_eq!(::f(), 1);
-    }
-}
-
-pub fn main() { return foo::g(); }
diff --git a/tests/ui/hello.rs b/tests/ui/hello.rs
deleted file mode 100644
index f329ee086f9..00000000000
--- a/tests/ui/hello.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-//@ run-pass
-//@ revisions: e2015 e2018 e2021 e2024
-
-//@[e2018] edition:2018
-//@[e2021] edition:2021
-//@[e2024] edition:2024
-
-fn main() {
-    println!("hello");
-}
diff --git a/tests/ui/include-macros/parent_dir.rs b/tests/ui/include-macros/parent_dir.rs
index 1dcf27324d1..9a81a6deeb1 100644
--- a/tests/ui/include-macros/parent_dir.rs
+++ b/tests/ui/include-macros/parent_dir.rs
@@ -3,8 +3,6 @@
 fn main() {
     let _ = include_str!("include-macros/file.txt");            //~ ERROR couldn't read
                                                                 //~^HELP different directory
-    let _ = include_str!("hello.rs");                           //~ ERROR couldn't read
-                                                                //~^HELP different directory
     let _ = include_bytes!("../../data.bin");                   //~ ERROR couldn't read
                                                                 //~^HELP different directory
     let _ = include_str!("tests/ui/include-macros/file.txt");   //~ ERROR couldn't read
diff --git a/tests/ui/include-macros/parent_dir.stderr b/tests/ui/include-macros/parent_dir.stderr
index 4ee6fe104b0..7a18b1de5d1 100644
--- a/tests/ui/include-macros/parent_dir.stderr
+++ b/tests/ui/include-macros/parent_dir.stderr
@@ -10,19 +10,8 @@ LL -     let _ = include_str!("include-macros/file.txt");
 LL +     let _ = include_str!("file.txt");
    |
 
-error: couldn't read `$DIR/hello.rs`: $FILE_NOT_FOUND_MSG
-  --> $DIR/parent_dir.rs:6:13
-   |
-LL |     let _ = include_str!("hello.rs");
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-help: there is a file with the same name in a different directory
-   |
-LL |     let _ = include_str!("../hello.rs");
-   |                           +++
-
 error: couldn't read `$DIR/../../data.bin`: $FILE_NOT_FOUND_MSG
-  --> $DIR/parent_dir.rs:8:13
+  --> $DIR/parent_dir.rs:6:13
    |
 LL |     let _ = include_bytes!("../../data.bin");
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -34,7 +23,7 @@ LL +     let _ = include_bytes!("data.bin");
    |
 
 error: couldn't read `$DIR/tests/ui/include-macros/file.txt`: $FILE_NOT_FOUND_MSG
-  --> $DIR/parent_dir.rs:10:13
+  --> $DIR/parent_dir.rs:8:13
    |
 LL |     let _ = include_str!("tests/ui/include-macros/file.txt");
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -45,5 +34,5 @@ LL -     let _ = include_str!("tests/ui/include-macros/file.txt");
 LL +     let _ = include_str!("file.txt");
    |
 
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
 
diff --git a/tests/ui/lint/future-incompatible-lint-group.rs b/tests/ui/lint/future-incompatible-lint-group.rs
new file mode 100644
index 00000000000..d1adcf21cdc
--- /dev/null
+++ b/tests/ui/lint/future-incompatible-lint-group.rs
@@ -0,0 +1,21 @@
+//! Test that future_incompatible lint group only includes edition-independent lints
+
+// Ensure that the future_incompatible lint group only includes
+// lints for changes that are not tied to an edition
+#![deny(future_incompatible)]
+
+// Error since this is a `future_incompatible` lint
+macro_rules! m {
+    ($i) => {};
+    //~^ ERROR missing fragment specifier
+    //~| WARN this was previously accepted
+}
+
+trait Tr {
+    // Warn only since this is not a `future_incompatible` lint
+    fn f(u8) {}
+    //~^ WARN anonymous parameters are deprecated
+    //~| WARN this is accepted in the current edition
+}
+
+fn main() {}
diff --git a/tests/ui/future-incompatible-lint-group.stderr b/tests/ui/lint/future-incompatible-lint-group.stderr
index 4c867e0aab3..264911b46d4 100644
--- a/tests/ui/future-incompatible-lint-group.stderr
+++ b/tests/ui/lint/future-incompatible-lint-group.stderr
@@ -1,20 +1,20 @@
 error: missing fragment specifier
-  --> $DIR/future-incompatible-lint-group.rs:6:19
+  --> $DIR/future-incompatible-lint-group.rs:9:6
    |
-LL | macro_rules! m { ($i) => {} }
-   |                   ^^
+LL |     ($i) => {};
+   |      ^^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
 note: the lint level is defined here
-  --> $DIR/future-incompatible-lint-group.rs:3:9
+  --> $DIR/future-incompatible-lint-group.rs:5:9
    |
 LL | #![deny(future_incompatible)]
    |         ^^^^^^^^^^^^^^^^^^^
    = note: `#[deny(missing_fragment_specifier)]` implied by `#[deny(future_incompatible)]`
 
 warning: anonymous parameters are deprecated and will be removed in the next edition
-  --> $DIR/future-incompatible-lint-group.rs:11:10
+  --> $DIR/future-incompatible-lint-group.rs:16:10
    |
 LL |     fn f(u8) {}
    |          ^^ help: try naming the parameter or explicitly ignoring it: `_: u8`
@@ -27,15 +27,15 @@ error: aborting due to 1 previous error; 1 warning emitted
 
 Future incompatibility report: Future breakage diagnostic:
 error: missing fragment specifier
-  --> $DIR/future-incompatible-lint-group.rs:6:19
+  --> $DIR/future-incompatible-lint-group.rs:9:6
    |
-LL | macro_rules! m { ($i) => {} }
-   |                   ^^
+LL |     ($i) => {};
+   |      ^^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
 note: the lint level is defined here
-  --> $DIR/future-incompatible-lint-group.rs:3:9
+  --> $DIR/future-incompatible-lint-group.rs:5:9
    |
 LL | #![deny(future_incompatible)]
    |         ^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/ext-expand-inner-exprs.rs b/tests/ui/macros/nested-macro-expansion.rs
index 94610d0a328..3b94b1051c9 100644
--- a/tests/ui/ext-expand-inner-exprs.rs
+++ b/tests/ui/macros/nested-macro-expansion.rs
@@ -1,3 +1,5 @@
+//! Test nested macro expansion with concat! macros
+
 //@ run-pass
 
 static FOO : &'static str = concat!(concat!("hel", "lo"), "world");
diff --git a/tests/ui/impl-inherent-non-conflict.rs b/tests/ui/methods/inherent-methods-same-name.rs
index 41ab865892a..d7d19bc3325 100644
--- a/tests/ui/impl-inherent-non-conflict.rs
+++ b/tests/ui/methods/inherent-methods-same-name.rs
@@ -1,17 +1,22 @@
+//! Test multiple inherent methods with same name on different type parameters
+
 //@ run-pass
 // Ensure that a user-defined type admits multiple inherent methods
 // with the same name, which can be called on values that have a
 // precise enough type to allow distinguishing between the methods.
 
-
 struct Foo<T>(T);
 
 impl Foo<usize> {
-    fn bar(&self) -> i32 { self.0 as i32 }
+    fn bar(&self) -> i32 {
+        self.0 as i32
+    }
 }
 
 impl Foo<isize> {
-    fn bar(&self) -> i32 { -(self.0 as i32) }
+    fn bar(&self) -> i32 {
+        -(self.0 as i32)
+    }
 }
 
 fn main() {
diff --git a/tests/ui/impl-not-adjacent-to-type.rs b/tests/ui/modules/impl-cross-module.rs
index ccf59ed4393..3ed8c18ff3c 100644
--- a/tests/ui/impl-not-adjacent-to-type.rs
+++ b/tests/ui/modules/impl-cross-module.rs
@@ -1,3 +1,5 @@
+//! Test implementing methods for types defined in other modules
+
 //@ run-pass
 
 mod foo {
diff --git a/tests/ui/resolve/auxiliary/issue-80079.rs b/tests/ui/resolve/auxiliary/issue-80079.rs
index 190ca75aba8..bfae5c5a24e 100644
--- a/tests/ui/resolve/auxiliary/issue-80079.rs
+++ b/tests/ui/resolve/auxiliary/issue-80079.rs
@@ -1,7 +1,7 @@
 #![crate_type = "lib"]
 
 pub mod public {
-    use private_import;
+    use crate::private_import;
 
     // should not be suggested since it is private
     struct Foo;
diff --git a/tests/ui/resolve/auxiliary/privacy-struct-ctor.rs b/tests/ui/resolve/auxiliary/privacy-struct-ctor.rs
index 6d0bc728524..ac157a82e17 100644
--- a/tests/ui/resolve/auxiliary/privacy-struct-ctor.rs
+++ b/tests/ui/resolve/auxiliary/privacy-struct-ctor.rs
@@ -2,7 +2,7 @@ pub mod m {
     pub struct S(u8);
 
     pub mod n {
-        pub(in m) struct Z(pub(in m::n) u8);
+        pub(in crate::m) struct Z(pub(in crate::m::n) u8);
     }
 }
 
diff --git a/tests/ui/resolve/extern-prelude-fail.rs b/tests/ui/resolve/extern-prelude-fail.rs
index c0716f1ebf5..7d0df03e57b 100644
--- a/tests/ui/resolve/extern-prelude-fail.rs
+++ b/tests/ui/resolve/extern-prelude-fail.rs
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ compile-flags:--extern extern_prelude
 //@ aux-build:extern-prelude.rs
 
diff --git a/tests/ui/resolve/extern-prelude-fail.stderr b/tests/ui/resolve/extern-prelude-fail.stderr
index 199a31244c0..b9668154f44 100644
--- a/tests/ui/resolve/extern-prelude-fail.stderr
+++ b/tests/ui/resolve/extern-prelude-fail.stderr
@@ -1,5 +1,5 @@
 error[E0432]: unresolved import `extern_prelude`
-  --> $DIR/extern-prelude-fail.rs:7:9
+  --> $DIR/extern-prelude-fail.rs:8:9
    |
 LL |     use extern_prelude::S;
    |         ^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `extern_prelude`
@@ -10,7 +10,7 @@ LL + extern crate extern_prelude;
    |
 
 error[E0433]: failed to resolve: use of unresolved module or unlinked crate `extern_prelude`
-  --> $DIR/extern-prelude-fail.rs:8:15
+  --> $DIR/extern-prelude-fail.rs:9:15
    |
 LL |     let s = ::extern_prelude::S;
    |               ^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `extern_prelude`
diff --git a/tests/ui/resolve/global-scope-resolution.rs b/tests/ui/resolve/global-scope-resolution.rs
new file mode 100644
index 00000000000..176bab36da7
--- /dev/null
+++ b/tests/ui/resolve/global-scope-resolution.rs
@@ -0,0 +1,21 @@
+//! Test global scope resolution with :: operator
+
+//@ run-pass
+
+pub fn f() -> isize {
+    return 1;
+}
+
+pub mod foo {
+    pub fn f() -> isize {
+        return 2;
+    }
+    pub fn g() {
+        assert_eq!(f(), 2);
+        assert_eq!(::f(), 1);
+    }
+}
+
+pub fn main() {
+    return foo::g();
+}
diff --git a/tests/ui/resolve/issue-42944.rs b/tests/ui/resolve/issue-42944.rs
index 7e439c10b7b..24aa110329b 100644
--- a/tests/ui/resolve/issue-42944.rs
+++ b/tests/ui/resolve/issue-42944.rs
@@ -3,7 +3,7 @@ mod foo {
 }
 
 mod bar {
-    use foo::Bx;
+    use crate::foo::Bx;
 
     fn foo() {
         Bx(());
diff --git a/tests/ui/resolve/issue-5035.rs b/tests/ui/resolve/issue-5035.rs
index 82c4bc0d5ef..a9e2509dde9 100644
--- a/tests/ui/resolve/issue-5035.rs
+++ b/tests/ui/resolve/issue-5035.rs
@@ -4,7 +4,7 @@ trait I {}
 type K = dyn I;
 impl K for isize {} //~ ERROR expected trait, found type alias `K`
 
-use ImportError; //~ ERROR unresolved import `ImportError` [E0432]
+use crate::ImportError; //~ ERROR unresolved import `crate::ImportError` [E0432]
                  //~^ NOTE no `ImportError` in the root
 impl ImportError for () {} // check that this is not an additional error (cf. issue #35142)
 
diff --git a/tests/ui/resolve/issue-5035.stderr b/tests/ui/resolve/issue-5035.stderr
index f5717438fc8..b26c962c9bb 100644
--- a/tests/ui/resolve/issue-5035.stderr
+++ b/tests/ui/resolve/issue-5035.stderr
@@ -1,8 +1,8 @@
-error[E0432]: unresolved import `ImportError`
+error[E0432]: unresolved import `crate::ImportError`
   --> $DIR/issue-5035.rs:7:5
    |
-LL | use ImportError;
-   |     ^^^^^^^^^^^ no `ImportError` in the root
+LL | use crate::ImportError;
+   |     ^^^^^^^^^^^^^^^^^^ no `ImportError` in the root
 
 error[E0404]: expected trait, found type alias `K`
   --> $DIR/issue-5035.rs:5:6
diff --git a/tests/ui/resolve/nonexistent-macro.rs b/tests/ui/resolve/nonexistent-macro.rs
new file mode 100644
index 00000000000..663075473a1
--- /dev/null
+++ b/tests/ui/resolve/nonexistent-macro.rs
@@ -0,0 +1,6 @@
+//! Test error handling for undefined macro calls
+
+fn main() {
+    iamnotanextensionthatexists!("");
+    //~^ ERROR cannot find macro `iamnotanextensionthatexists` in this scope
+}
diff --git a/tests/ui/resolve/nonexistent-macro.stderr b/tests/ui/resolve/nonexistent-macro.stderr
new file mode 100644
index 00000000000..7e89e07bf30
--- /dev/null
+++ b/tests/ui/resolve/nonexistent-macro.stderr
@@ -0,0 +1,8 @@
+error: cannot find macro `iamnotanextensionthatexists` in this scope
+  --> $DIR/nonexistent-macro.rs:4:5
+   |
+LL |     iamnotanextensionthatexists!("");
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/resolve/privacy-enum-ctor.rs b/tests/ui/resolve/privacy-enum-ctor.rs
index f0d2cf8c04e..3f79b12a267 100644
--- a/tests/ui/resolve/privacy-enum-ctor.rs
+++ b/tests/ui/resolve/privacy-enum-ctor.rs
@@ -8,7 +8,7 @@ mod m {
     }
 
     pub mod n {
-        pub(in m) enum Z {
+        pub(in crate::m) enum Z {
             Fn(u8),
             Struct {
                 s: u8,
@@ -17,7 +17,7 @@ mod m {
         }
     }
 
-    use m::n::Z; // OK, only the type is imported
+    use crate::m::n::Z; // OK, only the type is imported
 
     fn f() {
         n::Z;
diff --git a/tests/ui/resolve/privacy-enum-ctor.stderr b/tests/ui/resolve/privacy-enum-ctor.stderr
index f349b9391d1..4ec1b6b97bd 100644
--- a/tests/ui/resolve/privacy-enum-ctor.stderr
+++ b/tests/ui/resolve/privacy-enum-ctor.stderr
@@ -7,7 +7,7 @@ LL |         n::Z;
 note: the enum is defined here
   --> $DIR/privacy-enum-ctor.rs:11:9
    |
-LL | /         pub(in m) enum Z {
+LL | /         pub(in crate::m) enum Z {
 LL | |             Fn(u8),
 LL | |             Struct {
 LL | |                 s: u8,
@@ -35,7 +35,7 @@ LL |         Z;
 note: the enum is defined here
   --> $DIR/privacy-enum-ctor.rs:11:9
    |
-LL | /         pub(in m) enum Z {
+LL | /         pub(in crate::m) enum Z {
 LL | |             Fn(u8),
 LL | |             Struct {
 LL | |                 s: u8,
@@ -154,8 +154,8 @@ LL |     let _: Z = m::n::Z;
 note: enum `m::Z` exists but is inaccessible
   --> $DIR/privacy-enum-ctor.rs:11:9
    |
-LL |         pub(in m) enum Z {
-   |         ^^^^^^^^^^^^^^^^ not accessible
+LL |         pub(in crate::m) enum Z {
+   |         ^^^^^^^^^^^^^^^^^^^^^^^ not accessible
 
 error[E0423]: expected value, found enum `m::n::Z`
   --> $DIR/privacy-enum-ctor.rs:57:16
@@ -166,7 +166,7 @@ LL |     let _: Z = m::n::Z;
 note: the enum is defined here
   --> $DIR/privacy-enum-ctor.rs:11:9
    |
-LL | /         pub(in m) enum Z {
+LL | /         pub(in crate::m) enum Z {
 LL | |             Fn(u8),
 LL | |             Struct {
 LL | |                 s: u8,
@@ -197,8 +197,8 @@ LL |     let _: Z = m::n::Z::Fn;
 note: enum `m::Z` exists but is inaccessible
   --> $DIR/privacy-enum-ctor.rs:11:9
    |
-LL |         pub(in m) enum Z {
-   |         ^^^^^^^^^^^^^^^^ not accessible
+LL |         pub(in crate::m) enum Z {
+   |         ^^^^^^^^^^^^^^^^^^^^^^^ not accessible
 
 error[E0412]: cannot find type `Z` in this scope
   --> $DIR/privacy-enum-ctor.rs:64:12
@@ -212,8 +212,8 @@ LL |     let _: Z = m::n::Z::Struct;
 note: enum `m::Z` exists but is inaccessible
   --> $DIR/privacy-enum-ctor.rs:11:9
    |
-LL |         pub(in m) enum Z {
-   |         ^^^^^^^^^^^^^^^^ not accessible
+LL |         pub(in crate::m) enum Z {
+   |         ^^^^^^^^^^^^^^^^^^^^^^^ not accessible
 
 error[E0412]: cannot find type `Z` in this scope
   --> $DIR/privacy-enum-ctor.rs:68:12
@@ -227,8 +227,8 @@ LL |     let _: Z = m::n::Z::Unit {};
 note: enum `m::Z` exists but is inaccessible
   --> $DIR/privacy-enum-ctor.rs:11:9
    |
-LL |         pub(in m) enum Z {
-   |         ^^^^^^^^^^^^^^^^ not accessible
+LL |         pub(in crate::m) enum Z {
+   |         ^^^^^^^^^^^^^^^^^^^^^^^ not accessible
 
 error[E0603]: enum `Z` is private
   --> $DIR/privacy-enum-ctor.rs:57:22
@@ -239,8 +239,8 @@ LL |     let _: Z = m::n::Z;
 note: the enum `Z` is defined here
   --> $DIR/privacy-enum-ctor.rs:11:9
    |
-LL |         pub(in m) enum Z {
-   |         ^^^^^^^^^^^^^^^^
+LL |         pub(in crate::m) enum Z {
+   |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0603]: enum `Z` is private
   --> $DIR/privacy-enum-ctor.rs:61:22
@@ -253,8 +253,8 @@ LL |     let _: Z = m::n::Z::Fn;
 note: the enum `Z` is defined here
   --> $DIR/privacy-enum-ctor.rs:11:9
    |
-LL |         pub(in m) enum Z {
-   |         ^^^^^^^^^^^^^^^^
+LL |         pub(in crate::m) enum Z {
+   |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0603]: enum `Z` is private
   --> $DIR/privacy-enum-ctor.rs:64:22
@@ -265,8 +265,8 @@ LL |     let _: Z = m::n::Z::Struct;
 note: the enum `Z` is defined here
   --> $DIR/privacy-enum-ctor.rs:11:9
    |
-LL |         pub(in m) enum Z {
-   |         ^^^^^^^^^^^^^^^^
+LL |         pub(in crate::m) enum Z {
+   |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0603]: enum `Z` is private
   --> $DIR/privacy-enum-ctor.rs:68:22
@@ -279,8 +279,8 @@ LL |     let _: Z = m::n::Z::Unit {};
 note: the enum `Z` is defined here
   --> $DIR/privacy-enum-ctor.rs:11:9
    |
-LL |         pub(in m) enum Z {
-   |         ^^^^^^^^^^^^^^^^
+LL |         pub(in crate::m) enum Z {
+   |         ^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0308]: mismatched types
   --> $DIR/privacy-enum-ctor.rs:27:20
diff --git a/tests/ui/resolve/privacy-struct-ctor.rs b/tests/ui/resolve/privacy-struct-ctor.rs
index da0e9f2fc04..70c751999b7 100644
--- a/tests/ui/resolve/privacy-struct-ctor.rs
+++ b/tests/ui/resolve/privacy-struct-ctor.rs
@@ -9,10 +9,10 @@ mod m {
     }
 
     pub mod n {
-        pub(in m) struct Z(pub(in m::n) u8);
+        pub(in crate::m) struct Z(pub(in crate::m::n) u8);
     }
 
-    use m::n::Z; // OK, only the type is imported
+    use crate::m::n::Z; // OK, only the type is imported
 
     fn f() {
         n::Z;
diff --git a/tests/ui/resolve/privacy-struct-ctor.stderr b/tests/ui/resolve/privacy-struct-ctor.stderr
index 1d8c741c964..0a6b1b46afa 100644
--- a/tests/ui/resolve/privacy-struct-ctor.stderr
+++ b/tests/ui/resolve/privacy-struct-ctor.stderr
@@ -42,8 +42,8 @@ LL |     pub struct S(u8);
 error[E0603]: tuple struct constructor `Z` is private
   --> $DIR/privacy-struct-ctor.rs:18:12
    |
-LL |         pub(in m) struct Z(pub(in m::n) u8);
-   |                            --------------- a constructor is private if any of the fields is private
+LL |         pub(in crate::m) struct Z(pub(in crate::m::n) u8);
+   |                                   ---------------------- a constructor is private if any of the fields is private
 ...
 LL |         n::Z;
    |            ^ private tuple struct constructor
@@ -51,12 +51,12 @@ LL |         n::Z;
 note: the tuple struct constructor `Z` is defined here
   --> $DIR/privacy-struct-ctor.rs:12:9
    |
-LL |         pub(in m) struct Z(pub(in m::n) u8);
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         pub(in crate::m) struct Z(pub(in crate::m::n) u8);
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: consider making the field publicly accessible
    |
-LL -         pub(in m) struct Z(pub(in m::n) u8);
-LL +         pub(in m) struct Z(pub u8);
+LL -         pub(in crate::m) struct Z(pub(in crate::m::n) u8);
+LL +         pub(in crate::m) struct Z(pub u8);
    |
 
 error[E0603]: tuple struct constructor `S` is private
@@ -100,8 +100,8 @@ LL |     pub struct S(pub u8);
 error[E0603]: tuple struct constructor `Z` is private
   --> $DIR/privacy-struct-ctor.rs:35:11
    |
-LL |         pub(in m) struct Z(pub(in m::n) u8);
-   |                            --------------- a constructor is private if any of the fields is private
+LL |         pub(in crate::m) struct Z(pub(in crate::m::n) u8);
+   |                                   ---------------------- a constructor is private if any of the fields is private
 ...
 LL |     m::n::Z;
    |           ^ private tuple struct constructor
@@ -109,12 +109,12 @@ LL |     m::n::Z;
 note: the tuple struct constructor `Z` is defined here
   --> $DIR/privacy-struct-ctor.rs:12:9
    |
-LL |         pub(in m) struct Z(pub(in m::n) u8);
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         pub(in crate::m) struct Z(pub(in crate::m::n) u8);
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: consider making the field publicly accessible
    |
-LL -         pub(in m) struct Z(pub(in m::n) u8);
-LL +         pub(in m) struct Z(pub u8);
+LL -         pub(in crate::m) struct Z(pub(in crate::m::n) u8);
+LL +         pub(in crate::m) struct Z(pub u8);
    |
 
 error[E0603]: tuple struct constructor `S` is private
@@ -140,16 +140,16 @@ error[E0603]: tuple struct constructor `Z` is private
 LL |     xcrate::m::n::Z;
    |                   ^ private tuple struct constructor
    |
-  ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28
+  ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:35
    |
-LL |         pub(in m) struct Z(pub(in m::n) u8);
-   |                            --------------- a constructor is private if any of the fields is private
+LL |         pub(in crate::m) struct Z(pub(in crate::m::n) u8);
+   |                                   ---------------------- a constructor is private if any of the fields is private
    |
 note: the tuple struct constructor `Z` is defined here
   --> $DIR/auxiliary/privacy-struct-ctor.rs:5:9
    |
-LL |         pub(in m) struct Z(pub(in m::n) u8);
-   |         ^^^^^^^^^^^^^^^^^^
+LL |         pub(in crate::m) struct Z(pub(in crate::m::n) u8);
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 10 previous errors
 
diff --git a/tests/ui/resolve/resolve-bad-visibility.rs b/tests/ui/resolve/resolve-bad-visibility.rs
index 7d48bb97b10..81635611fca 100644
--- a/tests/ui/resolve/resolve-bad-visibility.rs
+++ b/tests/ui/resolve/resolve-bad-visibility.rs
@@ -1,3 +1,4 @@
+//@ edition: 2015
 enum E {}
 trait Tr {}
 
diff --git a/tests/ui/resolve/resolve-bad-visibility.stderr b/tests/ui/resolve/resolve-bad-visibility.stderr
index ac7e1c735b1..c7bbdfbd249 100644
--- a/tests/ui/resolve/resolve-bad-visibility.stderr
+++ b/tests/ui/resolve/resolve-bad-visibility.stderr
@@ -1,23 +1,23 @@
 error[E0577]: expected module, found enum `E`
-  --> $DIR/resolve-bad-visibility.rs:4:8
+  --> $DIR/resolve-bad-visibility.rs:5:8
    |
 LL | pub(in E) struct S;
    |        ^ not a module
 
 error[E0577]: expected module, found trait `Tr`
-  --> $DIR/resolve-bad-visibility.rs:5:8
+  --> $DIR/resolve-bad-visibility.rs:6:8
    |
 LL | pub(in Tr) struct Z;
    |        ^^ not a module
 
 error[E0742]: visibilities can only be restricted to ancestor modules
-  --> $DIR/resolve-bad-visibility.rs:6:8
+  --> $DIR/resolve-bad-visibility.rs:7:8
    |
 LL | pub(in std::vec) struct F;
    |        ^^^^^^^^
 
 error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent`
-  --> $DIR/resolve-bad-visibility.rs:7:8
+  --> $DIR/resolve-bad-visibility.rs:8:8
    |
 LL | pub(in nonexistent) struct G;
    |        ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent`
@@ -28,7 +28,7 @@ LL + extern crate nonexistent;
    |
 
 error[E0433]: failed to resolve: use of unresolved module or unlinked crate `too_soon`
-  --> $DIR/resolve-bad-visibility.rs:8:8
+  --> $DIR/resolve-bad-visibility.rs:9:8
    |
 LL | pub(in too_soon) struct H;
    |        ^^^^^^^^ use of unresolved module or unlinked crate `too_soon`
diff --git a/tests/ui/resolve/suggest-builder-fn.rs b/tests/ui/resolve/suggest-builder-fn.rs
index 0d9b35549a4..959675ef2c9 100644
--- a/tests/ui/resolve/suggest-builder-fn.rs
+++ b/tests/ui/resolve/suggest-builder-fn.rs
@@ -32,7 +32,7 @@ impl Bar {
 }
 
 mod SomeMod {
-    use Bar;
+    use crate::Bar;
 
     impl Bar {
         // Public method. Should be suggested
diff --git a/tests/ui/resolve/unresolved-segments-visibility.rs b/tests/ui/resolve/unresolved-segments-visibility.rs
index c26171f75d2..fc86b31adfc 100644
--- a/tests/ui/resolve/unresolved-segments-visibility.rs
+++ b/tests/ui/resolve/unresolved-segments-visibility.rs
@@ -5,7 +5,7 @@ extern crate alloc as b;
 
 mod foo {
     mod bar {
-        pub(in b::string::String::newy) extern crate alloc as e;
+        pub(in crate::b::string::String::newy) extern crate alloc as e;
         //~^ ERROR failed to resolve: `String` is a struct, not a module [E0433]
     }
 }
diff --git a/tests/ui/resolve/unresolved-segments-visibility.stderr b/tests/ui/resolve/unresolved-segments-visibility.stderr
index 09f3c50258d..082579c9fa1 100644
--- a/tests/ui/resolve/unresolved-segments-visibility.stderr
+++ b/tests/ui/resolve/unresolved-segments-visibility.stderr
@@ -1,8 +1,8 @@
 error[E0433]: failed to resolve: `String` is a struct, not a module
-  --> $DIR/unresolved-segments-visibility.rs:8:27
+  --> $DIR/unresolved-segments-visibility.rs:8:34
    |
-LL |         pub(in b::string::String::newy) extern crate alloc as e;
-   |                           ^^^^^^ `String` is a struct, not a module
+LL |         pub(in crate::b::string::String::newy) extern crate alloc as e;
+   |                                  ^^^^^^ `String` is a struct, not a module
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed
index fbe415e2e10..d685c4944ba 100644
--- a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed
+++ b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.fixed
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ run-rustfix
 
 #![deny(absolute_paths_not_starting_with_crate)]
diff --git a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs
index 72a212453cd..7a5ecf2720a 100644
--- a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs
+++ b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.rs
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ run-rustfix
 
 #![deny(absolute_paths_not_starting_with_crate)]
diff --git a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr
index 036b9ccab4f..c0a322edcd6 100644
--- a/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr
+++ b/tests/ui/rust-2018/edition-lint-fully-qualified-paths.stderr
@@ -1,5 +1,5 @@
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-fully-qualified-paths.rs:18:25
+  --> $DIR/edition-lint-fully-qualified-paths.rs:19:25
    |
 LL |     let _: <foo::Baz as ::foo::Foo>::Bar = ();
    |                         ^^^^^^^^^^ help: use `crate`: `crate::foo::Foo`
@@ -7,13 +7,13 @@ LL |     let _: <foo::Baz as ::foo::Foo>::Bar = ();
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 note: the lint level is defined here
-  --> $DIR/edition-lint-fully-qualified-paths.rs:3:9
+  --> $DIR/edition-lint-fully-qualified-paths.rs:4:9
    |
 LL | #![deny(absolute_paths_not_starting_with_crate)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-fully-qualified-paths.rs:18:25
+  --> $DIR/edition-lint-fully-qualified-paths.rs:19:25
    |
 LL |     let _: <foo::Baz as ::foo::Foo>::Bar = ();
    |                         ^^^^^^^^^^ help: use `crate`: `crate::foo::Foo`
@@ -23,7 +23,7 @@ LL |     let _: <foo::Baz as ::foo::Foo>::Bar = ();
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-fully-qualified-paths.rs:24:13
+  --> $DIR/edition-lint-fully-qualified-paths.rs:25:13
    |
 LL |     let _: <::foo::Baz as foo::Foo>::Bar = ();
    |             ^^^^^^^^^^ help: use `crate`: `crate::foo::Baz`
diff --git a/tests/ui/rust-2018/edition-lint-nested-empty-paths.fixed b/tests/ui/rust-2018/edition-lint-nested-empty-paths.fixed
index 7ec421099c7..4a584a55e64 100644
--- a/tests/ui/rust-2018/edition-lint-nested-empty-paths.fixed
+++ b/tests/ui/rust-2018/edition-lint-nested-empty-paths.fixed
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ run-rustfix
 
 #![deny(absolute_paths_not_starting_with_crate)]
diff --git a/tests/ui/rust-2018/edition-lint-nested-empty-paths.rs b/tests/ui/rust-2018/edition-lint-nested-empty-paths.rs
index 135908c8aef..2baafbd9704 100644
--- a/tests/ui/rust-2018/edition-lint-nested-empty-paths.rs
+++ b/tests/ui/rust-2018/edition-lint-nested-empty-paths.rs
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ run-rustfix
 
 #![deny(absolute_paths_not_starting_with_crate)]
diff --git a/tests/ui/rust-2018/edition-lint-nested-empty-paths.stderr b/tests/ui/rust-2018/edition-lint-nested-empty-paths.stderr
index 4174c2fa9ad..041572be844 100644
--- a/tests/ui/rust-2018/edition-lint-nested-empty-paths.stderr
+++ b/tests/ui/rust-2018/edition-lint-nested-empty-paths.stderr
@@ -1,5 +1,5 @@
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-nested-empty-paths.rs:16:5
+  --> $DIR/edition-lint-nested-empty-paths.rs:17:5
    |
 LL | use foo::{bar::{baz::{}}};
    |     ^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{baz::{}}}`
@@ -7,13 +7,13 @@ LL | use foo::{bar::{baz::{}}};
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 note: the lint level is defined here
-  --> $DIR/edition-lint-nested-empty-paths.rs:3:9
+  --> $DIR/edition-lint-nested-empty-paths.rs:4:9
    |
 LL | #![deny(absolute_paths_not_starting_with_crate)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-nested-empty-paths.rs:20:5
+  --> $DIR/edition-lint-nested-empty-paths.rs:21:5
    |
 LL | use foo::{bar::{XX, baz::{}}};
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{XX, baz::{}}}`
@@ -22,7 +22,7 @@ LL | use foo::{bar::{XX, baz::{}}};
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-nested-empty-paths.rs:20:5
+  --> $DIR/edition-lint-nested-empty-paths.rs:21:5
    |
 LL | use foo::{bar::{XX, baz::{}}};
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{XX, baz::{}}}`
@@ -32,7 +32,7 @@ LL | use foo::{bar::{XX, baz::{}}};
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-nested-empty-paths.rs:26:5
+  --> $DIR/edition-lint-nested-empty-paths.rs:27:5
    |
 LL | use foo::{bar::{baz::{}, baz1::{}}};
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{baz::{}, baz1::{}}}`
@@ -41,7 +41,7 @@ LL | use foo::{bar::{baz::{}, baz1::{}}};
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-nested-empty-paths.rs:26:5
+  --> $DIR/edition-lint-nested-empty-paths.rs:27:5
    |
 LL | use foo::{bar::{baz::{}, baz1::{}}};
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{baz::{}, baz1::{}}}`
diff --git a/tests/ui/rust-2018/edition-lint-nested-paths.fixed b/tests/ui/rust-2018/edition-lint-nested-paths.fixed
index 93ccb2fe6af..bf0038c3be4 100644
--- a/tests/ui/rust-2018/edition-lint-nested-paths.fixed
+++ b/tests/ui/rust-2018/edition-lint-nested-paths.fixed
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ run-rustfix
 
 #![deny(absolute_paths_not_starting_with_crate)]
diff --git a/tests/ui/rust-2018/edition-lint-nested-paths.rs b/tests/ui/rust-2018/edition-lint-nested-paths.rs
index 1c1d21dbab9..87dc51a3745 100644
--- a/tests/ui/rust-2018/edition-lint-nested-paths.rs
+++ b/tests/ui/rust-2018/edition-lint-nested-paths.rs
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ run-rustfix
 
 #![deny(absolute_paths_not_starting_with_crate)]
diff --git a/tests/ui/rust-2018/edition-lint-nested-paths.stderr b/tests/ui/rust-2018/edition-lint-nested-paths.stderr
index d059a2533a9..4a70bb7e5c8 100644
--- a/tests/ui/rust-2018/edition-lint-nested-paths.stderr
+++ b/tests/ui/rust-2018/edition-lint-nested-paths.stderr
@@ -1,5 +1,5 @@
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-nested-paths.rs:5:5
+  --> $DIR/edition-lint-nested-paths.rs:6:5
    |
 LL | use foo::{a, b};
    |     ^^^^^^^^^^^ help: use `crate`: `crate::foo::{a, b}`
@@ -7,13 +7,13 @@ LL | use foo::{a, b};
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 note: the lint level is defined here
-  --> $DIR/edition-lint-nested-paths.rs:3:9
+  --> $DIR/edition-lint-nested-paths.rs:4:9
    |
 LL | #![deny(absolute_paths_not_starting_with_crate)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-nested-paths.rs:5:5
+  --> $DIR/edition-lint-nested-paths.rs:6:5
    |
 LL | use foo::{a, b};
    |     ^^^^^^^^^^^ help: use `crate`: `crate::foo::{a, b}`
@@ -23,7 +23,7 @@ LL | use foo::{a, b};
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-nested-paths.rs:22:13
+  --> $DIR/edition-lint-nested-paths.rs:23:13
    |
 LL |         use foo::{self as x, c};
    |             ^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{self as x, c}`
@@ -32,7 +32,7 @@ LL |         use foo::{self as x, c};
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-nested-paths.rs:22:13
+  --> $DIR/edition-lint-nested-paths.rs:23:13
    |
 LL |         use foo::{self as x, c};
    |             ^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{self as x, c}`
diff --git a/tests/ui/rust-2018/edition-lint-paths.fixed b/tests/ui/rust-2018/edition-lint-paths.fixed
index 014bf91886f..9664b461161 100644
--- a/tests/ui/rust-2018/edition-lint-paths.fixed
+++ b/tests/ui/rust-2018/edition-lint-paths.fixed
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ aux-build:edition-lint-paths.rs
 //@ run-rustfix
 
diff --git a/tests/ui/rust-2018/edition-lint-paths.rs b/tests/ui/rust-2018/edition-lint-paths.rs
index 0ecd090c1df..39cdad3ab98 100644
--- a/tests/ui/rust-2018/edition-lint-paths.rs
+++ b/tests/ui/rust-2018/edition-lint-paths.rs
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ aux-build:edition-lint-paths.rs
 //@ run-rustfix
 
diff --git a/tests/ui/rust-2018/edition-lint-paths.stderr b/tests/ui/rust-2018/edition-lint-paths.stderr
index 553a3bfdaa8..fde17338d98 100644
--- a/tests/ui/rust-2018/edition-lint-paths.stderr
+++ b/tests/ui/rust-2018/edition-lint-paths.stderr
@@ -1,5 +1,5 @@
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-paths.rs:11:9
+  --> $DIR/edition-lint-paths.rs:12:9
    |
 LL |     use bar::Bar;
    |         ^^^^^^^^ help: use `crate`: `crate::bar::Bar`
@@ -7,13 +7,13 @@ LL |     use bar::Bar;
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 note: the lint level is defined here
-  --> $DIR/edition-lint-paths.rs:4:9
+  --> $DIR/edition-lint-paths.rs:5:9
    |
 LL | #![deny(absolute_paths_not_starting_with_crate)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-paths.rs:18:9
+  --> $DIR/edition-lint-paths.rs:19:9
    |
 LL |     use bar;
    |         ^^^ help: use `crate`: `crate::bar`
@@ -22,7 +22,7 @@ LL |     use bar;
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-paths.rs:24:9
+  --> $DIR/edition-lint-paths.rs:25:9
    |
 LL |     use {main, Bar as SomethingElse};
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{main, Bar as SomethingElse}`
@@ -31,7 +31,7 @@ LL |     use {main, Bar as SomethingElse};
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-paths.rs:24:9
+  --> $DIR/edition-lint-paths.rs:25:9
    |
 LL |     use {main, Bar as SomethingElse};
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{main, Bar as SomethingElse}`
@@ -41,7 +41,7 @@ LL |     use {main, Bar as SomethingElse};
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-paths.rs:24:9
+  --> $DIR/edition-lint-paths.rs:25:9
    |
 LL |     use {main, Bar as SomethingElse};
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{main, Bar as SomethingElse}`
@@ -51,7 +51,7 @@ LL |     use {main, Bar as SomethingElse};
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-paths.rs:39:5
+  --> $DIR/edition-lint-paths.rs:40:5
    |
 LL | use bar::Bar;
    |     ^^^^^^^^ help: use `crate`: `crate::bar::Bar`
@@ -60,7 +60,7 @@ LL | use bar::Bar;
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-paths.rs:51:9
+  --> $DIR/edition-lint-paths.rs:52:9
    |
 LL |     use *;
    |         ^ help: use `crate`: `crate::*`
@@ -69,7 +69,7 @@ LL |     use *;
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-paths.rs:56:6
+  --> $DIR/edition-lint-paths.rs:57:6
    |
 LL | impl ::foo::SomeTrait for u32 {}
    |      ^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::SomeTrait`
@@ -78,7 +78,7 @@ LL | impl ::foo::SomeTrait for u32 {}
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/edition-lint-paths.rs:61:13
+  --> $DIR/edition-lint-paths.rs:62:13
    |
 LL |     let x = ::bar::Bar;
    |             ^^^^^^^^^^ help: use `crate`: `crate::bar::Bar`
diff --git a/tests/ui/rust-2018/extern-crate-rename.fixed b/tests/ui/rust-2018/extern-crate-rename.fixed
index 36b52802990..b6b665f537e 100644
--- a/tests/ui/rust-2018/extern-crate-rename.fixed
+++ b/tests/ui/rust-2018/extern-crate-rename.fixed
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ aux-build:edition-lint-paths.rs
 //@ run-rustfix
 
diff --git a/tests/ui/rust-2018/extern-crate-rename.rs b/tests/ui/rust-2018/extern-crate-rename.rs
index 725e3aaa072..3257ab876e1 100644
--- a/tests/ui/rust-2018/extern-crate-rename.rs
+++ b/tests/ui/rust-2018/extern-crate-rename.rs
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ aux-build:edition-lint-paths.rs
 //@ run-rustfix
 
diff --git a/tests/ui/rust-2018/extern-crate-rename.stderr b/tests/ui/rust-2018/extern-crate-rename.stderr
index 6b251208030..36986c89c62 100644
--- a/tests/ui/rust-2018/extern-crate-rename.stderr
+++ b/tests/ui/rust-2018/extern-crate-rename.stderr
@@ -1,5 +1,5 @@
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/extern-crate-rename.rs:11:5
+  --> $DIR/extern-crate-rename.rs:12:5
    |
 LL | use my_crate::foo;
    |     ^^^^^^^^^^^^^ help: use `crate`: `crate::my_crate::foo`
@@ -7,7 +7,7 @@ LL | use my_crate::foo;
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 note: the lint level is defined here
-  --> $DIR/extern-crate-rename.rs:7:9
+  --> $DIR/extern-crate-rename.rs:8:9
    |
 LL | #![deny(absolute_paths_not_starting_with_crate)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/rust-2018/extern-crate-submod.fixed b/tests/ui/rust-2018/extern-crate-submod.fixed
index dc864d87039..8657960e972 100644
--- a/tests/ui/rust-2018/extern-crate-submod.fixed
+++ b/tests/ui/rust-2018/extern-crate-submod.fixed
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ aux-build:edition-lint-paths.rs
 //@ run-rustfix
 
diff --git a/tests/ui/rust-2018/extern-crate-submod.rs b/tests/ui/rust-2018/extern-crate-submod.rs
index f15bc6bced8..bf0a38d2b34 100644
--- a/tests/ui/rust-2018/extern-crate-submod.rs
+++ b/tests/ui/rust-2018/extern-crate-submod.rs
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ aux-build:edition-lint-paths.rs
 //@ run-rustfix
 
diff --git a/tests/ui/rust-2018/extern-crate-submod.stderr b/tests/ui/rust-2018/extern-crate-submod.stderr
index 0d45d32d568..85e26d72a67 100644
--- a/tests/ui/rust-2018/extern-crate-submod.stderr
+++ b/tests/ui/rust-2018/extern-crate-submod.stderr
@@ -1,5 +1,5 @@
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
-  --> $DIR/extern-crate-submod.rs:18:5
+  --> $DIR/extern-crate-submod.rs:19:5
    |
 LL | use m::edition_lint_paths::foo;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::m::edition_lint_paths::foo`
@@ -7,7 +7,7 @@ LL | use m::edition_lint_paths::foo;
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
    = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 note: the lint level is defined here
-  --> $DIR/extern-crate-submod.rs:8:9
+  --> $DIR/extern-crate-submod.rs:9:9
    |
 LL | #![deny(absolute_paths_not_starting_with_crate)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/rust-2018/try-ident.fixed b/tests/ui/rust-2018/try-ident.fixed
index b1c446e1022..b514c6d0756 100644
--- a/tests/ui/rust-2018/try-ident.fixed
+++ b/tests/ui/rust-2018/try-ident.fixed
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ run-rustfix
 //@ check-pass
 
diff --git a/tests/ui/rust-2018/try-ident.rs b/tests/ui/rust-2018/try-ident.rs
index 8e62f698e25..2b8bb9234e5 100644
--- a/tests/ui/rust-2018/try-ident.rs
+++ b/tests/ui/rust-2018/try-ident.rs
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ run-rustfix
 //@ check-pass
 
diff --git a/tests/ui/rust-2018/try-ident.stderr b/tests/ui/rust-2018/try-ident.stderr
index eaf4c235697..aca623d7d48 100644
--- a/tests/ui/rust-2018/try-ident.stderr
+++ b/tests/ui/rust-2018/try-ident.stderr
@@ -1,5 +1,5 @@
 warning: `try` is a keyword in the 2018 edition
-  --> $DIR/try-ident.rs:7:5
+  --> $DIR/try-ident.rs:8:5
    |
 LL |     try();
    |     ^^^ help: you can use a raw identifier to stay compatible: `r#try`
@@ -7,14 +7,14 @@ LL |     try();
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 note: the lint level is defined here
-  --> $DIR/try-ident.rs:4:9
+  --> $DIR/try-ident.rs:5:9
    |
 LL | #![warn(rust_2018_compatibility)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^
    = note: `#[warn(keyword_idents_2018)]` implied by `#[warn(rust_2018_compatibility)]`
 
 warning: `try` is a keyword in the 2018 edition
-  --> $DIR/try-ident.rs:12:4
+  --> $DIR/try-ident.rs:13:4
    |
 LL | fn try() {
    |    ^^^ help: you can use a raw identifier to stay compatible: `r#try`
diff --git a/tests/ui/rust-2018/try-macro.fixed b/tests/ui/rust-2018/try-macro.fixed
index 98c48d6b96f..f2d8cf2bd9a 100644
--- a/tests/ui/rust-2018/try-macro.fixed
+++ b/tests/ui/rust-2018/try-macro.fixed
@@ -1,5 +1,6 @@
 // Test that `try!` macros are rewritten.
 
+//@ edition: 2015
 //@ run-rustfix
 //@ check-pass
 
diff --git a/tests/ui/rust-2018/try-macro.rs b/tests/ui/rust-2018/try-macro.rs
index 99480b2a3ec..fec8eaa1786 100644
--- a/tests/ui/rust-2018/try-macro.rs
+++ b/tests/ui/rust-2018/try-macro.rs
@@ -1,5 +1,6 @@
 // Test that `try!` macros are rewritten.
 
+//@ edition: 2015
 //@ run-rustfix
 //@ check-pass
 
diff --git a/tests/ui/rust-2018/try-macro.stderr b/tests/ui/rust-2018/try-macro.stderr
index 095c755539d..20105e1868f 100644
--- a/tests/ui/rust-2018/try-macro.stderr
+++ b/tests/ui/rust-2018/try-macro.stderr
@@ -1,5 +1,5 @@
 warning: `try` is a keyword in the 2018 edition
-  --> $DIR/try-macro.rs:12:5
+  --> $DIR/try-macro.rs:13:5
    |
 LL |     try!(x);
    |     ^^^ help: you can use a raw identifier to stay compatible: `r#try`
@@ -7,7 +7,7 @@ LL |     try!(x);
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
    = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
 note: the lint level is defined here
-  --> $DIR/try-macro.rs:6:9
+  --> $DIR/try-macro.rs:7:9
    |
 LL | #![warn(rust_2018_compatibility)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/self/self-shadowing-import.rs b/tests/ui/self/self-shadowing-import.rs
index 85574daad5f..78d04e0713a 100644
--- a/tests/ui/self/self-shadowing-import.rs
+++ b/tests/ui/self/self-shadowing-import.rs
@@ -9,7 +9,7 @@ mod a {
 }
 
 mod c {
-    use a::b::a;
+    use crate::a::b::a;
     pub fn bar() { assert_eq!(a::foo(), 1); }
 }
 
diff --git a/tests/ui/sepcomp/auxiliary/sepcomp_lib.rs b/tests/ui/sepcomp/auxiliary/sepcomp_lib.rs
index 59efb3f790b..a0d91c5dc87 100644
--- a/tests/ui/sepcomp/auxiliary/sepcomp_lib.rs
+++ b/tests/ui/sepcomp/auxiliary/sepcomp_lib.rs
@@ -13,8 +13,8 @@ pub mod b {
 }
 
 pub mod c {
-    use a::one;
-    use b::two;
+    use crate::a::one;
+    use crate::b::two;
     pub fn three() -> usize {
         one() + two()
     }
diff --git a/tests/ui/sepcomp/sepcomp-extern.rs b/tests/ui/sepcomp/sepcomp-extern.rs
index 6acd3a1eede..d0756c5f19a 100644
--- a/tests/ui/sepcomp/sepcomp-extern.rs
+++ b/tests/ui/sepcomp/sepcomp-extern.rs
@@ -16,13 +16,13 @@ fn call1() -> usize {
 
 mod a {
     pub fn call2() -> usize {
-        unsafe { ::foo() }
+        unsafe { crate::foo() }
     }
 }
 
 mod b {
     pub fn call3() -> usize {
-        unsafe { ::foo() }
+        unsafe { crate::foo() }
     }
 }
 
diff --git a/tests/ui/sepcomp/sepcomp-fns-backwards.rs b/tests/ui/sepcomp/sepcomp-fns-backwards.rs
index 35326d19d6e..c671771babb 100644
--- a/tests/ui/sepcomp/sepcomp-fns-backwards.rs
+++ b/tests/ui/sepcomp/sepcomp-fns-backwards.rs
@@ -12,13 +12,13 @@ fn pad() -> usize { 0 }
 
 mod b {
     pub fn three() -> usize {
-        ::one() + ::a::two()
+        crate::one() + crate::a::two()
     }
 }
 
 mod a {
     pub fn two() -> usize {
-        ::one() + ::one()
+        crate::one() + crate::one()
     }
 }
 
diff --git a/tests/ui/sepcomp/sepcomp-fns.rs b/tests/ui/sepcomp/sepcomp-fns.rs
index 399193e69b6..1486a2471b8 100644
--- a/tests/ui/sepcomp/sepcomp-fns.rs
+++ b/tests/ui/sepcomp/sepcomp-fns.rs
@@ -13,13 +13,13 @@ fn one() -> usize { 1 }
 
 mod a {
     pub fn two() -> usize {
-        ::one() + ::one()
+        crate::one() + crate::one()
     }
 }
 
 mod b {
     pub fn three() -> usize {
-        ::one() + ::a::two()
+        crate::one() + crate::a::two()
     }
 }
 
diff --git a/tests/ui/sepcomp/sepcomp-statics.rs b/tests/ui/sepcomp/sepcomp-statics.rs
index 580bb628da6..3fe897f3c30 100644
--- a/tests/ui/sepcomp/sepcomp-statics.rs
+++ b/tests/ui/sepcomp/sepcomp-statics.rs
@@ -15,13 +15,13 @@ mod b {
     // that `a` and `b` don't go into the same compilation unit.
     fn pad() -> usize { 0 }
 
-    pub static THREE: usize = ::ONE + ::a::TWO;
+    pub static THREE: usize = crate::ONE + crate::a::TWO;
 }
 
 mod a {
     fn pad() -> usize { 0 }
 
-    pub const TWO: usize = ::ONE + ::ONE;
+    pub const TWO: usize = crate::ONE + crate::ONE;
 }
 
 fn main() {
diff --git a/tests/ui/sepcomp/sepcomp-unwind.rs b/tests/ui/sepcomp/sepcomp-unwind.rs
index 8c25278bb7e..95591676b5e 100644
--- a/tests/ui/sepcomp/sepcomp-unwind.rs
+++ b/tests/ui/sepcomp/sepcomp-unwind.rs
@@ -26,10 +26,10 @@ mod a {
 
 mod b {
     pub fn g() {
-        ::a::f();
+        crate::a::f();
     }
 }
 
 fn main() {
-    thread::spawn(move|| { ::b::g() }).join().unwrap_err();
+    thread::spawn(move|| { b::g() }).join().unwrap_err();
 }
diff --git a/tests/ui/shadowed-use-visibility.rs b/tests/ui/shadowed-use-visibility.rs
index 66181267f98..5ce4103b559 100644
--- a/tests/ui/shadowed-use-visibility.rs
+++ b/tests/ui/shadowed-use-visibility.rs
@@ -5,7 +5,7 @@ mod foo {
     pub fn f() {}
 
     pub use self::f as bar;
-    use foo as bar;
+    use crate::foo as bar;
 }
 
 fn main() {
diff --git a/tests/ui/shadowed/shadowed-trait-methods.rs b/tests/ui/shadowed/shadowed-trait-methods.rs
index f9c25d97913..6cc5159fd08 100644
--- a/tests/ui/shadowed/shadowed-trait-methods.rs
+++ b/tests/ui/shadowed/shadowed-trait-methods.rs
@@ -5,7 +5,7 @@ mod foo {
     impl T for () {}
 }
 
-mod bar { pub use foo::T; }
+mod bar { pub use crate::foo::T; }
 
 fn main() {
     pub use bar::*;
diff --git a/tests/ui/shadowed/shadowed-use-visibility.rs b/tests/ui/shadowed/shadowed-use-visibility.rs
index 6b801972f41..070aeaf1467 100644
--- a/tests/ui/shadowed/shadowed-use-visibility.rs
+++ b/tests/ui/shadowed/shadowed-use-visibility.rs
@@ -1,15 +1,15 @@
 mod foo {
     pub fn f() {}
 
-    use foo as bar;
+    use crate::foo as bar;
     pub use self::f as bar;
 }
 
 mod bar {
-    use foo::bar::f as g; //~ ERROR module import `bar` is private
+    use crate::foo::bar::f as g; //~ ERROR module import `bar` is private
 
-    use foo as f;
-    pub use foo::*;
+    use crate::foo as f;
+    pub use crate::foo::*;
 }
 
 use bar::f::f; //~ ERROR module import `f` is private
diff --git a/tests/ui/shadowed/shadowed-use-visibility.stderr b/tests/ui/shadowed/shadowed-use-visibility.stderr
index 1a642ae6e8e..b062341dc8b 100644
--- a/tests/ui/shadowed/shadowed-use-visibility.stderr
+++ b/tests/ui/shadowed/shadowed-use-visibility.stderr
@@ -1,14 +1,14 @@
 error[E0603]: module import `bar` is private
-  --> $DIR/shadowed-use-visibility.rs:9:14
+  --> $DIR/shadowed-use-visibility.rs:9:21
    |
-LL |     use foo::bar::f as g;
-   |              ^^^ private module import
+LL |     use crate::foo::bar::f as g;
+   |                     ^^^ private module import
    |
 note: the module import `bar` is defined here...
   --> $DIR/shadowed-use-visibility.rs:4:9
    |
-LL |     use foo as bar;
-   |         ^^^^^^^^^^
+LL |     use crate::foo as bar;
+   |         ^^^^^^^^^^^^^^^^^
 note: ...and refers to the module `foo` which is defined here
   --> $DIR/shadowed-use-visibility.rs:1:1
    |
@@ -24,8 +24,8 @@ LL | use bar::f::f;
 note: the module import `f` is defined here...
   --> $DIR/shadowed-use-visibility.rs:11:9
    |
-LL |     use foo as f;
-   |         ^^^^^^^^
+LL |     use crate::foo as f;
+   |         ^^^^^^^^^^^^^^^
 note: ...and refers to the module `foo` which is defined here
   --> $DIR/shadowed-use-visibility.rs:1:1
    |
diff --git a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs
index 66a432be357..baa664d5933 100644
--- a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs
+++ b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs
@@ -1,3 +1,5 @@
+//@ edition: 2015
+
 #![warn(rust_2021_incompatible_closure_captures)]
 
 fn main() {}
diff --git a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr
index 5ecbedf1867..00b9a81b27d 100644
--- a/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr
+++ b/tests/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr
@@ -1,5 +1,5 @@
 error[E0670]: `async fn` is not permitted in Rust 2015
-  --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:8:16
+  --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:10:16
    |
 LL |     pub(crate) async fn new(
    |                ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -8,7 +8,7 @@ LL |     pub(crate) async fn new(
    = note: for more on editions, read https://doc.rust-lang.org/edition-guide
 
 error[E0412]: cannot find type `Duration` in this scope
-  --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:10:19
+  --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs:12:19
    |
 LL |         interval: Duration,
    |                   ^^^^^^^^ not found in this scope
diff --git a/tests/ui/span/dropck_arr_cycle_checked.rs b/tests/ui/span/dropck_arr_cycle_checked.rs
index a14db5ff089..adecb3f5942 100644
--- a/tests/ui/span/dropck_arr_cycle_checked.rs
+++ b/tests/ui/span/dropck_arr_cycle_checked.rs
@@ -19,7 +19,7 @@ mod s {
 }
 
 mod id {
-    use s;
+    use crate::s;
     #[derive(Debug)]
     pub struct Id {
         orig_count: usize,
diff --git a/tests/ui/span/dropck_vec_cycle_checked.rs b/tests/ui/span/dropck_vec_cycle_checked.rs
index c5d21507d76..b015131caf1 100644
--- a/tests/ui/span/dropck_vec_cycle_checked.rs
+++ b/tests/ui/span/dropck_vec_cycle_checked.rs
@@ -16,7 +16,7 @@ mod s {
 }
 
 mod id {
-    use s;
+    use crate::s;
     #[derive(Debug)]
     pub struct Id {
         orig_count: usize,
diff --git a/tests/ui/span/vec-must-not-hide-type-from-dropck.rs b/tests/ui/span/vec-must-not-hide-type-from-dropck.rs
index 9bfbfab06a0..972ffef2e3c 100644
--- a/tests/ui/span/vec-must-not-hide-type-from-dropck.rs
+++ b/tests/ui/span/vec-must-not-hide-type-from-dropck.rs
@@ -31,7 +31,7 @@ mod s {
 }
 
 mod id {
-    use s;
+    use crate::s;
 
     /// Id represents a globally unique identifier (global across the
     /// current process, that is). When dropped, it automatically
diff --git a/tests/ui/span/visibility-ty-params.rs b/tests/ui/span/visibility-ty-params.rs
index 11c2cf44cb4..05d93e54636 100644
--- a/tests/ui/span/visibility-ty-params.rs
+++ b/tests/ui/span/visibility-ty-params.rs
@@ -3,11 +3,11 @@ macro_rules! m {
 }
 
 struct S<T>(T);
-m!{ S<u8> } //~ ERROR unexpected generic arguments in path
-            //~| ERROR failed to resolve: `S` is a struct, not a module [E0433]
+m!{ crate::S<u8> } //~ ERROR unexpected generic arguments in path
+                   //~| ERROR failed to resolve: `S` is a struct, not a module [E0433]
 
 mod m {
-    m!{ m<> } //~ ERROR unexpected generic arguments in path
+    m!{ crate::m<> } //~ ERROR unexpected generic arguments in path
 }
 
 fn main() {}
diff --git a/tests/ui/span/visibility-ty-params.stderr b/tests/ui/span/visibility-ty-params.stderr
index 97d05c4644e..7b02d79a1bc 100644
--- a/tests/ui/span/visibility-ty-params.stderr
+++ b/tests/ui/span/visibility-ty-params.stderr
@@ -1,20 +1,20 @@
 error: unexpected generic arguments in path
-  --> $DIR/visibility-ty-params.rs:6:6
+  --> $DIR/visibility-ty-params.rs:6:13
    |
-LL | m!{ S<u8> }
-   |      ^^^^
+LL | m!{ crate::S<u8> }
+   |             ^^^^
 
 error[E0433]: failed to resolve: `S` is a struct, not a module
-  --> $DIR/visibility-ty-params.rs:6:5
+  --> $DIR/visibility-ty-params.rs:6:12
    |
-LL | m!{ S<u8> }
-   |     ^ `S` is a struct, not a module
+LL | m!{ crate::S<u8> }
+   |            ^ `S` is a struct, not a module
 
 error: unexpected generic arguments in path
-  --> $DIR/visibility-ty-params.rs:10:10
+  --> $DIR/visibility-ty-params.rs:10:17
    |
-LL |     m!{ m<> }
-   |          ^^
+LL |     m!{ crate::m<> }
+   |                 ^^
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/auxiliary/pub-and-stability.rs b/tests/ui/stability-attribute/auxiliary/pub-and-stability.rs
index 8866233b61e..8866233b61e 100644
--- a/tests/ui/auxiliary/pub-and-stability.rs
+++ b/tests/ui/stability-attribute/auxiliary/pub-and-stability.rs
diff --git a/tests/ui/explore-issue-38412.rs b/tests/ui/stability-attribute/stability-privacy-interaction.rs
index 2008b120faa..e02816ae1e7 100644
--- a/tests/ui/explore-issue-38412.rs
+++ b/tests/ui/stability-attribute/stability-privacy-interaction.rs
@@ -1,28 +1,39 @@
+//! Regression test for issue #38412: interaction between stability attributes and privacy
+//!
+//! Tests that the compiler correctly handles the interaction between feature gates
+//! and privacy/visibility rules. Specifically verifies that enabled unstable features
+//! are accessible while disabled ones are properly rejected.
+
 //@ aux-build:pub-and-stability.rs
 
-// A big point of this test is that we *enable* `unstable_declared`,
-// but do *not* enable `unstable_undeclared`. This way we can check
-// that the compiler is letting in uses of enabled feature-gated
-// stuff but still rejecting uses of disabled feature-gated stuff.
+// Enable `unstable_declared` but not `unstable_undeclared` to test
+// that the compiler allows enabled features but rejects disabled ones
 #![feature(unstable_declared)]
 
 extern crate pub_and_stability;
 use pub_and_stability::{Record, Trait, Tuple};
 
 fn main() {
-    // Okay
+    // Test struct field access patterns
     let Record { .. } = Record::new();
 
-    // Okay
-    let Record { a_stable_pub: _, a_unstable_declared_pub: _, .. } = Record::new();
+    let Record {
+        a_stable_pub: _,
+        a_unstable_declared_pub: _,
+        ..
+    } = Record::new();
 
-    let Record { a_stable_pub: _, a_unstable_declared_pub: _, a_unstable_undeclared_pub: _, .. } =
-        Record::new();
-    //~^^ ERROR use of unstable library feature `unstable_undeclared`
+    let Record {
+        a_stable_pub: _,
+        a_unstable_declared_pub: _,
+        a_unstable_undeclared_pub: _,  //~ ERROR use of unstable library feature `unstable_undeclared`
+        ..
+    } = Record::new();
 
     let r = Record::new();
     let t = Tuple::new();
 
+    // Test field access with different stability/privacy combinations
     r.a_stable_pub;
     r.a_unstable_declared_pub;
     r.a_unstable_undeclared_pub; //~ ERROR use of unstable library feature
@@ -37,10 +48,12 @@ fn main() {
     t.4;                         //~ ERROR is private
     t.5;                         //~ ERROR is private
 
+    // Test trait method access
     r.stable_trait_method();
     r.unstable_declared_trait_method();
     r.unstable_undeclared_trait_method(); //~ ERROR use of unstable library feature
 
+    // Test inherent method access
     r.stable();
     r.unstable_declared();
     r.unstable_undeclared();              //~ ERROR use of unstable library feature
@@ -49,6 +62,7 @@ fn main() {
     r.pub_mod();                          //~ ERROR `pub_mod` is private
     r.private();                          //~ ERROR `private` is private
 
+    // Repeat tests for tuple struct
     let t = Tuple::new();
     t.stable_trait_method();
     t.unstable_declared_trait_method();
diff --git a/tests/ui/explore-issue-38412.stderr b/tests/ui/stability-attribute/stability-privacy-interaction.stderr
index fca5c738d27..991b3dbe019 100644
--- a/tests/ui/explore-issue-38412.stderr
+++ b/tests/ui/stability-attribute/stability-privacy-interaction.stderr
@@ -1,15 +1,15 @@
 error[E0658]: use of unstable library feature `unstable_undeclared`
-  --> $DIR/explore-issue-38412.rs:19:63
+  --> $DIR/stability-privacy-interaction.rs:29:9
    |
-LL |     let Record { a_stable_pub: _, a_unstable_declared_pub: _, a_unstable_undeclared_pub: _, .. } =
-   |                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |         a_unstable_undeclared_pub: _,
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #38412 <https://github.com/rust-lang/rust/issues/38412> for more information
    = help: add `#![feature(unstable_undeclared)]` 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]: use of unstable library feature `unstable_undeclared`
-  --> $DIR/explore-issue-38412.rs:28:5
+  --> $DIR/stability-privacy-interaction.rs:39:5
    |
 LL |     r.a_unstable_undeclared_pub;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -19,25 +19,25 @@ LL |     r.a_unstable_undeclared_pub;
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0616]: field `b_crate` of struct `Record` is private
-  --> $DIR/explore-issue-38412.rs:29:7
+  --> $DIR/stability-privacy-interaction.rs:40:7
    |
 LL |     r.b_crate;
    |       ^^^^^^^ private field
 
 error[E0616]: field `c_mod` of struct `Record` is private
-  --> $DIR/explore-issue-38412.rs:30:7
+  --> $DIR/stability-privacy-interaction.rs:41:7
    |
 LL |     r.c_mod;
    |       ^^^^^ private field
 
 error[E0616]: field `d_priv` of struct `Record` is private
-  --> $DIR/explore-issue-38412.rs:31:7
+  --> $DIR/stability-privacy-interaction.rs:42:7
    |
 LL |     r.d_priv;
    |       ^^^^^^ private field
 
 error[E0658]: use of unstable library feature `unstable_undeclared`
-  --> $DIR/explore-issue-38412.rs:35:5
+  --> $DIR/stability-privacy-interaction.rs:46:5
    |
 LL |     t.2;
    |     ^^^
@@ -47,25 +47,25 @@ LL |     t.2;
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0616]: field `3` of struct `pub_and_stability::Tuple` is private
-  --> $DIR/explore-issue-38412.rs:36:7
+  --> $DIR/stability-privacy-interaction.rs:47:7
    |
 LL |     t.3;
    |       ^ private field
 
 error[E0616]: field `4` of struct `pub_and_stability::Tuple` is private
-  --> $DIR/explore-issue-38412.rs:37:7
+  --> $DIR/stability-privacy-interaction.rs:48:7
    |
 LL |     t.4;
    |       ^ private field
 
 error[E0616]: field `5` of struct `pub_and_stability::Tuple` is private
-  --> $DIR/explore-issue-38412.rs:38:7
+  --> $DIR/stability-privacy-interaction.rs:49:7
    |
 LL |     t.5;
    |       ^ private field
 
 error[E0658]: use of unstable library feature `unstable_undeclared`
-  --> $DIR/explore-issue-38412.rs:42:7
+  --> $DIR/stability-privacy-interaction.rs:54:7
    |
 LL |     r.unstable_undeclared_trait_method();
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -75,7 +75,7 @@ LL |     r.unstable_undeclared_trait_method();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: use of unstable library feature `unstable_undeclared`
-  --> $DIR/explore-issue-38412.rs:46:7
+  --> $DIR/stability-privacy-interaction.rs:59:7
    |
 LL |     r.unstable_undeclared();
    |       ^^^^^^^^^^^^^^^^^^^
@@ -85,7 +85,7 @@ LL |     r.unstable_undeclared();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0624]: method `pub_crate` is private
-  --> $DIR/explore-issue-38412.rs:48:7
+  --> $DIR/stability-privacy-interaction.rs:61:7
    |
 LL |     r.pub_crate();
    |       ^^^^^^^^^ private method
@@ -96,7 +96,7 @@ LL |         pub(crate) fn pub_crate(&self) -> i32 { self.d_priv }
    |         ------------------------------------- private method defined here
 
 error[E0624]: method `pub_mod` is private
-  --> $DIR/explore-issue-38412.rs:49:7
+  --> $DIR/stability-privacy-interaction.rs:62:7
    |
 LL |     r.pub_mod();
    |       ^^^^^^^ private method
@@ -107,7 +107,7 @@ LL |         pub(in crate::m) fn pub_mod(&self) -> i32 { self.d_priv }
    |         ----------------------------------------- private method defined here
 
 error[E0624]: method `private` is private
-  --> $DIR/explore-issue-38412.rs:50:7
+  --> $DIR/stability-privacy-interaction.rs:63:7
    |
 LL |     r.private();
    |       ^^^^^^^ private method
@@ -118,7 +118,7 @@ LL |         fn private(&self) -> i32 { self.d_priv }
    |         ------------------------ private method defined here
 
 error[E0658]: use of unstable library feature `unstable_undeclared`
-  --> $DIR/explore-issue-38412.rs:55:7
+  --> $DIR/stability-privacy-interaction.rs:69:7
    |
 LL |     t.unstable_undeclared_trait_method();
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -128,7 +128,7 @@ LL |     t.unstable_undeclared_trait_method();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: use of unstable library feature `unstable_undeclared`
-  --> $DIR/explore-issue-38412.rs:59:7
+  --> $DIR/stability-privacy-interaction.rs:73:7
    |
 LL |     t.unstable_undeclared();
    |       ^^^^^^^^^^^^^^^^^^^
@@ -138,7 +138,7 @@ LL |     t.unstable_undeclared();
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0624]: method `pub_crate` is private
-  --> $DIR/explore-issue-38412.rs:61:7
+  --> $DIR/stability-privacy-interaction.rs:75:7
    |
 LL |     t.pub_crate();
    |       ^^^^^^^^^ private method
@@ -149,7 +149,7 @@ LL |         pub(crate) fn pub_crate(&self) -> i32 { self.0 }
    |         ------------------------------------- private method defined here
 
 error[E0624]: method `pub_mod` is private
-  --> $DIR/explore-issue-38412.rs:62:7
+  --> $DIR/stability-privacy-interaction.rs:76:7
    |
 LL |     t.pub_mod();
    |       ^^^^^^^ private method
@@ -160,7 +160,7 @@ LL |         pub(in crate::m) fn pub_mod(&self) -> i32 { self.0 }
    |         ----------------------------------------- private method defined here
 
 error[E0624]: method `private` is private
-  --> $DIR/explore-issue-38412.rs:63:7
+  --> $DIR/stability-privacy-interaction.rs:77:7
    |
 LL |     t.private();
    |       ^^^^^^^ private method
diff --git a/tests/ui/static/auxiliary/static_priv_by_default.rs b/tests/ui/static/auxiliary/static_priv_by_default.rs
index 39f912066ec..fe9aef42feb 100644
--- a/tests/ui/static/auxiliary/static_priv_by_default.rs
+++ b/tests/ui/static/auxiliary/static_priv_by_default.rs
@@ -31,11 +31,11 @@ mod foo {
 }
 
 pub mod bar {
-    pub use foo::reexported_a as e;
-    pub use foo::reexported_b as f;
-    pub use foo::reexported_c as g;
-    pub use foo::reexported_d as h;
-    pub use foo::reexported_e as i;
+    pub use crate::foo::reexported_a as e;
+    pub use crate::foo::reexported_b as f;
+    pub use crate::foo::reexported_c as g;
+    pub use crate::foo::reexported_d as h;
+    pub use crate::foo::reexported_e as i;
 }
 
 pub static a: isize = 0;
diff --git a/tests/ui/static/static-extern-type.rs b/tests/ui/static/static-extern-type.rs
index 8b022a5c31c..2597c22ed7e 100644
--- a/tests/ui/static/static-extern-type.rs
+++ b/tests/ui/static/static-extern-type.rs
@@ -10,7 +10,7 @@ pub mod a {
 
 pub mod b {
     #[repr(transparent)]
-    pub struct TransparentType(::a::StartFn);
+    pub struct TransparentType(crate::a::StartFn);
     extern "C" {
         pub static start: TransparentType;
     }
@@ -18,7 +18,7 @@ pub mod b {
 
 pub mod c {
     #[repr(C)]
-    pub struct CType(u32, ::b::TransparentType);
+    pub struct CType(u32, crate::b::TransparentType);
     extern "C" {
         pub static start: CType;
     }
diff --git a/tests/ui/statics/auxiliary/static_fn_inline_xc_aux.rs b/tests/ui/statics/auxiliary/static_fn_inline_xc_aux.rs
index 8d0f7f61ced..a739e8f2dbe 100644
--- a/tests/ui/statics/auxiliary/static_fn_inline_xc_aux.rs
+++ b/tests/ui/statics/auxiliary/static_fn_inline_xc_aux.rs
@@ -5,7 +5,7 @@ pub mod num {
 }
 
 pub mod f64 {
-    impl ::num::Num2 for f64 {
+    impl crate::num::Num2 for f64 {
         #[inline]
         fn from_int2(n: isize) -> f64 { return n as f64;  }
     }
diff --git a/tests/ui/statics/auxiliary/static_fn_trait_xc_aux.rs b/tests/ui/statics/auxiliary/static_fn_trait_xc_aux.rs
index b8aed2c5f54..ab73bac3bf8 100644
--- a/tests/ui/statics/auxiliary/static_fn_trait_xc_aux.rs
+++ b/tests/ui/statics/auxiliary/static_fn_trait_xc_aux.rs
@@ -5,7 +5,7 @@ pub mod num {
 }
 
 pub mod f64 {
-    impl ::num::Num2 for f64 {
+    impl crate::num::Num2 for f64 {
         fn from_int2(n: isize) -> f64 { return n as f64;  }
     }
 }
diff --git a/tests/ui/statics/static-impl.rs b/tests/ui/statics/static-impl.rs
index 37f3cd13133..5c8d20da0c6 100644
--- a/tests/ui/statics/static-impl.rs
+++ b/tests/ui/statics/static-impl.rs
@@ -9,12 +9,12 @@ pub trait plus {
 }
 
 mod a {
-    use plus;
+    use crate::plus;
     impl plus for usize { fn plus(&self) -> isize { *self as isize + 20 } }
 }
 
 mod b {
-    use plus;
+    use crate::plus;
     impl plus for String { fn plus(&self) -> isize { 200 } }
 }
 
diff --git a/tests/ui/structs-enums/issue-2718-a.rs b/tests/ui/structs-enums/issue-2718-a.rs
index 6c491584540..f799a82447f 100644
--- a/tests/ui/structs-enums/issue-2718-a.rs
+++ b/tests/ui/structs-enums/issue-2718-a.rs
@@ -3,7 +3,7 @@ pub struct SendPacket<T> {
 }
 
 mod pingpong {
-    use SendPacket;
+    use crate::SendPacket;
     pub type Ping = SendPacket<Pong>;
     pub struct Pong(SendPacket<Ping>);
     //~^ ERROR recursive type `Pong` has infinite size
diff --git a/tests/ui/structs-enums/namespaced-enum-glob-import.rs b/tests/ui/structs-enums/namespaced-enum-glob-import.rs
index e8a709d5bd0..82742a934c4 100644
--- a/tests/ui/structs-enums/namespaced-enum-glob-import.rs
+++ b/tests/ui/structs-enums/namespaced-enum-glob-import.rs
@@ -14,7 +14,7 @@ mod m2 {
 }
 
 mod m {
-    pub use m2::Foo::*;
+    pub use crate::m2::Foo::*;
 }
 
 fn _f(f: m2::Foo) {
diff --git a/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.rs b/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.rs
index 2893bbc8b71..63fe5ebaea4 100644
--- a/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.rs
+++ b/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.rs
@@ -1,16 +1,15 @@
-#![allow(bare_trait_objects)]
 trait A: Sized {
-    fn f(a: A) -> A;
+    fn f(a: dyn A) -> dyn A;
     //~^ ERROR associated item referring to unboxed trait object for its own trait
     //~| ERROR the trait `A` is not dyn compatible
 }
 trait B {
-    fn f(a: B) -> B;
+    fn f(a: dyn B) -> dyn B;
     //~^ ERROR associated item referring to unboxed trait object for its own trait
     //~| ERROR the trait `B` is not dyn compatible
 }
 trait C {
-    fn f(&self, a: C) -> C;
+    fn f(&self, a: dyn C) -> dyn C;
 }
 
 fn main() {}
diff --git a/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.stderr b/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.stderr
index f4b669d7fcd..e8384afed7a 100644
--- a/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.stderr
+++ b/tests/ui/suggestions/dyn-incompatible-trait-should-use-self.stderr
@@ -1,26 +1,26 @@
 error: associated item referring to unboxed trait object for its own trait
-  --> $DIR/dyn-incompatible-trait-should-use-self.rs:3:13
+  --> $DIR/dyn-incompatible-trait-should-use-self.rs:2:13
    |
 LL | trait A: Sized {
    |       - in this trait
-LL |     fn f(a: A) -> A;
-   |             ^     ^
+LL |     fn f(a: dyn A) -> dyn A;
+   |             ^^^^^     ^^^^^
    |
 help: you might have meant to use `Self` to refer to the implementing type
    |
-LL -     fn f(a: A) -> A;
+LL -     fn f(a: dyn A) -> dyn A;
 LL +     fn f(a: Self) -> Self;
    |
 
 error[E0038]: the trait `A` is not dyn compatible
-  --> $DIR/dyn-incompatible-trait-should-use-self.rs:3:13
+  --> $DIR/dyn-incompatible-trait-should-use-self.rs:2:13
    |
-LL |     fn f(a: A) -> A;
-   |             ^ `A` is not dyn compatible
+LL |     fn f(a: dyn A) -> dyn A;
+   |             ^^^^^ `A` is not dyn compatible
    |
 note: for a trait to be dyn compatible it needs to allow building a vtable
       for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
-  --> $DIR/dyn-incompatible-trait-should-use-self.rs:2:10
+  --> $DIR/dyn-incompatible-trait-should-use-self.rs:1:10
    |
 LL | trait A: Sized {
    |       -  ^^^^^ ...because it requires `Self: Sized`
@@ -28,41 +28,41 @@ LL | trait A: Sized {
    |       this trait is not dyn compatible...
 
 error: associated item referring to unboxed trait object for its own trait
-  --> $DIR/dyn-incompatible-trait-should-use-self.rs:8:13
+  --> $DIR/dyn-incompatible-trait-should-use-self.rs:7:13
    |
 LL | trait B {
    |       - in this trait
-LL |     fn f(a: B) -> B;
-   |             ^     ^
+LL |     fn f(a: dyn B) -> dyn B;
+   |             ^^^^^     ^^^^^
    |
 help: you might have meant to use `Self` to refer to the implementing type
    |
-LL -     fn f(a: B) -> B;
+LL -     fn f(a: dyn B) -> dyn B;
 LL +     fn f(a: Self) -> Self;
    |
 
 error[E0038]: the trait `B` is not dyn compatible
-  --> $DIR/dyn-incompatible-trait-should-use-self.rs:8:13
+  --> $DIR/dyn-incompatible-trait-should-use-self.rs:7:13
    |
-LL |     fn f(a: B) -> B;
-   |             ^ `B` is not dyn compatible
+LL |     fn f(a: dyn B) -> dyn B;
+   |             ^^^^^ `B` is not dyn compatible
    |
 note: for a trait to be dyn compatible it needs to allow building a vtable
       for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
-  --> $DIR/dyn-incompatible-trait-should-use-self.rs:8:8
+  --> $DIR/dyn-incompatible-trait-should-use-self.rs:7:8
    |
 LL | trait B {
    |       - this trait is not dyn compatible...
-LL |     fn f(a: B) -> B;
+LL |     fn f(a: dyn B) -> dyn B;
    |        ^ ...because associated function `f` has no `self` parameter
 help: consider turning `f` into a method by giving it a `&self` argument
    |
-LL |     fn f(&self, a: B) -> B;
+LL |     fn f(&self, a: dyn B) -> dyn B;
    |          ++++++
 help: alternatively, consider constraining `f` so it does not apply to trait objects
    |
-LL |     fn f(a: B) -> B where Self: Sized;
-   |                     +++++++++++++++++
+LL |     fn f(a: dyn B) -> dyn B where Self: Sized;
+   |                             +++++++++++++++++
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.rs b/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.rs
index efa296db47c..d10b3bec543 100644
--- a/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.rs
+++ b/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.rs
@@ -1,4 +1,5 @@
 // Regression test for ICE #125876
+//@ edition: 2015
 
 fn main() {
     std::ptr::from_ref(num).cast_mut().as_deref();
diff --git a/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.stderr b/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.stderr
index f943688e657..696151b6ee2 100644
--- a/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.stderr
+++ b/tests/ui/suggestions/ice-unwrap-probe-many-result-125876.stderr
@@ -1,11 +1,11 @@
 error[E0425]: cannot find value `num` in this scope
-  --> $DIR/ice-unwrap-probe-many-result-125876.rs:4:24
+  --> $DIR/ice-unwrap-probe-many-result-125876.rs:5:24
    |
 LL |     std::ptr::from_ref(num).cast_mut().as_deref();
    |                        ^^^ not found in this scope
 
 warning: type annotations needed
-  --> $DIR/ice-unwrap-probe-many-result-125876.rs:4:29
+  --> $DIR/ice-unwrap-probe-many-result-125876.rs:5:29
    |
 LL |     std::ptr::from_ref(num).cast_mut().as_deref();
    |                             ^^^^^^^^
@@ -15,7 +15,7 @@ LL |     std::ptr::from_ref(num).cast_mut().as_deref();
    = note: `#[warn(tyvar_behind_raw_pointer)]` on by default
 
 warning: type annotations needed
-  --> $DIR/ice-unwrap-probe-many-result-125876.rs:4:40
+  --> $DIR/ice-unwrap-probe-many-result-125876.rs:5:40
    |
 LL |     std::ptr::from_ref(num).cast_mut().as_deref();
    |                                        ^^^^^^^^
@@ -24,7 +24,7 @@ LL |     std::ptr::from_ref(num).cast_mut().as_deref();
    = note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906>
 
 error[E0599]: no method named `as_deref` found for raw pointer `*mut _` in the current scope
-  --> $DIR/ice-unwrap-probe-many-result-125876.rs:4:40
+  --> $DIR/ice-unwrap-probe-many-result-125876.rs:5:40
    |
 LL |     std::ptr::from_ref(num).cast_mut().as_deref();
    |                                        ^^^^^^^^
diff --git a/tests/ui/suggestions/issue-116434-2015.rs b/tests/ui/suggestions/issue-116434-2015.rs
index 1518765152f..bad9d02321c 100644
--- a/tests/ui/suggestions/issue-116434-2015.rs
+++ b/tests/ui/suggestions/issue-116434-2015.rs
@@ -1,3 +1,5 @@
+//@ edition: 2015
+
 trait Foo {
     type Clone;
     fn foo() -> Clone;
diff --git a/tests/ui/suggestions/issue-116434-2015.stderr b/tests/ui/suggestions/issue-116434-2015.stderr
index 07a254432a2..a0a99cc560d 100644
--- a/tests/ui/suggestions/issue-116434-2015.stderr
+++ b/tests/ui/suggestions/issue-116434-2015.stderr
@@ -1,5 +1,5 @@
 warning: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/issue-116434-2015.rs:3:17
+  --> $DIR/issue-116434-2015.rs:5:17
    |
 LL |     fn foo() -> Clone;
    |                 ^^^^^
@@ -13,7 +13,7 @@ LL |     fn foo() -> dyn Clone;
    |                 +++
 
 warning: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/issue-116434-2015.rs:3:17
+  --> $DIR/issue-116434-2015.rs:5:17
    |
 LL |     fn foo() -> Clone;
    |                 ^^^^^
@@ -27,7 +27,7 @@ LL |     fn foo() -> dyn Clone;
    |                 +++
 
 error[E0038]: the trait `Clone` is not dyn compatible
-  --> $DIR/issue-116434-2015.rs:3:17
+  --> $DIR/issue-116434-2015.rs:5:17
    |
 LL |     fn foo() -> Clone;
    |                 ^^^^^ `Clone` is not dyn compatible
@@ -41,7 +41,7 @@ LL |     fn foo() -> Self::Clone;
    |                 ++++++
 
 warning: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/issue-116434-2015.rs:18:20
+  --> $DIR/issue-116434-2015.rs:20:20
    |
 LL |     fn handle() -> DbHandle;
    |                    ^^^^^^^^
@@ -54,7 +54,7 @@ LL |     fn handle() -> dyn DbHandle;
    |                    +++
 
 warning: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/issue-116434-2015.rs:18:20
+  --> $DIR/issue-116434-2015.rs:20:20
    |
 LL |     fn handle() -> DbHandle;
    |                    ^^^^^^^^
@@ -68,14 +68,14 @@ LL |     fn handle() -> dyn DbHandle;
    |                    +++
 
 error[E0038]: the trait `DbHandle` is not dyn compatible
-  --> $DIR/issue-116434-2015.rs:18:20
+  --> $DIR/issue-116434-2015.rs:20:20
    |
 LL |     fn handle() -> DbHandle;
    |                    ^^^^^^^^ `DbHandle` is not dyn compatible
    |
 note: for a trait to be dyn compatible it needs to allow building a vtable
       for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
-  --> $DIR/issue-116434-2015.rs:14:17
+  --> $DIR/issue-116434-2015.rs:16:17
    |
 LL | trait DbHandle: Sized {}
    |       --------  ^^^^^ ...because it requires `Self: Sized`
diff --git a/tests/ui/suggestions/issue-61963.rs b/tests/ui/suggestions/issue-61963.rs
index 2fafe629db9..77e4b21f5db 100644
--- a/tests/ui/suggestions/issue-61963.rs
+++ b/tests/ui/suggestions/issue-61963.rs
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ proc-macro: issue-61963.rs
 //@ proc-macro: issue-61963-1.rs
 #![deny(bare_trait_objects)]
diff --git a/tests/ui/suggestions/issue-61963.stderr b/tests/ui/suggestions/issue-61963.stderr
index 734c88f3fd6..ef11efe5c74 100644
--- a/tests/ui/suggestions/issue-61963.stderr
+++ b/tests/ui/suggestions/issue-61963.stderr
@@ -1,5 +1,5 @@
 error: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/issue-61963.rs:22:14
+  --> $DIR/issue-61963.rs:23:14
    |
 LL |     bar: Box<Bar>,
    |              ^^^
@@ -7,7 +7,7 @@ LL |     bar: Box<Bar>,
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
 note: the lint level is defined here
-  --> $DIR/issue-61963.rs:3:9
+  --> $DIR/issue-61963.rs:4:9
    |
 LL | #![deny(bare_trait_objects)]
    |         ^^^^^^^^^^^^^^^^^^
@@ -17,7 +17,7 @@ LL |     bar: Box<dyn Bar>,
    |              +++
 
 error: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/issue-61963.rs:18:1
+  --> $DIR/issue-61963.rs:19:1
    |
 LL | pub struct Foo {
    | ^^^
diff --git a/tests/ui/suggestions/missing-lifetime-specifier.rs b/tests/ui/suggestions/missing-lifetime-specifier.rs
index a957477897d..88d9736a071 100644
--- a/tests/ui/suggestions/missing-lifetime-specifier.rs
+++ b/tests/ui/suggestions/missing-lifetime-specifier.rs
@@ -7,7 +7,6 @@
 // Different number of duplicated diagnostics on different targets
 //@ compile-flags: -Zdeduplicate-diagnostics=yes
 
-#![allow(bare_trait_objects)]
 use std::cell::RefCell;
 use std::collections::HashMap;
 
@@ -28,7 +27,7 @@ thread_local! {
     //~^ ERROR missing lifetime specifiers
 }
 thread_local! {
-    static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
+    static b: RefCell<HashMap<i32, Vec<Vec<&dyn Bar>>>> = RefCell::new(HashMap::new());
     //~^ ERROR missing lifetime specifiers
 }
 thread_local! {
@@ -36,7 +35,7 @@ thread_local! {
     //~^ ERROR missing lifetime specifiers
 }
 thread_local! {
-    static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
+    static d: RefCell<HashMap<i32, Vec<Vec<&dyn Tar<i32>>>>> = RefCell::new(HashMap::new());
     //~^ ERROR missing lifetime specifiers
 }
 
@@ -45,8 +44,9 @@ thread_local! {
     //~^ ERROR union takes 2 lifetime arguments but 1 lifetime argument
 }
 thread_local! {
-    static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
-    //~^ ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied
+    static f: RefCell<HashMap<i32, Vec<Vec<&dyn Tar<'static, i32>>>>> =
+        RefCell::new(HashMap::new());
+    //~^^ ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied
     //~| ERROR missing lifetime specifier
 }
 
diff --git a/tests/ui/suggestions/missing-lifetime-specifier.stderr b/tests/ui/suggestions/missing-lifetime-specifier.stderr
index 1fdbf3b0c79..b8c58155e63 100644
--- a/tests/ui/suggestions/missing-lifetime-specifier.stderr
+++ b/tests/ui/suggestions/missing-lifetime-specifier.stderr
@@ -1,5 +1,5 @@
 error[E0106]: missing lifetime specifiers
-  --> $DIR/missing-lifetime-specifier.rs:27:44
+  --> $DIR/missing-lifetime-specifier.rs:26:44
    |
 LL |     static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
    |                                            ^^^ expected 2 lifetime parameters
@@ -11,21 +11,21 @@ LL |     static a: RefCell<HashMap<i32, Vec<Vec<Foo<'static, 'static>>>>> = RefC
    |                                               ++++++++++++++++++
 
 error[E0106]: missing lifetime specifiers
-  --> $DIR/missing-lifetime-specifier.rs:31:44
+  --> $DIR/missing-lifetime-specifier.rs:30:44
    |
-LL |     static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
-   |                                            ^^^^ expected 2 lifetime parameters
+LL |     static b: RefCell<HashMap<i32, Vec<Vec<&dyn Bar>>>> = RefCell::new(HashMap::new());
+   |                                            ^    ^^^ expected 2 lifetime parameters
    |                                            |
    |                                            expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
 help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`
    |
-LL |     static b: RefCell<HashMap<i32, Vec<Vec<&'static Bar<'static, 'static>>>>> = RefCell::new(HashMap::new());
-   |                                             +++++++    ++++++++++++++++++
+LL |     static b: RefCell<HashMap<i32, Vec<Vec<&'static dyn Bar<'static, 'static>>>>> = RefCell::new(HashMap::new());
+   |                                             +++++++        ++++++++++++++++++
 
 error[E0106]: missing lifetime specifiers
-  --> $DIR/missing-lifetime-specifier.rs:35:47
+  --> $DIR/missing-lifetime-specifier.rs:34:47
    |
 LL |     static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
    |                                               ^ expected 2 lifetime parameters
@@ -37,33 +37,38 @@ LL |     static c: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> =
    |                                                +++++++++++++++++
 
 error[E0106]: missing lifetime specifiers
-  --> $DIR/missing-lifetime-specifier.rs:39:44
+  --> $DIR/missing-lifetime-specifier.rs:38:44
    |
-LL |     static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
-   |                                            ^   ^ expected 2 lifetime parameters
+LL |     static d: RefCell<HashMap<i32, Vec<Vec<&dyn Tar<i32>>>>> = RefCell::new(HashMap::new());
+   |                                            ^       ^ expected 2 lifetime parameters
    |                                            |
    |                                            expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
 help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`
    |
-LL |     static d: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
-   |                                             +++++++     +++++++++++++++++
+LL |     static d: RefCell<HashMap<i32, Vec<Vec<&'static dyn Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                             +++++++         +++++++++++++++++
 
 error[E0106]: missing lifetime specifier
-  --> $DIR/missing-lifetime-specifier.rs:48:44
+  --> $DIR/missing-lifetime-specifier.rs:47:44
    |
-LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&dyn Tar<'static, i32>>>>> =
    |                                            ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
 help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`
    |
-LL |     static f: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&'static dyn Tar<'static, i32>>>>> =
    |                                             +++++++
+help: instead, you are more likely to want to return an owned value
+   |
+LL -     static f: RefCell<HashMap<i32, Vec<Vec<&dyn Tar<'static, i32>>>>> =
+LL +     static f: RefCell<HashMap<i32, Vec<Vec<dyn Tar<'static, i32>>>>> =
+   |
 
 error[E0107]: union takes 2 lifetime arguments but 1 lifetime argument was supplied
-  --> $DIR/missing-lifetime-specifier.rs:44:44
+  --> $DIR/missing-lifetime-specifier.rs:43:44
    |
 LL |     static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell::new(HashMap::new());
    |                                            ^^^ ------- supplied 1 lifetime argument
@@ -71,7 +76,7 @@ LL |     static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell:
    |                                            expected 2 lifetime arguments
    |
 note: union defined here, with 2 lifetime parameters: `'t`, `'k`
-  --> $DIR/missing-lifetime-specifier.rs:20:11
+  --> $DIR/missing-lifetime-specifier.rs:19:11
    |
 LL | pub union Qux<'t, 'k, I> {
    |           ^^^ --  --
@@ -81,22 +86,22 @@ LL |     static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> =
    |                                                       +++++++++
 
 error[E0107]: trait takes 2 lifetime arguments but 1 lifetime argument was supplied
-  --> $DIR/missing-lifetime-specifier.rs:48:45
+  --> $DIR/missing-lifetime-specifier.rs:47:49
    |
-LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
-   |                                             ^^^ ------- supplied 1 lifetime argument
-   |                                             |
-   |                                             expected 2 lifetime arguments
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&dyn Tar<'static, i32>>>>> =
+   |                                                 ^^^ ------- supplied 1 lifetime argument
+   |                                                 |
+   |                                                 expected 2 lifetime arguments
    |
 note: trait defined here, with 2 lifetime parameters: `'t`, `'k`
-  --> $DIR/missing-lifetime-specifier.rs:24:7
+  --> $DIR/missing-lifetime-specifier.rs:23:7
    |
 LL | trait Tar<'t, 'k, I> {}
    |       ^^^ --  --
 help: add missing lifetime argument
    |
-LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
-   |                                                        +++++++++
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&dyn Tar<'static, 'static, i32>>>>> =
+   |                                                            +++++++++
 
 error: aborting due to 7 previous errors
 
diff --git a/tests/ui/symbol-names/impl1.rs b/tests/ui/symbol-names/impl1.rs
index 694cd89bd80..0fdf5645479 100644
--- a/tests/ui/symbol-names/impl1.rs
+++ b/tests/ui/symbol-names/impl1.rs
@@ -26,7 +26,7 @@ mod foo {
 }
 
 mod bar {
-    use foo::Foo;
+    use crate::foo::Foo;
 
     impl Foo {
         #[rustc_symbol_name]
diff --git a/tests/ui/symbol-names/issue-53912.rs b/tests/ui/symbol-names/issue-53912.rs
index 194416cdb70..ba28316b0bf 100644
--- a/tests/ui/symbol-names/issue-53912.rs
+++ b/tests/ui/symbol-names/issue-53912.rs
@@ -12,13 +12,13 @@ mod llvm {
 mod foo {
     pub(crate) struct Foo<T>(T);
 
-    impl Foo<::llvm::Foo> {
+    impl Foo<crate::llvm::Foo> {
         pub(crate) fn foo() {
             for _ in 0..0 {
-                for _ in &[::dummy()] {
-                    ::dummy();
-                    ::dummy();
-                    ::dummy();
+                for _ in &[crate::dummy()] {
+                    crate::dummy();
+                    crate::dummy();
+                    crate::dummy();
                 }
             }
         }
diff --git a/tests/ui/symbol-names/issue-60925.rs b/tests/ui/symbol-names/issue-60925.rs
index ca0f21b7a78..24969fc6641 100644
--- a/tests/ui/symbol-names/issue-60925.rs
+++ b/tests/ui/symbol-names/issue-60925.rs
@@ -17,7 +17,7 @@ mod llvm {
 mod foo {
     pub(crate) struct Foo<T>(T);
 
-    impl Foo<::llvm::Foo> {
+    impl Foo<crate::llvm::Foo> {
         #[rustc_symbol_name]
         //[legacy]~^ ERROR symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo
         //[legacy]~| ERROR demangling(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo
@@ -27,10 +27,10 @@ mod foo {
             //[v0]~| ERROR demangling-alt(<issue_60925::foo::Foo<issue_60925::llvm::Foo>>::foo)
         pub(crate) fn foo() {
             for _ in 0..0 {
-                for _ in &[::dummy()] {
-                    ::dummy();
-                    ::dummy();
-                    ::dummy();
+                for _ in &[crate::dummy()] {
+                    crate::dummy();
+                    crate::dummy();
+                    crate::dummy();
                 }
             }
         }
diff --git a/tests/ui/threads-sendsync/thread-local-syntax.rs b/tests/ui/threads-sendsync/thread-local-syntax.rs
index 2cf91f0c1f7..9492e1c93e2 100644
--- a/tests/ui/threads-sendsync/thread-local-syntax.rs
+++ b/tests/ui/threads-sendsync/thread-local-syntax.rs
@@ -13,7 +13,7 @@ mod foo {
 
             // look at these restrictions!!
             pub(crate) static BAZ: usize = 0;
-            pub(in foo) static QUUX: usize = 0;
+            pub(in crate::foo) static QUUX: usize = 0;
         }
         thread_local!(static SPLOK: u32 = 0);
     }
diff --git a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.fixed b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.fixed
index e6aac1708ce..6354676bb25 100644
--- a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.fixed
+++ b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.fixed
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ run-rustfix
 #![allow(non_snake_case)]
 mod A {
diff --git a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.rs b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.rs
index d5c557dc9c7..c3b3a00aa6d 100644
--- a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.rs
+++ b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.rs
@@ -1,3 +1,4 @@
+//@ edition: 2015
 //@ run-rustfix
 #![allow(non_snake_case)]
 mod A {
diff --git a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr
index e2a72697501..4fb0dcc7901 100644
--- a/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr
+++ b/tests/ui/trait-bounds/shadowed-path-in-trait-bound-suggestion.stderr
@@ -1,5 +1,5 @@
 error[E0405]: cannot find trait `Trait` in `A`
-  --> $DIR/shadowed-path-in-trait-bound-suggestion.rs:9:24
+  --> $DIR/shadowed-path-in-trait-bound-suggestion.rs:10:24
    |
 LL |     pub struct A<H: A::Trait>(pub H);
    |                        ^^^^^ not found in `A`
diff --git a/tests/ui/traits/auxiliary/traitimpl.rs b/tests/ui/traits/auxiliary/traitimpl.rs
index fda5314cdbf..2544a96048b 100644
--- a/tests/ui/traits/auxiliary/traitimpl.rs
+++ b/tests/ui/traits/auxiliary/traitimpl.rs
@@ -2,6 +2,6 @@
 
 pub trait Bar<'a> : 'a {}
 
-impl<'a> Bar<'a> {
+impl<'a> dyn Bar<'a> {
     pub fn bar(&self) {}
 }
diff --git a/tests/ui/traits/const-traits/inherent-impl.rs b/tests/ui/traits/const-traits/inherent-impl.rs
index afd0d137bb4..07b23adf9e1 100644
--- a/tests/ui/traits/const-traits/inherent-impl.rs
+++ b/tests/ui/traits/const-traits/inherent-impl.rs
@@ -7,7 +7,7 @@ trait T {}
 impl const S {}
 //~^ ERROR inherent impls cannot be `const`
 
-impl const T {}
+impl const dyn T {}
 //~^ ERROR inherent impls cannot be `const`
 
 fn main() {}
diff --git a/tests/ui/traits/const-traits/inherent-impl.stderr b/tests/ui/traits/const-traits/inherent-impl.stderr
index 8c55627031d..e4ec1e807b0 100644
--- a/tests/ui/traits/const-traits/inherent-impl.stderr
+++ b/tests/ui/traits/const-traits/inherent-impl.stderr
@@ -11,8 +11,8 @@ LL | impl const S {}
 error: inherent impls cannot be `const`
   --> $DIR/inherent-impl.rs:10:12
    |
-LL | impl const T {}
-   |      ----- ^ inherent impl for this type
+LL | impl const dyn T {}
+   |      ----- ^^^^^ inherent impl for this type
    |      |
    |      `const` because of this
    |
diff --git a/tests/ui/traits/const-traits/mbe-dyn-const-2015.rs b/tests/ui/traits/const-traits/mbe-dyn-const-2015.rs
index 9d65a2ac302..fadfbe66788 100644
--- a/tests/ui/traits/const-traits/mbe-dyn-const-2015.rs
+++ b/tests/ui/traits/const-traits/mbe-dyn-const-2015.rs
@@ -1,6 +1,7 @@
 // Ensure that the introduction of const trait bound didn't regress this code in Rust 2015.
 // See also `mbe-const-trait-bound-theoretical-regression.rs`.
 
+//@ edition: 2015
 //@ check-pass
 
 macro_rules! check {
diff --git a/tests/ui/traits/impl-2.rs b/tests/ui/traits/impl-2.rs
index c6f60a9081c..41fa1cd334f 100644
--- a/tests/ui/traits/impl-2.rs
+++ b/tests/ui/traits/impl-2.rs
@@ -10,7 +10,7 @@ pub mod Foo {
 }
 
 mod Bar {
-    impl<'a> dyn (::Foo::Trait) + 'a {
+    impl<'a> dyn (crate::Foo::Trait) + 'a {
         fn bar(&self) { self.foo() }
     }
 }
diff --git a/tests/ui/traits/item-privacy.rs b/tests/ui/traits/item-privacy.rs
index 9f75e6e4c12..b8724399e32 100644
--- a/tests/ui/traits/item-privacy.rs
+++ b/tests/ui/traits/item-privacy.rs
@@ -15,9 +15,9 @@ mod method {
         fn c(&self) { }
     }
 
-    impl A for ::S {}
-    impl B for ::S {}
-    impl C for ::S {}
+    impl A for crate::S {}
+    impl B for crate::S {}
+    impl C for crate::S {}
 }
 
 mod assoc_const {
@@ -33,9 +33,9 @@ mod assoc_const {
         const C: u8 = 0;
     }
 
-    impl A for ::S {}
-    impl B for ::S {}
-    impl C for ::S {}
+    impl A for crate::S {}
+    impl B for crate::S {}
+    impl C for crate::S {}
 }
 
 mod assoc_ty {
@@ -51,9 +51,9 @@ mod assoc_ty {
         type C = u8;
     }
 
-    impl A for ::S {}
-    impl B for ::S {}
-    impl C for ::S {}
+    impl A for crate::S {}
+    impl B for crate::S {}
+    impl C for crate::S {}
 }
 
 fn check_method() {
diff --git a/tests/ui/traits/static-method-overwriting.rs b/tests/ui/traits/static-method-overwriting.rs
index 7a2a51a4b99..28edcde4c49 100644
--- a/tests/ui/traits/static-method-overwriting.rs
+++ b/tests/ui/traits/static-method-overwriting.rs
@@ -9,7 +9,7 @@ mod base {
         dummy: (),
     }
 
-    impl ::base::HasNew for Foo {
+    impl crate::base::HasNew for Foo {
         fn new() -> Foo {
             println!("Foo");
             Foo { dummy: () }
@@ -20,7 +20,7 @@ mod base {
         dummy: (),
     }
 
-    impl ::base::HasNew for Bar {
+    impl crate::base::HasNew for Bar {
         fn new() -> Bar {
             println!("Bar");
             Bar { dummy: () }
diff --git a/tests/ui/transmutability/references/reject_extension.stderr b/tests/ui/transmutability/references/reject_extension.stderr
index 182106acf12..a5f67785094 100644
--- a/tests/ui/transmutability/references/reject_extension.stderr
+++ b/tests/ui/transmutability/references/reject_extension.stderr
@@ -2,7 +2,7 @@ error[E0277]: `&Packed<Two>` cannot be safely transmuted into `&Packed<Four>`
   --> $DIR/reject_extension.rs:48:37
    |
 LL |     assert::is_transmutable::<&Src, &Dst>();
-   |                                     ^^^^ the referent size of `&Packed<Two>` (2 bytes) is smaller than that of `&Packed<Four>` (4 bytes)
+   |                                     ^^^^ the size of `Packed<Two>` (2 bytes) is smaller than that of `Packed<Four>` (4 bytes)
    |
 note: required by a bound in `is_transmutable`
   --> $DIR/reject_extension.rs:13:14
diff --git a/tests/ui/transmutability/references/unit-to-u8.stderr b/tests/ui/transmutability/references/unit-to-u8.stderr
index bc9f286e097..35d1179f451 100644
--- a/tests/ui/transmutability/references/unit-to-u8.stderr
+++ b/tests/ui/transmutability/references/unit-to-u8.stderr
@@ -2,7 +2,7 @@ error[E0277]: `&Unit` cannot be safely transmuted into `&u8`
   --> $DIR/unit-to-u8.rs:22:52
    |
 LL |     assert::is_maybe_transmutable::<&'static Unit, &'static u8>();
-   |                                                    ^^^^^^^^^^^ the referent size of `&Unit` (0 bytes) is smaller than that of `&u8` (1 bytes)
+   |                                                    ^^^^^^^^^^^ the size of `Unit` (0 bytes) is smaller than that of `u8` (1 bytes)
    |
 note: required by a bound in `is_maybe_transmutable`
   --> $DIR/unit-to-u8.rs:9:14
diff --git a/tests/ui/transmutability/references/unsafecell.rs b/tests/ui/transmutability/references/unsafecell.rs
index 4001f139770..b0db4af45f5 100644
--- a/tests/ui/transmutability/references/unsafecell.rs
+++ b/tests/ui/transmutability/references/unsafecell.rs
@@ -38,10 +38,10 @@ fn mut_to_mut() {
 }
 
 fn mut_to_ref() {
-    // We don't care about `UnsafeCell` for transmutations in the form `&mut T
-    // -> &U`, because downgrading a `&mut T` to a `&U` deactivates `&mut T` for
-    // the lifetime of `&U`.
-    assert::is_maybe_transmutable::<&'static mut u8, &'static UnsafeCell<u8>>();
-    assert::is_maybe_transmutable::<&'static mut UnsafeCell<u8>, &'static u8>();
-    assert::is_maybe_transmutable::<&'static mut UnsafeCell<u8>, &'static UnsafeCell<u8>>();
+    // `&mut UnsafeCell` is irrelevant in the source.
+    assert::is_maybe_transmutable::<&'static mut UnsafeCell<bool>, &'static u8>();
+    // `&UnsafeCell` in forbidden in the destination, since the destination can be used to
+    // invalidate a shadowed source reference.
+    assert::is_maybe_transmutable::<&'static mut bool, &'static UnsafeCell<u8>>(); //~ ERROR: cannot be safely transmuted
+    assert::is_maybe_transmutable::<&'static mut UnsafeCell<bool>, &'static UnsafeCell<u8>>(); //~ ERROR: cannot be safely transmuted
 }
diff --git a/tests/ui/transmutability/references/unsafecell.stderr b/tests/ui/transmutability/references/unsafecell.stderr
index 6664d8a7d6f..02a0935e84e 100644
--- a/tests/ui/transmutability/references/unsafecell.stderr
+++ b/tests/ui/transmutability/references/unsafecell.stderr
@@ -28,6 +28,36 @@ LL |     where
 LL |         Dst: TransmuteFrom<Src, { Assume::SAFETY }>
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
 
-error: aborting due to 2 previous errors
+error[E0277]: `&mut bool` cannot be safely transmuted into `&UnsafeCell<u8>`
+  --> $DIR/unsafecell.rs:45:56
+   |
+LL |     assert::is_maybe_transmutable::<&'static mut bool, &'static UnsafeCell<u8>>();
+   |                                                        ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Freeze` is not implemented for `UnsafeCell<u8>`
+   |
+note: required by a bound in `is_maybe_transmutable`
+  --> $DIR/unsafecell.rs:12:14
+   |
+LL |     pub fn is_maybe_transmutable<Src, Dst>()
+   |            --------------------- required by a bound in this function
+LL |     where
+LL |         Dst: TransmuteFrom<Src, { Assume::SAFETY }>
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+
+error[E0277]: `&mut UnsafeCell<bool>` cannot be safely transmuted into `&UnsafeCell<u8>`
+  --> $DIR/unsafecell.rs:46:68
+   |
+LL |     assert::is_maybe_transmutable::<&'static mut UnsafeCell<bool>, &'static UnsafeCell<u8>>();
+   |                                                                    ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Freeze` is not implemented for `UnsafeCell<u8>`
+   |
+note: required by a bound in `is_maybe_transmutable`
+  --> $DIR/unsafecell.rs:12:14
+   |
+LL |     pub fn is_maybe_transmutable<Src, Dst>()
+   |            --------------------- required by a bound in this function
+LL |     where
+LL |         Dst: TransmuteFrom<Src, { Assume::SAFETY }>
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/tuple/tuple-struct-fields/test.rs b/tests/ui/tuple/tuple-struct-fields/test.rs
index 00677090d78..29aabf4579b 100644
--- a/tests/ui/tuple/tuple-struct-fields/test.rs
+++ b/tests/ui/tuple/tuple-struct-fields/test.rs
@@ -1,6 +1,6 @@
 mod foo {
     type T = ();
-    struct S1(pub(in foo) (), pub(T), pub(crate) (), pub(((), T)));
+    struct S1(pub(in crate::foo) (), pub(T), pub(crate) (), pub(((), T)));
     struct S2(pub((foo)) ());
     //~^ ERROR expected one of `)` or `,`, found `(`
     //~| ERROR cannot find type `foo` in this scope
diff --git a/tests/ui/tuple/tuple-struct-fields/test2.rs b/tests/ui/tuple/tuple-struct-fields/test2.rs
index 2b2a2c127e9..544d486752c 100644
--- a/tests/ui/tuple/tuple-struct-fields/test2.rs
+++ b/tests/ui/tuple/tuple-struct-fields/test2.rs
@@ -1,7 +1,7 @@
 macro_rules! define_struct {
     ($t:ty) => {
         struct S1(pub $t);
-        struct S2(pub (in foo) ());
+        struct S2(pub (in crate::foo) ());
         struct S3(pub $t ());
         //~^ ERROR expected one of `)` or `,`, found `(`
     }
diff --git a/tests/ui/tuple/tuple-struct-fields/test3.rs b/tests/ui/tuple/tuple-struct-fields/test3.rs
index 98d19426e77..b5f98a65fa6 100644
--- a/tests/ui/tuple/tuple-struct-fields/test3.rs
+++ b/tests/ui/tuple/tuple-struct-fields/test3.rs
@@ -1,7 +1,7 @@
 macro_rules! define_struct {
     ($t:ty) => {
         struct S1(pub($t));
-        struct S2(pub (in foo) ());
+        struct S2(pub (in crate::foo) ());
         struct S3(pub($t) ());
         //~^ ERROR expected one of `)` or `,`, found `(`
     }
diff --git a/tests/ui/type/auxiliary/crate_a1.rs b/tests/ui/type/auxiliary/crate_a1.rs
index 616493193fd..f8ee9ae15c1 100644
--- a/tests/ui/type/auxiliary/crate_a1.rs
+++ b/tests/ui/type/auxiliary/crate_a1.rs
@@ -2,10 +2,10 @@ pub struct Foo;
 
 pub trait Bar {}
 
-pub fn bar() -> Box<Bar> {
+pub fn bar() -> Box<dyn Bar> {
     unimplemented!()
 }
 
 
 pub fn try_foo(x: Foo){}
-pub fn try_bar(x: Box<Bar>){}
+pub fn try_bar(x: Box<dyn Bar>){}
diff --git a/tests/ui/type/auxiliary/crate_a2.rs b/tests/ui/type/auxiliary/crate_a2.rs
index 57a7685b77c..fe22598e63e 100644
--- a/tests/ui/type/auxiliary/crate_a2.rs
+++ b/tests/ui/type/auxiliary/crate_a2.rs
@@ -2,6 +2,6 @@ pub struct Foo;
 
 pub trait Bar {}
 
-pub fn bar() -> Box<Bar> {
+pub fn bar() -> Box<dyn Bar> {
     unimplemented!()
 }
diff --git a/tests/ui/type/issue-7607-2.rs b/tests/ui/type/issue-7607-2.rs
index ebc4fe1c2d3..53fafdf9489 100644
--- a/tests/ui/type/issue-7607-2.rs
+++ b/tests/ui/type/issue-7607-2.rs
@@ -6,7 +6,7 @@ pub mod a {
 }
 
 pub mod b {
-    use a::Foo;
+    use crate::a::Foo;
     impl Foo {
         fn bar(&self) { }
     }
diff --git a/tests/ui/type/type-mismatch-same-crate-name.stderr b/tests/ui/type/type-mismatch-same-crate-name.stderr
index 7b791549f56..8fafbfaa934 100644
--- a/tests/ui/type/type-mismatch-same-crate-name.stderr
+++ b/tests/ui/type/type-mismatch-same-crate-name.stderr
@@ -59,7 +59,7 @@ LL |         extern crate crate_a1 as a;
 note: function defined here
   --> $DIR/auxiliary/crate_a1.rs:11:8
    |
-LL | pub fn try_bar(x: Box<Bar>){}
+LL | pub fn try_bar(x: Box<dyn Bar>){}
    |        ^^^^^^^
 
 error: aborting due to 2 previous errors
diff --git a/tests/ui/underscore-imports/basic.rs b/tests/ui/underscore-imports/basic.rs
index 624ecb47ca6..8d8ff5c47bc 100644
--- a/tests/ui/underscore-imports/basic.rs
+++ b/tests/ui/underscore-imports/basic.rs
@@ -18,25 +18,25 @@ mod m {
         fn tr2_is_in_scope(&self) {}
     }
 
-    impl Tr1 for ::S {}
-    impl Tr2 for ::S {}
+    impl Tr1 for crate::S {}
+    impl Tr2 for crate::S {}
 }
 
 mod unused {
-    use m::Tr1 as _; //~ WARN unused import
-    use S as _; //~ WARN unused import
+    use crate::m::Tr1 as _; //~ WARN unused import
+    use crate::S as _; //~ WARN unused import
     extern crate core as _; // OK
 }
 
 mod outer {
     mod middle {
-        pub use m::Tr1 as _;
-        pub use m::Tr2 as _; // OK, no name conflict
+        pub use crate::m::Tr1 as _;
+        pub use crate::m::Tr2 as _; // OK, no name conflict
         struct Tr1; // OK, no name conflict
         fn check() {
             // Both traits are in scope
-            ::S.tr1_is_in_scope();
-            ::S.tr2_is_in_scope();
+            crate::S.tr1_is_in_scope();
+            crate::S.tr2_is_in_scope();
         }
 
         mod inner {
@@ -44,8 +44,8 @@ mod outer {
             use super::*;
             fn check() {
                 // Both traits are in scope
-                ::S.tr1_is_in_scope();
-                ::S.tr2_is_in_scope();
+                crate::S.tr1_is_in_scope();
+                crate::S.tr2_is_in_scope();
             }
         }
     }
@@ -54,8 +54,8 @@ mod outer {
     use self::middle::*;
     fn check() {
         // Both traits are in scope
-        ::S.tr1_is_in_scope();
-        ::S.tr2_is_in_scope();
+        crate::S.tr1_is_in_scope();
+        crate::S.tr2_is_in_scope();
     }
 }
 
diff --git a/tests/ui/underscore-imports/basic.stderr b/tests/ui/underscore-imports/basic.stderr
index c51493562eb..666d07349df 100644
--- a/tests/ui/underscore-imports/basic.stderr
+++ b/tests/ui/underscore-imports/basic.stderr
@@ -1,8 +1,8 @@
-warning: unused import: `m::Tr1 as _`
+warning: unused import: `crate::m::Tr1 as _`
   --> $DIR/basic.rs:26:9
    |
-LL |     use m::Tr1 as _;
-   |         ^^^^^^^^^^^
+LL |     use crate::m::Tr1 as _;
+   |         ^^^^^^^^^^^^^^^^^^
    |
 note: the lint level is defined here
   --> $DIR/basic.rs:4:9
@@ -10,11 +10,11 @@ note: the lint level is defined here
 LL | #![warn(unused_imports, unused_extern_crates)]
    |         ^^^^^^^^^^^^^^
 
-warning: unused import: `S as _`
+warning: unused import: `crate::S as _`
   --> $DIR/basic.rs:27:9
    |
-LL |     use S as _;
-   |         ^^^^^^
+LL |     use crate::S as _;
+   |         ^^^^^^^^^^^^^
 
 warning: 2 warnings emitted
 
diff --git a/tests/ui/unresolved/unresolved-import-recovery.rs b/tests/ui/unresolved/unresolved-import-recovery.rs
index 0b0653378cb..8657bb661a8 100644
--- a/tests/ui/unresolved/unresolved-import-recovery.rs
+++ b/tests/ui/unresolved/unresolved-import-recovery.rs
@@ -1,7 +1,7 @@
 // Check that unresolved imports do not create additional errors and ICEs
 
 mod m {
-    pub use unresolved; //~ ERROR unresolved import `unresolved`
+    pub use crate::unresolved; //~ ERROR unresolved import `crate::unresolved`
 
     fn f() {
         let unresolved = 0; // OK
diff --git a/tests/ui/unresolved/unresolved-import-recovery.stderr b/tests/ui/unresolved/unresolved-import-recovery.stderr
index 1c006049756..ec41c9e79d7 100644
--- a/tests/ui/unresolved/unresolved-import-recovery.stderr
+++ b/tests/ui/unresolved/unresolved-import-recovery.stderr
@@ -1,8 +1,8 @@
-error[E0432]: unresolved import `unresolved`
+error[E0432]: unresolved import `crate::unresolved`
   --> $DIR/unresolved-import-recovery.rs:4:13
    |
-LL |     pub use unresolved;
-   |             ^^^^^^^^^^ no `unresolved` in the root
+LL |     pub use crate::unresolved;
+   |             ^^^^^^^^^^^^^^^^^ no `unresolved` in the root
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/unsized/unsized3-rpass.rs b/tests/ui/unsized/unsized3-rpass.rs
index ff35051774b..03aa1a538ea 100644
--- a/tests/ui/unsized/unsized3-rpass.rs
+++ b/tests/ui/unsized/unsized3-rpass.rs
@@ -37,7 +37,7 @@ impl Tr for St {
 }
 
 struct Qux<'a> {
-    f: Tr + 'a,
+    f: dyn Tr + 'a,
 }
 
 pub fn main() {
@@ -85,7 +85,7 @@ pub fn main() {
         }
 
         let obj: Box<St> = Box::new(St { f: 42 });
-        let obj: &Tr = &*obj;
+        let obj: &dyn Tr = &*obj;
         let data: Box<_> = Box::new(Qux_ { f: St { f: 234 } });
         let x: &Qux = &*ptr::from_raw_parts::<Qux>(&*data as *const _, ptr::metadata(obj));
         assert_eq!(x.f.foo(), 234);
diff --git a/tests/ui/use/use-mod/use-mod-4.rs b/tests/ui/use/use-mod/use-mod-4.rs
index 46ae8ddadc0..34ce7c71957 100644
--- a/tests/ui/use/use-mod/use-mod-4.rs
+++ b/tests/ui/use/use-mod/use-mod-4.rs
@@ -1,4 +1,4 @@
-use foo::self; //~ ERROR unresolved import `foo`
+use crate::foo::self; //~ ERROR unresolved import `crate::foo`
 //~^ ERROR `self` imports are only allowed within a { } list
 
 use std::mem::self;
diff --git a/tests/ui/use/use-mod/use-mod-4.stderr b/tests/ui/use/use-mod/use-mod-4.stderr
index 0b4fbadb458..d4621296c0d 100644
--- a/tests/ui/use/use-mod/use-mod-4.stderr
+++ b/tests/ui/use/use-mod/use-mod-4.stderr
@@ -1,18 +1,18 @@
 error[E0429]: `self` imports are only allowed within a { } list
-  --> $DIR/use-mod-4.rs:1:8
+  --> $DIR/use-mod-4.rs:1:15
    |
-LL | use foo::self;
-   |        ^^^^^^
+LL | use crate::foo::self;
+   |               ^^^^^^
    |
 help: consider importing the module directly
    |
-LL - use foo::self;
-LL + use foo;
+LL - use crate::foo::self;
+LL + use crate::foo;
    |
 help: alternatively, use the multi-path `use` syntax to import `self`
    |
-LL | use foo::{self};
-   |          +    +
+LL | use crate::foo::{self};
+   |                 +    +
 
 error[E0429]: `self` imports are only allowed within a { } list
   --> $DIR/use-mod-4.rs:4:13
@@ -30,11 +30,11 @@ help: alternatively, use the multi-path `use` syntax to import `self`
 LL | use std::mem::{self};
    |               +    +
 
-error[E0432]: unresolved import `foo`
+error[E0432]: unresolved import `crate::foo`
   --> $DIR/use-mod-4.rs:1:5
    |
-LL | use foo::self;
-   |     ^^^^^^^^^ no `foo` in the root
+LL | use crate::foo::self;
+   |     ^^^^^^^^^^^^^^^^ no `foo` in the root
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/warnings/no-explicit-path-issue-122509.rs b/tests/ui/warnings/no-explicit-path-issue-122509.rs
index 4e8eefde5da..5be4b174076 100644
--- a/tests/ui/warnings/no-explicit-path-issue-122509.rs
+++ b/tests/ui/warnings/no-explicit-path-issue-122509.rs
@@ -7,13 +7,13 @@ fn one() -> usize {
 
 pub mod a {
     pub fn two() -> usize {
-        ::one() + ::one()
+        crate::one() + crate::one()
     }
 }
 
 pub mod b {
     pub fn three() -> usize {
-        ::one() + ::a::two()
+        crate::one() + crate::a::two()
     }
 }
 
diff --git a/tests/ui/weird-exprs.rs b/tests/ui/weird-exprs.rs
index b24e754a4ec..7db92d46067 100644
--- a/tests/ui/weird-exprs.rs
+++ b/tests/ui/weird-exprs.rs
@@ -105,7 +105,7 @@ fn u8(u8: u8) {
 
             u8!(u8);
             let &u8: &u8 = u8::u8(&8u8);
-            ::u8(0u8);
+            crate::u8(0u8);
             u8
         });
     }
diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs
index a95e10b7265..53f07a94fd1 100644
--- a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs
+++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs
@@ -1,17 +1,11 @@
-trait Trait<const N: Trait = bar> {
+trait Trait<const N: dyn Trait = bar> {
     //~^ ERROR cannot find value `bar` in this scope
     //~| ERROR cycle detected when computing type of `Trait::N`
-    //~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
-    //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
-    fn fnc<const N: Trait = u32>(&self) -> Trait {
+    fn fnc<const N: dyn Trait = u32>(&self) -> dyn Trait {
         //~^ ERROR the name `N` is already used for a generic parameter in this item's generic parameters
         //~| ERROR expected value, found builtin type `u32`
         //~| ERROR defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
         //~| ERROR associated item referring to unboxed trait object for its own trait
-        //~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
-        //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
-        //~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
-        //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
         bar
         //~^ ERROR cannot find value `bar` in this scope
     }
diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr
index 59eef0c6327..a085dd6ac57 100644
--- a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr
+++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr
@@ -1,106 +1,66 @@
 error[E0403]: the name `N` is already used for a generic parameter in this item's generic parameters
-  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:18
+  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:4:18
    |
-LL | trait Trait<const N: Trait = bar> {
+LL | trait Trait<const N: dyn Trait = bar> {
    |                   - first use of `N`
 ...
-LL |     fn fnc<const N: Trait = u32>(&self) -> Trait {
+LL |     fn fnc<const N: dyn Trait = u32>(&self) -> dyn Trait {
    |                  ^ already used
 
 error[E0425]: cannot find value `bar` in this scope
-  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:30
+  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:34
    |
-LL | trait Trait<const N: Trait = bar> {
-   |                              ^^^ not found in this scope
+LL | trait Trait<const N: dyn Trait = bar> {
+   |                                  ^^^ not found in this scope
 
 error[E0423]: expected value, found builtin type `u32`
-  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:29
+  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:4:33
    |
-LL |     fn fnc<const N: Trait = u32>(&self) -> Trait {
-   |                             ^^^ not a value
+LL |     fn fnc<const N: dyn Trait = u32>(&self) -> dyn Trait {
+   |                                 ^^^ not a value
 
 error[E0425]: cannot find value `bar` in this scope
-  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:15:9
+  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:9:9
    |
 LL |         bar
    |         ^^^ not found in this scope
 
-warning: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22
-   |
-LL | trait Trait<const N: Trait = bar> {
-   |                      ^^^^^
-   |
-   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
-   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
-   = note: `#[warn(bare_trait_objects)]` on by default
-help: if this is a dyn-compatible trait, use `dyn`
-   |
-LL | trait Trait<const N: dyn Trait = bar> {
-   |                      +++
-
 error[E0391]: cycle detected when computing type of `Trait::N`
-  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22
+  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:26
    |
-LL | trait Trait<const N: Trait = bar> {
-   |                      ^^^^^
+LL | trait Trait<const N: dyn Trait = bar> {
+   |                          ^^^^^
    |
    = note: ...which immediately requires computing type of `Trait::N` again
 note: cycle used when computing explicit predicates of trait `Trait`
   --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:1
    |
-LL | trait Trait<const N: Trait = bar> {
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | trait Trait<const N: dyn Trait = bar> {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
 
 error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
-  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:12
+  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:4:12
    |
-LL |     fn fnc<const N: Trait = u32>(&self) -> Trait {
-   |            ^^^^^^^^^^^^^^^^^^^^
-
-warning: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:44
-   |
-LL |     fn fnc<const N: Trait = u32>(&self) -> Trait {
-   |                                            ^^^^^
-   |
-   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
-   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
-help: if this is a dyn-compatible trait, use `dyn`
-   |
-LL |     fn fnc<const N: Trait = u32>(&self) -> dyn Trait {
-   |                                            +++
-
-warning: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:21
-   |
-LL |     fn fnc<const N: Trait = u32>(&self) -> Trait {
-   |                     ^^^^^
-   |
-   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
-   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
-help: if this is a dyn-compatible trait, use `dyn`
-   |
-LL |     fn fnc<const N: dyn Trait = u32>(&self) -> Trait {
-   |                     +++
+LL |     fn fnc<const N: dyn Trait = u32>(&self) -> dyn Trait {
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: associated item referring to unboxed trait object for its own trait
-  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:6:44
+  --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:4:48
    |
-LL | trait Trait<const N: Trait = bar> {
+LL | trait Trait<const N: dyn Trait = bar> {
    |       ----- in this trait
 ...
-LL |     fn fnc<const N: Trait = u32>(&self) -> Trait {
-   |                                            ^^^^^
+LL |     fn fnc<const N: dyn Trait = u32>(&self) -> dyn Trait {
+   |                                                ^^^^^^^^^
    |
 help: you might have meant to use `Self` to refer to the implementing type
    |
-LL -     fn fnc<const N: Trait = u32>(&self) -> Trait {
-LL +     fn fnc<const N: Trait = u32>(&self) -> Self {
+LL -     fn fnc<const N: dyn Trait = u32>(&self) -> dyn Trait {
+LL +     fn fnc<const N: dyn Trait = u32>(&self) -> Self {
    |
 
-error: aborting due to 7 previous errors; 3 warnings emitted
+error: aborting due to 7 previous errors
 
 Some errors have detailed explanations: E0391, E0403, E0423, E0425.
 For more information about an error, try `rustc --explain E0391`.