about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-08-01 10:20:07 +0000
committerbors <bors@rust-lang.org>2025-08-01 10:20:07 +0000
commit924a5a4b7ff83cd7ba427a0a4a6fc84ef43034f3 (patch)
treeb21ca544919c9b3f14470d4c27fbfd3ceb3a1ef6
parente3ee7f7aea5b45af3b42b5e4713da43876a65ac9 (diff)
parent21140a5111df236fc24dac44af4ec3452b3cb948 (diff)
downloadrust-924a5a4b7ff83cd7ba427a0a4a6fc84ef43034f3.tar.gz
rust-924a5a4b7ff83cd7ba427a0a4a6fc84ef43034f3.zip
Auto merge of #144773 - RalfJung:rollup-uif2yyj, r=RalfJung
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#144397 (`tests/ui/issues/`: The Issues Strike Back [2/N])
 - rust-lang/rust#144410 (Make tier 3 musl targets link dynamically by default)
 - rust-lang/rust#144708 (Add tracing to step.rs and friends)
 - rust-lang/rust#144730 (Create a typed wrapper for codegen backends in bootstrap)
 - rust-lang/rust#144771 (Remove some noisy triagebot pings for myself)
 - rust-lang/rust#144772 (add unsupported_calling_conventions to lint list)

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_const_eval/src/interpret/call.rs10
-rw-r--r--compiler/rustc_const_eval/src/interpret/operand.rs12
-rw-r--r--compiler/rustc_const_eval/src/interpret/place.rs5
-rw-r--r--compiler/rustc_const_eval/src/interpret/step.rs22
-rw-r--r--compiler/rustc_const_eval/src/interpret/util.rs35
-rw-r--r--compiler/rustc_lint_defs/src/builtin.rs1
-rw-r--r--compiler/rustc_target/src/spec/targets/hexagon_unknown_linux_musl.rs1
-rw-r--r--compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs2
-rw-r--r--compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs2
-rw-r--r--compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs2
-rw-r--r--compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs2
-rw-r--r--compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs2
-rw-r--r--compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs2
-rw-r--r--compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs2
-rw-r--r--src/bootstrap/src/core/build_steps/check.rs19
-rw-r--r--src/bootstrap/src/core/build_steps/compile.rs24
-rw-r--r--src/bootstrap/src/core/build_steps/dist.rs30
-rw-r--r--src/bootstrap/src/core/build_steps/install.rs4
-rw-r--r--src/bootstrap/src/core/build_steps/test.rs10
-rw-r--r--src/bootstrap/src/core/builder/cargo.rs2
-rw-r--r--src/bootstrap/src/core/builder/mod.rs16
-rw-r--r--src/bootstrap/src/core/builder/tests.rs24
-rw-r--r--src/bootstrap/src/core/config/config.rs12
-rw-r--r--src/bootstrap/src/core/config/toml/rust.rs27
-rw-r--r--src/bootstrap/src/core/config/toml/target.rs8
-rw-r--r--src/bootstrap/src/lib.rs40
-rw-r--r--src/bootstrap/src/utils/build_stamp.rs6
-rw-r--r--tests/ui/autoref-autoderef/deref-chain-method-calls-13264.rs (renamed from tests/ui/issues/issue-13264.rs)2
-rw-r--r--tests/ui/block-result/blocks-without-results-11709.rs (renamed from tests/ui/issues/issue-11709.rs)2
-rw-r--r--tests/ui/borrowck/moved-value-in-thread-loop-12041.rs (renamed from tests/ui/issues/issue-12041.rs)2
-rw-r--r--tests/ui/borrowck/moved-value-in-thread-loop-12041.stderr (renamed from tests/ui/issues/issue-12041.stderr)2
-rw-r--r--tests/ui/borrowck/refcell-borrow-comparison-12033.rs (renamed from tests/ui/issues/issue-12033.rs)2
-rw-r--r--tests/ui/borrowck/string-literal-match-patterns-11869.rs (renamed from tests/ui/issues/issue-11869.rs)2
-rw-r--r--tests/ui/closures/fnonce-moved-twice-12127.rs (renamed from tests/ui/issues/issue-12127.rs)2
-rw-r--r--tests/ui/closures/fnonce-moved-twice-12127.stderr (renamed from tests/ui/issues/issue-12127.stderr)6
-rw-r--r--tests/ui/closures/moved-upvar-mut-rebind-11958.rs (renamed from tests/ui/issues/issue-11958.rs)2
-rw-r--r--tests/ui/closures/moved-upvar-mut-rebind-11958.stderr (renamed from tests/ui/issues/issue-11958.stderr)4
-rw-r--r--tests/ui/coercion/any-trait-object-debug-12744.rs (renamed from tests/ui/issues/issue-12744.rs)2
-rw-r--r--tests/ui/collections/hashset-connected-border-12860.rs (renamed from tests/ui/issues/issue-12860.rs)2
-rw-r--r--tests/ui/const-generics/vec-macro-in-static-array.rs (renamed from tests/ui/issues/issue-13446.rs)2
-rw-r--r--tests/ui/const-generics/vec-macro-in-static-array.stderr (renamed from tests/ui/issues/issue-13446.stderr)2
-rw-r--r--tests/ui/extern/windows-tcb-trash-13259.rs49
-rw-r--r--tests/ui/fn/anonymous-parameters-trait-13105.rs (renamed from tests/ui/issues/issue-13105.rs)2
-rw-r--r--tests/ui/issues/issue-13259-windows-tcb-trash.rs39
-rw-r--r--tests/ui/iterators/bytes-iterator-clone-12677.rs (renamed from tests/ui/issues/issue-12677.rs)2
-rw-r--r--tests/ui/lifetimes/iterator-trait-lifetime-error-13058.rs (renamed from tests/ui/issues/issue-13058.rs)2
-rw-r--r--tests/ui/lifetimes/iterator-trait-lifetime-error-13058.stderr (renamed from tests/ui/issues/issue-13058.stderr)2
-rw-r--r--tests/ui/lifetimes/lifetime-inference-destructuring-arg.rs (renamed from tests/ui/issues/issue-13167.rs)2
-rw-r--r--tests/ui/lifetimes/matcher-trait-equality-13323.rs (renamed from tests/ui/issues/issue-13323.rs)2
-rw-r--r--tests/ui/lifetimes/struct-lifetime-field-assignment-13405.rs (renamed from tests/ui/issues/issue-13405.rs)2
-rw-r--r--tests/ui/lifetimes/unsafe-transmute-in-find-11740.rs (renamed from tests/ui/issues/issue-11740.rs)2
-rw-r--r--tests/ui/match/option-result-mismatch-11844.rs (renamed from tests/ui/issues/issue-11844.rs)2
-rw-r--r--tests/ui/match/option-result-mismatch-11844.stderr (renamed from tests/ui/issues/issue-11844.stderr)2
-rw-r--r--tests/ui/match/option-result-type-param-mismatch-13466.rs (renamed from tests/ui/issues/issue-13466.rs)2
-rw-r--r--tests/ui/match/option-result-type-param-mismatch-13466.stderr (renamed from tests/ui/issues/issue-13466.stderr)4
-rw-r--r--tests/ui/match/overeager-sub-match-pruning-13027.rs (renamed from tests/ui/issues/issue-13027.rs)2
-rw-r--r--tests/ui/match/slice-move-out-error-12567.rs (renamed from tests/ui/issues/issue-12567.rs)2
-rw-r--r--tests/ui/match/slice-move-out-error-12567.stderr (renamed from tests/ui/issues/issue-12567.stderr)4
-rw-r--r--tests/ui/match/struct-reference-patterns-12285.rs (renamed from tests/ui/issues/issue-12285.rs)2
-rw-r--r--tests/ui/parser/encode-symbol-ice-12920.rs (renamed from tests/ui/issues/issue-12920.rs)2
-rw-r--r--tests/ui/privacy/private-unit-struct-assignment.rs (renamed from tests/ui/issues/issue-13407.rs)2
-rw-r--r--tests/ui/privacy/private-unit-struct-assignment.stderr (renamed from tests/ui/issues/issue-13407.stderr)6
-rw-r--r--tests/ui/privacy/use-in-impl-scope-12729.rs (renamed from tests/ui/issues/issue-12729.rs)2
-rw-r--r--tests/ui/resolve/reference-clone-nonclone-11820.rs (renamed from tests/ui/issues/issue-11820.rs)2
-rw-r--r--tests/ui/statics/enum-with-static-str-variant-13214.rs (renamed from tests/ui/issues/issue-13214.rs)2
-rw-r--r--tests/ui/traits/default-method-lifetime-params-13204.rs (renamed from tests/ui/issues/issue-13204.rs)2
-rw-r--r--tests/ui/traits/fnonce-repro-trait-impl-13434.rs (renamed from tests/ui/issues/issue-13434.rs)2
-rw-r--r--tests/ui/type-inference/partial-type-hint-12909.rs (renamed from tests/ui/issues/issue-12909.rs)2
-rw-r--r--tests/ui/typeck/function-in-pattern-error-12863.rs (renamed from tests/ui/issues/issue-12863.rs)2
-rw-r--r--tests/ui/typeck/function-in-pattern-error-12863.stderr (renamed from tests/ui/issues/issue-12863.stderr)2
-rw-r--r--tests/ui/typeck/isize-usize-mismatch-error.rs (renamed from tests/ui/issues/issue-13359.rs)2
-rw-r--r--tests/ui/typeck/isize-usize-mismatch-error.stderr (renamed from tests/ui/issues/issue-13359.stderr)8
-rw-r--r--tests/ui/typeck/unit-type-add-error-11771.rs (renamed from tests/ui/issues/issue-11771.rs)2
-rw-r--r--tests/ui/typeck/unit-type-add-error-11771.stderr (renamed from tests/ui/issues/issue-11771.stderr)4
-rw-r--r--tests/ui/typeck/unwrap-or-panic-input-13202.rs (renamed from tests/ui/issues/issue-13202.rs)2
-rw-r--r--triagebot.toml8
76 files changed, 359 insertions, 173 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/call.rs b/compiler/rustc_const_eval/src/interpret/call.rs
index 5b3adba0265..b8a65369825 100644
--- a/compiler/rustc_const_eval/src/interpret/call.rs
+++ b/compiler/rustc_const_eval/src/interpret/call.rs
@@ -11,6 +11,7 @@ use rustc_middle::ty::{self, AdtDef, Instance, Ty, VariantDef};
 use rustc_middle::{bug, mir, span_bug};
 use rustc_span::sym;
 use rustc_target::callconv::{ArgAbi, FnAbi, PassMode};
