about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-25 08:12:16 +0000
committerbors <bors@rust-lang.org>2024-08-25 08:12:16 +0000
commit717aec0f8eebdc5eb51756e5129dde15e8b25710 (patch)
tree1b6387c8512783fda7b7810ce7bd7091aa0ff7ea
parent697d9530d78aeba31458cadfc338adb2aea90bee (diff)
parente664ff5d8cdc8672955475c47b049a2844950167 (diff)
Auto merge of #129521 - matthiaskrgr:rollup-uigv77m, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #128596 (stabilize const_fn_floating_point_arithmetic)
 - #129199 (make writes_through_immutable_pointer a hard error)
 - #129246 (Retroactively feature gate `ConstArgKind::Path`)
 - #129290 (Pin `cc` to 1.0.105)
 - #129323 (Implement `ptr::fn_addr_eq`)
 - #129500 (remove invalid `TyCompat` relation for effects)
 - #129501 (panicking: improve hint for Miri's RUST_BACKTRACE behavior)
 - #129505 (interpret: ImmTy: tighten sanity checks in offset logic)
 - #129510 (Fix `elided_named_lifetimes` in code)

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--Cargo.lock7
-rw-r--r--compiler/rustc_ast_lowering/src/asm.rs4
-rw-r--r--compiler/rustc_ast_lowering/src/expr.rs2
-rw-r--r--compiler/rustc_ast_lowering/src/lib.rs7
-rw-r--r--compiler/rustc_codegen_ssa/Cargo.toml2
-rw-r--r--compiler/rustc_codegen_ssa/src/back/archive.rs2
-rw-r--r--compiler/rustc_const_eval/src/check_consts/check.rs16
-rw-r--r--compiler/rustc_const_eval/src/check_consts/ops.rs44
-rw-r--r--compiler/rustc_const_eval/src/const_eval/error.rs8
-rw-r--r--compiler/rustc_const_eval/src/const_eval/machine.rs9
-rw-r--r--compiler/rustc_const_eval/src/errors.rs7
-rw-r--r--compiler/rustc_const_eval/src/interpret/operand.rs21
-rw-r--r--compiler/rustc_errors/src/markdown/parse.rs2
-rw-r--r--compiler/rustc_errors/src/translation.rs2
-rw-r--r--compiler/rustc_feature/src/accepted.rs2
-rw-r--r--compiler/rustc_feature/src/unstable.rs4
-rw-r--r--compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs2
-rw-r--r--compiler/rustc_hir_typeck/src/coercion.rs2
-rw-r--r--compiler/rustc_hir_typeck/src/lib.rs7
-rw-r--r--compiler/rustc_interface/src/queries.rs2
-rw-r--r--compiler/rustc_lint/src/lib.rs3
-rw-r--r--compiler/rustc_lint_defs/src/builtin.rs35
-rw-r--r--compiler/rustc_llvm/Cargo.toml2
-rw-r--r--compiler/rustc_metadata/src/rmeta/decoder.rs2
-rw-r--r--compiler/rustc_middle/src/ty/consts.rs32
-rw-r--r--compiler/rustc_middle/src/ty/generics.rs2
-rw-r--r--compiler/rustc_mir_build/src/errors.rs2
-rw-r--r--compiler/rustc_resolve/src/def_collector.rs16
-rw-r--r--compiler/rustc_span/src/symbol.rs1
-rw-r--r--compiler/rustc_ty_utils/src/needs_drop.rs2
-rw-r--r--library/core/src/lib.rs2
-rw-r--r--library/core/src/marker.rs1
-rw-r--r--library/core/src/ptr/mod.rs27
-rw-r--r--library/std/src/panicking.rs2
-rw-r--r--src/librustdoc/passes/collect_intra_doc_links.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/unused_io_amount.rs2
-rw-r--r--src/tools/clippy/tests/ui/floating_point_abs.fixed1
-rw-r--r--src/tools/clippy/tests/ui/floating_point_abs.rs1
-rw-r--r--src/tools/clippy/tests/ui/floating_point_abs.stderr16
-rw-r--r--src/tools/clippy/tests/ui/floating_point_mul_add.fixed1
-rw-r--r--src/tools/clippy/tests/ui/floating_point_mul_add.rs1
-rw-r--r--src/tools/clippy/tests/ui/floating_point_mul_add.stderr26
-rw-r--r--src/tools/clippy/tests/ui/floating_point_rad.fixed1
-rw-r--r--src/tools/clippy/tests/ui/floating_point_rad.rs1
-rw-r--r--src/tools/clippy/tests/ui/floating_point_rad.stderr16
-rw-r--r--src/tools/miri/src/concurrency/thread.rs2
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr2
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr2
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr2
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr2
-rw-r--r--src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr2
-rw-r--r--src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr2
-rw-r--r--src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr2
-rw-r--r--src/tools/miri/tests/fail/panic/bad_unwind.stderr2
-rw-r--r--src/tools/miri/tests/fail/panic/double_panic.stderr2
-rw-r--r--src/tools/miri/tests/fail/panic/panic_abort1.stderr2
-rw-r--r--src/tools/miri/tests/fail/panic/panic_abort2.stderr2
-rw-r--r--src/tools/miri/tests/fail/panic/panic_abort3.stderr2
-rw-r--r--src/tools/miri/tests/fail/panic/panic_abort4.stderr2
-rw-r--r--src/tools/miri/tests/fail/terminate-terminator.stderr2
-rw-r--r--src/tools/miri/tests/fail/unwind-action-terminate.stderr2
-rw-r--r--src/tools/miri/tests/panic/alloc_error_handler_hook.stderr2
-rw-r--r--src/tools/miri/tests/panic/alloc_error_handler_panic.stderr2
-rw-r--r--src/tools/miri/tests/panic/div-by-zero-2.stderr2
-rw-r--r--src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr2
-rw-r--r--src/tools/miri/tests/panic/oob_subslice.stderr2
-rw-r--r--src/tools/miri/tests/panic/overflowing-lsh-neg.stderr2
-rw-r--r--src/tools/miri/tests/panic/overflowing-rsh-1.stderr2
-rw-r--r--src/tools/miri/tests/panic/overflowing-rsh-2.stderr2
-rw-r--r--src/tools/miri/tests/panic/panic2.stderr2
-rw-r--r--src/tools/miri/tests/panic/panic3.stderr2
-rw-r--r--src/tools/miri/tests/panic/panic4.stderr2
-rw-r--r--src/tools/miri/tests/panic/transmute_fat2.stderr2
-rw-r--r--src/tools/miri/tests/panic/unsupported_foreign_function.stderr2
-rw-r--r--src/tools/miri/tests/panic/unsupported_syscall.stderr2
-rw-r--r--src/tools/miri/tests/pass/panic/catch_panic.stderr2
-rw-r--r--src/tools/miri/tests/pass/panic/concurrent-panic.stderr2
-rw-r--r--src/tools/miri/tests/pass/panic/nested_panic_caught.stderr2
-rw-r--r--src/tools/miri/tests/pass/panic/thread_panic.stderr2
-rw-r--r--tests/crashes/127972.rs2
-rw-r--r--tests/crashes/128016.rs10
-rw-r--r--tests/ui-fulldeps/stable-mir/check_instance.rs10
-rw-r--r--tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs2
-rw-r--r--tests/ui/coherence/negative-coherence/generic_const_type_mismatch.stderr20
-rw-r--r--tests/ui/const-generics/bad-subst-const-kind.rs1
-rw-r--r--tests/ui/const-generics/bad-subst-const-kind.stderr11
-rw-r--r--tests/ui/const-generics/early/trivial-const-arg-macro-nested.rs21
-rw-r--r--tests/ui/const-generics/early/trivial-const-arg-macro-param.rs13
-rw-r--r--tests/ui/const-generics/early/trivial-const-arg-macro-res-error.rs13
-rw-r--r--tests/ui/const-generics/early/trivial-const-arg-macro-res-error.stderr24
-rw-r--r--tests/ui/const-generics/early/trivial-const-arg-macro.rs15
-rw-r--r--tests/ui/const-generics/generic_const_exprs/type_mismatch.rs1
-rw-r--r--tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr12
-rw-r--r--tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs10
-rw-r--r--tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr4
-rw-r--r--tests/ui/const-generics/transmute-fail.rs126
-rw-r--r--tests/ui/const-generics/transmute-fail.stderr101
-rw-r--r--tests/ui/const-generics/type_mismatch.rs2
-rw-r--r--tests/ui/const-generics/type_mismatch.stderr20
-rw-r--r--tests/ui/consts/const-eval/ub-write-through-immutable.rs9
-rw-r--r--tests/ui/consts/const-eval/ub-write-through-immutable.stderr54
-rw-r--r--tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs4
-rw-r--r--tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr15
-rw-r--r--tests/ui/consts/const-extern-fn/const-extern-fn.rs17
-rw-r--r--tests/ui/consts/const_fn_floating_point_arithmetic.gated.stderr8
-rw-r--r--tests/ui/consts/const_fn_floating_point_arithmetic.rs20
-rw-r--r--tests/ui/consts/const_fn_floating_point_arithmetic.stock.stderr53
-rw-r--r--tests/ui/consts/const_let_eq_float.rs2
-rw-r--r--tests/ui/consts/issue-36163.stderr6
-rw-r--r--tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs12
-rw-r--r--tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr27
-rw-r--r--tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs8
-rw-r--r--tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr21
-rw-r--r--tests/ui/feature-gates/feature-gate-const-arg-path.rs5
-rw-r--r--tests/ui/internal/internal-unstable-const.rs13
-rw-r--r--tests/ui/internal/internal-unstable-const.stderr19
-rw-r--r--tests/ui/lifetimes/issue-95023.rs7
-rw-r--r--tests/ui/lifetimes/issue-95023.stderr10
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs4
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.stderr11
-rw-r--r--tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.rs1
-rw-r--r--tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.stderr14
-rw-r--r--tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs1
-rw-r--r--tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr14
-rw-r--r--tests/ui/transmutability/issue-101739-1.rs3
-rw-r--r--tests/ui/transmutability/issue-101739-1.stderr11
-rw-r--r--tests/ui/transmutability/issue-101739-2.rs24
-rw-r--r--tests/ui/transmutability/issue-101739-2.stderr25
-rw-r--r--tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs8
-rw-r--r--tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.stderr20
130 files changed, 651 insertions, 630 deletions
diff --git a/Cargo.lock b/Cargo.lock
index f2e2baea8e4..e3ab150b320 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -410,12 +410,9 @@ version = "0.1.0"
 
 [[package]]
 name = "cc"
-version = "1.1.13"
+version = "1.0.105"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48"
-dependencies = [
- "shlex",
-]
+checksum = "5208975e568d83b6b05cc0a063c8e7e9acc2b43bee6da15616a5b73e109d7437"
 
 [[package]]
 name = "cfg-if"
diff --git a/compiler/rustc_ast_lowering/src/asm.rs b/compiler/rustc_ast_lowering/src/asm.rs
index 51cbe808a3a..e077c544965 100644
--- a/compiler/rustc_ast_lowering/src/asm.rs
+++ b/compiler/rustc_ast_lowering/src/asm.rs
@@ -220,7 +220,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
                             let parent_def_id = self.current_def_id_parent;
                             let node_id = self.next_node_id();
                             // HACK(min_generic_const_args): see lower_anon_const