+use tracing::field::Empty;
 use tracing::{info, instrument, trace};
 
 use super::{
@@ -18,7 +19,8 @@ use super::{
     Projectable, Provenance, ReturnAction, ReturnContinuation, Scalar, StackPopInfo, interp_ok,
     throw_ub, throw_ub_custom, throw_unsup_format,
 };
-use crate::fluent_generated as fluent;
+use crate::interpret::EnteredTraceSpan;
+use crate::{enter_trace_span, fluent_generated as fluent};
 
 /// An argument passed to a function.
 #[derive(Clone, Debug)]
@@ -344,6 +346,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
         destination: &PlaceTy<'tcx, M::Provenance>,
         mut cont: ReturnContinuation,
     ) -> InterpResult<'tcx> {
+        let _span = enter_trace_span!(M, step::init_stack_frame, %instance, tracing_separate_thread = Empty);
+
         // Compute callee information.
         // FIXME: for variadic support, do we have to somehow determine callee's extra_args?
         let callee_fn_abi = self.fn_abi_of_instance(instance, ty::List::empty())?;
@@ -523,7 +527,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
         target: Option<mir::BasicBlock>,
         unwind: mir::UnwindAction,
     ) -> InterpResult<'tcx> {
-        trace!("init_fn_call: {:#?}", fn_val);
+        let _span =
+            enter_trace_span!(M, step::init_fn_call, tracing_separate_thread = Empty, ?fn_val)
+                .or_if_tracing_disabled(|| trace!("init_fn_call: {:#?}", fn_val));
 
         let instance = match fn_val {
             FnVal::Instance(instance) => instance,
diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs
index 21afd082a05..41713457908 100644
--- a/compiler/rustc_const_eval/src/interpret/operand.rs
+++ b/compiler/rustc_const_eval/src/interpret/operand.rs
@@ -13,6 +13,7 @@ use rustc_middle::ty::print::{FmtPrinter, PrettyPrinter};
 use rustc_middle::ty::{ConstInt, ScalarInt, Ty, TyCtxt};
 use rustc_middle::{bug, mir, span_bug, ty};
 use rustc_span::DUMMY_SP;
+use tracing::field::Empty;
 use tracing::trace;
 
 use super::{
@@ -20,6 +21,7 @@ use super::{
     OffsetMode, PlaceTy, Pointer, Projectable, Provenance, Scalar, alloc_range, err_ub,
     from_known_layout, interp_ok, mir_assign_valid_types, throw_ub,
 };
+use crate::enter_trace_span;
 
 /// An `Immediate` represents a single immediate self-contained Rust value.
 ///
@@ -770,6 +772,13 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
         mir_place: mir::Place<'tcx>,
         layout: Option<TyAndLayout<'tcx>>,
     ) -> InterpResult<'tcx, OpTy<'tcx, M::Provenance>> {
+        let _span = enter_trace_span!(
+            M,
+            step::eval_place_to_op,
+            ?mir_place,
+            tracing_separate_thread = Empty
+        );
+
         // Do not use the layout passed in as argument if the base we are looking at
         // here is not the entire place.
         let layout = if mir_place.projection.is_empty() { layout } else { None };
@@ -813,6 +822,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
         mir_op: &mir::Operand<'tcx>,
         layout: Option<TyAndLayout<'tcx>>,
     ) -> InterpResult<'tcx, OpTy<'tcx, M::Provenance>> {
+        let _span =
+            enter_trace_span!(M, step::eval_operand, ?mir_op, tracing_separate_thread = Empty);
+
         use rustc_middle::mir::Operand::*;
         let op = match mir_op {
             // FIXME: do some more logic on `move` to invalidate the old location
diff --git a/compiler/rustc_const_eval/src/interpret/place.rs b/compiler/rustc_const_eval/src/interpret/place.rs
index e2284729efd..45c4edb8503 100644
--- a/compiler/rustc_const_eval/src/interpret/place.rs
+++ b/compiler/rustc_const_eval/src/interpret/place.rs
@@ -9,6 +9,7 @@ use rustc_abi::{BackendRepr, HasDataLayout, Size};
 use rustc_middle::ty::Ty;
 use rustc_middle::ty::layout::TyAndLayout;
 use rustc_middle::{bug, mir, span_bug};
+use tracing::field::Empty;
 use tracing::{instrument, trace};
 
 use super::{
@@ -16,6 +17,7 @@ use super::{
     InterpResult, Machine, MemoryKind, Misalignment, OffsetMode, OpTy, Operand, Pointer,
     Projectable, Provenance, Scalar, alloc_range, interp_ok, mir_assign_valid_types,
 };
+use crate::enter_trace_span;
 
 #[derive(Copy, Clone, Hash, PartialEq, Eq, Debug)]
 /// Information required for the sound usage of a `MemPlace`.
@@ -524,6 +526,9 @@ where
         &self,
         mir_place: mir::Place<'tcx>,
     ) -> InterpResult<'tcx, PlaceTy<'tcx, M::Provenance>> {
+        let _span =
+            enter_trace_span!(M, step::eval_place, ?mir_place, tracing_separate_thread = Empty);
+
         let mut place = self.local_to_place(mir_place.local)?;
         // Using `try_fold` turned out to be bad for performance, hence the loop.
         for elem in mir_place.projection.iter() {
diff --git a/compiler/rustc_const_eval/src/interpret/step.rs b/compiler/rustc_const_eval/src/interpret/step.rs
index 629dcc3523c..9df49c0f4cc 100644
--- a/compiler/rustc_const_eval/src/interpret/step.rs
+++ b/compiler/rustc_const_eval/src/interpret/step.rs
@@ -9,13 +9,15 @@ use rustc_middle::ty::{self, Instance, Ty};
 use rustc_middle::{bug, mir, span_bug};
 use rustc_span::source_map::Spanned;
 use rustc_target::callconv::FnAbi;
+use tracing::field::Empty;
 use tracing::{info, instrument, trace};
 
 use super::{
     FnArg, FnVal, ImmTy, Immediate, InterpCx, InterpResult, Machine, MemPlaceMeta, PlaceTy,
     Projectable, Scalar, interp_ok, throw_ub, throw_unsup_format,
 };
-use crate::util;
+use crate::interpret::EnteredTraceSpan;
+use crate::{enter_trace_span, util};
 
 struct EvaluatedCalleeAndArgs<'tcx, M: Machine<'tcx>> {
     callee: FnVal<'tcx, M::ExtraFnVal>,
@@ -74,7 +76,14 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
     ///
     /// This does NOT move the statement counter forward, the caller has to do that!
     pub fn eval_statement(&mut self, stmt: &mir::Statement<'tcx>) -> InterpResult<'tcx> {
-        info!("{:?}", stmt);
+        let _span = enter_trace_span!(
+            M,
+            step::eval_statement,
+            stmt = ?stmt.kind,
+            span = ?stmt.source_info.span,
+            tracing_separate_thread = Empty,
+        )
+        .or_if_tracing_disabled(|| info!(stmt = ?stmt.kind));
 
         use rustc_middle::mir::StatementKind::*;
 
@@ -456,7 +465,14 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
     }
 
     fn eval_terminator(&mut self, terminator: &mir::Terminator<'tcx>) -> InterpResult<'tcx> {
-        info!("{:?}", terminator.kind);
+        let _span = enter_trace_span!(
+            M,
+            step::eval_terminator,
+            terminator = ?terminator.kind,
+            span = ?terminator.source_info.span,
+            tracing_separate_thread = Empty,
+        )
+        .or_if_tracing_disabled(|| info!(terminator = ?terminator.kind));
 
         use rustc_middle::mir::TerminatorKind::*;
         match terminator.kind {
diff --git a/compiler/rustc_const_eval/src/interpret/util.rs b/compiler/rustc_const_eval/src/interpret/util.rs
index 6696a0c5026..71800950faa 100644
--- a/compiler/rustc_const_eval/src/interpret/util.rs
+++ b/compiler/rustc_const_eval/src/interpret/util.rs
@@ -48,10 +48,24 @@ pub(crate) fn create_static_alloc<'tcx>(
 
 /// A marker trait returned by [crate::interpret::Machine::enter_trace_span], identifying either a
 /// real [tracing::span::EnteredSpan] in case tracing is enabled, or the dummy type `()` when
-/// tracing is disabled.
-pub trait EnteredTraceSpan {}
-impl EnteredTraceSpan for () {}
-impl EnteredTraceSpan for tracing::span::EnteredSpan {}
+/// tracing is disabled. Also see [crate::enter_trace_span!] below.
+pub trait EnteredTraceSpan {
+    /// Allows executing an alternative function when tracing is disabled. Useful for example if you
+    /// want to open a trace span when tracing is enabled, and alternatively just log a line when
+    /// tracing is disabled.
+    fn or_if_tracing_disabled(self, f: impl FnOnce()) -> Self;
+}
+impl EnteredTraceSpan for () {
+    fn or_if_tracing_disabled(self, f: impl FnOnce()) -> Self {
+        f(); // tracing is disabled, execute the function
+        self
+    }
+}
+impl EnteredTraceSpan for tracing::span::EnteredSpan {
+    fn or_if_tracing_disabled(self, _f: impl FnOnce()) -> Self {
+        self // tracing is enabled, don't execute anything
+    }
+}
 
 /// Shortand for calling [crate::interpret::Machine::enter_trace_span] on a [tracing::info_span!].
 /// This is supposed to be compiled out when [crate::interpret::Machine::enter_trace_span] has the
@@ -112,6 +126,19 @@ impl EnteredTraceSpan for tracing::span::EnteredSpan {}
 /// # type M = rustc_const_eval::const_eval::CompileTimeMachine<'static>;
 /// let _span = enter_trace_span!(M, step::eval_statement, tracing_separate_thread = tracing::field::Empty);
 /// ```
+///
+/// ### Executing something else when tracing is disabled
+///
+/// [crate::interpret::Machine::enter_trace_span] returns [EnteredTraceSpan], on which you can call
+/// [EnteredTraceSpan::or_if_tracing_disabled], to e.g. log a line as an alternative to the tracing
+/// span for when tracing is disabled. For example:
+/// ```rust
+/// # use rustc_const_eval::enter_trace_span;
+/// # use rustc_const_eval::interpret::EnteredTraceSpan;
+/// # type M = rustc_const_eval::const_eval::CompileTimeMachine<'static>;
+/// let _span = enter_trace_span!(M, step::eval_statement)
+///     .or_if_tracing_disabled(|| tracing::info!("eval_statement"));
+/// ```
 #[macro_export]
 macro_rules! enter_trace_span {
     ($machine:ty, $name:ident :: $subname:ident $($tt:tt)*) => {
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs
index b1edb5c3044..3b84c6b6110 100644
--- a/compiler/rustc_lint_defs/src/builtin.rs
+++ b/compiler/rustc_lint_defs/src/builtin.rs
@@ -125,6 +125,7 @@ declare_lint_pass! {
         UNSAFE_OP_IN_UNSAFE_FN,
         UNSTABLE_NAME_COLLISIONS,
         UNSTABLE_SYNTAX_PRE_EXPANSION,
+        UNSUPPORTED_CALLING_CONVENTIONS,
         UNUSED_ASSIGNMENTS,
         UNUSED_ASSOCIATED_TYPE_BOUNDS,
         UNUSED_ATTRIBUTES,
diff --git a/compiler/rustc_target/src/spec/targets/hexagon_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/hexagon_unknown_linux_musl.rs
index f7416a7e0fd..1abf0537cda 100644
--- a/compiler/rustc_target/src/spec/targets/hexagon_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/hexagon_unknown_linux_musl.rs
@@ -7,7 +7,6 @@ pub(crate) fn target() -> Target {
     // FIXME: HVX length defaults are per-CPU
     base.features = "-small-data,+hvx-length128b".into();
 
-    base.crt_static_default = false;
     base.has_rpath = true;
     base.linker_flavor = LinkerFlavor::Unix(Cc::Yes);
 
diff --git a/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs b/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs
index f95ce756354..94ecd3590a9 100644
--- a/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs
+++ b/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs
@@ -23,8 +23,6 @@ pub(crate) fn target() -> Target {
             abi: "abi64".into(),
             endian: Endian::Big,
             mcount: "_mcount".into(),
-            // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
-            crt_static_default: true,
             llvm_abiname: "n64".into(),
             ..base
         },
diff --git a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs
index 4dc76f0936c..482b6790dad 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs
@@ -10,8 +10,6 @@ pub(crate) fn target() -> Target {
     base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
     base.max_atomic_width = Some(64);
     base.stack_probes = StackProbeType::Inline;
-    // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
-    base.crt_static_default = true;
     base.abi = "elfv2".into();
     base.llvm_abiname = "elfv2".into();
 
diff --git a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs
index 316b62d941b..f39142d0101 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs
@@ -9,8 +9,6 @@ pub(crate) fn target() -> Target {
     base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32"]);
     base.max_atomic_width = Some(32);
     base.stack_probes = StackProbeType::Inline;
-    // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
-    base.crt_static_default = true;
 
     Target {
         llvm_target: "powerpc-unknown-linux-musl".into(),
diff --git a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs
index 30d0d9cb60a..8ddb45483b3 100644
--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs
+++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs
@@ -9,8 +9,6 @@ pub(crate) fn target() -> Target {
     base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-mspe"]);
     base.max_atomic_width = Some(32);
     base.stack_probes = StackProbeType::Inline;
-    // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
-    base.crt_static_default = true;
 
     Target {
         llvm_target: "powerpc-unknown-linux-muslspe".into(),
diff --git a/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs
index 938b39b10c6..eb592cca1c8 100644
--- a/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs
@@ -23,8 +23,6 @@ pub(crate) fn target() -> Target {
             llvm_abiname: "ilp32d".into(),
             max_atomic_width: Some(32),
             supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
-            // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
-            crt_static_default: true,
             ..base::linux_musl::opts()
         },
     }
diff --git a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs
index e9522ac760e..0cdbb626739 100644
--- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs
@@ -13,8 +13,6 @@ pub(crate) fn target() -> Target {
     base.stack_probes = StackProbeType::Inline;
     base.supported_sanitizers =
         SanitizerSet::ADDRESS | SanitizerSet::LEAK | SanitizerSet::MEMORY | SanitizerSet::THREAD;
-    // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
-    base.crt_static_default = true;
 
     Target {
         llvm_target: "s390x-unknown-linux-musl".into(),
diff --git a/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs b/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs
index 81c502bfead..e026595439f 100644
--- a/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs
+++ b/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs
@@ -27,8 +27,6 @@ pub(crate) fn target() -> Target {
             features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".into(),
             max_atomic_width: Some(64),
             mcount: "\u{1}mcount".into(),
-            // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
-            crt_static_default: true,
             ..base::linux_musl::opts()
         },
     }
diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs
index b4232409ba8..f6653ed899b 100644
--- a/src/bootstrap/src/core/build_steps/check.rs
+++ b/src/bootstrap/src/core/build_steps/check.rs
@@ -13,7 +13,7 @@ use crate::core::builder::{
 };
 use crate::core::config::TargetSelection;
 use crate::utils::build_stamp::{self, BuildStamp};
-use crate::{Compiler, Mode, Subcommand};
+use crate::{CodegenBackendKind, Compiler, Mode, Subcommand};
 
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct Std {
@@ -312,7 +312,7 @@ fn prepare_compiler_for_check(
 pub struct CodegenBackend {
     pub build_compiler: Compiler,
     pub target: TargetSelection,
-    pub backend: &'static str,
+    pub backend: CodegenBackendKind,
 }
 
 impl Step for CodegenBackend {
@@ -327,14 +327,14 @@ impl Step for CodegenBackend {
     fn make_run(run: RunConfig<'_>) {
         // FIXME: only check the backend(s) that were actually selected in run.paths
         let build_compiler = prepare_compiler_for_check(run.builder, run.target, Mode::Codegen);
-        for &backend in &["cranelift", "gcc"] {
+        for backend in [CodegenBackendKind::Cranelift, CodegenBackendKind::Gcc] {
             run.builder.ensure(CodegenBackend { build_compiler, target: run.target, backend });
         }
     }
 
     fn run(self, builder: &Builder<'_>) {
         // FIXME: remove once https://github.com/rust-lang/rust/issues/112393 is resolved
-        if builder.build.config.vendor && self.backend == "gcc" {
+        if builder.build.config.vendor && self.backend.is_gcc() {
             println!("Skipping checking of `rustc_codegen_gcc` with vendoring enabled.");
             return;
         }
@@ -354,19 +354,22 @@ impl Step for CodegenBackend {
 
         cargo
             .arg("--manifest-path")
-            .arg(builder.src.join(format!("compiler/rustc_codegen_{backend}/Cargo.toml")));
+            .arg(builder.src.join(format!("compiler/{}/Cargo.toml", backend.crate_name())));
         rustc_cargo_env(builder, &mut cargo, target);
 
-        let _guard = builder.msg_check(format!("rustc_codegen_{backend}"), target, None);
+        let _guard = builder.msg_check(backend.crate_name(), target, None);
 
-        let stamp = build_stamp::codegen_backend_stamp(builder, build_compiler, target, backend)
+        let stamp = build_stamp::codegen_backend_stamp(builder, build_compiler, target, &backend)
             .with_prefix("check");
 
         run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
     }
 
     fn metadata(&self) -> Option<StepMetadata> {
-        Some(StepMetadata::check(self.backend, self.target).built_by(self.build_compiler))
+        Some(
+            StepMetadata::check(&self.backend.crate_name(), self.target)
+                .built_by(self.build_compiler),
+        )
     }
 }
 
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index 4abfe1843eb..59541bf12de 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -33,7 +33,10 @@ use crate::utils::exec::command;
 use crate::utils::helpers::{
     exe, get_clang_cl_resource_dir, is_debug_info, is_dylib, symlink_dir, t, up_to_date,
 };
-use crate::{CLang, Compiler, DependencyType, FileType, GitRepo, LLVM_TOOLS, Mode, debug, trace};
+use crate::{
+    CLang, CodegenBackendKind, 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)]
@@ -1330,7 +1333,7 @@ pub fn rustc_cargo_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetS
     }
 
     if let Some(backend) = builder.config.default_codegen_backend(target) {
-        cargo.env("CFG_DEFAULT_CODEGEN_BACKEND", backend);
+        cargo.env("CFG_DEFAULT_CODEGEN_BACKEND", backend.name());
     }
 
     let libdir_relative = builder.config.libdir_relative().unwrap_or_else(|| Path::new("lib"));
@@ -1543,7 +1546,7 @@ impl Step for RustcLink {
 pub struct CodegenBackend {
     pub target: TargetSelection,
     pub compiler: Compiler,
-    pub backend: String,
+    pub backend: CodegenBackendKind,
 }
 
 fn needs_codegen_config(run: &RunConfig<'_>) -> bool {
@@ -1568,7 +1571,7 @@ fn is_codegen_cfg_needed(path: &TaskPath, run: &RunConfig<'_>) -> bool {
     if path.contains(CODEGEN_BACKEND_PREFIX) {
         let mut needs_codegen_backend_config = true;
         for backend in run.builder.config.codegen_backends(run.target) {
-            if path.ends_with(&(CODEGEN_BACKEND_PREFIX.to_owned() + backend)) {
+            if path.ends_with(&(CODEGEN_BACKEND_PREFIX.to_owned() + backend.name())) {
                 needs_codegen_backend_config = false;
             }
         }
@@ -1602,7 +1605,7 @@ impl Step for CodegenBackend {
         }
 
         for backend in run.builder.config.codegen_backends(run.target) {
-            if backend == "llvm" {
+            if backend.is_llvm() {
                 continue; // Already built as part of rustc
             }
 
@@ -1663,20 +1666,21 @@ impl Step for CodegenBackend {
         );
         cargo
             .arg("--manifest-path")
-            .arg(builder.src.join(format!("compiler/rustc_codegen_{backend}/Cargo.toml")));
+            .arg(builder.src.join(format!("compiler/{}/Cargo.toml", backend.crate_name())));
         rustc_cargo_env(builder, &mut cargo, target);
 
         // Ideally, we'd have a separate step for the individual codegen backends,
         // like we have in tests (test::CodegenGCC) but that would require a lot of restructuring.
         // If the logic gets more complicated, it should probably be done.
-        if backend == "gcc" {
+        if backend.is_gcc() {
             let gcc = builder.ensure(Gcc { target });
             add_cg_gcc_cargo_flags(&mut cargo, &gcc);
         }
 
         let tmp_stamp = BuildStamp::new(&out_dir).with_prefix("tmp");
 
-        let _guard = builder.msg_build(compiler, format_args!("codegen backend {backend}"), target);
+        let _guard =
+            builder.msg_build(compiler, format_args!("codegen backend {}", backend.name()), target);
         let files = run_cargo(builder, cargo, vec![], &tmp_stamp, vec![], false, false);
         if builder.config.dry_run() {
             return;
@@ -1731,7 +1735,7 @@ fn copy_codegen_backends_to_sysroot(
     }
 
     for backend in builder.config.codegen_backends(target) {
-        if backend == "llvm" {
+        if backend.is_llvm() {
             continue; // Already built as part of rustc
         }
 
@@ -2161,7 +2165,7 @@ impl Step for Assemble {
         let _codegen_backend_span =
             span!(tracing::Level::DEBUG, "building requested codegen backends").entered();
         for backend in builder.config.codegen_backends(target_compiler.host) {
-            if backend == "llvm" {
+            if backend.is_llvm() {
                 debug!("llvm codegen backend is already built as part of rustc");
                 continue; // Already built as part of rustc
             }
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
index c8a54ad250c..4699813abf4 100644
--- a/src/bootstrap/src/core/build_steps/dist.rs
+++ b/src/bootstrap/src/core/build_steps/dist.rs
@@ -32,7 +32,7 @@ use crate::utils::helpers::{
     exe, is_dylib, move_file, t, target_supports_cranelift_backend, timeit,
 };
 use crate::utils::tarball::{GeneratedTarball, OverlayKind, Tarball};
-use crate::{Compiler, DependencyType, FileType, LLVM_TOOLS, Mode, trace};
+use crate::{CodegenBackendKind, Compiler, DependencyType, FileType, LLVM_TOOLS, Mode, trace};
 
 pub fn pkgname(builder: &Builder<'_>, component: &str) -> String {
     format!("{}-{}", component, builder.rust_package_vers())
@@ -1372,10 +1372,10 @@ impl Step for Miri {
     }
 }
 
-#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]
+#[derive(Debug, Clone, Hash, PartialEq, Eq)]
 pub struct CodegenBackend {
     pub compiler: Compiler,
-    pub backend: String,
+    pub backend: CodegenBackendKind,
 }
 
 impl Step for CodegenBackend {
@@ -1389,7 +1389,7 @@ impl Step for CodegenBackend {
 
     fn make_run(run: RunConfig<'_>) {
         for backend in run.builder.config.codegen_backends(run.target) {
-            if backend == "llvm" {
+            if backend.is_llvm() {
                 continue; // Already built as part of rustc
             }
 
@@ -1412,12 +1412,11 @@ impl Step for CodegenBackend {
             return None;
         }
 
-        if !builder.config.codegen_backends(self.compiler.host).contains(&self.backend.to_string())
-        {
+        if !builder.config.codegen_backends(self.compiler.host).contains(&self.backend) {
             return None;
         }
 
-        if self.backend == "cranelift" && !target_supports_cranelift_backend(self.compiler.host) {
+        if self.backend.is_cranelift() && !target_supports_cranelift_backend(self.compiler.host) {
             builder.info("target not supported by rustc_codegen_cranelift. skipping");
             return None;
         }
@@ -1425,15 +1424,18 @@ impl Step for CodegenBackend {
         let compiler = self.compiler;
         let backend = self.backend;
 
-        let mut tarball =
-            Tarball::new(builder, &format!("rustc-codegen-{backend}"), &compiler.host.triple);
-        if backend == "cranelift" {
+        let mut tarball = Tarball::new(
+            builder,
+            &format!("rustc-codegen-{}", backend.name()),
+            &compiler.host.triple,
+        );
+        if backend.is_cranelift() {
             tarball.set_overlay(OverlayKind::RustcCodegenCranelift);
         } else {
-            panic!("Unknown backend rustc_codegen_{backend}");
+            panic!("Unknown codegen backend {}", backend.name());
         }
         tarball.is_preview(true);
-        tarball.add_legal_and_readme_to(format!("share/doc/rustc_codegen_{backend}"));
+        tarball.add_legal_and_readme_to(format!("share/doc/{}", backend.crate_name()));
 
         let src = builder.sysroot(compiler);
         let backends_src = builder.sysroot_codegen_backends(compiler);
@@ -1445,7 +1447,7 @@ impl Step for CodegenBackend {
         // Don't use custom libdir here because ^lib/ will be resolved again with installer
         let backends_dst = PathBuf::from("lib").join(backends_rel);
 
-        let backend_name = format!("rustc_codegen_{backend}");
+        let backend_name = backend.crate_name();
         let mut found_backend = false;
         for backend in fs::read_dir(&backends_src).unwrap() {
             let file_name = backend.unwrap().file_name();
@@ -1575,7 +1577,7 @@ impl Step for Extended {
         add_component!("analysis" => Analysis { compiler, target });
         add_component!("rustc-codegen-cranelift" => CodegenBackend {
             compiler: builder.compiler(stage, target),
-            backend: "cranelift".to_string(),
+            backend: CodegenBackendKind::Cranelift,
         });
         add_component!("llvm-bitcode-linker" => LlvmBitcodeLinker {
             build_compiler: compiler,
diff --git a/src/bootstrap/src/core/build_steps/install.rs b/src/bootstrap/src/core/build_steps/install.rs
index 4156b49a8b3..4513a138e19 100644
--- a/src/bootstrap/src/core/build_steps/install.rs
+++ b/src/bootstrap/src/core/build_steps/install.rs
@@ -12,7 +12,7 @@ use crate::core::config::{Config, TargetSelection};
 use crate::utils::exec::command;
 use crate::utils::helpers::t;
 use crate::utils::tarball::GeneratedTarball;
-use crate::{Compiler, Kind};
+use crate::{CodegenBackendKind, Compiler, Kind};
 
 #[cfg(target_os = "illumos")]
 const SHELL: &str = "bash";
@@ -276,7 +276,7 @@ install!((self, builder, _config),
     RustcCodegenCranelift, alias = "rustc-codegen-cranelift", Self::should_build(_config), only_hosts: true, {
         if let Some(tarball) = builder.ensure(dist::CodegenBackend {
             compiler: self.compiler,
-            backend: "cranelift".to_string(),
+            backend: CodegenBackendKind::Cranelift,
         }) {
             install_sh(builder, "rustc-codegen-cranelift", self.compiler.stage, Some(self.target), &tarball);
         } else {
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
index 951ca73fcc4..119fa4237bc 100644
--- a/src/bootstrap/src/core/build_steps/test.rs
+++ b/src/bootstrap/src/core/build_steps/test.rs
@@ -33,7 +33,7 @@ use crate::utils::helpers::{
     linker_flags, t, target_supports_cranelift_backend, up_to_date,
 };
 use crate::utils::render_tests::{add_flags_and_try_run_tests, try_run_tests};
-use crate::{CLang, DocTests, GitRepo, Mode, PathSet, debug, envify};
+use crate::{CLang, CodegenBackendKind, DocTests, GitRepo, Mode, PathSet, debug, envify};
 
 const ADB_TEST_DIR: &str = "/data/local/tmp/work";
 
@@ -1786,7 +1786,9 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
         cmd.arg("--llvm-filecheck").arg(builder.llvm_filecheck(builder.config.host_target));
 
         if let Some(codegen_backend) = builder.config.default_codegen_backend(compiler.host) {
-            cmd.arg("--codegen-backend").arg(&codegen_backend);
+            // Tells compiletest which codegen backend is used by default by the compiler.
+            // It is used to e.g. ignore tests that don't support that codegen backend.
+            cmd.arg("--codegen-backend").arg(codegen_backend.name());
         }
 
         if builder.build.config.llvm_enzyme {
@@ -3406,7 +3408,7 @@ impl Step for CodegenCranelift {
             return;
         }
 
-        if !builder.config.codegen_backends(run.target).contains(&"cranelift".to_owned()) {
+        if !builder.config.codegen_backends(run.target).contains(&CodegenBackendKind::Cranelift) {
             builder.info("cranelift not in rust.codegen-backends. skipping");
             return;
         }
@@ -3533,7 +3535,7 @@ impl Step for CodegenGCC {
             return;
         }
 
-        if !builder.config.codegen_backends(run.target).contains(&"gcc".to_owned()) {
+        if !builder.config.codegen_backends(run.target).contains(&CodegenBackendKind::Gcc) {
             builder.info("gcc not in rust.codegen-backends. skipping");
             return;
         }
diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
index badd5f24dba..6b3236ef47e 100644
--- a/src/bootstrap/src/core/builder/cargo.rs
+++ b/src/bootstrap/src/core/builder/cargo.rs
@@ -1286,7 +1286,7 @@ impl Builder<'_> {
 
             if let Some(limit) = limit
                 && (build_compiler_stage == 0
-                    || self.config.default_codegen_backend(target).unwrap_or_default() == "llvm")
+                    || self.config.default_codegen_backend(target).unwrap_or_default().is_llvm())
             {
                 rustflags.arg(&format!("-Cllvm-args=-import-instr-limit={limit}"));
             }
diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs
index 020622d1c12..96289a63785 100644
--- a/src/bootstrap/src/core/builder/mod.rs
+++ b/src/bootstrap/src/core/builder/mod.rs
@@ -141,7 +141,7 @@ pub trait Step: 'static + Clone + Debug + PartialEq + Eq + Hash {
 #[allow(unused)]
 #[derive(Debug, PartialEq, Eq)]
 pub struct StepMetadata {
-    name: &'static str,
+    name: String,
     kind: Kind,
     target: TargetSelection,
     built_by: Option<Compiler>,
@@ -151,28 +151,28 @@ pub struct StepMetadata {
 }
 
 impl StepMetadata {
-    pub fn build(name: &'static str, target: TargetSelection) -> Self {
+    pub fn build(name: &str, target: TargetSelection) -> Self {
         Self::new(name, target, Kind::Build)
     }
 
-    pub fn check(name: &'static str, target: TargetSelection) -> Self {
+    pub fn check(name: &str, target: TargetSelection) -> Self {
         Self::new(name, target, Kind::Check)
     }
 
-    pub fn doc(name: &'static str, target: TargetSelection) -> Self {
+    pub fn doc(name: &str, target: TargetSelection) -> Self {
         Self::new(name, target, Kind::Doc)
     }
 
-    pub fn dist(name: &'static str, target: TargetSelection) -> Self {
+    pub fn dist(name: &str, target: TargetSelection) -> Self {
         Self::new(name, target, Kind::Dist)
     }
 
-    pub fn test(name: &'static str, target: TargetSelection) -> Self {
+    pub fn test(name: &str, target: TargetSelection) -> Self {
         Self::new(name, target, Kind::Test)
     }
 
-    fn new(name: &'static str, target: TargetSelection, kind: Kind) -> Self {
-        Self { name, kind, target, built_by: None, stage: None, metadata: None }
+    fn new(name: &str, target: TargetSelection, kind: Kind) -> Self {
+        Self { name: name.to_string(), kind, target, built_by: None, stage: None, metadata: None }
     }
 
     pub fn built_by(mut self, compiler: Compiler) -> Self {
diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs
index c707294bd8d..f012645b7ef 100644
--- a/src/bootstrap/src/core/builder/tests.rs
+++ b/src/bootstrap/src/core/builder/tests.rs
@@ -1309,8 +1309,8 @@ mod snapshot {
                 .path("compiler")
                 .render_steps(), @r"
         [check] rustc 0 <host> -> rustc 1 <host>
-        [check] rustc 0 <host> -> cranelift 1 <host>
-        [check] rustc 0 <host> -> gcc 1 <host>
+        [check] rustc 0 <host> -> rustc_codegen_cranelift 1 <host>
+        [check] rustc 0 <host> -> rustc_codegen_gcc 1 <host>
         ");
     }
 
@@ -1341,8 +1341,8 @@ mod snapshot {
                 .stage(1)
                 .render_steps(), @r"
         [check] rustc 0 <host> -> rustc 1 <host>
-        [check] rustc 0 <host> -> cranelift 1 <host>
-        [check] rustc 0 <host> -> gcc 1 <host>
+        [check] rustc 0 <host> -> rustc_codegen_cranelift 1 <host>
+        [check] rustc 0 <host> -> rustc_codegen_gcc 1 <host>
         ");
     }
 
@@ -1358,8 +1358,8 @@ mod snapshot {
         [build] rustc 0 <host> -> rustc 1 <host>
         [build] rustc 1 <host> -> std 1 <host>
         [check] rustc 1 <host> -> rustc 2 <host>
-        [check] rustc 1 <host> -> cranelift 2 <host>
-        [check] rustc 1 <host> -> gcc 2 <host>
+        [check] rustc 1 <host> -> rustc_codegen_cranelift 2 <host>
+        [check] rustc 1 <host> -> rustc_codegen_gcc 2 <host>
         ");
     }
 
@@ -1377,8 +1377,8 @@ mod snapshot {
         [build] rustc 1 <host> -> std 1 <target1>
         [check] rustc 1 <host> -> rustc 2 <target1>
         [check] rustc 1 <host> -> Rustdoc 2 <target1>
-        [check] rustc 1 <host> -> cranelift 2 <target1>
-        [check] rustc 1 <host> -> gcc 2 <target1>
+        [check] rustc 1 <host> -> rustc_codegen_cranelift 2 <target1>
+        [check] rustc 1 <host> -> rustc_codegen_gcc 2 <target1>
         [check] rustc 1 <host> -> Clippy 2 <target1>
         [check] rustc 1 <host> -> Miri 2 <target1>
         [check] rustc 1 <host> -> CargoMiri 2 <target1>
@@ -1472,8 +1472,8 @@ mod snapshot {
                 .args(&args)
                 .render_steps(), @r"
         [check] rustc 0 <host> -> rustc 1 <host>
-        [check] rustc 0 <host> -> cranelift 1 <host>
-        [check] rustc 0 <host> -> gcc 1 <host>
+        [check] rustc 0 <host> -> rustc_codegen_cranelift 1 <host>
+        [check] rustc 0 <host> -> rustc_codegen_gcc 1 <host>
         ");
     }
 
@@ -1557,8 +1557,8 @@ mod snapshot {
                 .path("rustc_codegen_cranelift")
                 .render_steps(), @r"
         [check] rustc 0 <host> -> rustc 1 <host>
-        [check] rustc 0 <host> -> cranelift 1 <host>
-        [check] rustc 0 <host> -> gcc 1 <host>
+        [check] rustc 0 <host> -> rustc_codegen_cranelift 1 <host>
+        [check] rustc 0 <host> -> rustc_codegen_gcc 1 <host>
         ");
     }
 
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 78abdd7f9b8..6055876c475 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -51,7 +51,7 @@ use crate::core::download::{
 use crate::utils::channel;
 use crate::utils::exec::{ExecutionContext, command};
 use crate::utils::helpers::{exe, get_host_target};
-use crate::{GitInfo, OnceLock, TargetSelection, check_ci_llvm, helpers, t};
+use crate::{CodegenBackendKind, GitInfo, OnceLock, TargetSelection, check_ci_llvm, helpers, t};
 
 /// Each path in this list is considered "allowed" in the `download-rustc="if-unchanged"` logic.
 /// This means they can be modified and changes to these paths should never trigger a compiler build
@@ -208,7 +208,7 @@ pub struct Config {
     pub rustc_default_linker: Option<String>,
     pub rust_optimize_tests: bool,
     pub rust_dist_src: bool,
-    pub rust_codegen_backends: Vec<String>,
+    pub rust_codegen_backends: Vec<CodegenBackendKind>,
     pub rust_verify_llvm_ir: bool,
     pub rust_thin_lto_import_instr_limit: Option<u32>,
     pub rust_randomize_layout: bool,
@@ -350,7 +350,7 @@ impl Config {
             channel: "dev".to_string(),
             codegen_tests: true,
             rust_dist_src: true,
-            rust_codegen_backends: vec!["llvm".to_owned()],
+            rust_codegen_backends: vec![CodegenBackendKind::Llvm],
             deny_warnings: true,
             bindir: "bin".into(),
             dist_include_mingw_linker: true,
@@ -1747,7 +1747,7 @@ impl Config {
             .unwrap_or(self.profiler)
     }
 
-    pub fn codegen_backends(&self, target: TargetSelection) -> &[String] {
+    pub fn codegen_backends(&self, target: TargetSelection) -> &[CodegenBackendKind] {
         self.target_config
             .get(&target)
             .and_then(|cfg| cfg.codegen_backends.as_deref())
@@ -1758,7 +1758,7 @@ impl Config {
         self.target_config.get(&target).and_then(|cfg| cfg.jemalloc).unwrap_or(self.jemalloc)
     }
 
-    pub fn default_codegen_backend(&self, target: TargetSelection) -> Option<String> {
+    pub fn default_codegen_backend(&self, target: TargetSelection) -> Option<CodegenBackendKind> {
         self.codegen_backends(target).first().cloned()
     }
 
@@ -1774,7 +1774,7 @@ impl Config {
     }
 
     pub fn llvm_enabled(&self, target: TargetSelection) -> bool {
-        self.codegen_backends(target).contains(&"llvm".to_owned())
+        self.codegen_backends(target).contains(&CodegenBackendKind::Llvm)
     }
 
     pub fn llvm_libunwind(&self, target: TargetSelection) -> LlvmLibunwind {
diff --git a/src/bootstrap/src/core/config/toml/rust.rs b/src/bootstrap/src/core/config/toml/rust.rs
index c136bd4a6f9..03da993a17d 100644
--- a/src/bootstrap/src/core/config/toml/rust.rs
+++ b/src/bootstrap/src/core/config/toml/rust.rs
@@ -11,7 +11,9 @@ use crate::core::config::{
     DebuginfoLevel, Merge, ReplaceOpt, RustcLto, StringOrBool, set, threads_from_config,
 };
 use crate::flags::Warnings;
-use crate::{BTreeSet, Config, HashSet, PathBuf, TargetSelection, define_config, exit};
+use crate::{
+    BTreeSet, CodegenBackendKind, Config, HashSet, PathBuf, TargetSelection, define_config, exit,
+};
 
 define_config! {
     /// TOML representation of how the Rust build is configured.
@@ -389,9 +391,13 @@ pub fn check_incompatible_options_for_ci_rustc(
     Ok(())
 }
 
-pub(crate) const VALID_CODEGEN_BACKENDS: &[&str] = &["llvm", "cranelift", "gcc"];
+pub(crate) const BUILTIN_CODEGEN_BACKENDS: &[&str] = &["llvm", "cranelift", "gcc"];
 
-pub(crate) fn validate_codegen_backends(backends: Vec<String>, section: &str) -> Vec<String> {
+pub(crate) fn parse_codegen_backends(
+    backends: Vec<String>,
+    section: &str,
+) -> Vec<CodegenBackendKind> {
+    let mut found_backends = vec![];
     for backend in &backends {
         if let Some(stripped) = backend.strip_prefix(CODEGEN_BACKEND_PREFIX) {
             panic!(
@@ -400,14 +406,21 @@ pub(crate) fn validate_codegen_backends(backends: Vec<String>, section: &str) ->
                 Please, use '{stripped}' instead."
             )
         }
-        if !VALID_CODEGEN_BACKENDS.contains(&backend.as_str()) {
+        if !BUILTIN_CODEGEN_BACKENDS.contains(&backend.as_str()) {
             println!(
                 "HELP: '{backend}' for '{section}.codegen-backends' might fail. \
-                List of known good values: {VALID_CODEGEN_BACKENDS:?}"
+                List of known codegen backends: {BUILTIN_CODEGEN_BACKENDS:?}"
             );
         }
+        let backend = match backend.as_str() {
+            "llvm" => CodegenBackendKind::Llvm,
+            "cranelift" => CodegenBackendKind::Cranelift,
+            "gcc" => CodegenBackendKind::Gcc,
+            backend => CodegenBackendKind::Custom(backend.to_string()),
+        };
+        found_backends.push(backend);
     }
-    backends
+    found_backends
 }
 
 #[cfg(not(test))]
@@ -609,7 +622,7 @@ impl Config {
                 llvm_libunwind.map(|v| v.parse().expect("failed to parse rust.llvm-libunwind"));
             set(
                 &mut self.rust_codegen_backends,
-                codegen_backends.map(|backends| validate_codegen_backends(backends, "rust")),
+                codegen_backends.map(|backends| parse_codegen_backends(backends, "rust")),
             );
 
             self.rust_codegen_units = codegen_units.map(threads_from_config);
diff --git a/src/bootstrap/src/core/config/toml/target.rs b/src/bootstrap/src/core/config/toml/target.rs
index 337276948b3..9dedadff3a1 100644
--- a/src/bootstrap/src/core/config/toml/target.rs
+++ b/src/bootstrap/src/core/config/toml/target.rs
@@ -16,9 +16,9 @@ use std::collections::HashMap;
 
 use serde::{Deserialize, Deserializer};
 
-use crate::core::config::toml::rust::validate_codegen_backends;
+use crate::core::config::toml::rust::parse_codegen_backends;
 use crate::core::config::{LlvmLibunwind, Merge, ReplaceOpt, SplitDebuginfo, StringOrBool};
-use crate::{Config, HashSet, PathBuf, TargetSelection, define_config, exit};
+use crate::{CodegenBackendKind, Config, HashSet, PathBuf, TargetSelection, define_config, exit};
 
 define_config! {
     /// TOML representation of how each build target is configured.
@@ -76,7 +76,7 @@ pub struct Target {
     pub qemu_rootfs: Option<PathBuf>,
     pub runner: Option<String>,
     pub no_std: bool,
-    pub codegen_backends: Option<Vec<String>>,
+    pub codegen_backends: Option<Vec<CodegenBackendKind>>,
     pub optimized_compiler_builtins: Option<bool>,
     pub jemalloc: Option<bool>,
 }
@@ -144,7 +144,7 @@ impl Config {
                 target.jemalloc = cfg.jemalloc;
                 if let Some(backends) = cfg.codegen_backends {
                     target.codegen_backends =
-                        Some(validate_codegen_backends(backends, &format!("target.{triple}")))
+                        Some(parse_codegen_backends(backends, &format!("target.{triple}")))
                 }
 
                 target.split_debuginfo = cfg.split_debuginfo.as_ref().map(|v| {
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index 51a84ad5272..011b52df97b 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -123,6 +123,46 @@ impl PartialEq for Compiler {
     }
 }
 
+/// Represents a codegen backend.
+#[derive(Debug, Clone, PartialEq, Eq, Hash, Default)]
+pub enum CodegenBackendKind {
+    #[default]
+    Llvm,
+    Cranelift,
+    Gcc,
+    Custom(String),
+}
+
+impl CodegenBackendKind {
+    /// Name of the codegen backend, as identified in the `compiler` directory
+    /// (`rustc_codegen_<name>`).
+    pub fn name(&self) -> &str {
+        match self {
+            CodegenBackendKind::Llvm => "llvm",
+            CodegenBackendKind::Cranelift => "cranelift",
+            CodegenBackendKind::Gcc => "gcc",
+            CodegenBackendKind::Custom(name) => name,
+        }
+    }
+
+    /// Name of the codegen backend's crate, e.g. `rustc_codegen_cranelift`.
+    pub fn crate_name(&self) -> String {
+        format!("rustc_codegen_{}", self.name())
+    }
+
+    pub fn is_llvm(&self) -> bool {
+        matches!(self, Self::Llvm)
+    }
+
+    pub fn is_cranelift(&self) -> bool {
+        matches!(self, Self::Cranelift)
+    }
+
+    pub fn is_gcc(&self) -> bool {
+        matches!(self, Self::Gcc)
+    }
+}
+
 #[derive(PartialEq, Eq, Copy, Clone, Debug)]
 pub enum DocTests {
     /// Run normal tests and doc tests (default).
diff --git a/src/bootstrap/src/utils/build_stamp.rs b/src/bootstrap/src/utils/build_stamp.rs
index f43d860893f..bd4eb790ae5 100644
--- a/src/bootstrap/src/utils/build_stamp.rs
+++ b/src/bootstrap/src/utils/build_stamp.rs
@@ -10,7 +10,7 @@ use sha2::digest::Digest;
 use crate::core::builder::Builder;
 use crate::core::config::TargetSelection;
 use crate::utils::helpers::{hex_encode, mtime};
-use crate::{Compiler, Mode, helpers, t};
+use crate::{CodegenBackendKind, Compiler, Mode, helpers, t};
 
 #[cfg(test)]
 mod tests;
@@ -129,10 +129,10 @@ pub fn codegen_backend_stamp(
     builder: &Builder<'_>,
     compiler: Compiler,
     target: TargetSelection,
-    backend: &str,
+    backend: &CodegenBackendKind,
 ) -> BuildStamp {
     BuildStamp::new(&builder.cargo_out(compiler, Mode::Codegen, target))
-        .with_prefix(&format!("librustc_codegen_{backend}"))
+        .with_prefix(&format!("lib{}", backend.crate_name()))
 }
 
 /// Cargo's output path for the standard library in a given stage, compiled
diff --git a/tests/ui/issues/issue-13264.rs b/tests/ui/autoref-autoderef/deref-chain-method-calls-13264.rs
index bf4ec388c4f..f471c1c7eef 100644
--- a/tests/ui/issues/issue-13264.rs
+++ b/tests/ui/autoref-autoderef/deref-chain-method-calls-13264.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13264
+
 //@ run-pass
 #![allow(non_camel_case_types)]
 #![allow(non_snake_case)]
diff --git a/tests/ui/issues/issue-11709.rs b/tests/ui/block-result/blocks-without-results-11709.rs
index 8a11074eca8..97ea6f9e19e 100644
--- a/tests/ui/issues/issue-11709.rs
+++ b/tests/ui/block-result/blocks-without-results-11709.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/11709
+
 //@ run-pass
 #![allow(dead_code)]
 
diff --git a/tests/ui/issues/issue-12041.rs b/tests/ui/borrowck/moved-value-in-thread-loop-12041.rs
index 091e8fe8b2a..98f9cdbdef7 100644
--- a/tests/ui/issues/issue-12041.rs
+++ b/tests/ui/borrowck/moved-value-in-thread-loop-12041.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/12041
+
 use std::sync::mpsc::channel;
 use std::thread;
 
diff --git a/tests/ui/issues/issue-12041.stderr b/tests/ui/borrowck/moved-value-in-thread-loop-12041.stderr
index f2c10b83383..627dd193dad 100644
--- a/tests/ui/issues/issue-12041.stderr
+++ b/tests/ui/borrowck/moved-value-in-thread-loop-12041.stderr
@@ -1,5 +1,5 @@
 error[E0382]: use of moved value: `tx`
-  --> $DIR/issue-12041.rs:8:22
+  --> $DIR/moved-value-in-thread-loop-12041.rs:10:22
    |
 LL |             let tx = tx;
    |                      ^^ value moved here, in previous iteration of loop
diff --git a/tests/ui/issues/issue-12033.rs b/tests/ui/borrowck/refcell-borrow-comparison-12033.rs
index 0bf6490bafe..de22cedd5b9 100644
--- a/tests/ui/issues/issue-12033.rs
+++ b/tests/ui/borrowck/refcell-borrow-comparison-12033.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/12033
+
 //@ run-pass
 use std::cell::RefCell;
 
diff --git a/tests/ui/issues/issue-11869.rs b/tests/ui/borrowck/string-literal-match-patterns-11869.rs
index dd752227bbe..4c159e457cf 100644
--- a/tests/ui/issues/issue-11869.rs
+++ b/tests/ui/borrowck/string-literal-match-patterns-11869.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/11869
+
 //@ check-pass
 #![allow(dead_code)]
 
diff --git a/tests/ui/issues/issue-12127.rs b/tests/ui/closures/fnonce-moved-twice-12127.rs
index 199d542e816..369ddcafaab 100644
--- a/tests/ui/issues/issue-12127.rs
+++ b/tests/ui/closures/fnonce-moved-twice-12127.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/12127
+
 #![feature(unboxed_closures, tuple_trait)]
 
 fn to_fn_once<A:std::marker::Tuple,F:FnOnce<A>>(f: F) -> F { f }
diff --git a/tests/ui/issues/issue-12127.stderr b/tests/ui/closures/fnonce-moved-twice-12127.stderr
index 2a6233547ee..c2e12827527 100644
--- a/tests/ui/issues/issue-12127.stderr
+++ b/tests/ui/closures/fnonce-moved-twice-12127.stderr
@@ -1,5 +1,5 @@
 error[E0382]: use of moved value: `f`
-  --> $DIR/issue-12127.rs:11:9
+  --> $DIR/fnonce-moved-twice-12127.rs:13:9
    |
 LL |         f();
    |         --- `f` moved due to this call
@@ -7,11 +7,11 @@ LL |         f();
    |         ^ value used here after move
    |
 note: this value implements `FnOnce`, which causes it to be moved when called
-  --> $DIR/issue-12127.rs:10:9
+  --> $DIR/fnonce-moved-twice-12127.rs:12:9
    |
 LL |         f();
    |         ^
-   = note: move occurs because `f` has type `{closure@$DIR/issue-12127.rs:8:24: 8:30}`, which does not implement the `Copy` trait
+   = note: move occurs because `f` has type `{closure@$DIR/fnonce-moved-twice-12127.rs:10:24: 10:30}`, which does not implement the `Copy` trait
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/issues/issue-11958.rs b/tests/ui/closures/moved-upvar-mut-rebind-11958.rs
index 9185c5158af..701dc1a2cef 100644
--- a/tests/ui/issues/issue-11958.rs
+++ b/tests/ui/closures/moved-upvar-mut-rebind-11958.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/11958
+
 //@ run-pass
 
 // We shouldn't need to rebind a moved upvar as mut if it's already
diff --git a/tests/ui/issues/issue-11958.stderr b/tests/ui/closures/moved-upvar-mut-rebind-11958.stderr
index 5dca4c2f01d..b12bbcad925 100644
--- a/tests/ui/issues/issue-11958.stderr
+++ b/tests/ui/closures/moved-upvar-mut-rebind-11958.stderr
@@ -1,5 +1,5 @@
 warning: value assigned to `x` is never read
-  --> $DIR/issue-11958.rs:8:36
+  --> $DIR/moved-upvar-mut-rebind-11958.rs:10:36
    |
 LL |     let _thunk = Box::new(move|| { x = 2; });
    |                                    ^
@@ -8,7 +8,7 @@ LL |     let _thunk = Box::new(move|| { x = 2; });
    = note: `#[warn(unused_assignments)]` on by default
 
 warning: unused variable: `x`
-  --> $DIR/issue-11958.rs:8:36
+  --> $DIR/moved-upvar-mut-rebind-11958.rs:10:36
    |
 LL |     let _thunk = Box::new(move|| { x = 2; });
    |                                    ^
diff --git a/tests/ui/issues/issue-12744.rs b/tests/ui/coercion/any-trait-object-debug-12744.rs
index eaf92d413d5..4d981c077ee 100644
--- a/tests/ui/issues/issue-12744.rs
+++ b/tests/ui/coercion/any-trait-object-debug-12744.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/12744
+
 //@ run-pass
 fn main() {
     fn test() -> Box<dyn std::any::Any + 'static> { Box::new(1) }
diff --git a/tests/ui/issues/issue-12860.rs b/tests/ui/collections/hashset-connected-border-12860.rs
index 255f6670793..40185bef7c8 100644
--- a/tests/ui/issues/issue-12860.rs
+++ b/tests/ui/collections/hashset-connected-border-12860.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/12860
+
 //@ run-pass
 use std::collections::HashSet;
 
diff --git a/tests/ui/issues/issue-13446.rs b/tests/ui/const-generics/vec-macro-in-static-array.rs
index 9f1fc42774f..7a81836e255 100644
--- a/tests/ui/issues/issue-13446.rs
+++ b/tests/ui/const-generics/vec-macro-in-static-array.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13446
+
 // Used to cause ICE
 
 static VEC: [u32; 256] = vec![];
diff --git a/tests/ui/issues/issue-13446.stderr b/tests/ui/const-generics/vec-macro-in-static-array.stderr
index 28c459e6e62..de21f2274f3 100644
--- a/tests/ui/issues/issue-13446.stderr
+++ b/tests/ui/const-generics/vec-macro-in-static-array.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-13446.rs:3:26
+  --> $DIR/vec-macro-in-static-array.rs:5:26
    |
 LL | static VEC: [u32; 256] = vec![];
    |                          ^^^^^^ expected `[u32; 256]`, found `Vec<_>`
diff --git a/tests/ui/extern/windows-tcb-trash-13259.rs b/tests/ui/extern/windows-tcb-trash-13259.rs
new file mode 100644
index 00000000000..0852e31251a
--- /dev/null
+++ b/tests/ui/extern/windows-tcb-trash-13259.rs
@@ -0,0 +1,49 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13259
+
+//@ run-pass
+
+#[cfg(windows)]
+mod imp {
+    type LPVOID = *mut u8;
+    type DWORD = u32;
+    type LPWSTR = *mut u16;
+
+    extern "system" {
+        fn FormatMessageW(
+            flags: DWORD,
+            lpSrc: LPVOID,
+            msgId: DWORD,
+            langId: DWORD,
+            buf: LPWSTR,
+            nsize: DWORD,
+            args: *const u8,
+        ) -> DWORD;
+    }
+
+    pub fn test() {
+        let mut buf: [u16; 50] = [0; 50];
+        let ret = unsafe {
+            FormatMessageW(
+                0x1000,
+                core::ptr::null_mut(),
+                1,
+                0x400,
+                buf.as_mut_ptr(),
+                buf.len() as u32,
+                core::ptr::null(),
+            )
+        };
+        // On some 32-bit Windowses (Win7-8 at least) this will panic with segmented
+        // stacks taking control of pvArbitrary
+        assert!(ret != 0);
+    }
+}
+
+#[cfg(not(windows))]
+mod imp {
+    pub fn test() {}
+}
+
+fn main() {
+    imp::test()
+}
diff --git a/tests/ui/issues/issue-13105.rs b/tests/ui/fn/anonymous-parameters-trait-13105.rs
index d119aa9c788..171dab15fe7 100644
--- a/tests/ui/issues/issue-13105.rs
+++ b/tests/ui/fn/anonymous-parameters-trait-13105.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13105
+
 //@ edition: 2015
 //@ check-pass
 
diff --git a/tests/ui/issues/issue-13259-windows-tcb-trash.rs b/tests/ui/issues/issue-13259-windows-tcb-trash.rs
deleted file mode 100644
index 381e3f15259..00000000000
--- a/tests/ui/issues/issue-13259-windows-tcb-trash.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-//@ run-pass
-
-#[cfg(windows)]
-mod imp {
-    type LPVOID = *mut u8;
-    type DWORD = u32;
-    type LPWSTR = *mut u16;
-
-    extern "system" {
-        fn FormatMessageW(flags: DWORD,
-                          lpSrc: LPVOID,
-                          msgId: DWORD,
-                          langId: DWORD,
-                          buf: LPWSTR,
-                          nsize: DWORD,
-                          args: *const u8)
-                          -> DWORD;
-    }
-
-    pub fn test() {
-        let mut buf: [u16; 50] = [0; 50];
-        let ret = unsafe {
-            FormatMessageW(0x1000, core::ptr::null_mut(), 1, 0x400,
-                           buf.as_mut_ptr(), buf.len() as u32, core::ptr::null())
-        };
-        // On some 32-bit Windowses (Win7-8 at least) this will panic with segmented
-        // stacks taking control of pvArbitrary
-        assert!(ret != 0);
-    }
-}
-
-#[cfg(not(windows))]
-mod imp {
-    pub fn test() { }
-}
-
-fn main() {
-    imp::test()
-}
diff --git a/tests/ui/issues/issue-12677.rs b/tests/ui/iterators/bytes-iterator-clone-12677.rs
index dbc2dbc8527..cfbb85a3ecb 100644
--- a/tests/ui/issues/issue-12677.rs
+++ b/tests/ui/iterators/bytes-iterator-clone-12677.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/12677
+
 //@ run-pass
 
 fn main() {
diff --git a/tests/ui/issues/issue-13058.rs b/tests/ui/lifetimes/iterator-trait-lifetime-error-13058.rs
index a5806feb720..6cfe440b43d 100644
--- a/tests/ui/issues/issue-13058.rs
+++ b/tests/ui/lifetimes/iterator-trait-lifetime-error-13058.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13058
+
 use std::ops::Range;
 
 trait Itble<'r, T, I: Iterator<Item=T>> { fn iter(&'r self) -> I; }
diff --git a/tests/ui/issues/issue-13058.stderr b/tests/ui/lifetimes/iterator-trait-lifetime-error-13058.stderr
index 4f4108fa182..e6564e36b21 100644
--- a/tests/ui/issues/issue-13058.stderr
+++ b/tests/ui/lifetimes/iterator-trait-lifetime-error-13058.stderr
@@ -1,5 +1,5 @@
 error[E0621]: explicit lifetime required in the type of `cont`
-  --> $DIR/issue-13058.rs:14:21
+  --> $DIR/iterator-trait-lifetime-error-13058.rs:16:21
    |
 LL |     let cont_iter = cont.iter();
    |                     ^^^^^^^^^^^ lifetime `'r` required
diff --git a/tests/ui/issues/issue-13167.rs b/tests/ui/lifetimes/lifetime-inference-destructuring-arg.rs
index 5f733e85948..7a019a71d75 100644
--- a/tests/ui/issues/issue-13167.rs
+++ b/tests/ui/lifetimes/lifetime-inference-destructuring-arg.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13167
+
 //@ check-pass
 //@ revisions: current next
 //@ ignore-compare-mode-next-solver (explicit revisions)
diff --git a/tests/ui/issues/issue-13323.rs b/tests/ui/lifetimes/matcher-trait-equality-13323.rs
index 8f334404f9a..efd56294b39 100644
--- a/tests/ui/issues/issue-13323.rs
+++ b/tests/ui/lifetimes/matcher-trait-equality-13323.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13323
+
 //@ run-pass
 
 struct StrWrap {
diff --git a/tests/ui/issues/issue-13405.rs b/tests/ui/lifetimes/struct-lifetime-field-assignment-13405.rs
index 80b298d2f37..9482d89681b 100644
--- a/tests/ui/issues/issue-13405.rs
+++ b/tests/ui/lifetimes/struct-lifetime-field-assignment-13405.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13405
+
 //@ check-pass
 #![allow(dead_code)]
 #![allow(unused_variables)]
diff --git a/tests/ui/issues/issue-11740.rs b/tests/ui/lifetimes/unsafe-transmute-in-find-11740.rs
index c6099c2a0c0..eeecd2e9e40 100644
--- a/tests/ui/issues/issue-11740.rs
+++ b/tests/ui/lifetimes/unsafe-transmute-in-find-11740.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/11740
+
 //@ check-pass
 
 struct Attr {
diff --git a/tests/ui/issues/issue-11844.rs b/tests/ui/match/option-result-mismatch-11844.rs
index f974a470296..24a2004134d 100644
--- a/tests/ui/issues/issue-11844.rs
+++ b/tests/ui/match/option-result-mismatch-11844.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/11844
+
 fn main() {
     let a = Some(Box::new(1));
     match a {
diff --git a/tests/ui/issues/issue-11844.stderr b/tests/ui/match/option-result-mismatch-11844.stderr
index 9ff66eaef49..8a84b7b8a48 100644
--- a/tests/ui/issues/issue-11844.stderr
+++ b/tests/ui/match/option-result-mismatch-11844.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-11844.rs:4:9
+  --> $DIR/option-result-mismatch-11844.rs:6:9
    |
 LL |     match a {
    |           - this expression has type `Option<Box<{integer}>>`
diff --git a/tests/ui/issues/issue-13466.rs b/tests/ui/match/option-result-type-param-mismatch-13466.rs
index 78ce4c1d2f6..05dbdfdee0e 100644
--- a/tests/ui/issues/issue-13466.rs
+++ b/tests/ui/match/option-result-type-param-mismatch-13466.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13466
+
 // Regression test for #13466
 
 //@ dont-require-annotations: NOTE
diff --git a/tests/ui/issues/issue-13466.stderr b/tests/ui/match/option-result-type-param-mismatch-13466.stderr
index 68a555a1626..b0cf1591f5e 100644
--- a/tests/ui/issues/issue-13466.stderr
+++ b/tests/ui/match/option-result-type-param-mismatch-13466.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-13466.rs:10:9
+  --> $DIR/option-result-type-param-mismatch-13466.rs:12:9
    |
 LL |     let _x: usize = match Some(1) {
    |                           ------- this expression has type `Option<{integer}>`
@@ -10,7 +10,7 @@ LL |         Ok(u) => u,
               found enum `Result<_, _>`
 
 error[E0308]: mismatched types
-  --> $DIR/issue-13466.rs:16:9
+  --> $DIR/option-result-type-param-mismatch-13466.rs:18:9
    |
 LL |     let _x: usize = match Some(1) {
    |                           ------- this expression has type `Option<{integer}>`
diff --git a/tests/ui/issues/issue-13027.rs b/tests/ui/match/overeager-sub-match-pruning-13027.rs
index fbd1d75067b..c4feb697f7d 100644
--- a/tests/ui/issues/issue-13027.rs
+++ b/tests/ui/match/overeager-sub-match-pruning-13027.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13027
+
 //@ run-pass
 
 // Tests that match expression handles overlapped literal and range
diff --git a/tests/ui/issues/issue-12567.rs b/tests/ui/match/slice-move-out-error-12567.rs
index 1b2a37de475..3f9bf9c76cf 100644
--- a/tests/ui/issues/issue-12567.rs
+++ b/tests/ui/match/slice-move-out-error-12567.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/12567
+
 fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) {
     match (l1, l2) {
     //~^ ERROR: cannot move out of type `[T]`, a non-copy slice
diff --git a/tests/ui/issues/issue-12567.stderr b/tests/ui/match/slice-move-out-error-12567.stderr
index 0b19299ece3..ab5377d4701 100644
--- a/tests/ui/issues/issue-12567.stderr
+++ b/tests/ui/match/slice-move-out-error-12567.stderr
@@ -1,5 +1,5 @@
 error[E0508]: cannot move out of type `[T]`, a non-copy slice
-  --> $DIR/issue-12567.rs:2:11
+  --> $DIR/slice-move-out-error-12567.rs:4:11
    |
 LL |     match (l1, l2) {
    |           ^^^^^^^^ cannot move out of here
@@ -23,7 +23,7 @@ LL +         (&[hd1, ..], [hd2, ..])
    |
 
 error[E0508]: cannot move out of type `[T]`, a non-copy slice
-  --> $DIR/issue-12567.rs:2:11
+  --> $DIR/slice-move-out-error-12567.rs:4:11
    |
 LL |     match (l1, l2) {
    |           ^^^^^^^^ cannot move out of here
diff --git a/tests/ui/issues/issue-12285.rs b/tests/ui/match/struct-reference-patterns-12285.rs
index fe199147128..246e230b0de 100644
--- a/tests/ui/issues/issue-12285.rs
+++ b/tests/ui/match/struct-reference-patterns-12285.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/12285
+
 //@ run-pass
 
 struct S;
diff --git a/tests/ui/issues/issue-12920.rs b/tests/ui/parser/encode-symbol-ice-12920.rs
index f3b1b643c45..87389c0ffb4 100644
--- a/tests/ui/issues/issue-12920.rs
+++ b/tests/ui/parser/encode-symbol-ice-12920.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/12920
+
 //@ run-fail
 //@ error-pattern:explicit panic
 //@ needs-subprocess
diff --git a/tests/ui/issues/issue-13407.rs b/tests/ui/privacy/private-unit-struct-assignment.rs
index 7794be37b85..b8e1c4ecb18 100644
--- a/tests/ui/issues/issue-13407.rs
+++ b/tests/ui/privacy/private-unit-struct-assignment.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13407
+
 mod A {
     struct C;
 }
diff --git a/tests/ui/issues/issue-13407.stderr b/tests/ui/privacy/private-unit-struct-assignment.stderr
index ac2eb6581fe..8c36a08846d 100644
--- a/tests/ui/issues/issue-13407.stderr
+++ b/tests/ui/privacy/private-unit-struct-assignment.stderr
@@ -1,17 +1,17 @@
 error[E0603]: unit struct `C` is private
-  --> $DIR/issue-13407.rs:6:8
+  --> $DIR/private-unit-struct-assignment.rs:8:8
    |
 LL |     A::C = 1;
    |        ^ private unit struct
    |
 note: the unit struct `C` is defined here
-  --> $DIR/issue-13407.rs:2:5
+  --> $DIR/private-unit-struct-assignment.rs:4:5
    |
 LL |     struct C;
    |     ^^^^^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/issue-13407.rs:6:5
+  --> $DIR/private-unit-struct-assignment.rs:8:5
    |
 LL |     struct C;
    |     -------- unit struct defined here
diff --git a/tests/ui/issues/issue-12729.rs b/tests/ui/privacy/use-in-impl-scope-12729.rs
index 4d45846bc60..58fe042beec 100644
--- a/tests/ui/issues/issue-12729.rs
+++ b/tests/ui/privacy/use-in-impl-scope-12729.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/12729
+
 //@ edition: 2015
 //@ check-pass
 #![allow(dead_code)]
diff --git a/tests/ui/issues/issue-11820.rs b/tests/ui/resolve/reference-clone-nonclone-11820.rs
index ada844f8ee1..74dad96da94 100644
--- a/tests/ui/issues/issue-11820.rs
+++ b/tests/ui/resolve/reference-clone-nonclone-11820.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/11820
+
 //@ run-pass
 
 #![allow(noop_method_call)]
diff --git a/tests/ui/issues/issue-13214.rs b/tests/ui/statics/enum-with-static-str-variant-13214.rs
index 8140ec943a0..1db37da632d 100644
--- a/tests/ui/issues/issue-13214.rs
+++ b/tests/ui/statics/enum-with-static-str-variant-13214.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13214
+
 //@ build-pass
 #![allow(dead_code)]
 // defining static with struct that contains enum
diff --git a/tests/ui/issues/issue-13204.rs b/tests/ui/traits/default-method-lifetime-params-13204.rs
index 01362f6fe61..cdf34ab773c 100644
--- a/tests/ui/issues/issue-13204.rs
+++ b/tests/ui/traits/default-method-lifetime-params-13204.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13204
+
 //@ run-pass
 #![allow(unused_mut)]
 // Test that when instantiating trait default methods, typeck handles
diff --git a/tests/ui/issues/issue-13434.rs b/tests/ui/traits/fnonce-repro-trait-impl-13434.rs
index caf7b632393..61d5a1d74ae 100644
--- a/tests/ui/issues/issue-13434.rs
+++ b/tests/ui/traits/fnonce-repro-trait-impl-13434.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13434
+
 //@ run-pass
 #[derive(Debug)]
 struct MyStruct;
diff --git a/tests/ui/issues/issue-12909.rs b/tests/ui/type-inference/partial-type-hint-12909.rs
index f2c33806aae..d7017f451e3 100644
--- a/tests/ui/issues/issue-12909.rs
+++ b/tests/ui/type-inference/partial-type-hint-12909.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/12909
+
 //@ run-pass
 #![allow(unused_variables)]
 
diff --git a/tests/ui/issues/issue-12863.rs b/tests/ui/typeck/function-in-pattern-error-12863.rs
index 1ac1c3d818e..d2fa2555658 100644
--- a/tests/ui/issues/issue-12863.rs
+++ b/tests/ui/typeck/function-in-pattern-error-12863.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/12863
+
 mod foo { pub fn bar() {} }
 
 fn main() {
diff --git a/tests/ui/issues/issue-12863.stderr b/tests/ui/typeck/function-in-pattern-error-12863.stderr
index 95d4a704e72..f28874b5d48 100644
--- a/tests/ui/issues/issue-12863.stderr
+++ b/tests/ui/typeck/function-in-pattern-error-12863.stderr
@@ -1,5 +1,5 @@
 error[E0532]: expected unit struct, unit variant or constant, found function `foo::bar`
-  --> $DIR/issue-12863.rs:5:9
+  --> $DIR/function-in-pattern-error-12863.rs:7:9
    |
 LL |         foo::bar => {}
    |         ^^^^^^^^ not a unit struct, unit variant or constant
diff --git a/tests/ui/issues/issue-13359.rs b/tests/ui/typeck/isize-usize-mismatch-error.rs
index 5d31d7f861c..2fb5cf489c0 100644
--- a/tests/ui/issues/issue-13359.rs
+++ b/tests/ui/typeck/isize-usize-mismatch-error.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13359
+
 //@ dont-require-annotations: NOTE
 
 fn foo(_s: i16) { }
diff --git a/tests/ui/issues/issue-13359.stderr b/tests/ui/typeck/isize-usize-mismatch-error.stderr
index 91f5de8e8f3..d5724665a03 100644
--- a/tests/ui/issues/issue-13359.stderr
+++ b/tests/ui/typeck/isize-usize-mismatch-error.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-13359.rs:8:9
+  --> $DIR/isize-usize-mismatch-error.rs:10:9
    |
 LL |     foo(1*(1 as isize));
    |     --- ^^^^^^^^^^^^^^ expected `i16`, found `isize`
@@ -7,7 +7,7 @@ LL |     foo(1*(1 as isize));
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/issue-13359.rs:3:4
+  --> $DIR/isize-usize-mismatch-error.rs:5:4
    |
 LL | fn foo(_s: i16) { }
    |    ^^^ -------
@@ -17,7 +17,7 @@ LL |     foo((1*(1 as isize)).try_into().unwrap());
    |         +              +++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/issue-13359.rs:12:9
+  --> $DIR/isize-usize-mismatch-error.rs:14:9
    |
 LL |     bar(1*(1 as usize));
    |     --- ^^^^^^^^^^^^^^ expected `u32`, found `usize`
@@ -25,7 +25,7 @@ LL |     bar(1*(1 as usize));
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/issue-13359.rs:5:4
+  --> $DIR/isize-usize-mismatch-error.rs:7:4
    |
 LL | fn bar(_s: u32) { }
    |    ^^^ -------
diff --git a/tests/ui/issues/issue-11771.rs b/tests/ui/typeck/unit-type-add-error-11771.rs
index c69cd1e79e3..d009f50f4b9 100644
--- a/tests/ui/issues/issue-11771.rs
+++ b/tests/ui/typeck/unit-type-add-error-11771.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/11771
+
 fn main() {
     let x = ();
     1 +
diff --git a/tests/ui/issues/issue-11771.stderr b/tests/ui/typeck/unit-type-add-error-11771.stderr
index 5603dc18b63..155cc093524 100644
--- a/tests/ui/issues/issue-11771.stderr
+++ b/tests/ui/typeck/unit-type-add-error-11771.stderr
@@ -1,5 +1,5 @@
 error[E0277]: cannot add `()` to `{integer}`
-  --> $DIR/issue-11771.rs:3:7
+  --> $DIR/unit-type-add-error-11771.rs:5:7
    |
 LL |     1 +
    |       ^ no implementation for `{integer} + ()`
@@ -17,7 +17,7 @@ LL |     1 +
            and 56 others
 
 error[E0277]: cannot add `()` to `{integer}`
-  --> $DIR/issue-11771.rs:8:7
+  --> $DIR/unit-type-add-error-11771.rs:10:7
    |
 LL |     1 +
    |       ^ no implementation for `{integer} + ()`
diff --git a/tests/ui/issues/issue-13202.rs b/tests/ui/typeck/unwrap-or-panic-input-13202.rs
index 99ffba3fba5..29833a727c5 100644
--- a/tests/ui/issues/issue-13202.rs
+++ b/tests/ui/typeck/unwrap-or-panic-input-13202.rs
@@ -1,3 +1,5 @@
+//! Regression test for https://github.com/rust-lang/rust/issues/13202
+
 //@ run-fail
 //@ error-pattern:bad input
 //@ needs-subprocess
diff --git a/triagebot.toml b/triagebot.toml
index 02e051e759d..fefff78d64e 100644
--- a/triagebot.toml
+++ b/triagebot.toml
@@ -1007,10 +1007,6 @@ cc = [
 message = "Some changes occurred in GUI tests."
 cc = ["@GuillaumeGomez"]
 
-[mentions."tests/run-make/"]
-message = "This PR modifies `run-make` tests."
-cc = ["@jieyouxu"]
-
 [mentions."tests/auxiliary/minicore.rs"]
 message = "This PR modifies `tests/auxiliary/minicore.rs`."
 cc = ["@jieyouxu"]
@@ -1113,10 +1109,6 @@ Otherwise, you can ignore this comment.
 [mentions."src/tools/x"]
 message = "`src/tools/x` was changed. Bump version of Cargo.toml in `src/tools/x` so tidy will suggest installing the new version."
 
-[mentions."src/tools/tidy"]
-message = "There are changes to the `tidy` tool."
-cc = ["@jieyouxu"]
-
 [mentions."src/tools/tidy/src/deps.rs"]
 message = "The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging."
 cc = ["@davidtwco", "@wesleywiser"]