-                            if !expr.is_potential_trivial_const_arg() {
+                            if !self.tcx.features().const_arg_path
+                                || !expr.is_potential_trivial_const_arg()
+                            {
                                 self.create_def(
                                     parent_def_id,
                                     node_id,
diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs
index b5d8a547a8f..bb86e5c9325 100644
--- a/compiler/rustc_ast_lowering/src/expr.rs
+++ b/compiler/rustc_ast_lowering/src/expr.rs
@@ -387,7 +387,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
                 let node_id = self.next_node_id();
 
                 // HACK(min_generic_const_args): see lower_anon_const
-                if !arg.is_potential_trivial_const_arg() {
+                if !self.tcx.features().const_arg_path || !arg.is_potential_trivial_const_arg() {
                     // Add a definition for the in-band const def.
                     self.create_def(parent_def_id, node_id, kw::Empty, DefKind::AnonConst, f.span);
                 }
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs
index 81d17a9dec2..4b8c47ac4b4 100644
--- a/compiler/rustc_ast_lowering/src/lib.rs
+++ b/compiler/rustc_ast_lowering/src/lib.rs
@@ -2358,7 +2358,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
         span: Span,
     ) -> &'hir hir::ConstArg<'hir> {
         let ct_kind = match res {
-            Res::Def(DefKind::ConstParam, _) => {
+            Res::Def(DefKind::ConstParam, _) if self.tcx.features().const_arg_path => {
                 let qpath = self.lower_qpath(
                     ty_id,
                     &None,
@@ -2433,7 +2433,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
             self.resolver.get_partial_res(expr.id).and_then(|partial_res| partial_res.full_res());
         debug!("res={:?}", maybe_res);
         // FIXME(min_generic_const_args): for now we only lower params to ConstArgKind::Path
-        if let Some(res) = maybe_res
+        if self.tcx.features().const_arg_path
+            && let Some(res) = maybe_res
             && let Res::Def(DefKind::ConstParam, _) = res
             && let ExprKind::Path(qself, path) = &expr.kind
         {
@@ -2464,7 +2465,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
     /// See [`hir::ConstArg`] for when to use this function vs
     /// [`Self::lower_anon_const_to_const_arg`].
     fn lower_anon_const_to_anon_const(&mut self, c: &AnonConst) -> &'hir hir::AnonConst {
-        if c.value.is_potential_trivial_const_arg() {
+        if self.tcx.features().const_arg_path && c.value.is_potential_trivial_const_arg() {
             // HACK(min_generic_const_args): see DefCollector::visit_anon_const
             // Over there, we guess if this is a bare param and only create a def if
             // we think it's not. However we may can guess wrong (see there for example)
diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml
index 56b75f9b329..e78039bafd8 100644
--- a/compiler/rustc_codegen_ssa/Cargo.toml
+++ b/compiler/rustc_codegen_ssa/Cargo.toml
@@ -8,7 +8,7 @@ edition = "2021"
 ar_archive_writer = "0.4.2"
 arrayvec = { version = "0.7", default-features = false }
 bitflags = "2.4.1"
-cc = "1.0.90"
+cc = "=1.0.105" # FIXME(cc): pinned to keep support for VS2013
 either = "1.5.0"
 itertools = "0.12"
 jobserver = "0.1.28"
diff --git a/compiler/rustc_codegen_ssa/src/back/archive.rs b/compiler/rustc_codegen_ssa/src/back/archive.rs
index c8c1bd3e8f9..76a94de5433 100644
--- a/compiler/rustc_codegen_ssa/src/back/archive.rs
+++ b/compiler/rustc_codegen_ssa/src/back/archive.rs
@@ -125,7 +125,7 @@ pub trait ArchiveBuilderBuilder {
         rlib: &'a Path,
         outdir: &Path,
         bundled_lib_file_names: &FxIndexSet<Symbol>,
-    ) -> Result<(), ExtractBundledLibsError<'_>> {
+    ) -> Result<(), ExtractBundledLibsError<'a>> {
         let archive_map = unsafe {
             Mmap::map(
                 File::open(rlib)
diff --git a/compiler/rustc_const_eval/src/check_consts/check.rs b/compiler/rustc_const_eval/src/check_consts/check.rs
index 86a5afa65ba..c80b3e673b0 100644
--- a/compiler/rustc_const_eval/src/check_consts/check.rs
+++ b/compiler/rustc_const_eval/src/check_consts/check.rs
@@ -575,10 +575,8 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
 
             Rvalue::UnaryOp(_, operand) => {
                 let ty = operand.ty(self.body, self.tcx);
-                if is_int_bool_or_char(ty) {
-                    // Int, bool, and char operations are fine.
-                } else if ty.is_floating_point() {
-                    self.check_op(ops::FloatingPointOp);
+                if is_int_bool_float_or_char(ty) {
+                    // Int, bool, float, and char operations are fine.
                 } else {
                     span_bug!(self.span, "non-primitive type in `Rvalue::UnaryOp`: {:?}", ty);
                 }
@@ -588,8 +586,8 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
                 let lhs_ty = lhs.ty(self.body, self.tcx);
                 let rhs_ty = rhs.ty(self.body, self.tcx);
 
-                if is_int_bool_or_char(lhs_ty) && is_int_bool_or_char(rhs_ty) {
-                    // Int, bool, and char operations are fine.
+                if is_int_bool_float_or_char(lhs_ty) && is_int_bool_float_or_char(rhs_ty) {
+                    // Int, bool, float, and char operations are fine.
                 } else if lhs_ty.is_fn_ptr() || lhs_ty.is_unsafe_ptr() {
                     assert_matches!(
                         op,
@@ -603,8 +601,6 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
                     );
 
                     self.check_op(ops::RawPtrComparison);
-                } else if lhs_ty.is_floating_point() || rhs_ty.is_floating_point() {
-                    self.check_op(ops::FloatingPointOp);
                 } else {
                     span_bug!(
                         self.span,
@@ -1009,8 +1005,8 @@ fn place_as_reborrow<'tcx>(
     }
 }
 
-fn is_int_bool_or_char(ty: Ty<'_>) -> bool {
-    ty.is_bool() || ty.is_integral() || ty.is_char()
+fn is_int_bool_float_or_char(ty: Ty<'_>) -> bool {
+    ty.is_bool() || ty.is_integral() || ty.is_char() || ty.is_floating_point()
 }
 
 fn emit_unstable_in_stable_error(ccx: &ConstCx<'_, '_>, span: Span, gate: Symbol) {
diff --git a/compiler/rustc_const_eval/src/check_consts/ops.rs b/compiler/rustc_const_eval/src/check_consts/ops.rs
index 259114dbdc2..93fafa60557 100644
--- a/compiler/rustc_const_eval/src/check_consts/ops.rs
+++ b/compiler/rustc_const_eval/src/check_consts/ops.rs
@@ -55,28 +55,6 @@ pub trait NonConstOp<'tcx>: std::fmt::Debug {
     fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> Diag<'tcx>;
 }
 
-#[derive(Debug)]
-pub struct FloatingPointOp;
-impl<'tcx> NonConstOp<'tcx> for FloatingPointOp {
-    fn status_in_item(&self, ccx: &ConstCx<'_, 'tcx>) -> Status {
-        if ccx.const_kind() == hir::ConstContext::ConstFn {
-            Status::Unstable(sym::const_fn_floating_point_arithmetic)
-        } else {
-            Status::Allowed
-        }
-    }
-
-    #[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
-    fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> Diag<'tcx> {
-        feature_err(
-            &ccx.tcx.sess,
-            sym::const_fn_floating_point_arithmetic,
-            span,
-            format!("floating point arithmetic is not allowed in {}s", ccx.const_kind()),
-        )
-    }
-}
-
 /// A function call where the callee is a pointer.
 #[derive(Debug)]
 pub struct FnCallIndirect;
@@ -440,22 +418,12 @@ impl<'tcx> NonConstOp<'tcx> for CellBorrow {
         DiagImportance::Secondary
     }
     fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> Diag<'tcx> {
-        // FIXME: Maybe a more elegant solution to this if else case
-        if let hir::ConstContext::Static(_) = ccx.const_kind() {
-            ccx.dcx().create_err(errors::InteriorMutableDataRefer {
-                span,
-                opt_help: true,
-                kind: ccx.const_kind(),
-                teach: ccx.tcx.sess.teach(E0492),
-            })
-        } else {
-            ccx.dcx().create_err(errors::InteriorMutableDataRefer {
-                span,
-                opt_help: false,
-                kind: ccx.const_kind(),
-                teach: ccx.tcx.sess.teach(E0492),
-            })
-        }
+        ccx.dcx().create_err(errors::InteriorMutableDataRefer {
+            span,
+            opt_help: matches!(ccx.const_kind(), hir::ConstContext::Static(_)),
+            kind: ccx.const_kind(),
+            teach: ccx.tcx.sess.teach(E0492),
+        })
     }
 }
 
diff --git a/compiler/rustc_const_eval/src/const_eval/error.rs b/compiler/rustc_const_eval/src/const_eval/error.rs
index 00bbd9337f7..25b32785b7d 100644
--- a/compiler/rustc_const_eval/src/const_eval/error.rs
+++ b/compiler/rustc_const_eval/src/const_eval/error.rs
@@ -22,6 +22,7 @@ pub enum ConstEvalErrKind {
     RecursiveStatic,
     AssertFailure(AssertKind<ConstInt>),
     Panic { msg: Symbol, line: u32, col: u32, file: Symbol },
+    WriteThroughImmutablePointer,
 }
 
 impl MachineStopType for ConstEvalErrKind {
@@ -35,12 +36,16 @@ impl MachineStopType for ConstEvalErrKind {
             Panic { .. } => const_eval_panic,
             RecursiveStatic => const_eval_recursive_static,
             AssertFailure(x) => x.diagnostic_message(),
+            WriteThroughImmutablePointer => const_eval_write_through_immutable_pointer,
         }
     }
     fn add_args(self: Box<Self>, adder: &mut dyn FnMut(DiagArgName, DiagArgValue)) {
         use ConstEvalErrKind::*;
         match *self {
-            RecursiveStatic | ConstAccessesMutGlobal | ModifiedGlobal => {}
+            RecursiveStatic
+            | ConstAccessesMutGlobal
+            | ModifiedGlobal
+            | WriteThroughImmutablePointer => {}
             AssertFailure(kind) => kind.add_args(adder),
             Panic { msg, line, col, file } => {
                 adder("msg".into(), msg.into_diag_arg());
@@ -159,6 +164,7 @@ where
 
 /// Emit a lint from a const-eval situation, with a backtrace.
 // Even if this is unused, please don't remove it -- chances are we will need to emit a lint during const-eval again in the future!
+#[allow(unused)]
 pub(super) fn lint<'tcx, L>(
     tcx: TyCtxtAt<'tcx>,
     machine: &CompileTimeMachine<'tcx>,
diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs
index c3d94ca0e59..9c1fef095f5 100644
--- a/compiler/rustc_const_eval/src/const_eval/machine.rs
+++ b/compiler/rustc_const_eval/src/const_eval/machine.rs
@@ -12,7 +12,6 @@ use rustc_middle::query::TyCtxtAt;
 use rustc_middle::ty::layout::{FnAbiOf, TyAndLayout};
 use rustc_middle::ty::{self, TyCtxt};
 use rustc_middle::{bug, mir};
-use rustc_session::lint::builtin::WRITES_THROUGH_IMMUTABLE_POINTER;
 use rustc_span::symbol::{sym, Symbol};
 use rustc_span::Span;
 use rustc_target::abi::{Align, Size};
@@ -732,8 +731,8 @@ impl<'tcx> interpret::Machine<'tcx> for CompileTimeMachine<'tcx> {
     }
 
     fn before_memory_write(
-        tcx: TyCtxtAt<'tcx>,
-        machine: &mut Self,
+        _tcx: TyCtxtAt<'tcx>,
+        _machine: &mut Self,
         _alloc_extra: &mut Self::AllocExtra,
         (_alloc_id, immutable): (AllocId, bool),
         range: AllocRange,
@@ -744,9 +743,7 @@ impl<'tcx> interpret::Machine<'tcx> for CompileTimeMachine<'tcx> {
         }
         // Reject writes through immutable pointers.
         if immutable {
-            super::lint(tcx, machine, WRITES_THROUGH_IMMUTABLE_POINTER, |frames| {
-                crate::errors::WriteThroughImmutablePointer { frames }
-            });
+            return Err(ConstEvalErrKind::WriteThroughImmutablePointer.into());
         }
         // Everything else is fine.
         Ok(())
diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs
index 6075f3f84cd..0b366b43f95 100644
--- a/compiler/rustc_const_eval/src/errors.rs
+++ b/compiler/rustc_const_eval/src/errors.rs
@@ -407,13 +407,6 @@ pub struct ConstEvalError {
     pub frame_notes: Vec<FrameNote>,
 }
 
-#[derive(LintDiagnostic)]
-#[diag(const_eval_write_through_immutable_pointer)]
-pub struct WriteThroughImmutablePointer {
-    #[subdiagnostic]
-    pub frames: Vec<FrameNote>,
-}
-
 #[derive(Diagnostic)]
 #[diag(const_eval_nullary_intrinsic_fail)]
 pub struct NullaryIntrinsicError {
diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs
index ad87d6953d3..9a8ccaa7cc5 100644
--- a/compiler/rustc_const_eval/src/interpret/operand.rs
+++ b/compiler/rustc_const_eval/src/interpret/operand.rs
@@ -319,6 +319,7 @@ impl<'tcx, Prov: Provenance> ImmTy<'tcx, Prov> {
             // some fieldless enum variants can have non-zero size but still `Aggregate` ABI... try
             // to detect those here and also give them no data
             _ if matches!(layout.abi, Abi::Aggregate { .. })
+                && matches!(layout.variants, abi::Variants::Single { .. })
                 && matches!(&layout.fields, abi::FieldsShape::Arbitrary { offsets, .. } if offsets.len() == 0) =>
             {
                 Immediate::Uninit
@@ -328,8 +329,9 @@ impl<'tcx, Prov: Provenance> ImmTy<'tcx, Prov> {
                 assert_eq!(offset.bytes(), 0);
                 assert!(
                     match (self.layout.abi, layout.abi) {
-                        (Abi::Scalar(..), Abi::Scalar(..)) => true,
-                        (Abi::ScalarPair(..), Abi::ScalarPair(..)) => true,
+                        (Abi::Scalar(l), Abi::Scalar(r)) => l.size(cx) == r.size(cx),
+                        (Abi::ScalarPair(l1, l2), Abi::ScalarPair(r1, r2)) =>
+                            l1.size(cx) == r1.size(cx) && l2.size(cx) == r2.size(cx),
                         _ => false,
                     },
                     "cannot project into {} immediate with equally-sized field {}\nouter ABI: {:#?}\nfield ABI: {:#?}",
@@ -344,16 +346,23 @@ impl<'tcx, Prov: Provenance> ImmTy<'tcx, Prov> {
             (Immediate::ScalarPair(a_val, b_val), Abi::ScalarPair(a, b)) => {
                 assert_matches!(layout.abi, Abi::Scalar(..));
                 Immediate::from(if offset.bytes() == 0 {
-                    debug_assert_eq!(layout.size, a.size(cx));
+                    // It is "okay" to transmute from `usize` to a pointer (GVN relies on that).
+                    // So only compare the size.
+                    assert_eq!(layout.size, a.size(cx));
                     a_val
                 } else {
-                    debug_assert_eq!(offset, a.size(cx).align_to(b.align(cx).abi));
-                    debug_assert_eq!(layout.size, b.size(cx));
+                    assert_eq!(offset, a.size(cx).align_to(b.align(cx).abi));
+                    assert_eq!(layout.size, b.size(cx));
                     b_val
                 })
             }
             // everything else is a bug
-            _ => bug!("invalid field access on immediate {}, layout {:#?}", self, self.layout),
+            _ => bug!(
+                "invalid field access on immediate {} at offset {}, original layout {:#?}",
+                self,
+                offset.bytes(),
+                self.layout
+            ),
         };
 
         ImmTy::from_immediate(inner_val, layout)
diff --git a/compiler/rustc_errors/src/markdown/parse.rs b/compiler/rustc_errors/src/markdown/parse.rs
index c44f136120a..46f8959b6f2 100644
--- a/compiler/rustc_errors/src/markdown/parse.rs
+++ b/compiler/rustc_errors/src/markdown/parse.rs
@@ -80,7 +80,7 @@ pub fn entrypoint(txt: &str) -> MdStream<'_> {
 }
 
 /// Parse a buffer with specified context
-fn parse_recursive<'a>(buf: &'a [u8], ctx: Context) -> MdStream<'_> {
+fn parse_recursive<'a>(buf: &'a [u8], ctx: Context) -> MdStream<'a> {
     use ParseOpt as Po;
     use Prev::{Escape, Newline, Whitespace};
 
diff --git a/compiler/rustc_errors/src/translation.rs b/compiler/rustc_errors/src/translation.rs
index a44e794ee12..e0b64b276eb 100644
--- a/compiler/rustc_errors/src/translation.rs
+++ b/compiler/rustc_errors/src/translation.rs
@@ -59,7 +59,7 @@ pub trait Translate {
         &'a self,
         message: &'a DiagMessage,
         args: &'a FluentArgs<'_>,
-    ) -> Result<Cow<'_, str>, TranslateError<'_>> {
+    ) -> Result<Cow<'a, str>, TranslateError<'a>> {
         trace!(?message, ?args);
         let (identifier, attr) = match message {
             DiagMessage::Str(msg) | DiagMessage::Translated(msg) => {
diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs
index a4a2028e26e..9223c3c322a 100644
--- a/compiler/rustc_feature/src/accepted.rs
+++ b/compiler/rustc_feature/src/accepted.rs
@@ -115,6 +115,8 @@ declare_features! (
     (accepted, conservative_impl_trait, "1.26.0", Some(34511)),
     /// Allows calling constructor functions in `const fn`.
     (accepted, const_constructor, "1.40.0", Some(61456)),
+    /// Allows basic arithmetic on floating point types in a `const fn`.
+    (accepted, const_fn_floating_point_arithmetic, "CURRENT_RUSTC_VERSION", Some(57241)),
     /// Allows using and casting function pointers in a `const fn`.
     (accepted, const_fn_fn_ptr_basics, "1.61.0", Some(57563)),
     /// Allows trait bounds in `const fn`.
diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs
index a1741ac33ca..4524458023d 100644
--- a/compiler/rustc_feature/src/unstable.rs
+++ b/compiler/rustc_feature/src/unstable.rs
@@ -193,6 +193,8 @@ declare_features! (
     (unstable, anonymous_lifetime_in_impl_trait, "1.63.0", None),
     /// Allows identifying the `compiler_builtins` crate.
     (internal, compiler_builtins, "1.13.0", None),
+    /// Gating for a new desugaring of const arguments of usages of const parameters
+    (internal, const_arg_path, "1.81.0", None),
     /// Allows writing custom MIR
     (internal, custom_mir, "1.65.0", None),
     /// Outputs useful `assert!` messages
@@ -400,8 +402,6 @@ declare_features! (
     (incomplete, const_closures, "1.68.0", Some(106003)),
     /// Allows the definition of `const extern fn` and `const unsafe extern fn`.
     (unstable, const_extern_fn, "1.40.0", Some(64926)),
-    /// Allows basic arithmetic on floating point types in a `const fn`.
-    (unstable, const_fn_floating_point_arithmetic, "1.48.0", Some(57241)),
     /// Allows `for _ in _` loops in const contexts.
     (unstable, const_for, "1.56.0", Some(87575)),
     /// Allows using `&mut` in constant functions.
diff --git a/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs b/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs
index d1048b742a0..c8b0f03a929 100644
--- a/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs
+++ b/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs
@@ -331,7 +331,7 @@ pub(super) fn find_opaque_ty_constraints_for_rpit<'tcx>(
     tcx: TyCtxt<'tcx>,
     def_id: LocalDefId,
     owner_def_id: LocalDefId,
-) -> Ty<'_> {
+) -> Ty<'tcx> {
     let tables = tcx.typeck(owner_def_id);
 
     // Check that all of the opaques we inferred during HIR are compatible.
diff --git a/compiler/rustc_hir_typeck/src/coercion.rs b/compiler/rustc_hir_typeck/src/coercion.rs
index 9b34c59f1f1..b47d8a97bce 100644
--- a/compiler/rustc_hir_typeck/src/coercion.rs
+++ b/compiler/rustc_hir_typeck/src/coercion.rs
@@ -106,7 +106,7 @@ fn identity(_: Ty<'_>) -> Vec<Adjustment<'_>> {
     vec![]
 }
 
-fn simple<'tcx>(kind: Adjust<'tcx>) -> impl FnOnce(Ty<'tcx>) -> Vec<Adjustment<'_>> {
+fn simple<'tcx>(kind: Adjust<'tcx>) -> impl FnOnce(Ty<'tcx>) -> Vec<Adjustment<'tcx>> {
     move |target| vec![Adjustment { kind, target }]
 }
 
diff --git a/compiler/rustc_hir_typeck/src/lib.rs b/compiler/rustc_hir_typeck/src/lib.rs
index 9ec101196a4..8ff4c11f24a 100644
--- a/compiler/rustc_hir_typeck/src/lib.rs
+++ b/compiler/rustc_hir_typeck/src/lib.rs
@@ -87,14 +87,17 @@ fn used_trait_imports(tcx: TyCtxt<'_>, def_id: LocalDefId) -> &UnordSet<LocalDef
     &tcx.typeck(def_id).used_trait_imports
 }
 
-fn typeck<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::TypeckResults<'tcx> {
+fn typeck<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx ty::TypeckResults<'tcx> {
     let fallback = move || tcx.type_of(def_id.to_def_id()).instantiate_identity();
     typeck_with_fallback(tcx, def_id, fallback, None)
 }
 
 /// Used only to get `TypeckResults` for type inference during error recovery.
 /// Currently only used for type inference of `static`s and `const`s to avoid type cycle errors.
-fn diagnostic_only_typeck<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::TypeckResults<'tcx> {
+fn diagnostic_only_typeck<'tcx>(
+    tcx: TyCtxt<'tcx>,
+    def_id: LocalDefId,
+) -> &'tcx ty::TypeckResults<'tcx> {
     let fallback = move || {
         let span = tcx.hir().span(tcx.local_def_id_to_hir_id(def_id));
         Ty::new_error_with_message(tcx, span, "diagnostic only typeck table used")
diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs
index c5d56c15c6e..44e07b36b61 100644
--- a/compiler/rustc_interface/src/queries.rs
+++ b/compiler/rustc_interface/src/queries.rs
@@ -98,7 +98,7 @@ impl<'tcx> Queries<'tcx> {
         self.parse.compute(|| passes::parse(&self.compiler.sess))
     }
 
-    pub fn global_ctxt(&'tcx self) -> Result<QueryResult<'_, &'tcx GlobalCtxt<'tcx>>> {
+    pub fn global_ctxt(&'tcx self) -> Result<QueryResult<'tcx, &'tcx GlobalCtxt<'tcx>>> {
         self.gcx.compute(|| {
             let krate = self.parse()?.steal();
 
diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs
index 1828b6ea93c..a6e7d288f08 100644
--- a/compiler/rustc_lint/src/lib.rs
+++ b/compiler/rustc_lint/src/lib.rs
@@ -572,7 +572,8 @@ fn register_builtins(store: &mut LintStore) {
         "byte_slice_in_packed_struct_with_derive",
         "converted into hard error, see issue #107457 \
          <https://github.com/rust-lang/rust/issues/107457> for more information",
-    )
+    );
+    store.register_removed("writes_through_immutable_pointer", "converted into hard error");
 }
 
 fn register_internals(store: &mut LintStore) {
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs
index a65d30eb817..44c72e0c4fe 100644
--- a/compiler/rustc_lint_defs/src/builtin.rs
+++ b/compiler/rustc_lint_defs/src/builtin.rs
@@ -142,7 +142,6 @@ declare_lint_pass! {
         USELESS_DEPRECATED,
         WARNINGS,
         WASM_C_ABI,
-        WRITES_THROUGH_IMMUTABLE_POINTER,
         // tidy-alphabetical-end
     ]
 }
@@ -4697,40 +4696,6 @@ declare_lint! {
 }
 
 declare_lint! {
-    /// The `writes_through_immutable_pointer` lint detects writes through pointers derived from
-    /// shared references.
-    ///
-    /// ### Example
-    ///
-    /// ```rust,compile_fail
-    /// #![feature(const_mut_refs)]
-    /// const WRITE_AFTER_CAST: () = unsafe {
-    ///     let mut x = 0;
-    ///     let ptr = &x as *const i32 as *mut i32;
-    ///     *ptr = 0;
-    /// };
-    /// ```
-    ///
-    /// {{produces}}
-    ///
-    /// ### Explanation
-    ///
-    /// Shared references are immutable (when there is no `UnsafeCell` involved),
-    /// and writing through them or through pointers derived from them is Undefined Behavior.
-    /// The compiler recently learned to detect such Undefined Behavior during compile-time
-    /// evaluation, and in the future this will raise a hard error.
-    ///
-    /// [future-incompatible]: ../index.md#future-incompatible-lints
-    pub WRITES_THROUGH_IMMUTABLE_POINTER,
-    Warn,
-    "shared references are immutable, and pointers derived from them must not be written to",
-    @future_incompatible = FutureIncompatibleInfo {
-        reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
-        reference: "issue #X <https://github.com/rust-lang/rust/issues/X>",
-    };
-}
-
-declare_lint! {
     /// The `private_macro_use` lint detects private macros that are imported
     /// with `#[macro_use]`.
     ///
diff --git a/compiler/rustc_llvm/Cargo.toml b/compiler/rustc_llvm/Cargo.toml
index 83fda7ef07c..1f74aaf9965 100644
--- a/compiler/rustc_llvm/Cargo.toml
+++ b/compiler/rustc_llvm/Cargo.toml
@@ -10,5 +10,5 @@ libc = "0.2.73"
 
 [build-dependencies]
 # tidy-alphabetical-start
-cc = "1.0.97"
+cc = "=1.0.105" # FIXME(cc): pinned to keep support for VS2013
 # tidy-alphabetical-end
diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs
index 8c0ea3eaea9..a13eac08c9f 100644
--- a/compiler/rustc_metadata/src/rmeta/decoder.rs
+++ b/compiler/rustc_metadata/src/rmeta/decoder.rs
@@ -1487,7 +1487,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
             .decode((self, sess))
     }
 
-    fn get_foreign_modules(self, sess: &'a Session) -> impl Iterator<Item = ForeignModule> + '_ {
+    fn get_foreign_modules(self, sess: &'a Session) -> impl Iterator<Item = ForeignModule> + 'a {
         self.root.foreign_modules.decode((self, sess))
     }
 
diff --git a/compiler/rustc_middle/src/ty/consts.rs b/compiler/rustc_middle/src/ty/consts.rs
index e373292741b..362ff8e988d 100644
--- a/compiler/rustc_middle/src/ty/consts.rs
+++ b/compiler/rustc_middle/src/ty/consts.rs
@@ -240,7 +240,7 @@ impl<'tcx> Const<'tcx> {
 
         let ty = tcx.type_of(def).no_bound_vars().expect("const parameter types cannot be generic");
 
-        match Self::try_from_lit(tcx, ty, expr) {
+        match Self::try_from_lit_or_param(tcx, ty, expr) {
             Some(v) => v,
             None => ty::Const::new_unevaluated(
                 tcx,
@@ -281,7 +281,11 @@ impl<'tcx> Const<'tcx> {
     }
 
     #[instrument(skip(tcx), level = "debug")]
-    fn try_from_lit(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, expr: &'tcx hir::Expr<'tcx>) -> Option<Self> {
+    fn try_from_lit_or_param(
+        tcx: TyCtxt<'tcx>,
+        ty: Ty<'tcx>,
+        expr: &'tcx hir::Expr<'tcx>,
+    ) -> Option<Self> {
         // Unwrap a block, so that e.g. `{ P }` is recognised as a parameter. Const arguments
         // currently have to be wrapped in curly brackets, so it's necessary to special-case.
         let expr = match &expr.kind {
@@ -291,6 +295,22 @@ impl<'tcx> Const<'tcx> {
             _ => expr,
         };
 
+        if let hir::ExprKind::Path(
+            qpath @ hir::QPath::Resolved(
+                _,
+                &hir::Path { res: Res::Def(DefKind::ConstParam, _), .. },
+            ),
+        ) = expr.kind
+        {
+            if tcx.features().const_arg_path {
+                span_bug!(
+                    expr.span,
+                    "try_from_lit: received const param which shouldn't be possible"
+                );
+            }
+            return Some(Const::from_param(tcx, qpath, expr.hir_id));
+        };
+
         let lit_input = match expr.kind {
             hir::ExprKind::Lit(lit) => Some(LitToConstInput { lit: &lit.node, ty, neg: false }),
             hir::ExprKind::Unary(hir::UnOp::Neg, expr) => match expr.kind {
@@ -318,14 +338,6 @@ impl<'tcx> Const<'tcx> {
             }
         }
 
-        if let hir::ExprKind::Path(hir::QPath::Resolved(
-            _,
-            &hir::Path { res: Res::Def(DefKind::ConstParam, _), .. },
-        )) = expr.kind
-        {
-            span_bug!(expr.span, "try_from_lit: received const param which shouldn't be possible")
-        }
-
         None
     }
 
diff --git a/compiler/rustc_middle/src/ty/generics.rs b/compiler/rustc_middle/src/ty/generics.rs
index 8cb8e9af11c..bbc696e0f08 100644
--- a/compiler/rustc_middle/src/ty/generics.rs
+++ b/compiler/rustc_middle/src/ty/generics.rs
@@ -269,7 +269,7 @@ impl<'tcx> Generics {
     }
 
     /// Returns the `GenericParamDef` associated with this `ParamConst`.
-    pub fn const_param(&'tcx self, param: ParamConst, tcx: TyCtxt<'tcx>) -> &GenericParamDef {
+    pub fn const_param(&'tcx self, param: ParamConst, tcx: TyCtxt<'tcx>) -> &'tcx GenericParamDef {
         let param = self.param_at(param.index as usize, tcx);
         match param.kind {
             GenericParamDefKind::Const { .. } => param,
diff --git a/compiler/rustc_mir_build/src/errors.rs b/compiler/rustc_mir_build/src/errors.rs
index 843ac2eb240..7f9eefd1d52 100644
--- a/compiler/rustc_mir_build/src/errors.rs
+++ b/compiler/rustc_mir_build/src/errors.rs
@@ -493,7 +493,7 @@ pub(crate) struct NonExhaustivePatternsTypeNotEmpty<'p, 'tcx, 'm> {
 }
 
 impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for NonExhaustivePatternsTypeNotEmpty<'_, '_, '_> {
-    fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'_, G> {
+    fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
         let mut diag =
             Diag::new(dcx, level, fluent::mir_build_non_exhaustive_patterns_type_not_empty);
         diag.span(self.scrut_span);
diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs
index ed23870dfdf..3595db78e93 100644
--- a/compiler/rustc_resolve/src/def_collector.rs
+++ b/compiler/rustc_resolve/src/def_collector.rs
@@ -314,13 +314,15 @@ impl<'a, 'b, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'b, 'tcx> {
     }
 
     fn visit_anon_const(&mut self, constant: &'a AnonConst) {
-        // HACK(min_generic_const_args): don't create defs for anon consts if we think they will
-        // later be turned into ConstArgKind::Path's. because this is before resolve is done, we
-        // may accidentally identify a construction of a unit struct as a param and not create a
-        // def. we'll then create a def later in ast lowering in this case. the parent of nested
-        // items will be messed up, but that's ok because there can't be any if we're just looking
-        // for bare idents.
-        if constant.value.is_potential_trivial_const_arg() {
+        if self.resolver.tcx.features().const_arg_path
+            && constant.value.is_potential_trivial_const_arg()
+        {
+            // HACK(min_generic_const_args): don't create defs for anon consts if we think they will
+            // later be turned into ConstArgKind::Path's. because this is before resolve is done, we
+            // may accidentally identify a construction of a unit struct as a param and not create a
+            // def. we'll then create a def later in ast lowering in this case. the parent of nested
+            // items will be messed up, but that's ok because there can't be any if we're just looking
+            // for bare idents.
             visit::walk_anon_const(self, constant)
         } else {
             let def =
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index b16951a1868..db09c948a8e 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -595,6 +595,7 @@ symbols! {
         conservative_impl_trait,
         console,
         const_allocate,
+        const_arg_path,
         const_async_blocks,
         const_closures,
         const_compare_raw_pointers,
diff --git a/compiler/rustc_ty_utils/src/needs_drop.rs b/compiler/rustc_ty_utils/src/needs_drop.rs
index d274a934d52..9a3956596d2 100644
--- a/compiler/rustc_ty_utils/src/needs_drop.rs
+++ b/compiler/rustc_ty_utils/src/needs_drop.rs
@@ -366,7 +366,7 @@ fn adt_consider_insignificant_dtor<'tcx>(
 fn adt_drop_tys<'tcx>(
     tcx: TyCtxt<'tcx>,
     def_id: DefId,
-) -> Result<&ty::List<Ty<'tcx>>, AlwaysRequiresDrop> {
+) -> Result<&'tcx ty::List<Ty<'tcx>>, AlwaysRequiresDrop> {
     // This is for the "adt_drop_tys" query, that considers all `Drop` impls, therefore all dtors are
     // significant.
     let adt_has_dtor =
diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs
index bbfe412fbcf..7f0efede240 100644
--- a/library/core/src/lib.rs
+++ b/library/core/src/lib.rs
@@ -193,6 +193,7 @@
 // Language features:
 // tidy-alphabetical-start
 #![cfg_attr(bootstrap, feature(asm_const))]
+#![cfg_attr(bootstrap, feature(const_fn_floating_point_arithmetic))]
 #![cfg_attr(bootstrap, feature(min_exhaustive_patterns))]
 #![feature(abi_unadjusted)]
 #![feature(adt_const_params)]
@@ -202,7 +203,6 @@
 #![feature(cfg_sanitize)]
 #![feature(cfg_target_has_atomic)]
 #![feature(cfg_target_has_atomic_equal_alignment)]
-#![feature(const_fn_floating_point_arithmetic)]
 #![feature(const_for)]
 #![feature(const_mut_refs)]
 #![feature(const_precise_live_drops)]
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs
index 374fa086aec..5654f5aa4b8 100644
--- a/library/core/src/marker.rs
+++ b/library/core/src/marker.rs
@@ -1097,7 +1097,6 @@ pub mod effects {
     pub trait TyCompat<T: ?Sized> {}
 
     impl<T: ?Sized> TyCompat<T> for T {}
-    impl<T: ?Sized> TyCompat<T> for Maybe {}
     impl<T: ?Sized> TyCompat<Maybe> for T {}
 
     #[lang = "EffectsIntersection"]
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs
index 3fe5212cea7..65e473d99b3 100644
--- a/library/core/src/ptr/mod.rs
+++ b/library/core/src/ptr/mod.rs
@@ -2130,6 +2130,33 @@ pub fn addr_eq<T: ?Sized, U: ?Sized>(p: *const T, q: *const U) -> bool {
     (p as *const ()) == (q as *const ())
 }
 
+/// Compares the *addresses* of the two function pointers for equality.
+///
+/// Function pointers comparisons can have surprising results since
+/// they are never guaranteed to be unique and could vary between different
+/// code generation units. Furthermore, different functions could have the
+/// same address after being merged together.
+///
+/// This is the same as `f == g` but using this function makes clear
+/// that you are aware of these potentially surprising semantics.
+///
+/// # Examples
+///
+/// ```
+/// #![feature(ptr_fn_addr_eq)]
+/// use std::ptr;
+///
+/// fn a() { println!("a"); }
+/// fn b() { println!("b"); }
+/// assert!(!ptr::fn_addr_eq(a as fn(), b as fn()));
+/// ```
+#[unstable(feature = "ptr_fn_addr_eq", issue = "129322")]
+#[inline(always)]
+#[must_use = "function pointer comparison produces a value"]
+pub fn fn_addr_eq<T: FnPtr, U: FnPtr>(f: T, g: U) -> bool {
+    f.addr() == g.addr()
+}
+
 /// Hash a raw pointer.
 ///
 /// This can be used to hash a `&T` reference (which coerces to `*const T` implicitly)
diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs
index e818b448270..190eed94555 100644
--- a/library/std/src/panicking.rs
+++ b/library/std/src/panicking.rs
@@ -275,7 +275,7 @@ fn default_hook(info: &PanicHookInfo<'_>) {
                     if cfg!(miri) {
                         let _ = writeln!(
                             err,
-                            "note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` \
+                            "note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` \
                                 for the environment variable to have an effect"
                         );
                     }
diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs
index 5b96529fed7..ab03f620230 100644
--- a/src/librustdoc/passes/collect_intra_doc_links.rs
+++ b/src/librustdoc/passes/collect_intra_doc_links.rs
@@ -53,7 +53,7 @@ fn filter_assoc_items_by_name_and_namespace<'a>(
     assoc_items_of: DefId,
     ident: Ident,
     ns: Namespace,
-) -> impl Iterator<Item = &ty::AssocItem> + 'a {
+) -> impl Iterator<Item = &'a ty::AssocItem> + 'a {
     tcx.associated_items(assoc_items_of).filter_by_name_unhygienic(ident.name).filter(move |item| {
         item.kind.namespace() == ns && tcx.hygienic_eq(ident, item.ident(tcx), assoc_items_of)
     })
diff --git a/src/tools/clippy/clippy_lints/src/unused_io_amount.rs b/src/tools/clippy/clippy_lints/src/unused_io_amount.rs
index 448946bd66d..c6ca17175e2 100644
--- a/src/tools/clippy/clippy_lints/src/unused_io_amount.rs
+++ b/src/tools/clippy/clippy_lints/src/unused_io_amount.rs
@@ -235,7 +235,7 @@ fn unpack_match<'a>(mut expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> {
 
 /// If `expr` is an (e).await, return the inner expression "e" that's being
 /// waited on.  Otherwise return None.
-fn unpack_await<'a>(expr: &'a hir::Expr<'a>) -> &hir::Expr<'a> {
+fn unpack_await<'a>(expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> {
     if let ExprKind::Match(expr, _, hir::MatchSource::AwaitDesugar) = expr.kind {
         if let ExprKind::Call(func, [ref arg_0, ..]) = expr.kind {
             if matches!(
diff --git a/src/tools/clippy/tests/ui/floating_point_abs.fixed b/src/tools/clippy/tests/ui/floating_point_abs.fixed
index 5312a8b29c6..33183c76972 100644
--- a/src/tools/clippy/tests/ui/floating_point_abs.fixed
+++ b/src/tools/clippy/tests/ui/floating_point_abs.fixed
@@ -1,4 +1,3 @@
-#![feature(const_fn_floating_point_arithmetic)]
 #![warn(clippy::suboptimal_flops)]
 
 /// Allow suboptimal ops in constant context
diff --git a/src/tools/clippy/tests/ui/floating_point_abs.rs b/src/tools/clippy/tests/ui/floating_point_abs.rs
index 8619177130c..a08d5bbcef5 100644
--- a/src/tools/clippy/tests/ui/floating_point_abs.rs
+++ b/src/tools/clippy/tests/ui/floating_point_abs.rs
@@ -1,4 +1,3 @@
-#![feature(const_fn_floating_point_arithmetic)]
 #![warn(clippy::suboptimal_flops)]
 
 /// Allow suboptimal ops in constant context
diff --git a/src/tools/clippy/tests/ui/floating_point_abs.stderr b/src/tools/clippy/tests/ui/floating_point_abs.stderr
index f5a778c5b76..0c1f68f3b7f 100644
--- a/src/tools/clippy/tests/ui/floating_point_abs.stderr
+++ b/src/tools/clippy/tests/ui/floating_point_abs.stderr
@@ -1,5 +1,5 @@
 error: manual implementation of `abs` method
-  --> tests/ui/floating_point_abs.rs:15:5
+  --> tests/ui/floating_point_abs.rs:14:5
    |
 LL |     if num >= 0.0 { num } else { -num }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
@@ -8,43 +8,43 @@ LL |     if num >= 0.0 { num } else { -num }
    = help: to override `-D warnings` add `#[allow(clippy::suboptimal_flops)]`
 
 error: manual implementation of `abs` method
-  --> tests/ui/floating_point_abs.rs:19:5
+  --> tests/ui/floating_point_abs.rs:18:5
    |
 LL |     if 0.0 < num { num } else { -num }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
 
 error: manual implementation of `abs` method
-  --> tests/ui/floating_point_abs.rs:23:5
+  --> tests/ui/floating_point_abs.rs:22:5
    |
 LL |     if a.a > 0.0 { a.a } else { -a.a }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()`
 
 error: manual implementation of `abs` method
-  --> tests/ui/floating_point_abs.rs:27:5
+  --> tests/ui/floating_point_abs.rs:26:5
    |
 LL |     if 0.0 >= num { -num } else { num }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()`
 
 error: manual implementation of `abs` method
-  --> tests/ui/floating_point_abs.rs:31:5
+  --> tests/ui/floating_point_abs.rs:30:5
    |
 LL |     if a.a < 0.0 { -a.a } else { a.a }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()`
 
 error: manual implementation of negation of `abs` method
-  --> tests/ui/floating_point_abs.rs:35:5
+  --> tests/ui/floating_point_abs.rs:34:5
    |
 LL |     if num < 0.0 { num } else { -num }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()`
 
 error: manual implementation of negation of `abs` method
-  --> tests/ui/floating_point_abs.rs:39:5
+  --> tests/ui/floating_point_abs.rs:38:5
    |
 LL |     if 0.0 >= num { num } else { -num }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()`
 
 error: manual implementation of negation of `abs` method
-  --> tests/ui/floating_point_abs.rs:44:12
+  --> tests/ui/floating_point_abs.rs:43:12
    |
 LL |         a: if a.a >= 0.0 { -a.a } else { a.a },
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-a.a.abs()`
diff --git a/src/tools/clippy/tests/ui/floating_point_mul_add.fixed b/src/tools/clippy/tests/ui/floating_point_mul_add.fixed
index 3ce2edf2c71..164aac2601a 100644
--- a/src/tools/clippy/tests/ui/floating_point_mul_add.fixed
+++ b/src/tools/clippy/tests/ui/floating_point_mul_add.fixed
@@ -1,4 +1,3 @@
-#![feature(const_fn_floating_point_arithmetic)]
 #![warn(clippy::suboptimal_flops)]
 
 /// Allow suboptimal_ops in constant context
diff --git a/src/tools/clippy/tests/ui/floating_point_mul_add.rs b/src/tools/clippy/tests/ui/floating_point_mul_add.rs
index b5e4a8db4db..ae024b7f224 100644
--- a/src/tools/clippy/tests/ui/floating_point_mul_add.rs
+++ b/src/tools/clippy/tests/ui/floating_point_mul_add.rs
@@ -1,4 +1,3 @@
-#![feature(const_fn_floating_point_arithmetic)]
 #![warn(clippy::suboptimal_flops)]
 
 /// Allow suboptimal_ops in constant context
diff --git a/src/tools/clippy/tests/ui/floating_point_mul_add.stderr b/src/tools/clippy/tests/ui/floating_point_mul_add.stderr
index 3e1a071de73..9c75909f715 100644
--- a/src/tools/clippy/tests/ui/floating_point_mul_add.stderr
+++ b/src/tools/clippy/tests/ui/floating_point_mul_add.stderr
@@ -1,5 +1,5 @@
 error: multiply and add expressions can be calculated more efficiently and accurately
-  --> tests/ui/floating_point_mul_add.rs:20:13
+  --> tests/ui/floating_point_mul_add.rs:19:13
    |
 LL |     let _ = a * b + c;
    |             ^^^^^^^^^ help: consider using: `a.mul_add(b, c)`
@@ -8,73 +8,73 @@ LL |     let _ = a * b + c;
    = help: to override `-D warnings` add `#[allow(clippy::suboptimal_flops)]`
 
 error: multiply and add expressions can be calculated more efficiently and accurately
-  --> tests/ui/floating_point_mul_add.rs:21:13
+  --> tests/ui/floating_point_mul_add.rs:20:13
    |
 LL |     let _ = a * b - c;
    |             ^^^^^^^^^ help: consider using: `a.mul_add(b, -c)`
 
 error: multiply and add expressions can be calculated more efficiently and accurately
-  --> tests/ui/floating_point_mul_add.rs:22:13
+  --> tests/ui/floating_point_mul_add.rs:21:13
    |
 LL |     let _ = c + a * b;
    |             ^^^^^^^^^ help: consider using: `a.mul_add(b, c)`
 
 error: multiply and add expressions can be calculated more efficiently and accurately
-  --> tests/ui/floating_point_mul_add.rs:23:13
+  --> tests/ui/floating_point_mul_add.rs:22:13
    |
 LL |     let _ = c - a * b;
    |             ^^^^^^^^^ help: consider using: `a.mul_add(-b, c)`
 
 error: multiply and add expressions can be calculated more efficiently and accurately
-  --> tests/ui/floating_point_mul_add.rs:24:13
+  --> tests/ui/floating_point_mul_add.rs:23:13
    |
 LL |     let _ = a + 2.0 * 4.0;
    |             ^^^^^^^^^^^^^ help: consider using: `2.0f64.mul_add(4.0, a)`
 
 error: multiply and add expressions can be calculated more efficiently and accurately
-  --> tests/ui/floating_point_mul_add.rs:25:13
+  --> tests/ui/floating_point_mul_add.rs:24:13
    |
 LL |     let _ = a + 2. * 4.;
    |             ^^^^^^^^^^^ help: consider using: `2.0f64.mul_add(4., a)`
 
 error: multiply and add expressions can be calculated more efficiently and accurately
-  --> tests/ui/floating_point_mul_add.rs:27:13
+  --> tests/ui/floating_point_mul_add.rs:26:13
    |
 LL |     let _ = (a * b) + c;
    |             ^^^^^^^^^^^ help: consider using: `a.mul_add(b, c)`
 
 error: multiply and add expressions can be calculated more efficiently and accurately
-  --> tests/ui/floating_point_mul_add.rs:28:13
+  --> tests/ui/floating_point_mul_add.rs:27:13
    |
 LL |     let _ = c + (a * b);
    |             ^^^^^^^^^^^ help: consider using: `a.mul_add(b, c)`
 
 error: multiply and add expressions can be calculated more efficiently and accurately
-  --> tests/ui/floating_point_mul_add.rs:29:13
+  --> tests/ui/floating_point_mul_add.rs:28:13
    |
 LL |     let _ = a * b * c + d;
    |             ^^^^^^^^^^^^^ help: consider using: `(a * b).mul_add(c, d)`
 
 error: multiply and add expressions can be calculated more efficiently and accurately
-  --> tests/ui/floating_point_mul_add.rs:31:13
+  --> tests/ui/floating_point_mul_add.rs:30:13
    |
 LL |     let _ = a.mul_add(b, c) * a.mul_add(b, c) + a.mul_add(b, c) + c;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `a.mul_add(b, c).mul_add(a.mul_add(b, c), a.mul_add(b, c))`
 
 error: multiply and add expressions can be calculated more efficiently and accurately
-  --> tests/ui/floating_point_mul_add.rs:32:13
+  --> tests/ui/floating_point_mul_add.rs:31:13
    |
 LL |     let _ = 1234.567_f64 * 45.67834_f64 + 0.0004_f64;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1234.567_f64.mul_add(45.67834_f64, 0.0004_f64)`
 
 error: multiply and add expressions can be calculated more efficiently and accurately
-  --> tests/ui/floating_point_mul_add.rs:34:13
+  --> tests/ui/floating_point_mul_add.rs:33:13
    |
 LL |     let _ = (a * a + b).sqrt();
    |             ^^^^^^^^^^^ help: consider using: `a.mul_add(a, b)`
 
 error: multiply and add expressions can be calculated more efficiently and accurately
-  --> tests/ui/floating_point_mul_add.rs:37:13
+  --> tests/ui/floating_point_mul_add.rs:36:13
    |
 LL |     let _ = a - (b * u as f64);
    |             ^^^^^^^^^^^^^^^^^^ help: consider using: `b.mul_add(-(u as f64), a)`
diff --git a/src/tools/clippy/tests/ui/floating_point_rad.fixed b/src/tools/clippy/tests/ui/floating_point_rad.fixed
index a710bd9bd60..2f93d233cb4 100644
--- a/src/tools/clippy/tests/ui/floating_point_rad.fixed
+++ b/src/tools/clippy/tests/ui/floating_point_rad.fixed
@@ -1,4 +1,3 @@
-#![feature(const_fn_floating_point_arithmetic)]
 #![warn(clippy::suboptimal_flops)]
 
 /// Allow suboptimal_flops in constant context
diff --git a/src/tools/clippy/tests/ui/floating_point_rad.rs b/src/tools/clippy/tests/ui/floating_point_rad.rs
index 14656f021df..9690effc4e1 100644
--- a/src/tools/clippy/tests/ui/floating_point_rad.rs
+++ b/src/tools/clippy/tests/ui/floating_point_rad.rs
@@ -1,4 +1,3 @@
-#![feature(const_fn_floating_point_arithmetic)]
 #![warn(clippy::suboptimal_flops)]
 
 /// Allow suboptimal_flops in constant context
diff --git a/src/tools/clippy/tests/ui/floating_point_rad.stderr b/src/tools/clippy/tests/ui/floating_point_rad.stderr
index 64674342c2b..b834f5374e0 100644
--- a/src/tools/clippy/tests/ui/floating_point_rad.stderr
+++ b/src/tools/clippy/tests/ui/floating_point_rad.stderr
@@ -1,5 +1,5 @@
 error: conversion to radians can be done more accurately
-  --> tests/ui/floating_point_rad.rs:11:13
+  --> tests/ui/floating_point_rad.rs:10:13
    |
 LL |     let _ = degrees as f64 * std::f64::consts::PI / 180.0;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(degrees as f64).to_radians()`
@@ -8,43 +8,43 @@ LL |     let _ = degrees as f64 * std::f64::consts::PI / 180.0;
    = help: to override `-D warnings` add `#[allow(clippy::suboptimal_flops)]`
 
 error: conversion to degrees can be done more accurately
-  --> tests/ui/floating_point_rad.rs:12:13
+  --> tests/ui/floating_point_rad.rs:11:13
    |
 LL |     let _ = degrees as f64 * 180.0 / std::f64::consts::PI;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(degrees as f64).to_degrees()`
 
 error: conversion to degrees can be done more accurately
-  --> tests/ui/floating_point_rad.rs:17:13
+  --> tests/ui/floating_point_rad.rs:16:13
    |
 LL |     let _ = x * 180f32 / std::f32::consts::PI;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.to_degrees()`
 
 error: conversion to degrees can be done more accurately
-  --> tests/ui/floating_point_rad.rs:18:13
+  --> tests/ui/floating_point_rad.rs:17:13
    |
 LL |     let _ = 90. * 180f64 / std::f64::consts::PI;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `90.0_f64.to_degrees()`
 
 error: conversion to degrees can be done more accurately
-  --> tests/ui/floating_point_rad.rs:19:13
+  --> tests/ui/floating_point_rad.rs:18:13
    |
 LL |     let _ = 90.5 * 180f64 / std::f64::consts::PI;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `90.5_f64.to_degrees()`
 
 error: conversion to radians can be done more accurately
-  --> tests/ui/floating_point_rad.rs:20:13
+  --> tests/ui/floating_point_rad.rs:19:13
    |
 LL |     let _ = x * std::f32::consts::PI / 180f32;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.to_radians()`
 
 error: conversion to radians can be done more accurately
-  --> tests/ui/floating_point_rad.rs:21:13
+  --> tests/ui/floating_point_rad.rs:20:13
    |
 LL |     let _ = 90. * std::f32::consts::PI / 180f32;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `90.0_f64.to_radians()`
 
 error: conversion to radians can be done more accurately
-  --> tests/ui/floating_point_rad.rs:22:13
+  --> tests/ui/floating_point_rad.rs:21:13
    |
 LL |     let _ = 90.5 * std::f32::consts::PI / 180f32;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `90.5_f64.to_radians()`
diff --git a/src/tools/miri/src/concurrency/thread.rs b/src/tools/miri/src/concurrency/thread.rs
index f72591f0c4b..a4d3e3f7af3 100644
--- a/src/tools/miri/src/concurrency/thread.rs
+++ b/src/tools/miri/src/concurrency/thread.rs
@@ -1157,7 +1157,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
     }
 
     #[inline]
-    fn get_thread_name<'c>(&'c self, thread: ThreadId) -> Option<&[u8]>
+    fn get_thread_name<'c>(&'c self, thread: ThreadId) -> Option<&'c [u8]>
     where
         'tcx: 'c,
     {
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr
index 42beed4ecde..a11a2b95689 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/exported_symbol_bad_unwind1.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding
   --> $DIR/exported_symbol_bad_unwind1.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr
index 112a9687837..12425cc4892 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
 panic in a function that cannot unwind
 stack backtrace:
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr
index 112a9687837..12425cc4892 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
 panic in a function that cannot unwind
 stack backtrace:
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr
index bc3e4858716..f9e299bf5d2 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding
   --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr
index a2fa4c1d590..83efc9974e8 100644
--- a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr
+++ b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/return_pointer_on_unwind.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
   --> $DIR/return_pointer_on_unwind.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr b/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr
index 8dd76edafea..67fd60e572e 100644
--- a/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
 aborted execution: attempted to instantiate uninhabited type `!`
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 thread caused non-unwinding panic. aborting.
 error: abnormal termination: the program aborted execution
   --> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
diff --git a/src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr b/src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr
index 55f66a275b6..f89a1fc4bbb 100644
--- a/src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
 aborted execution: attempted to zero-initialize type `fn()`, which is invalid
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 thread caused non-unwinding panic. aborting.
 error: abnormal termination: the program aborted execution
   --> RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
diff --git a/src/tools/miri/tests/fail/panic/bad_unwind.stderr b/src/tools/miri/tests/fail/panic/bad_unwind.stderr
index 230e8337c7c..c08fe5153b1 100644
--- a/src/tools/miri/tests/fail/panic/bad_unwind.stderr
+++ b/src/tools/miri/tests/fail/panic/bad_unwind.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/bad_unwind.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding
   --> $DIR/bad_unwind.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/panic/double_panic.stderr b/src/tools/miri/tests/fail/panic/double_panic.stderr
index 5829c1897bb..0395fe418d9 100644
--- a/src/tools/miri/tests/fail/panic/double_panic.stderr
+++ b/src/tools/miri/tests/fail/panic/double_panic.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/double_panic.rs:LL:CC:
 first
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 thread 'main' panicked at $DIR/double_panic.rs:LL:CC:
 second
 stack backtrace:
diff --git a/src/tools/miri/tests/fail/panic/panic_abort1.stderr b/src/tools/miri/tests/fail/panic/panic_abort1.stderr
index d4abf19cd1e..6c7cac23bec 100644
--- a/src/tools/miri/tests/fail/panic/panic_abort1.stderr
+++ b/src/tools/miri/tests/fail/panic/panic_abort1.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/panic_abort1.rs:LL:CC:
 panicking from libstd
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 error: abnormal termination: the program aborted execution
   --> RUSTLIB/panic_abort/src/lib.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/panic/panic_abort2.stderr b/src/tools/miri/tests/fail/panic/panic_abort2.stderr
index 507f17abf4e..1eda5449d1b 100644
--- a/src/tools/miri/tests/fail/panic/panic_abort2.stderr
+++ b/src/tools/miri/tests/fail/panic/panic_abort2.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/panic_abort2.rs:LL:CC:
 42-panicking from libstd
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 error: abnormal termination: the program aborted execution
   --> RUSTLIB/panic_abort/src/lib.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/panic/panic_abort3.stderr b/src/tools/miri/tests/fail/panic/panic_abort3.stderr
index a5d8b4d2eeb..5c7c5e17bee 100644
--- a/src/tools/miri/tests/fail/panic/panic_abort3.stderr
+++ b/src/tools/miri/tests/fail/panic/panic_abort3.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/panic_abort3.rs:LL:CC:
 panicking from libcore
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 error: abnormal termination: the program aborted execution
   --> RUSTLIB/panic_abort/src/lib.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/panic/panic_abort4.stderr b/src/tools/miri/tests/fail/panic/panic_abort4.stderr
index 62fbbf942cb..c8104f570f6 100644
--- a/src/tools/miri/tests/fail/panic/panic_abort4.stderr
+++ b/src/tools/miri/tests/fail/panic/panic_abort4.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/panic_abort4.rs:LL:CC:
 42-panicking from libcore
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 error: abnormal termination: the program aborted execution
   --> RUSTLIB/panic_abort/src/lib.rs:LL:CC
    |
diff --git a/src/tools/miri/tests/fail/terminate-terminator.stderr b/src/tools/miri/tests/fail/terminate-terminator.stderr
index a5fa0b3e07a..6384689c563 100644
--- a/src/tools/miri/tests/fail/terminate-terminator.stderr
+++ b/src/tools/miri/tests/fail/terminate-terminator.stderr
@@ -3,7 +3,7 @@ warning: You have explicitly enabled MIR optimizations, overriding Miri's defaul
 thread 'main' panicked at $DIR/terminate-terminator.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
 panic in a function that cannot unwind
 stack backtrace:
diff --git a/src/tools/miri/tests/fail/unwind-action-terminate.stderr b/src/tools/miri/tests/fail/unwind-action-terminate.stderr
index 547d550d3d0..fd67bdf4a90 100644
--- a/src/tools/miri/tests/fail/unwind-action-terminate.stderr
+++ b/src/tools/miri/tests/fail/unwind-action-terminate.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/unwind-action-terminate.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
 panic in a function that cannot unwind
 stack backtrace:
diff --git a/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr b/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr
index 5b309ed09bb..319a10febb3 100644
--- a/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr
+++ b/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr
@@ -1,5 +1,5 @@
 thread 'main' panicked at $DIR/alloc_error_handler_hook.rs:LL:CC:
 alloc error hook called
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 yes we are unwinding!
diff --git a/src/tools/miri/tests/panic/alloc_error_handler_panic.stderr b/src/tools/miri/tests/panic/alloc_error_handler_panic.stderr
index 3d5457799f6..2cdff03f10f 100644
--- a/src/tools/miri/tests/panic/alloc_error_handler_panic.stderr
+++ b/src/tools/miri/tests/panic/alloc_error_handler_panic.stderr
@@ -1,5 +1,5 @@
 thread 'main' panicked at RUSTLIB/std/src/alloc.rs:LL:CC:
 memory allocation of 4 bytes failed
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 yes we are unwinding!
diff --git a/src/tools/miri/tests/panic/div-by-zero-2.stderr b/src/tools/miri/tests/panic/div-by-zero-2.stderr
index f0b84ea6fd6..ed394f76b0e 100644
--- a/src/tools/miri/tests/panic/div-by-zero-2.stderr
+++ b/src/tools/miri/tests/panic/div-by-zero-2.stderr
@@ -1,4 +1,4 @@
 thread 'main' panicked at $DIR/div-by-zero-2.rs:LL:CC:
 attempt to divide by zero
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr b/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr
index f77f6f01119..6733f2e42c1 100644
--- a/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr
+++ b/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC:
 explicit panic
 thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC:
diff --git a/src/tools/miri/tests/panic/oob_subslice.stderr b/src/tools/miri/tests/panic/oob_subslice.stderr
index c116f8eb525..46f0f643a47 100644
--- a/src/tools/miri/tests/panic/oob_subslice.stderr
+++ b/src/tools/miri/tests/panic/oob_subslice.stderr
@@ -1,4 +1,4 @@
 thread 'main' panicked at $DIR/oob_subslice.rs:LL:CC:
 range end index 5 out of range for slice of length 4
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr b/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr
index 1d057ea5eb4..be822bd0285 100644
--- a/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr
+++ b/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr
@@ -1,4 +1,4 @@
 thread 'main' panicked at $DIR/overflowing-lsh-neg.rs:LL:CC:
 attempt to shift left with overflow
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/overflowing-rsh-1.stderr b/src/tools/miri/tests/panic/overflowing-rsh-1.stderr
index d1a79400bfa..fc090aba5fd 100644
--- a/src/tools/miri/tests/panic/overflowing-rsh-1.stderr
+++ b/src/tools/miri/tests/panic/overflowing-rsh-1.stderr
@@ -1,4 +1,4 @@
 thread 'main' panicked at $DIR/overflowing-rsh-1.rs:LL:CC:
 attempt to shift right with overflow
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/overflowing-rsh-2.stderr b/src/tools/miri/tests/panic/overflowing-rsh-2.stderr
index 612b0c0c4c2..77160e1870f 100644
--- a/src/tools/miri/tests/panic/overflowing-rsh-2.stderr
+++ b/src/tools/miri/tests/panic/overflowing-rsh-2.stderr
@@ -1,4 +1,4 @@
 thread 'main' panicked at $DIR/overflowing-rsh-2.rs:LL:CC:
 attempt to shift right with overflow
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/panic2.stderr b/src/tools/miri/tests/panic/panic2.stderr
index 792c71346fd..f7408310093 100644
--- a/src/tools/miri/tests/panic/panic2.stderr
+++ b/src/tools/miri/tests/panic/panic2.stderr
@@ -1,4 +1,4 @@
 thread 'main' panicked at $DIR/panic2.rs:LL:CC:
 42-panicking from libstd
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/panic3.stderr b/src/tools/miri/tests/panic/panic3.stderr
index f8016bc3912..32ba400e025 100644
--- a/src/tools/miri/tests/panic/panic3.stderr
+++ b/src/tools/miri/tests/panic/panic3.stderr
@@ -1,4 +1,4 @@
 thread 'main' panicked at $DIR/panic3.rs:LL:CC:
 panicking from libcore
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/panic4.stderr b/src/tools/miri/tests/panic/panic4.stderr
index 67410bf3b1a..a8a23ee3ce1 100644
--- a/src/tools/miri/tests/panic/panic4.stderr
+++ b/src/tools/miri/tests/panic/panic4.stderr
@@ -1,4 +1,4 @@
 thread 'main' panicked at $DIR/panic4.rs:LL:CC:
 42-panicking from libcore
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/transmute_fat2.stderr b/src/tools/miri/tests/panic/transmute_fat2.stderr
index 2ee01d46931..021ca1c4b32 100644
--- a/src/tools/miri/tests/panic/transmute_fat2.stderr
+++ b/src/tools/miri/tests/panic/transmute_fat2.stderr
@@ -1,4 +1,4 @@
 thread 'main' panicked at $DIR/transmute_fat2.rs:LL:CC:
 index out of bounds: the len is 0 but the index is 0
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/unsupported_foreign_function.stderr b/src/tools/miri/tests/panic/unsupported_foreign_function.stderr
index d0a7d8dafc5..fcc4220bfce 100644
--- a/src/tools/miri/tests/panic/unsupported_foreign_function.stderr
+++ b/src/tools/miri/tests/panic/unsupported_foreign_function.stderr
@@ -1,4 +1,4 @@
 thread 'main' panicked at $DIR/unsupported_foreign_function.rs:LL:CC:
 unsupported Miri functionality: can't call foreign function `foo` on $OS
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/unsupported_syscall.stderr b/src/tools/miri/tests/panic/unsupported_syscall.stderr
index f802159cb1c..660cfba8900 100644
--- a/src/tools/miri/tests/panic/unsupported_syscall.stderr
+++ b/src/tools/miri/tests/panic/unsupported_syscall.stderr
@@ -1,4 +1,4 @@
 thread 'main' panicked at $DIR/unsupported_syscall.rs:LL:CC:
 unsupported Miri functionality: can't execute syscall with ID 0
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/pass/panic/catch_panic.stderr b/src/tools/miri/tests/pass/panic/catch_panic.stderr
index a472a5d80cb..f61b39493ed 100644
--- a/src/tools/miri/tests/pass/panic/catch_panic.stderr
+++ b/src/tools/miri/tests/pass/panic/catch_panic.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/catch_panic.rs:LL:CC:
 Hello from std::panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 Caught panic message (&str): Hello from std::panic
 thread 'main' panicked at $DIR/catch_panic.rs:LL:CC:
 Hello from std::panic: 1
diff --git a/src/tools/miri/tests/pass/panic/concurrent-panic.stderr b/src/tools/miri/tests/pass/panic/concurrent-panic.stderr
index b2a5cf4922c..fe0d16ca78a 100644
--- a/src/tools/miri/tests/pass/panic/concurrent-panic.stderr
+++ b/src/tools/miri/tests/pass/panic/concurrent-panic.stderr
@@ -3,7 +3,7 @@ Thread 1 reported it has started
 thread '<unnamed>' panicked at $DIR/concurrent-panic.rs:LL:CC:
 panic in thread 2
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 Thread 2 blocking on thread 1
 Thread 2 reported it has started
 Unlocking mutex
diff --git a/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr b/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr
index 3efb4be40f9..a346d31f645 100644
--- a/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr
+++ b/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/nested_panic_caught.rs:LL:CC:
 once
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 thread 'main' panicked at $DIR/nested_panic_caught.rs:LL:CC:
 twice
 stack backtrace:
diff --git a/src/tools/miri/tests/pass/panic/thread_panic.stderr b/src/tools/miri/tests/pass/panic/thread_panic.stderr
index bdfe4f98ba3..0fde5922c19 100644
--- a/src/tools/miri/tests/pass/panic/thread_panic.stderr
+++ b/src/tools/miri/tests/pass/panic/thread_panic.stderr
@@ -1,6 +1,6 @@
 thread '<unnamed>' panicked at $DIR/thread_panic.rs:LL:CC:
 Hello!
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-note: in Miri, you may have to set `-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
+note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 thread 'childthread' panicked at $DIR/thread_panic.rs:LL:CC:
 Hello, world!
diff --git a/tests/crashes/127972.rs b/tests/crashes/127972.rs
index d0764f875db..797dd7e6020 100644
--- a/tests/crashes/127972.rs
+++ b/tests/crashes/127972.rs
@@ -1,5 +1,5 @@
 //@ known-bug: #127962
-#![feature(generic_const_exprs)]
+#![feature(generic_const_exprs, const_arg_path)]
 
 fn zero_init<const usize: usize>() -> Substs1<{ (N) }> {
     Substs1([0; { (usize) }])
diff --git a/tests/crashes/128016.rs b/tests/crashes/128016.rs
deleted file mode 100644
index d23721ae14e..00000000000
--- a/tests/crashes/128016.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-//@ known-bug: #128016
-macro_rules! len {
-    () => {
-        target
-    };
-}
-
-fn main() {
-    let val: [str; len!()] = [];
-}
diff --git a/tests/ui-fulldeps/stable-mir/check_instance.rs b/tests/ui-fulldeps/stable-mir/check_instance.rs
index 5e3f2557566..5449c09d35a 100644
--- a/tests/ui-fulldeps/stable-mir/check_instance.rs
+++ b/tests/ui-fulldeps/stable-mir/check_instance.rs
@@ -17,12 +17,14 @@ extern crate rustc_driver;
 extern crate rustc_interface;
 extern crate stable_mir;
 
-use mir::{mono::Instance, TerminatorKind::*};
+use std::io::Write;
+use std::ops::ControlFlow;
+
+use mir::mono::Instance;
+use mir::TerminatorKind::*;
 use rustc_smir::rustc_internal;
 use stable_mir::ty::{RigidTy, TyKind};
 use stable_mir::*;
-use std::io::Write;
-use std::ops::ControlFlow;
 
 const CRATE_NAME: &str = "input";
 
@@ -33,7 +35,7 @@ fn test_stable_mir() -> ControlFlow<()> {
     // Get all items and split generic vs monomorphic items.
     let (generic, mono): (Vec<_>, Vec<_>) =
         items.into_iter().partition(|item| item.requires_monomorphization());
-    assert_eq!(mono.len(), 3, "Expected 3 mono functions");
+    assert_eq!(mono.len(), 4, "Expected 3 mono functions");
     assert_eq!(generic.len(), 2, "Expected 2 generic functions");
 
     // For all monomorphic items, get the correspondent instances.
diff --git a/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs b/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs
index e07fa78463c..cdfeb9c434e 100644
--- a/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs
+++ b/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs
@@ -5,7 +5,9 @@
 #![feature(with_negative_coherence)]
 trait Trait {}
 impl<const N: u8> Trait for [(); N] {}
+//~^ ERROR: mismatched types
 impl<const N: i8> Trait for [(); N] {}
 //~^ ERROR: conflicting implementations of trait `Trait`
+//~| ERROR: mismatched types
 
 fn main() {}
diff --git a/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.stderr b/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.stderr
index 2087be8e711..d65450845bc 100644
--- a/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.stderr
+++ b/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.stderr
@@ -1,11 +1,25 @@
 error[E0119]: conflicting implementations of trait `Trait` for type `[(); _]`
-  --> $DIR/generic_const_type_mismatch.rs:8:1
+  --> $DIR/generic_const_type_mismatch.rs:9:1
    |
 LL | impl<const N: u8> Trait for [(); N] {}
    | ----------------------------------- first implementation here
+LL |
 LL | impl<const N: i8> Trait for [(); N] {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `[(); _]`
 
-error: aborting due to 1 previous error
+error[E0308]: mismatched types
+  --> $DIR/generic_const_type_mismatch.rs:7:34
+   |
+LL | impl<const N: u8> Trait for [(); N] {}
+   |                                  ^ expected `usize`, found `u8`
+
+error[E0308]: mismatched types
+  --> $DIR/generic_const_type_mismatch.rs:9:34
+   |
+LL | impl<const N: i8> Trait for [(); N] {}
+   |                                  ^ expected `usize`, found `i8`
+
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0119`.
+Some errors have detailed explanations: E0119, E0308.
+For more information about an error, try `rustc --explain E0119`.
diff --git a/tests/ui/const-generics/bad-subst-const-kind.rs b/tests/ui/const-generics/bad-subst-const-kind.rs
index cc2ff9b8dea..c4e74596e9f 100644
--- a/tests/ui/const-generics/bad-subst-const-kind.rs
+++ b/tests/ui/const-generics/bad-subst-const-kind.rs
@@ -7,6 +7,7 @@ trait Q {
 
 impl<const N: u64> Q for [u8; N] {
     //~^ ERROR: the constant `N` is not of type `usize`
+    //~| ERROR: mismatched types
     const ASSOC: usize = 1;
 }
 
diff --git a/tests/ui/const-generics/bad-subst-const-kind.stderr b/tests/ui/const-generics/bad-subst-const-kind.stderr
index 5c8d9c90363..21ec8f0768c 100644
--- a/tests/ui/const-generics/bad-subst-const-kind.stderr
+++ b/tests/ui/const-generics/bad-subst-const-kind.stderr
@@ -5,7 +5,7 @@ LL | impl<const N: u64> Q for [u8; N] {
    |                          ^^^^^^^ expected `usize`, found `u64`
 
 error: the constant `13` is not of type `u64`
-  --> $DIR/bad-subst-const-kind.rs:13:24
+  --> $DIR/bad-subst-const-kind.rs:14:24
    |
 LL | pub fn test() -> [u8; <[u8; 13] as Q>::ASSOC] {
    |                        ^^^^^^^^ expected `u64`, found `usize`
@@ -18,5 +18,12 @@ LL | impl<const N: u64> Q for [u8; N] {
    |      |
    |      unsatisfied trait bound introduced here
 
-error: aborting due to 2 previous errors
+error[E0308]: mismatched types
+  --> $DIR/bad-subst-const-kind.rs:8:31
+   |
+LL | impl<const N: u64> Q for [u8; N] {
+   |                               ^ expected `usize`, found `u64`
+
+error: aborting due to 3 previous errors
 
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/const-generics/early/trivial-const-arg-macro-nested.rs b/tests/ui/const-generics/early/trivial-const-arg-macro-nested.rs
new file mode 100644
index 00000000000..f9730cf8566
--- /dev/null
+++ b/tests/ui/const-generics/early/trivial-const-arg-macro-nested.rs
@@ -0,0 +1,21 @@
+//@ check-pass
+
+// This is a regression test for #128016.
+
+macro_rules! len_inner {
+    () => {
+        BAR
+    };
+}
+
+macro_rules! len {
+    () => {
+        len_inner!()
+    };
+}
+
+const BAR: usize = 0;
+
+fn main() {
+    let val: [bool; len!()] = [];
+}
diff --git a/tests/ui/const-generics/early/trivial-const-arg-macro-param.rs b/tests/ui/const-generics/early/trivial-const-arg-macro-param.rs
new file mode 100644
index 00000000000..f123e55c028
--- /dev/null
+++ b/tests/ui/const-generics/early/trivial-const-arg-macro-param.rs
@@ -0,0 +1,13 @@
+//@ check-pass
+
+macro_rules! len {
+    ($x:ident) => {
+        $x
+    };
+}
+
+fn bar<const N: usize>() {
+    let val: [bool; len!(N)] = [true; N];
+}
+
+fn main() {}
diff --git a/tests/ui/const-generics/early/trivial-const-arg-macro-res-error.rs b/tests/ui/const-generics/early/trivial-const-arg-macro-res-error.rs
new file mode 100644
index 00000000000..f218caac0cf
--- /dev/null
+++ b/tests/ui/const-generics/early/trivial-const-arg-macro-res-error.rs
@@ -0,0 +1,13 @@
+// This is a regression test for #128016.
+
+macro_rules! len {
+    () => {
+        target
+        //~^ ERROR cannot find value `target`
+    };
+}
+
+fn main() {
+    let val: [str; len!()] = [];
+    //~^ ERROR the size for values
+}
diff --git a/tests/ui/const-generics/early/trivial-const-arg-macro-res-error.stderr b/tests/ui/const-generics/early/trivial-const-arg-macro-res-error.stderr
new file mode 100644
index 00000000000..ab289e5a6b7
--- /dev/null
+++ b/tests/ui/const-generics/early/trivial-const-arg-macro-res-error.stderr
@@ -0,0 +1,24 @@
+error[E0425]: cannot find value `target` in this scope
+  --> $DIR/trivial-const-arg-macro-res-error.rs:5:9
+   |
+LL |         target
+   |         ^^^^^^ not found in this scope
+...
+LL |     let val: [str; len!()] = [];
+   |                    ------ in this macro invocation
+   |
+   = note: this error originates in the macro `len` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0277]: the size for values of type `str` cannot be known at compilation time
+  --> $DIR/trivial-const-arg-macro-res-error.rs:11:14
+   |
+LL |     let val: [str; len!()] = [];
+   |              ^^^^^^^^^^^^^ doesn't have a size known at compile-time
+   |
+   = help: the trait `Sized` is not implemented for `str`
+   = note: slice and array elements must have `Sized` type
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0277, E0425.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/const-generics/early/trivial-const-arg-macro.rs b/tests/ui/const-generics/early/trivial-const-arg-macro.rs
new file mode 100644
index 00000000000..a19d9abfdcb
--- /dev/null
+++ b/tests/ui/const-generics/early/trivial-const-arg-macro.rs
@@ -0,0 +1,15 @@
+//@ check-pass
+
+// This is a regression test for #128016.
+
+macro_rules! len {
+    () => {
+        BAR
+    };
+}
+
+const BAR: usize = 0;
+
+fn main() {
+    let val: [bool; len!()] = [];
+}
diff --git a/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs b/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs
index 8e5e23b2337..a45deabbb0f 100644
--- a/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs
+++ b/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs
@@ -8,6 +8,7 @@ trait Q {
 impl<const N: u64> Q for [u8; N] {}
 //~^ ERROR not all trait items implemented
 //~| ERROR the constant `N` is not of type `usize`
+//~| ERROR mismatched types
 
 pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {}
 //~^ ERROR the constant `13` is not of type `u64`
diff --git a/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr b/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr
index e03580ec007..68870a8d38d 100644
--- a/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr
@@ -14,7 +14,7 @@ LL | impl<const N: u64> Q for [u8; N] {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `ASSOC` in implementation
 
 error: the constant `13` is not of type `u64`
-  --> $DIR/type_mismatch.rs:12:26
+  --> $DIR/type_mismatch.rs:13:26
    |
 LL | pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {}
    |                          ^^^^^^^^ expected `u64`, found `usize`
@@ -28,14 +28,20 @@ LL | impl<const N: u64> Q for [u8; N] {}
    |      unsatisfied trait bound introduced here
 
 error[E0308]: mismatched types
-  --> $DIR/type_mismatch.rs:12:20
+  --> $DIR/type_mismatch.rs:13:20
    |
 LL | pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {}
    |        ------      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `[u8; <[u8; 13] as Q>::ASSOC]`, found `()`
    |        |
    |        implicitly returns `()` as its body has no tail or `return` expression
 
-error: aborting due to 4 previous errors
+error[E0308]: mismatched types
+  --> $DIR/type_mismatch.rs:8:31
+   |
+LL | impl<const N: u64> Q for [u8; N] {}
+   |                               ^ expected `usize`, found `u64`
+
+error: aborting due to 5 previous errors
 
 Some errors have detailed explanations: E0046, E0308.
 For more information about an error, try `rustc --explain E0046`.
diff --git a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs
index 8b7ee577569..05a3487ffca 100644
--- a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs
+++ b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs
@@ -14,8 +14,8 @@ mod v20 {
     //~^ ERROR cannot find value `v8` in this scope
     //~| ERROR cannot find function `v6` in this scope
     pub struct v17<const v10: usize, const v7: v11> {
-    //~^ WARN type `v17` should have an upper camel case name
-    //~| ERROR `[[usize; v4]; v4]` is forbidden as the type of a const generic parameter
+        //~^ WARN type `v17` should have an upper camel case name
+        //~| ERROR `[[usize; v4]; v4]` is forbidden as the type of a const generic parameter
         _p: (),
     }
 
@@ -25,10 +25,10 @@ mod v20 {
     }
 
     impl<const v10: usize> v17<v10, v2> {
-    //~^ ERROR maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#0}
-    //~| ERROR maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#0}
+        //~^ ERROR maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#1}
+        //~| ERROR maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#1}
         pub const fn v21() -> v18 {
-        //~^ ERROR cannot find type `v18` in this scope
+            //~^ ERROR cannot find type `v18` in this scope
             v18 { _p: () }
             //~^ ERROR cannot find struct, variant or union type `v18` in this scope
         }
diff --git a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr
index 15d3c472585..39f022fbee9 100644
--- a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr
@@ -72,13 +72,13 @@ help: add `#![feature(adt_const_params)]` to the crate attributes to enable more
 LL + #![feature(adt_const_params)]
    |
 
-error: maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#0}
+error: maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#1}
   --> $DIR/unevaluated-const-ice-119731.rs:27:37
    |
 LL |     impl<const v10: usize> v17<v10, v2> {
    |                                     ^^
 
-error: maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#0}
+error: maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#1}
   --> $DIR/unevaluated-const-ice-119731.rs:27:37
    |
 LL |     impl<const v10: usize> v17<v10, v2> {
diff --git a/tests/ui/const-generics/transmute-fail.rs b/tests/ui/const-generics/transmute-fail.rs
index 59b77c678e8..a9b297ffb62 100644
--- a/tests/ui/const-generics/transmute-fail.rs
+++ b/tests/ui/const-generics/transmute-fail.rs
@@ -2,108 +2,108 @@
 #![feature(generic_const_exprs)]
 #![allow(incomplete_features)]
 
-fn foo<const W: usize, const H: usize>(v: [[u32;H+1]; W]) -> [[u32; W+1]; H] {
-  unsafe {
-    std::mem::transmute(v)
-    //~^ ERROR cannot transmute
-  }
+fn foo<const W: usize, const H: usize>(v: [[u32; H + 1]; W]) -> [[u32; W + 1]; H] {
+    unsafe {
+        std::mem::transmute(v)
+        //~^ ERROR cannot transmute
+    }
 }
 
 fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] {
-  //~^ ERROR the constant `W` is not of type `usize`
-  unsafe {
-    std::mem::transmute(v)
-    //~^ ERROR the constant `W` is not of type `usize`
-  }
+    //~^ ERROR: the constant `W` is not of type `usize`
+    //~| ERROR: mismatched types
+    //~| ERROR: mismatched types
+    unsafe {
+        std::mem::transmute(v)
+        //~^ ERROR: the constant `W` is not of type `usize`
+    }
 }
 
 fn baz<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [u32; W * H * H] {
-  unsafe {
-    std::mem::transmute(v)
-    //~^ ERROR cannot transmute
-  }
+    unsafe {
+        std::mem::transmute(v)
+        //~^ ERROR cannot transmute
+    }
 }
 
 fn overflow(v: [[[u32; 8888888]; 9999999]; 777777777]) -> [[[u32; 9999999]; 777777777]; 8888888] {
-  unsafe {
-    std::mem::transmute(v)
-    //~^ ERROR cannot transmute
-  }
+    unsafe {
+        std::mem::transmute(v)
+        //~^ ERROR cannot transmute
+    }
 }
 
-fn transpose<const W: usize, const H: usize>(v: [[u32;H]; W]) -> [[u32; W]; H] {
-  unsafe {
-    std::mem::transmute(v)
-    //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
-  }
+fn transpose<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] {
+    unsafe {
+        std::mem::transmute(v)
+        //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
+    }
 }
 
 fn ident<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [[u32; H]; W] {
-  unsafe {
-    std::mem::transmute(v)
-  }
+    unsafe { std::mem::transmute(v) }
 }
 
 fn flatten<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [u32; W * H] {
-  unsafe {
-    std::mem::transmute(v)
-    //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
-  }
+    unsafe {
+        std::mem::transmute(v)
+        //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
+    }
 }
 
-fn coagulate<const W: usize, const H: usize>(v: [u32; H*W]) -> [[u32; W];H] {
-  unsafe {
-    std::mem::transmute(v)
-    //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
-  }
+fn coagulate<const W: usize, const H: usize>(v: [u32; H * W]) -> [[u32; W]; H] {
+    unsafe {
+        std::mem::transmute(v)
+        //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
+    }
 }
 
 fn flatten_3d<const W: usize, const H: usize, const D: usize>(
-  v: [[[u32; D]; H]; W]
+    v: [[[u32; D]; H]; W],
 ) -> [u32; D * W * H] {
-  unsafe {
-    std::mem::transmute(v)
-    //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
-  }
+    unsafe {
+        std::mem::transmute(v)
+        //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
+    }
 }
 
 fn flatten_somewhat<const W: usize, const H: usize, const D: usize>(
-  v: [[[u32; D]; H]; W]
+    v: [[[u32; D]; H]; W],
 ) -> [[u32; D * W]; H] {
-  unsafe {
-    std::mem::transmute(v)
-    //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
-  }
+    unsafe {
+        std::mem::transmute(v)
+        //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
+    }
 }
 
 fn known_size<const L: usize>(v: [u16; L]) -> [u8; L * 2] {
-  unsafe {
-    std::mem::transmute(v)
-    //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
-  }
+    unsafe {
+        std::mem::transmute(v)
+        //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
+    }
 }
 
 fn condense_bytes<const L: usize>(v: [u8; L * 2]) -> [u16; L] {
-  unsafe {
-    std::mem::transmute(v)
-    //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
-  }
+    unsafe {
+        std::mem::transmute(v)
+        //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
+    }
 }
 
-fn singleton_each<const L: usize>(v: [u8; L]) -> [[u8;1]; L] {
-  unsafe {
-    std::mem::transmute(v)
-    //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
-  }
+fn singleton_each<const L: usize>(v: [u8; L]) -> [[u8; 1]; L] {
+    unsafe {
+        std::mem::transmute(v)
+        //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
+    }
 }
 
 fn transpose_with_const<const W: usize, const H: usize>(
-  v: [[u32; 2 * H]; W + W]
+    v: [[u32; 2 * H]; W + W],
 ) -> [[u32; W + W]; 2 * H] {
-  unsafe {
-    std::mem::transmute(v)
-    //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
-  }
+    unsafe {
+        std::mem::transmute(v)
+        //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
+    }
 }
 
 fn main() {}
diff --git a/tests/ui/const-generics/transmute-fail.stderr b/tests/ui/const-generics/transmute-fail.stderr
index b40fb23c331..124fbee8850 100644
--- a/tests/ui/const-generics/transmute-fail.stderr
+++ b/tests/ui/const-generics/transmute-fail.stderr
@@ -5,119 +5,132 @@ LL | fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] {
    |                                          ^^^^^^^^^^^^^ expected `usize`, found `bool`
 
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute-fail.rs:7:5
+  --> $DIR/transmute-fail.rs:7:9
    |
-LL |     std::mem::transmute(v)
-   |     ^^^^^^^^^^^^^^^^^^^
+LL |         std::mem::transmute(v)
+   |         ^^^^^^^^^^^^^^^^^^^
    |
-   = note: source type: `[[u32; H+1]; W]` (size can vary because of [u32; H+1])
-   = note: target type: `[[u32; W+1]; H]` (size can vary because of [u32; W+1])
+   = note: source type: `[[u32; H + 1]; W]` (size can vary because of [u32; H + 1])
+   = note: target type: `[[u32; W + 1]; H]` (size can vary because of [u32; W + 1])
 
 error: the constant `W` is not of type `usize`
-  --> $DIR/transmute-fail.rs:15:5
+  --> $DIR/transmute-fail.rs:17:9
    |
-LL |     std::mem::transmute(v)
-   |     ^^^^^^^^^^^^^^^^^^^ expected `usize`, found `bool`
+LL |         std::mem::transmute(v)
+   |         ^^^^^^^^^^^^^^^^^^^ expected `usize`, found `bool`
 
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute-fail.rs:22:5
+  --> $DIR/transmute-fail.rs:24:9
    |
-LL |     std::mem::transmute(v)
-   |     ^^^^^^^^^^^^^^^^^^^
+LL |         std::mem::transmute(v)
+   |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `[[u32; H]; W]` (size can vary because of [u32; H])
    = note: target type: `[u32; W * H * H]` (this type does not have a fixed size)
 
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute-fail.rs:29:5
+  --> $DIR/transmute-fail.rs:31:9
    |
-LL |     std::mem::transmute(v)
-   |     ^^^^^^^^^^^^^^^^^^^
+LL |         std::mem::transmute(v)
+   |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `[[[u32; 8888888]; 9999999]; 777777777]` (values of the type `[[u32; 8888888]; 9999999]` are too big for the current architecture)
    = note: target type: `[[[u32; 9999999]; 777777777]; 8888888]` (values of the type `[[u32; 9999999]; 777777777]` are too big for the current architecture)
 
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute-fail.rs:36:5
+  --> $DIR/transmute-fail.rs:38:9
    |
-LL |     std::mem::transmute(v)
-   |     ^^^^^^^^^^^^^^^^^^^
+LL |         std::mem::transmute(v)
+   |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `[[u32; H]; W]` (size can vary because of [u32; H])
    = note: target type: `[[u32; W]; H]` (size can vary because of [u32; W])
 
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute-fail.rs:49:5
+  --> $DIR/transmute-fail.rs:49:9
    |
-LL |     std::mem::transmute(v)
-   |     ^^^^^^^^^^^^^^^^^^^
+LL |         std::mem::transmute(v)
+   |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `[[u32; H]; W]` (size can vary because of [u32; H])
    = note: target type: `[u32; W * H]` (this type does not have a fixed size)
 
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute-fail.rs:56:5
+  --> $DIR/transmute-fail.rs:56:9
    |
-LL |     std::mem::transmute(v)
-   |     ^^^^^^^^^^^^^^^^^^^
+LL |         std::mem::transmute(v)
+   |         ^^^^^^^^^^^^^^^^^^^
    |
-   = note: source type: `[u32; H*W]` (this type does not have a fixed size)
+   = note: source type: `[u32; H * W]` (this type does not have a fixed size)
    = note: target type: `[[u32; W]; H]` (size can vary because of [u32; W])
 
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute-fail.rs:65:5
+  --> $DIR/transmute-fail.rs:65:9
    |
-LL |     std::mem::transmute(v)
-   |     ^^^^^^^^^^^^^^^^^^^
+LL |         std::mem::transmute(v)
+   |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `[[[u32; D]; H]; W]` (size can vary because of [u32; D])
    = note: target type: `[u32; D * W * H]` (this type does not have a fixed size)
 
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute-fail.rs:74:5
+  --> $DIR/transmute-fail.rs:74:9
    |
-LL |     std::mem::transmute(v)
-   |     ^^^^^^^^^^^^^^^^^^^
+LL |         std::mem::transmute(v)
+   |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `[[[u32; D]; H]; W]` (size can vary because of [u32; D])
    = note: target type: `[[u32; D * W]; H]` (size can vary because of [u32; D * W])
 
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute-fail.rs:81:5
+  --> $DIR/transmute-fail.rs:81:9
    |
-LL |     std::mem::transmute(v)
-   |     ^^^^^^^^^^^^^^^^^^^
+LL |         std::mem::transmute(v)
+   |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `[u16; L]` (this type does not have a fixed size)
    = note: target type: `[u8; L * 2]` (this type does not have a fixed size)
 
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute-fail.rs:88:5
+  --> $DIR/transmute-fail.rs:88:9
    |
-LL |     std::mem::transmute(v)
-   |     ^^^^^^^^^^^^^^^^^^^
+LL |         std::mem::transmute(v)
+   |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `[u8; L * 2]` (this type does not have a fixed size)
    = note: target type: `[u16; L]` (this type does not have a fixed size)
 
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute-fail.rs:95:5
+  --> $DIR/transmute-fail.rs:95:9
    |
-LL |     std::mem::transmute(v)
-   |     ^^^^^^^^^^^^^^^^^^^
+LL |         std::mem::transmute(v)
+   |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `[u8; L]` (this type does not have a fixed size)
    = note: target type: `[[u8; 1]; L]` (this type does not have a fixed size)
 
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute-fail.rs:104:5
+  --> $DIR/transmute-fail.rs:104:9
    |
-LL |     std::mem::transmute(v)
-   |     ^^^^^^^^^^^^^^^^^^^
+LL |         std::mem::transmute(v)
+   |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `[[u32; 2 * H]; W + W]` (size can vary because of [u32; 2 * H])
    = note: target type: `[[u32; W + W]; 2 * H]` (size can vary because of [u32; W + W])
 
-error: aborting due to 14 previous errors
+error[E0308]: mismatched types
+  --> $DIR/transmute-fail.rs:12:53
+   |
+LL | fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] {
+   |                                                     ^ expected `usize`, found `bool`
+
+error[E0308]: mismatched types
+  --> $DIR/transmute-fail.rs:12:67
+   |
+LL | fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] {
+   |                                                                   ^ expected `usize`, found `bool`
+
+error: aborting due to 16 previous errors
 
-For more information about this error, try `rustc --explain E0512`.
+Some errors have detailed explanations: E0308, E0512.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/tests/ui/const-generics/type_mismatch.rs b/tests/ui/const-generics/type_mismatch.rs
index 8187c785cd1..9c7217cd83e 100644
--- a/tests/ui/const-generics/type_mismatch.rs
+++ b/tests/ui/const-generics/type_mismatch.rs
@@ -1,10 +1,12 @@
 fn foo<const N: usize>() -> [u8; N] {
     bar::<N>()
     //~^ ERROR the constant `N` is not of type `u8`
+    //~| ERROR: mismatched types
 }
 
 fn bar<const N: u8>() -> [u8; N] {}
 //~^ ERROR the constant `N` is not of type `usize`
+//~| ERROR: mismatched types
 //~| ERROR mismatched types
 
 fn main() {}
diff --git a/tests/ui/const-generics/type_mismatch.stderr b/tests/ui/const-generics/type_mismatch.stderr
index d1bb5c1242f..77e9f5e2b44 100644
--- a/tests/ui/const-generics/type_mismatch.stderr
+++ b/tests/ui/const-generics/type_mismatch.stderr
@@ -1,5 +1,5 @@
 error: the constant `N` is not of type `usize`
-  --> $DIR/type_mismatch.rs:6:26
+  --> $DIR/type_mismatch.rs:7:26
    |
 LL | fn bar<const N: u8>() -> [u8; N] {}
    |                          ^^^^^^^ expected `usize`, found `u8`
@@ -11,19 +11,31 @@ LL |     bar::<N>()
    |           ^ expected `u8`, found `usize`
    |
 note: required by a const generic parameter in `bar`
-  --> $DIR/type_mismatch.rs:6:8
+  --> $DIR/type_mismatch.rs:7:8
    |
 LL | fn bar<const N: u8>() -> [u8; N] {}
    |        ^^^^^^^^^^^ required by this const generic parameter in `bar`
 
 error[E0308]: mismatched types
-  --> $DIR/type_mismatch.rs:6:26
+  --> $DIR/type_mismatch.rs:7:26
    |
 LL | fn bar<const N: u8>() -> [u8; N] {}
    |    ---                   ^^^^^^^ expected `[u8; N]`, found `()`
    |    |
    |    implicitly returns `()` as its body has no tail or `return` expression
 
-error: aborting due to 3 previous errors
+error[E0308]: mismatched types
+  --> $DIR/type_mismatch.rs:2:11
+   |
+LL |     bar::<N>()
+   |           ^ expected `u8`, found `usize`
+
+error[E0308]: mismatched types
+  --> $DIR/type_mismatch.rs:7:31
+   |
+LL | fn bar<const N: u8>() -> [u8; N] {}
+   |                               ^ expected `usize`, found `u8`
+
+error: aborting due to 5 previous errors
 
 For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/consts/const-eval/ub-write-through-immutable.rs b/tests/ui/consts/const-eval/ub-write-through-immutable.rs
index 945367f1823..9860b8fde4a 100644
--- a/tests/ui/consts/const-eval/ub-write-through-immutable.rs
+++ b/tests/ui/consts/const-eval/ub-write-through-immutable.rs
@@ -1,6 +1,5 @@
 //! Ensure we catch UB due to writing through a shared reference.
 #![feature(const_mut_refs, const_refs_to_cell)]
-#![deny(writes_through_immutable_pointer)]
 #![allow(invalid_reference_casting)]
 
 use std::mem;
@@ -9,15 +8,15 @@ use std::cell::UnsafeCell;
 const WRITE_AFTER_CAST: () = unsafe {
     let mut x = 0;
     let ptr = &x as *const i32 as *mut i32;
-    *ptr = 0; //~ERROR: writes_through_immutable_pointer
-    //~^ previously accepted
+    *ptr = 0; //~ERROR: evaluation of constant value failed
+    //~| immutable
 };
 
 const WRITE_AFTER_TRANSMUTE: () = unsafe {
     let mut x = 0;
     let ptr: *mut i32 = mem::transmute(&x);
-    *ptr = 0; //~ERROR: writes_through_immutable_pointer
-    //~^ previously accepted
+    *ptr = 0; //~ERROR: evaluation of constant value failed
+    //~| immutable
 };
 
 // it's okay when there is interior mutability;
diff --git a/tests/ui/consts/const-eval/ub-write-through-immutable.stderr b/tests/ui/consts/const-eval/ub-write-through-immutable.stderr
index 27eb2d2c0d1..dbcd35e0b88 100644
--- a/tests/ui/consts/const-eval/ub-write-through-immutable.stderr
+++ b/tests/ui/consts/const-eval/ub-write-through-immutable.stderr
@@ -1,55 +1,15 @@
-error: writing through a pointer that was derived from a shared (immutable) reference
-  --> $DIR/ub-write-through-immutable.rs:12:5
+error[E0080]: evaluation of constant value failed
+  --> $DIR/ub-write-through-immutable.rs:11:5
    |
 LL |     *ptr = 0;
-   |     ^^^^^^^^
-   |
-   = 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 #X <https://github.com/rust-lang/rust/issues/X>
-note: the lint level is defined here
-  --> $DIR/ub-write-through-immutable.rs:3:9
-   |
-LL | #![deny(writes_through_immutable_pointer)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^ writing through a pointer that was derived from a shared (immutable) reference
 
-error: writing through a pointer that was derived from a shared (immutable) reference
-  --> $DIR/ub-write-through-immutable.rs:19:5
+error[E0080]: evaluation of constant value failed
+  --> $DIR/ub-write-through-immutable.rs:18:5
    |
 LL |     *ptr = 0;
-   |     ^^^^^^^^
-   |
-   = 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 #X <https://github.com/rust-lang/rust/issues/X>
+   |     ^^^^^^^^ writing through a pointer that was derived from a shared (immutable) reference
 
 error: aborting due to 2 previous errors
 
-Future incompatibility report: Future breakage diagnostic:
-error: writing through a pointer that was derived from a shared (immutable) reference
-  --> $DIR/ub-write-through-immutable.rs:12:5
-   |
-LL |     *ptr = 0;
-   |     ^^^^^^^^
-   |
-   = 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 #X <https://github.com/rust-lang/rust/issues/X>
-note: the lint level is defined here
-  --> $DIR/ub-write-through-immutable.rs:3:9
-   |
-LL | #![deny(writes_through_immutable_pointer)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Future breakage diagnostic:
-error: writing through a pointer that was derived from a shared (immutable) reference
-  --> $DIR/ub-write-through-immutable.rs:19:5
-   |
-LL |     *ptr = 0;
-   |     ^^^^^^^^
-   |
-   = 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 #X <https://github.com/rust-lang/rust/issues/X>
-note: the lint level is defined here
-  --> $DIR/ub-write-through-immutable.rs:3:9
-   |
-LL | #![deny(writes_through_immutable_pointer)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs b/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs
index c7078e46fa6..efc0a1c2fba 100644
--- a/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs
+++ b/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.rs
@@ -1,9 +1,5 @@
 #![feature(const_extern_fn)]
 
-const extern "C" fn unsize(x: &[u8; 3]) -> &[u8] { x }
-const unsafe extern "C" fn closure() -> fn() { || {} }
-const unsafe extern "C" fn use_float() { 1.0 + 1.0; }
-//~^ ERROR floating point arithmetic
 const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
 //~^ ERROR pointers cannot be cast to integers
 
diff --git a/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr b/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr
index 29fa90d611c..9cdeec159be 100644
--- a/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr
+++ b/tests/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr
@@ -1,15 +1,5 @@
-error[E0658]: floating point arithmetic is not allowed in constant functions
-  --> $DIR/const-extern-fn-min-const-fn.rs:5:42
-   |
-LL | const unsafe extern "C" fn use_float() { 1.0 + 1.0; }
-   |                                          ^^^^^^^^^
-   |
-   = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information
-   = help: add `#![feature(const_fn_floating_point_arithmetic)]` 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: pointers cannot be cast to integers during const eval
-  --> $DIR/const-extern-fn-min-const-fn.rs:7:48
+  --> $DIR/const-extern-fn-min-const-fn.rs:3:48
    |
 LL | const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
    |                                                ^^^^^^^^^^^^
@@ -17,6 +7,5 @@ LL | const extern "C" fn ptr_cast(val: *const u8) { val as usize; }
    = note: at compile-time, pointers do not have an integer value
    = note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
 
-error: aborting due to 2 previous errors
+error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/consts/const-extern-fn/const-extern-fn.rs b/tests/ui/consts/const-extern-fn/const-extern-fn.rs
index 57f5da8d0af..4b164767064 100644
--- a/tests/ui/consts/const-extern-fn/const-extern-fn.rs
+++ b/tests/ui/consts/const-extern-fn/const-extern-fn.rs
@@ -17,6 +17,19 @@ const unsafe extern "C" fn bar2(val: bool) -> bool {
     !val
 }
 
+#[allow(improper_ctypes_definitions)]
+const extern "C" fn unsize(x: &[u8; 3]) -> &[u8] {
+    x
+}
+
+#[allow(improper_ctypes_definitions)]
+const unsafe extern "C" fn closure() -> fn() {
+    || {}
+}
+
+const unsafe extern "C" fn use_float() -> f32 {
+    1.0 + 1.0
+}
 
 fn main() {
     let a: [u8; foo1(25) as usize] = [0; 26];
@@ -32,4 +45,8 @@ fn main() {
     let _foo2_cast: extern "C" fn(u8) -> u8 = foo2;
     let _bar1_cast: unsafe extern "C" fn(bool) -> bool = bar1;
     let _bar2_cast: unsafe extern "C" fn(bool) -> bool = bar2;
+
+    unsize(&[0, 1, 2]);
+    unsafe { closure(); }
+    unsafe { use_float(); }
 }
diff --git a/tests/ui/consts/const_fn_floating_point_arithmetic.gated.stderr b/tests/ui/consts/const_fn_floating_point_arithmetic.gated.stderr
deleted file mode 100644
index e1b8154a287..00000000000
--- a/tests/ui/consts/const_fn_floating_point_arithmetic.gated.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: fatal error triggered by #[rustc_error]
-  --> $DIR/const_fn_floating_point_arithmetic.rs:20:1
-   |
-LL | fn main() {}
-   | ^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/consts/const_fn_floating_point_arithmetic.rs b/tests/ui/consts/const_fn_floating_point_arithmetic.rs
deleted file mode 100644
index b0d0bc6b9f4..00000000000
--- a/tests/ui/consts/const_fn_floating_point_arithmetic.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-// gate-test-const_fn_floating_point_arithmetic
-
-//@ revisions: stock gated
-
-#![feature(rustc_attrs)]
-#![cfg_attr(gated, feature(const_fn_floating_point_arithmetic))]
-
-const fn add(f: f32) -> f32 { f + 2.0 }
-//[stock]~^ floating point arithmetic
-const fn sub(f: f32) -> f32 { 2.0 - f }
-//[stock]~^ floating point arithmetic
-const fn mul(f: f32, g: f32) -> f32 { f * g }
-//[stock]~^ floating point arithmetic
-const fn div(f: f32, g: f32) -> f32 { f / g }
-//[stock]~^ floating point arithmetic
-const fn neg(f: f32) -> f32 { -f }
-//[stock]~^ floating point arithmetic
-
-#[rustc_error]
-fn main() {} //[gated]~ fatal error triggered by #[rustc_error]
diff --git a/tests/ui/consts/const_fn_floating_point_arithmetic.stock.stderr b/tests/ui/consts/const_fn_floating_point_arithmetic.stock.stderr
deleted file mode 100644
index b5b94786ebb..00000000000
--- a/tests/ui/consts/const_fn_floating_point_arithmetic.stock.stderr
+++ /dev/null
@@ -1,53 +0,0 @@
-error[E0658]: floating point arithmetic is not allowed in constant functions
-  --> $DIR/const_fn_floating_point_arithmetic.rs:8:31
-   |
-LL | const fn add(f: f32) -> f32 { f + 2.0 }
-   |                               ^^^^^^^
-   |
-   = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information
-   = help: add `#![feature(const_fn_floating_point_arithmetic)]` 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]: floating point arithmetic is not allowed in constant functions
-  --> $DIR/const_fn_floating_point_arithmetic.rs:10:31
-   |
-LL | const fn sub(f: f32) -> f32 { 2.0 - f }
-   |                               ^^^^^^^
-   |
-   = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information
-   = help: add `#![feature(const_fn_floating_point_arithmetic)]` 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]: floating point arithmetic is not allowed in constant functions
-  --> $DIR/const_fn_floating_point_arithmetic.rs:12:39
-   |
-LL | const fn mul(f: f32, g: f32) -> f32 { f * g }
-   |                                       ^^^^^
-   |
-   = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information
-   = help: add `#![feature(const_fn_floating_point_arithmetic)]` 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]: floating point arithmetic is not allowed in constant functions
-  --> $DIR/const_fn_floating_point_arithmetic.rs:14:39
-   |
-LL | const fn div(f: f32, g: f32) -> f32 { f / g }
-   |                                       ^^^^^
-   |
-   = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information
-   = help: add `#![feature(const_fn_floating_point_arithmetic)]` 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]: floating point arithmetic is not allowed in constant functions
-  --> $DIR/const_fn_floating_point_arithmetic.rs:16:31
-   |
-LL | const fn neg(f: f32) -> f32 { -f }
-   |                               ^^
-   |
-   = note: see issue #57241 <https://github.com/rust-lang/rust/issues/57241> for more information
-   = help: add `#![feature(const_fn_floating_point_arithmetic)]` 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: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/consts/const_let_eq_float.rs b/tests/ui/consts/const_let_eq_float.rs
index 30d839cdc2a..c9ca6b8b7ea 100644
--- a/tests/ui/consts/const_let_eq_float.rs
+++ b/tests/ui/consts/const_let_eq_float.rs
@@ -1,7 +1,5 @@
 //@ run-pass
 
-#![feature(const_fn_floating_point_arithmetic)]
-
 struct Foo<T>(T);
 struct Bar<T> { x: T }
 struct W(f32);
diff --git a/tests/ui/consts/issue-36163.stderr b/tests/ui/consts/issue-36163.stderr
index 52d3e003f0a..8a7a0981f41 100644
--- a/tests/ui/consts/issue-36163.stderr
+++ b/tests/ui/consts/issue-36163.stderr
@@ -1,10 +1,10 @@
-error[E0391]: cycle detected when simplifying constant for the type system `Foo::{constant#0}`
+error[E0391]: cycle detected when simplifying constant for the type system `Foo::B::{constant#0}`
   --> $DIR/issue-36163.rs:4:9
    |
 LL |     B = A,
    |         ^
    |
-note: ...which requires const-evaluating + checking `Foo::{constant#0}`...
+note: ...which requires const-evaluating + checking `Foo::B::{constant#0}`...
   --> $DIR/issue-36163.rs:4:9
    |
 LL |     B = A,
@@ -19,7 +19,7 @@ note: ...which requires const-evaluating + checking `A`...
    |
 LL | const A: isize = Foo::B as isize;
    |                  ^^^^^^^^^^^^^^^
-   = note: ...which again requires simplifying constant for the type system `Foo::{constant#0}`, completing the cycle
+   = note: ...which again requires simplifying constant for the type system `Foo::B::{constant#0}`, completing the cycle
 note: cycle used when checking that `Foo` is well-formed
   --> $DIR/issue-36163.rs:3:1
    |
diff --git a/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs b/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs
index bb240fb4ad6..dc653370e51 100644
--- a/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs
+++ b/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs
@@ -3,7 +3,7 @@
             we're apparently really bad at it",
             issue = "none")]
 
-#![feature(const_fn_floating_point_arithmetic, foo, foo2)]
+#![feature(const_refs_to_cell, foo, foo2)]
 #![feature(staged_api)]
 
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -25,9 +25,13 @@ const fn bar2() -> u32 { foo2() } //~ ERROR not yet stable as a const fn
 
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
-// Const-stable functions cannot rely on unstable const-eval features.
-const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
-//~^ ERROR const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
+// conformity is required
+const fn bar3() -> u32 {
+    let x = std::cell::Cell::new(0u32);
+    x.get()
+    //~^ ERROR const-stable function cannot use `#[feature(const_refs_to_cell)]`
+    //~| ERROR cannot call non-const fn
+}
 
 // check whether this function cannot be called even with the feature gate active
 #[unstable(feature = "foo2", issue = "none")]
diff --git a/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr b/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr
index 7ec2508ca93..e5f8fa25b64 100644
--- a/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr
+++ b/tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr
@@ -14,30 +14,39 @@ LL | const fn bar2() -> u32 { foo2() }
    |
    = help: const-stable functions can only call other const-stable functions
 
-error: const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
-  --> $DIR/min_const_fn_libstd_stability.rs:29:26
+error: const-stable function cannot use `#[feature(const_refs_to_cell)]`
+  --> $DIR/min_const_fn_libstd_stability.rs:31:5
    |
-LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
-   |                          ^^^^^^^^^^^^^
+LL |     x.get()
+   |     ^
    |
 help: if it is not part of the public API, make this function unstably const
    |
 LL + #[rustc_const_unstable(feature = "...", issue = "...")]
-LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
+LL | const fn bar3() -> u32 {
    |
 help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
    |
-LL + #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
-LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
+LL + #[rustc_allow_const_fn_unstable(const_refs_to_cell)]
+LL | const fn bar3() -> u32 {
    |
 
+error[E0015]: cannot call non-const fn `Cell::<u32>::get` in constant functions
+  --> $DIR/min_const_fn_libstd_stability.rs:31:7
+   |
+LL |     x.get()
+   |       ^^^^^
+   |
+   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+
 error: `foo2_gated` is not yet stable as a const fn
-  --> $DIR/min_const_fn_libstd_stability.rs:39:32
+  --> $DIR/min_const_fn_libstd_stability.rs:43:32
    |
 LL | const fn bar2_gated() -> u32 { foo2_gated() }
    |                                ^^^^^^^^^^^^
    |
    = help: const-stable functions can only call other const-stable functions
 
-error: aborting due to 4 previous errors
+error: aborting due to 5 previous errors
 
+For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs b/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs
index 03084c8674d..f2a54b8a13d 100644
--- a/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs
+++ b/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs
@@ -3,7 +3,7 @@
             we're apparently really bad at it",
             issue = "none")]
 
-#![feature(const_fn_floating_point_arithmetic, foo, foo2)]
+#![feature(const_refs_to_cell, foo, foo2)]
 #![feature(staged_api)]
 
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -23,12 +23,6 @@ const unsafe fn foo2() -> u32 { 42 }
 // can't call non-min_const_fn
 const unsafe fn bar2() -> u32 { unsafe { foo2() } } //~ ERROR not yet stable as a const fn
 
-#[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
-// conformity is required
-const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
-//~^ ERROR const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
-
 // check whether this function cannot be called even with the feature gate active
 #[unstable(feature = "foo2", issue = "none")]
 const unsafe fn foo2_gated() -> u32 { 42 }
diff --git a/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr b/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr
index 72c1f175d1d..353b117efbc 100644
--- a/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr
+++ b/tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr
@@ -14,30 +14,13 @@ LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } }
    |
    = help: const-stable functions can only call other const-stable functions
 
-error: const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
-  --> $DIR/min_const_unsafe_fn_libstd_stability.rs:29:33
-   |
-LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
-   |                                 ^^^^^^^^^^^^^
-   |
-help: if it is not part of the public API, make this function unstably const
-   |
-LL + #[rustc_const_unstable(feature = "...", issue = "...")]
-LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
-   |
-help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
-   |
-LL + #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
-LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
-   |
-
 error: `foo2_gated` is not yet stable as a const fn
-  --> $DIR/min_const_unsafe_fn_libstd_stability.rs:39:48
+  --> $DIR/min_const_unsafe_fn_libstd_stability.rs:33:48
    |
 LL | const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } }
    |                                                ^^^^^^^^^^^^
    |
    = help: const-stable functions can only call other const-stable functions
 
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
 
diff --git a/tests/ui/feature-gates/feature-gate-const-arg-path.rs b/tests/ui/feature-gates/feature-gate-const-arg-path.rs
new file mode 100644
index 00000000000..0938c5733a2
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-const-arg-path.rs
@@ -0,0 +1,5 @@
+//@ check-pass
+
+// this doesn't really have any user facing impact....
+
+fn main() {}
diff --git a/tests/ui/internal/internal-unstable-const.rs b/tests/ui/internal/internal-unstable-const.rs
deleted file mode 100644
index 4ec2426dfee..00000000000
--- a/tests/ui/internal/internal-unstable-const.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-// Don't allow unstable features in stable functions without `allow_internal_unstable`.
-
-#![stable(feature = "rust1", since = "1.0.0")]
-#![feature(staged_api)]
-#![feature(const_fn_floating_point_arithmetic)]
-
-#[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
-pub const fn foo() -> f32 {
-    1.0 + 1.0 //~ ERROR const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
-}
-
-fn main() {}
diff --git a/tests/ui/internal/internal-unstable-const.stderr b/tests/ui/internal/internal-unstable-const.stderr
deleted file mode 100644
index ed9196d2b63..00000000000
--- a/tests/ui/internal/internal-unstable-const.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error: const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
-  --> $DIR/internal-unstable-const.rs:10:5
-   |
-LL |     1.0 + 1.0
-   |     ^^^^^^^^^
-   |
-help: if it is not part of the public API, make this function unstably const
-   |
-LL + #[rustc_const_unstable(feature = "...", issue = "...")]
-LL | pub const fn foo() -> f32 {
-   |
-help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
-   |
-LL + #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
-LL | pub const fn foo() -> f32 {
-   |
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/lifetimes/issue-95023.rs b/tests/ui/lifetimes/issue-95023.rs
index bcacd01474f..8461d92fc33 100644
--- a/tests/ui/lifetimes/issue-95023.rs
+++ b/tests/ui/lifetimes/issue-95023.rs
@@ -2,12 +2,13 @@ struct ErrorKind;
 struct Error(ErrorKind);
 impl Fn(&isize) for Error {
     //~^ ERROR manual implementations of `Fn` are experimental [E0183]
-    //~^^ ERROR associated item constraints are not allowed here [E0229]
+    //~| ERROR associated item constraints are not allowed here [E0229]
     //~| ERROR not all trait items implemented
     //~| ERROR expected a `FnMut(&isize)` closure, found `Error`
     fn foo<const N: usize>(&self) -> Self::B<{ N }>;
     //~^ ERROR associated function in `impl` without body
-    //~^^ ERROR method `foo` is not a member of trait `Fn` [E0407]
-    //~^^^ ERROR associated type `B` not found for `Self` [E0220]
+    //~| ERROR method `foo` is not a member of trait `Fn` [E0407]
+    //~| ERROR associated type `B` not found for `Self` [E0220]
+    //~| ERROR: associated type `B` not found for `Self`
 }
 fn main() {}
diff --git a/tests/ui/lifetimes/issue-95023.stderr b/tests/ui/lifetimes/issue-95023.stderr
index cbc0eeebee1..310dee51406 100644
--- a/tests/ui/lifetimes/issue-95023.stderr
+++ b/tests/ui/lifetimes/issue-95023.stderr
@@ -56,7 +56,15 @@ error[E0220]: associated type `B` not found for `Self`
 LL |     fn foo<const N: usize>(&self) -> Self::B<{ N }>;
    |                                            ^ help: `Self` has the following associated type: `Output`
 
-error: aborting due to 7 previous errors
+error[E0220]: associated type `B` not found for `Self`
+  --> $DIR/issue-95023.rs:8:44
+   |
+LL |     fn foo<const N: usize>(&self) -> Self::B<{ N }>;
+   |                                            ^ help: `Self` has the following associated type: `Output`
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+error: aborting due to 8 previous errors
 
 Some errors have detailed explanations: E0046, E0183, E0220, E0229, E0277, E0407.
 For more information about an error, try `rustc --explain E0046`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs
index 637a24f53bc..6c320c0462e 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs
@@ -1,4 +1,4 @@
-//@ check-pass
+//~ ERROR the trait bound
 //@ compile-flags: -Znext-solver
 
 #![allow(incomplete_features)]
@@ -17,6 +17,6 @@ impl Foo for S {
 }
 
 impl const Bar for S {}
-//FIXME ~^ ERROR the trait bound
+// FIXME(effects) bad span
 
 fn main() {}
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.stderr
new file mode 100644
index 00000000000..9a907bbee0a
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.stderr
@@ -0,0 +1,11 @@
+error[E0277]: the trait bound `Maybe: TyCompat<<(Foo::{synthetic#0},) as std::marker::effects::Intersection>::Output>` is not satisfied
+   |
+note: required by a bound in `Bar::{synthetic#0}`
+  --> $DIR/super-traits-fail.rs:11:1
+   |
+LL | #[const_trait]
+   | ^^^^^^^^^^^^^^ required by this bound in `Bar::{synthetic#0}`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.rs b/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.rs
index fb962ad24bf..858fba2132a 100644
--- a/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.rs
+++ b/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.rs
@@ -14,5 +14,6 @@ struct Wrapper<const C: <i32 as Trait>::Type> {}
 
 impl<const C: usize> Wrapper<C> {}
 //~^ ERROR the constant `C` is not of type `<i32 as Trait>::Type`
+//~| ERROR: mismatched types
 
 fn main() {}
diff --git a/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.stderr b/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.stderr
index 7094ee8c67c..71d4277275f 100644
--- a/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.stderr
+++ b/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.stderr
@@ -20,5 +20,17 @@ note: required by a const generic parameter in `Wrapper`
 LL | struct Wrapper<const C: <i32 as Trait>::Type> {}
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this const generic parameter in `Wrapper`
 
-error: aborting due to 2 previous errors
+error[E0308]: mismatched types
+  --> $DIR/default-proj-ty-as-type-of-const-issue-125757.rs:15:30
+   |
+LL | impl<const C: usize> Wrapper<C> {}
+   |                              ^ expected associated type, found `usize`
+   |
+   = note: expected associated type `<i32 as Trait>::Type`
+                         found type `usize`
+   = help: consider constraining the associated type `<i32 as Trait>::Type` to `usize`
+   = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
+
+error: aborting due to 3 previous errors
 
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs
index a0ee7714417..f89a463bc58 100644
--- a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs
+++ b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs
@@ -6,6 +6,7 @@
 struct S<const L: usize>;
 
 impl<const N: i32> Copy for S<N> {}
+//~^ ERROR: mismatched types
 impl<const M: usize> Copy for S<M> {}
 //~^ ERROR: conflicting implementations of trait `Copy` for type `S<_>`
 
diff --git a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr
index 2953bc95917..1dac58e1f69 100644
--- a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr
+++ b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr
@@ -1,11 +1,19 @@
 error[E0119]: conflicting implementations of trait `Copy` for type `S<_>`
-  --> $DIR/bad-const-wf-doesnt-specialize.rs:9:1
+  --> $DIR/bad-const-wf-doesnt-specialize.rs:10:1
    |
 LL | impl<const N: i32> Copy for S<N> {}
    | -------------------------------- first implementation here
+LL |
 LL | impl<const M: usize> Copy for S<M> {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `S<_>`
 
-error: aborting due to 1 previous error
+error[E0308]: mismatched types
+  --> $DIR/bad-const-wf-doesnt-specialize.rs:8:31
+   |
+LL | impl<const N: i32> Copy for S<N> {}
+   |                               ^ expected `usize`, found `i32`
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0119`.
+Some errors have detailed explanations: E0119, E0308.
+For more information about an error, try `rustc --explain E0119`.
diff --git a/tests/ui/transmutability/issue-101739-1.rs b/tests/ui/transmutability/issue-101739-1.rs
index 20bd7917e53..81a9038fdb5 100644
--- a/tests/ui/transmutability/issue-101739-1.rs
+++ b/tests/ui/transmutability/issue-101739-1.rs
@@ -6,7 +6,8 @@ mod assert {
     pub fn is_transmutable<Src, const ASSUME_ALIGNMENT: bool>()
     where
         Dst: BikeshedIntrinsicFrom<Src, ASSUME_ALIGNMENT>, //~ ERROR cannot find type `Dst` in this scope
-        //~^ the constant `ASSUME_ALIGNMENT` is not of type `Assume`
+                                                           //~| the constant `ASSUME_ALIGNMENT` is not of type `Assume`
+                                                           //~| ERROR: mismatched types
     {
     }
 }
diff --git a/tests/ui/transmutability/issue-101739-1.stderr b/tests/ui/transmutability/issue-101739-1.stderr
index ba18a980f4d..6f79bf7b424 100644
--- a/tests/ui/transmutability/issue-101739-1.stderr
+++ b/tests/ui/transmutability/issue-101739-1.stderr
@@ -13,6 +13,13 @@ LL |         Dst: BikeshedIntrinsicFrom<Src, ASSUME_ALIGNMENT>,
 note: required by a const generic parameter in `BikeshedIntrinsicFrom`
   --> $SRC_DIR/core/src/mem/transmutability.rs:LL:COL
 
-error: aborting due to 2 previous errors
+error[E0308]: mismatched types
+  --> $DIR/issue-101739-1.rs:8:41
+   |
+LL |         Dst: BikeshedIntrinsicFrom<Src, ASSUME_ALIGNMENT>,
+   |                                         ^^^^^^^^^^^^^^^^ expected `Assume`, found `bool`
+
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0412`.
+Some errors have detailed explanations: E0308, E0412.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/tests/ui/transmutability/issue-101739-2.rs b/tests/ui/transmutability/issue-101739-2.rs
index 8b36bf3dcb1..6dfde06d6b3 100644
--- a/tests/ui/transmutability/issue-101739-2.rs
+++ b/tests/ui/transmutability/issue-101739-2.rs
@@ -14,19 +14,23 @@ mod assert {
         const ASSUME_VISIBILITY: bool,
     >()
     where
-        Dst: BikeshedIntrinsicFrom< //~ ERROR trait takes at most 2 generic arguments but 5 generic arguments were supplied
-            Src,
-            ASSUME_ALIGNMENT,
-            ASSUME_LIFETIMES,
-            ASSUME_VALIDITY,
-            ASSUME_VISIBILITY,
-        >,
-    {}
+        Dst: BikeshedIntrinsicFrom<
+                //~^ ERROR trait takes at most 2 generic arguments but 5 generic arguments were supplied
+                Src,
+                ASSUME_ALIGNMENT, //~ ERROR: mismatched types
+                ASSUME_LIFETIMES,
+                ASSUME_VALIDITY,
+                ASSUME_VISIBILITY,
+            >,
+    {
+    }
 }
 
 fn via_const() {
-    #[repr(C)] struct Src;
-    #[repr(C)] struct Dst;
+    #[repr(C)]
+    struct Src;
+    #[repr(C)]
+    struct Dst;
 
     const FALSE: bool = false;
 
diff --git a/tests/ui/transmutability/issue-101739-2.stderr b/tests/ui/transmutability/issue-101739-2.stderr
index 6b0a36a414b..11e8fa1d8c5 100644
--- a/tests/ui/transmutability/issue-101739-2.stderr
+++ b/tests/ui/transmutability/issue-101739-2.stderr
@@ -3,14 +3,21 @@ error[E0107]: trait takes at most 2 generic arguments but 5 generic arguments we
    |
 LL |           Dst: BikeshedIntrinsicFrom<
    |                ^^^^^^^^^^^^^^^^^^^^^ expected at most 2 generic arguments
-LL |               Src,
-LL |               ASSUME_ALIGNMENT,
-   |  _____________________________-
-LL | |             ASSUME_LIFETIMES,
-LL | |             ASSUME_VALIDITY,
-LL | |             ASSUME_VISIBILITY,
-   | |_____________________________- help: remove the unnecessary generic arguments
+...
+LL |                   ASSUME_ALIGNMENT,
+   |  _________________________________-
+LL | |                 ASSUME_LIFETIMES,
+LL | |                 ASSUME_VALIDITY,
+LL | |                 ASSUME_VISIBILITY,
+   | |_________________________________- help: remove the unnecessary generic arguments
 
-error: aborting due to 1 previous error
+error[E0308]: mismatched types
+  --> $DIR/issue-101739-2.rs:20:17
+   |
+LL |                 ASSUME_ALIGNMENT,
+   |                 ^^^^^^^^^^^^^^^^ expected `Assume`, found `bool`
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0107`.
+Some errors have detailed explanations: E0107, E0308.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs b/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs
index 9fc249198d0..92c1999e154 100644
--- a/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs
+++ b/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs
@@ -3,16 +3,18 @@
 // of an impl fn produces a type mismatch error instead of triggering
 // a const eval cycle
 
-
 trait Trait {
-    fn func<const N: u32>() -> [ (); N ]; //~ ERROR the constant `N` is not of type `usize`
+    fn func<const N: u32>() -> [(); N];
+    //~^ ERROR: the constant `N` is not of type `usize`
+    //~| ERROR: mismatched types
 }
 
 struct S {}
 
 #[allow(unused_braces)]
 impl Trait for S {
-    fn func<const N: u32>() -> [ (); { () }] { //~ ERROR mismatched types
+    fn func<const N: u32>() -> [(); { () }] {
+        //~^ ERROR mismatched types
         N
     }
 }
diff --git a/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.stderr b/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.stderr
index bff926a2081..bb8025d47a1 100644
--- a/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.stderr
+++ b/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.stderr
@@ -1,15 +1,21 @@
 error[E0308]: mismatched types
-  --> $DIR/const-in-impl-fn-return-type.rs:15:40
+  --> $DIR/const-in-impl-fn-return-type.rs:16:39
    |
-LL |     fn func<const N: u32>() -> [ (); { () }] {
-   |                                        ^^ expected `usize`, found `()`
+LL |     fn func<const N: u32>() -> [(); { () }] {
+   |                                       ^^ expected `usize`, found `()`
 
 error: the constant `N` is not of type `usize`
-  --> $DIR/const-in-impl-fn-return-type.rs:8:32
+  --> $DIR/const-in-impl-fn-return-type.rs:7:32
    |
-LL |     fn func<const N: u32>() -> [ (); N ];
-   |                                ^^^^^^^^^ expected `usize`, found `u32`
+LL |     fn func<const N: u32>() -> [(); N];
+   |                                ^^^^^^^ expected `usize`, found `u32`
 
-error: aborting due to 2 previous errors
+error[E0308]: mismatched types
+  --> $DIR/const-in-impl-fn-return-type.rs:7:37
+   |
+LL |     fn func<const N: u32>() -> [(); N];
+   |                                     ^ expected `usize`, found `u32`
+
+error: aborting due to 3 previous errors
 
 For more information about this error, try `rustc --explain E0308`.