about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/assembly-llvm/aarch64-pointer-auth.rs6
-rw-r--r--tests/assembly-llvm/naked-functions/wasm32.rs1
-rw-r--r--tests/assembly-llvm/riscv-soft-abi-with-float-features.rs10
-rw-r--r--tests/assembly-llvm/targets/targets-elf.rs3
-rw-r--r--tests/assembly-llvm/x86_64-bigint-helpers.rs1
-rw-r--r--tests/assembly-llvm/x86_64-cmp.rs73
-rw-r--r--tests/codegen-llvm/asm/powerpc-clobbers.rs8
-rw-r--r--tests/codegen-llvm/asm/readonly-not-pure.rs48
-rw-r--r--tests/codegen-llvm/asm/riscv-clobbers.rs2
-rw-r--r--tests/codegen-llvm/autodiff/abi_handling.rs210
-rw-r--r--tests/codegen-llvm/autodiff/batched.rs2
-rw-r--r--tests/codegen-llvm/autodiff/scalar.rs2
-rw-r--r--tests/codegen-llvm/autodiff/sret.rs2
-rw-r--r--tests/codegen-llvm/autodiff/typetree.rs33
-rw-r--r--tests/codegen-llvm/autodiff/void_ret.rs41
-rw-r--r--tests/codegen-llvm/auxiliary/darwin_objc_aux.rs27
-rw-r--r--tests/codegen-llvm/branch-protection.rs6
-rw-r--r--tests/codegen-llvm/c-variadic-lifetime.rs4
-rw-r--r--tests/codegen-llvm/cffi/c-variadic-inline.rs47
-rw-r--r--tests/codegen-llvm/comparison-operators-2-struct.rs1
-rw-r--r--tests/codegen-llvm/comparison-operators-2-tuple.rs1
-rw-r--r--tests/codegen-llvm/darwin-no-objc.rs52
-rw-r--r--tests/codegen-llvm/darwin-objc-abi-v1.rs100
-rw-r--r--tests/codegen-llvm/darwin-objc-abi-v2.rs185
-rw-r--r--tests/codegen-llvm/darwin-objc-cross-crate.rs58
-rw-r--r--tests/codegen-llvm/debug-fndef-size.rs4
-rw-r--r--tests/codegen-llvm/debuginfo-dse.rs362
-rw-r--r--tests/codegen-llvm/enum/enum-aggregate.rs1
-rw-r--r--tests/codegen-llvm/enum/enum-discriminant-eq.rs1
-rw-r--r--tests/codegen-llvm/global-allocator-attributes.rs41
-rw-r--r--tests/codegen-llvm/integer-cmp.rs36
-rw-r--r--tests/codegen-llvm/intrinsic-no-unnamed-attr.rs4
-rw-r--r--tests/codegen-llvm/intrinsics/three_way_compare.rs1
-rw-r--r--tests/codegen-llvm/issues/and-masked-comparison-131162.rs1
-rw-r--r--tests/codegen-llvm/issues/cows-dont-have-branches-117763.rs17
-rw-r--r--tests/codegen-llvm/issues/issue-101082.rs1
-rw-r--r--tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs7
-rw-r--r--tests/codegen-llvm/issues/issue-129795.rs1
-rw-r--r--tests/codegen-llvm/issues/iter-max-no-unwrap-failed-129583.rs1
-rw-r--r--tests/codegen-llvm/issues/looping-over-ne-bytes-133528.rs1
-rw-r--r--tests/codegen-llvm/option-niche-eq.rs1
-rw-r--r--tests/codegen-llvm/pattern_type_symbols.rs4
-rw-r--r--tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs8
-rw-r--r--tests/codegen-llvm/slice-last-elements-optimization.rs1
-rw-r--r--tests/codegen-llvm/swap-small-types.rs1
-rw-r--r--tests/codegen-llvm/try_question_mark_nop.rs31
-rw-r--r--tests/codegen-llvm/union-aggregate.rs1
-rw-r--r--tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs9
-rw-r--r--tests/codegen-llvm/unwind-and-panic-abort.rs9
-rw-r--r--tests/codegen-llvm/vec_pop_push_noop.rs5
-rw-r--r--tests/codegen-llvm/vecdeque_pop_push.rs5
-rw-r--r--tests/codegen-llvm/wasm_exceptions.rs57
-rw-r--r--tests/coverage/issue-83601.cov-map34
-rw-r--r--tests/coverage/issue-84561.cov-map136
-rw-r--r--tests/crashes/117808.rs27
-rw-r--r--tests/crashes/120016.rs14
-rw-r--r--tests/crashes/120175.rs1
-rw-r--r--tests/crashes/122904-2.rs17
-rw-r--r--tests/crashes/125772.rs2
-rw-r--r--tests/crashes/129095.rs13
-rw-r--r--tests/crashes/131292.rs2
-rw-r--r--tests/crashes/132142.rs3
-rw-r--r--tests/crashes/134174.rs17
-rw-r--r--tests/crashes/134654.rs15
-rw-r--r--tests/crashes/135570.rs15
-rw-r--r--tests/crashes/136381.rs18
-rw-r--r--tests/crashes/137190-1.rs10
-rw-r--r--tests/crashes/137468.rs16
-rw-r--r--tests/crashes/139556.rs13
-rw-r--r--tests/crashes/34127.rs2
-rw-r--r--tests/debuginfo/opt/dead_refs.rs50
-rw-r--r--tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir18
-rw-r--r--tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-abort.mir9
-rw-r--r--tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-unwind.mir9
-rw-r--r--tests/mir-opt/building/async_await.a-{closure#0}.coroutine_resume.0.mir10
-rw-r--r--tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir30
-rw-r--r--tests/mir-opt/building/coroutine.main-{closure#0}.StateTransform.after.mir207
-rw-r--r--tests/mir-opt/building/coroutine.main-{closure#1}.StateTransform.after.mir207
-rw-r--r--tests/mir-opt/building/coroutine.rs29
-rw-r--r--tests/mir-opt/building/custom/arrays.arrays.built.after.mir10
-rw-r--r--tests/mir-opt/building/custom/arrays.rs4
-rw-r--r--tests/mir-opt/building/match/array_len.const_array_len.built.after.panic-abort.mir155
-rw-r--r--tests/mir-opt/building/match/array_len.const_array_len.built.after.panic-unwind.mir155
-rw-r--r--tests/mir-opt/building/match/array_len.rs31
-rw-r--r--tests/mir-opt/building/match/array_len.slice_len.built.after.panic-abort.mir115
-rw-r--r--tests/mir-opt/building/match/array_len.slice_len.built.after.panic-unwind.mir115
-rw-r--r--tests/mir-opt/coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.panic-abort.mir7
-rw-r--r--tests/mir-opt/coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.panic-unwind.mir7
-rw-r--r--tests/mir-opt/coroutine_tiny.main-{closure#0}.coroutine_resume.0.mir16
-rw-r--r--tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-abort.diff77
-rw-r--r--tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-unwind.diff77
-rw-r--r--tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-abort.diff77
-rw-r--r--tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-unwind.diff77
-rw-r--r--tests/mir-opt/dataflow-const-prop/slice_len.rs34
-rw-r--r--tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff4
-rw-r--r--tests/mir-opt/dead-store-elimination/ref.dead_first.DeadStoreElimination-initial.diff30
-rw-r--r--tests/mir-opt/dead-store-elimination/ref.rs31
-rw-r--r--tests/mir-opt/dead-store-elimination/ref.tuple.DeadStoreElimination-initial.diff25
-rw-r--r--tests/mir-opt/debuginfo/simplifycfg.drop_debuginfo.SimplifyCfg-final.diff26
-rw-r--r--tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_1.SimplifyCfg-final.diff30
-rw-r--r--tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_2.SimplifyCfg-final.diff29
-rw-r--r--tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_3.SimplifyCfg-final.diff37
-rw-r--r--tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_identical_succs.SimplifyCfg-final.diff29
-rw-r--r--tests/mir-opt/debuginfo/simplifycfg.rs207
-rw-r--r--tests/mir-opt/dest-prop/aggregate.rewrap.DestinationPropagation.panic-abort.diff19
-rw-r--r--tests/mir-opt/dest-prop/aggregate.rewrap.DestinationPropagation.panic-unwind.diff19
-rw-r--r--tests/mir-opt/dest-prop/aggregate.rs51
-rw-r--r--tests/mir-opt/dest-prop/aggregate.swap.DestinationPropagation.panic-abort.diff22
-rw-r--r--tests/mir-opt/dest-prop/aggregate.swap.DestinationPropagation.panic-unwind.diff22
-rw-r--r--tests/mir-opt/dest-prop/nrvo_borrowed.nrvo.DestinationPropagation.panic-abort.diff (renamed from tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff)31
-rw-r--r--tests/mir-opt/dest-prop/nrvo_borrowed.nrvo.DestinationPropagation.panic-unwind.diff (renamed from tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff)31
-rw-r--r--tests/mir-opt/dest-prop/nrvo_borrowed.rs (renamed from tests/mir-opt/nrvo_simple.rs)4
-rw-r--r--tests/mir-opt/dest-prop/nrvo_miscompile_111005.rs (renamed from tests/mir-opt/nrvo_miscompile_111005.rs)7
-rw-r--r--tests/mir-opt/dest-prop/nrvo_miscompile_111005.wrong.DestinationPropagation.diff (renamed from tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff)7
-rw-r--r--tests/mir-opt/gvn.array_len.GVN.panic-abort.diff6
-rw-r--r--tests/mir-opt/gvn.array_len.GVN.panic-unwind.diff6
-rw-r--r--tests/mir-opt/inline/forced_closure_inherent.caller-{closure#0}.ForceInline.panic-abort.diff21
-rw-r--r--tests/mir-opt/inline/forced_closure_inherent.caller-{closure#0}.ForceInline.panic-unwind.diff21
-rw-r--r--tests/mir-opt/inline/forced_closure_inherent.rs19
-rw-r--r--tests/mir-opt/inline/forced_inherent.caller.ForceInline.panic-abort.diff21
-rw-r--r--tests/mir-opt/inline/forced_inherent.caller.ForceInline.panic-unwind.diff21
-rw-r--r--tests/mir-opt/inline/forced_inherent.rs17
-rw-r--r--tests/mir-opt/inline/forced_inherent_ambiguous.caller.ForceInline.panic-abort.diff21
-rw-r--r--tests/mir-opt/inline/forced_inherent_ambiguous.caller.ForceInline.panic-unwind.diff21
-rw-r--r--tests/mir-opt/inline/forced_inherent_ambiguous.rs25
-rw-r--r--tests/mir-opt/inline/forced_inherent_async.caller.ForceInline.panic-abort.diff12
-rw-r--r--tests/mir-opt/inline/forced_inherent_async.caller.ForceInline.panic-unwind.diff12
-rw-r--r--tests/mir-opt/inline/forced_inherent_async.rs18
-rw-r--r--tests/mir-opt/inline/forced_inherent_dead_code.caller.ForceInline.panic-abort.diff21
-rw-r--r--tests/mir-opt/inline/forced_inherent_dead_code.caller.ForceInline.panic-unwind.diff21
-rw-r--r--tests/mir-opt/inline/forced_inherent_dead_code.rs21
-rw-r--r--tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff2
-rw-r--r--tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff2
-rw-r--r--tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff117
-rw-r--r--tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff125
-rw-r--r--tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff71
-rw-r--r--tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff71
-rw-r--r--tests/mir-opt/instsimplify/combine_array_len.normN.InstSimplify-after-simplifycfg.panic-abort.diff71
-rw-r--r--tests/mir-opt/instsimplify/combine_array_len.normN.InstSimplify-after-simplifycfg.panic-unwind.diff71
-rw-r--r--tests/mir-opt/instsimplify/combine_array_len.rs25
-rw-r--r--tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff1
-rw-r--r--tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff1
-rw-r--r--tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff30
-rw-r--r--tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff30
-rw-r--r--tests/mir-opt/lower_array_len.array_len_raw.GVN.panic-abort.diff6
-rw-r--r--tests/mir-opt/lower_array_len.array_len_raw.GVN.panic-unwind.diff6
-rw-r--r--tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-abort.diff6
-rw-r--r--tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-unwind.diff6
-rw-r--r--tests/mir-opt/pre-codegen/checked_ops.rs3
-rw-r--r--tests/mir-opt/pre-codegen/checked_ops.saturating_sub_at_home.PreCodegen.after.panic-abort.mir6
-rw-r--r--tests/mir-opt/pre-codegen/checked_ops.saturating_sub_at_home.PreCodegen.after.panic-unwind.mir6
-rw-r--r--tests/mir-opt/pre-codegen/clone_as_copy.clone_as_copy.PreCodegen.after.mir4
-rw-r--r--tests/mir-opt/pre-codegen/clone_as_copy.enum_clone_as_copy.PreCodegen.after.mir46
-rw-r--r--tests/mir-opt/pre-codegen/clone_as_copy.rs16
-rw-r--r--tests/mir-opt/pre-codegen/dead_on_invalid_place.invalid_place.PreCodegen.after.mir13
-rw-r--r--tests/mir-opt/pre-codegen/dead_on_invalid_place.rs27
-rw-r--r--tests/mir-opt/pre-codegen/derived_ord.demo_le.PreCodegen.after.mir35
-rw-r--r--tests/mir-opt/pre-codegen/derived_ord.rs5
-rw-r--r--tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir32
-rw-r--r--tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir44
-rw-r--r--tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir94
-rw-r--r--tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir84
-rw-r--r--tests/mir-opt/pre-codegen/loops.rs1
-rw-r--r--tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir306
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir68
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir68
-rw-r--r--tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir205
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir240
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir70
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir182
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir182
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir54
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir54
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir241
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir249
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-abort.mir177
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-unwind.mir177
-rw-r--r--tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir2
-rw-r--r--tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir2
-rw-r--r--tests/mir-opt/pre-codegen/tuple_ord.demo_ge_partial.PreCodegen.after.mir18
-rw-r--r--tests/mir-opt/pre-codegen/tuple_ord.demo_le_total.PreCodegen.after.mir18
-rw-r--r--tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff85
-rw-r--r--tests/run-make-cargo/panic-immediate-abort-codegen/Cargo.toml12
-rw-r--r--tests/run-make-cargo/panic-immediate-abort-codegen/lib.rs65
-rw-r--r--tests/run-make-cargo/panic-immediate-abort-codegen/rmake.rs46
-rw-r--r--tests/run-make-cargo/panic-immediate-abort-works/hello/Cargo.toml4
-rw-r--r--tests/run-make-cargo/panic-immediate-abort-works/hello/src/main.rs1
-rw-r--r--tests/run-make-cargo/panic-immediate-abort-works/rmake.rs39
-rw-r--r--tests/run-make/autodiff/type-trees/array-typetree/array.check4
-rw-r--r--tests/run-make/autodiff/type-trees/array-typetree/rmake.rs9
-rw-r--r--tests/run-make/autodiff/type-trees/array-typetree/test.rs15
-rw-r--r--tests/run-make/autodiff/type-trees/memcpy-typetree/memcpy-ir.check8
-rw-r--r--tests/run-make/autodiff/type-trees/memcpy-typetree/memcpy.check13
-rw-r--r--tests/run-make/autodiff/type-trees/memcpy-typetree/memcpy.rs36
-rw-r--r--tests/run-make/autodiff/type-trees/memcpy-typetree/rmake.rs39
-rw-r--r--tests/run-make/autodiff/type-trees/mixed-struct-typetree/mixed.check2
-rw-r--r--tests/run-make/autodiff/type-trees/mixed-struct-typetree/rmake.rs16
-rw-r--r--tests/run-make/autodiff/type-trees/mixed-struct-typetree/test.rs23
-rw-r--r--tests/run-make/autodiff/type-trees/nott-flag/nott.check5
-rw-r--r--tests/run-make/autodiff/type-trees/nott-flag/rmake.rs30
-rw-r--r--tests/run-make/autodiff/type-trees/nott-flag/test.rs15
-rw-r--r--tests/run-make/autodiff/type-trees/nott-flag/with_tt.check4
-rw-r--r--tests/run-make/autodiff/type-trees/recursion-typetree/recursion.check3
-rw-r--r--tests/run-make/autodiff/type-trees/recursion-typetree/rmake.rs9
-rw-r--r--tests/run-make/autodiff/type-trees/recursion-typetree/test.rs100
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/f128-typetree/f128.check4
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/f128-typetree/rmake.rs12
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/f128-typetree/test.rs15
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/f16-typetree/f16.check4
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/f16-typetree/rmake.rs12
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/f16-typetree/test.rs15
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/f32-typetree/f32.check4
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/f32-typetree/rmake.rs12
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/f32-typetree/test.rs15
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/f64-typetree/f64.check4
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/f64-typetree/rmake.rs12
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/f64-typetree/test.rs15
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/i32-typetree/i32.check4
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/i32-typetree/rmake.rs12
-rw-r--r--tests/run-make/autodiff/type-trees/scalar-types/i32-typetree/test.rs15
-rw-r--r--tests/run-make/autodiff/type-trees/slice-typetree/rmake.rs9
-rw-r--r--tests/run-make/autodiff/type-trees/slice-typetree/slice.check4
-rw-r--r--tests/run-make/autodiff/type-trees/slice-typetree/test.rs16
-rw-r--r--tests/run-make/autodiff/type-trees/struct-typetree/rmake.rs9
-rw-r--r--tests/run-make/autodiff/type-trees/struct-typetree/struct.check4
-rw-r--r--tests/run-make/autodiff/type-trees/struct-typetree/test.rs22
-rw-r--r--tests/run-make/autodiff/type-trees/tuple-typetree/rmake.rs9
-rw-r--r--tests/run-make/autodiff/type-trees/tuple-typetree/test.rs15
-rw-r--r--tests/run-make/autodiff/type-trees/tuple-typetree/tuple.check4
-rw-r--r--tests/run-make/autodiff/type-trees/type-analysis/vec/vec.check2
-rw-r--r--tests/run-make/crate-loading/dep-2-reexport.rs (renamed from tests/run-make/crate-loading/multiple-dep-versions-3.rs)0
-rw-r--r--tests/run-make/crate-loading/dependency-1.rs (renamed from tests/run-make/crate-loading/multiple-dep-versions-1.rs)0
-rw-r--r--tests/run-make/crate-loading/dependency-2.rs (renamed from tests/run-make/crate-loading/multiple-dep-versions-2.rs)0
-rw-r--r--tests/run-make/crate-loading/rmake.rs9
-rw-r--r--tests/run-make/doctests-compilation-time-info/rmake.rs119
-rw-r--r--tests/run-make/doctests-merge/doctest-2024.stdout1
-rw-r--r--tests/run-make/doctests-merge/rmake.rs2
-rw-r--r--tests/run-make/linker-warning/rmake.rs3
-rw-r--r--tests/run-make/musl-default-linking/rmake.rs11
-rw-r--r--tests/run-make/panic-abort-eh_frame/rmake.rs11
-rw-r--r--tests/run-make/pointer-auth-link-with-c-lto-clang/rmake.rs8
-rw-r--r--tests/run-make/pointer-auth-link-with-c/rmake.rs10
-rw-r--r--tests/run-make/print-request-help-stable-unstable/help-diff.diff2
-rw-r--r--tests/run-make/print-request-help-stable-unstable/unstable-invalid-print-request-help.err2
-rw-r--r--tests/run-make/rustc-help/help-v.stdout2
-rw-r--r--tests/run-make/rustc-help/help.stdout2
-rw-r--r--tests/run-make/rustdoc-merge-no-input-finalize/rmake.rs28
-rw-r--r--tests/run-make/rustdoc-merge-no-input-finalize/sierra.rs1
-rw-r--r--tests/run-make/split-debuginfo/rmake.rs150
-rw-r--r--tests/rustdoc-gui/search-result-color.goml45
-rw-r--r--tests/rustdoc-gui/search-tab.goml2
-rw-r--r--tests/rustdoc-gui/search-title.goml12
-rw-r--r--tests/rustdoc-gui/sidebar.goml2
-rw-r--r--tests/rustdoc-gui/src/lib2/lib.rs1
-rw-r--r--tests/rustdoc-gui/src/test_docs/lib.rs9
-rw-r--r--tests/rustdoc-js-std/asrawfd.js4
-rw-r--r--tests/rustdoc-js-std/quoted.js18
-rw-r--r--tests/rustdoc-js-std/trait-unbox.js (renamed from tests/rustdoc-js-std/bufread-fill-buf.js)6
-rw-r--r--tests/rustdoc-js/trait-methods.js20
-rw-r--r--tests/rustdoc-js/trait-methods.rs18
-rw-r--r--tests/rustdoc-ui/cfg-hide-show-conflict.rs3
-rw-r--r--tests/rustdoc-ui/cfg-hide-show-conflict.stderr14
-rw-r--r--tests/rustdoc-ui/doc-cfg.rs11
-rw-r--r--tests/rustdoc-ui/doc-cfg.stderr78
-rw-r--r--tests/rustdoc-ui/doctest/doctest-output.edition2015.stdout6
-rw-r--r--tests/rustdoc-ui/doctest/doctest-output.edition2024.stdout7
-rw-r--r--tests/rustdoc-ui/doctest/doctest-output.rs2
-rw-r--r--tests/rustdoc-ui/doctest/merged-ignore-no_run.rs2
-rw-r--r--tests/rustdoc-ui/doctest/merged-ignore-no_run.stdout5
-rw-r--r--tests/rustdoc-ui/feature-gate-doc_cfg.rs6
-rw-r--r--tests/rustdoc-ui/feature-gate-doc_cfg.stderr63
-rw-r--r--tests/rustdoc-ui/feature-gate-doc_cfg_hide.rs7
-rw-r--r--tests/rustdoc-ui/feature-gate-doc_cfg_hide.stderr13
-rw-r--r--tests/rustdoc-ui/intra-doc/type-alias-primitive-suggestion.rs21
-rw-r--r--tests/rustdoc-ui/intra-doc/type-alias-primitive-suggestion.stderr39
-rw-r--r--tests/rustdoc-ui/intra-doc/type-alias-primitive.rs14
-rw-r--r--tests/rustdoc-ui/invalid-cfg.rs2
-rw-r--r--tests/rustdoc-ui/issues/issue-91713.stdout4
-rw-r--r--tests/rustdoc-ui/lints/doc_cfg_hide.rs11
-rw-r--r--tests/rustdoc-ui/lints/doc_cfg_hide.stderr27
-rw-r--r--tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.rs25
-rw-r--r--tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.stderr38
-rw-r--r--tests/rustdoc/attribute-rendering.rs8
-rw-r--r--tests/rustdoc/attributes.rs12
-rw-r--r--tests/rustdoc/auxiliary/ext-repr.rs5
-rw-r--r--tests/rustdoc/doc-auto-cfg-public-in-private.rs16
-rw-r--r--tests/rustdoc/doc-auto-cfg.rs2
-rw-r--r--tests/rustdoc/doc-cfg/doc-cfg-hide.rs8
-rw-r--r--tests/rustdoc/doc-cfg/doc-cfg-implicit-gate.rs3
-rw-r--r--tests/rustdoc/doc-cfg/doc-cfg-implicit.rs2
-rw-r--r--tests/rustdoc/doc_auto_cfg.rs77
-rw-r--r--tests/rustdoc/doc_auto_cfg_reexports.rs35
-rw-r--r--tests/rustdoc/impl/doc_auto_cfg_nested_impl.rs2
-rw-r--r--tests/rustdoc/inline_cross/attributes.rs17
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/attributes.rs9
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/repr.rs42
-rw-r--r--tests/rustdoc/inline_cross/repr.rs40
-rw-r--r--tests/rustdoc/intra-doc/type-alias-primitive.rs21
-rw-r--r--tests/rustdoc/jump-to-def-assoc-items.rs54
-rw-r--r--tests/rustdoc/jump-to-def-ice-assoc-types.rs20
-rw-r--r--tests/rustdoc/jump-to-def-ice.rs24
-rw-r--r--tests/rustdoc/jump-to-def/jump-to-def-doc-links-calls.rs4
-rw-r--r--tests/rustdoc/jump-to-def/jump-to-def-pats.rs10
-rw-r--r--tests/rustdoc/jump-to-def/jump-to-non-local-method.rs7
-rw-r--r--tests/rustdoc/reexport/auxiliary/reexports-attrs.rs14
-rw-r--r--tests/rustdoc/reexport/doc_auto_cfg-reexport-foreign-113982.rs2
-rw-r--r--tests/rustdoc/reexport/glob-reexport-attribute-merge-doc-auto-cfg.rs2
-rw-r--r--tests/rustdoc/reexport/private-mod-override-reexport.rs13
-rw-r--r--tests/rustdoc/reexport/reexport-attrs.rs20
-rw-r--r--tests/rustdoc/reexport/reexport-cfg.rs2
-rw-r--r--tests/rustdoc/repr.rs154
-rw-r--r--tests/rustdoc/source-code-pages/check-source-code-urls-to-def.rs2
-rw-r--r--tests/rustdoc/target-feature.rs2
-rw-r--r--tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs4
-rw-r--r--tests/ui-fulldeps/mod_dir_path_canonicalized.rs1
-rw-r--r--tests/ui/README.md6
-rw-r--r--tests/ui/abi/abi-sysv64-arg-passing.rs1
-rw-r--r--tests/ui/abi/abi-sysv64-register-usage.rs1
-rw-r--r--tests/ui/abi/invalid-self-parameter-type-56806.rs (renamed from tests/ui/issues/issue-56806.rs)1
-rw-r--r--tests/ui/abi/invalid-self-parameter-type-56806.stderr (renamed from tests/ui/issues/issue-56806.stderr)2
-rw-r--r--tests/ui/abi/issue-28676.rs2
-rw-r--r--tests/ui/abi/large-byval-align.rs1
-rw-r--r--tests/ui/abi/numbers-arithmetic/float-struct.rs1
-rw-r--r--tests/ui/abi/sparcv8plus-llvm19.rs42
-rw-r--r--tests/ui/abi/sparcv8plus-llvm19.sparc.stderr8
-rw-r--r--tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9.stderr8
-rw-r--r--tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9_feature_v8plus.stderr8
-rw-r--r--tests/ui/abi/sparcv8plus-llvm19.sparc_feature_v8plus.stderr8
-rw-r--r--tests/ui/abi/sparcv8plus-llvm19.sparcv8plus.stderr8
-rw-r--r--tests/ui/abi/sparcv8plus.rs1
-rw-r--r--tests/ui/abi/sparcv8plus.sparc.stderr2
-rw-r--r--tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr2
-rw-r--r--tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr2
-rw-r--r--tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr2
-rw-r--r--tests/ui/abi/sparcv8plus.sparcv8plus.stderr2
-rw-r--r--tests/ui/abi/stack-probes-lto.rs1
-rw-r--r--tests/ui/abi/stack-probes.rs1
-rw-r--r--tests/ui/abi/stack-protector.rs1
-rw-r--r--tests/ui/abi/struct-enums/struct-return.rs2
-rw-r--r--tests/ui/abi/variadic-ffi.rs2
-rw-r--r--tests/ui/abi/x86stdcall.rs1
-rw-r--r--tests/ui/array-slice-vec/box-of-array-of-drop-1.rs1
-rw-r--r--tests/ui/array-slice-vec/box-of-array-of-drop-2.rs1
-rw-r--r--tests/ui/array-slice-vec/nested-vec-3.rs1
-rw-r--r--tests/ui/array-slice-vec/slice-panic-1.rs1
-rw-r--r--tests/ui/array-slice-vec/slice-panic-2.rs1
-rw-r--r--tests/ui/asm/global-asm-isnt-really-a-mir-body.rs1
-rw-r--r--tests/ui/asm/loongarch/bad-reg.loongarch32_ilp32d.stderr12
-rw-r--r--tests/ui/asm/loongarch/bad-reg.loongarch32_ilp32s.stderr20
-rw-r--r--tests/ui/asm/loongarch/bad-reg.loongarch64_lp64d.stderr12
-rw-r--r--tests/ui/asm/loongarch/bad-reg.loongarch64_lp64s.stderr20
-rw-r--r--tests/ui/asm/loongarch/bad-reg.rs1
-rw-r--r--tests/ui/asm/powerpc/bad-reg.aix64.stderr162
-rw-r--r--tests/ui/asm/powerpc/bad-reg.powerpc.stderr176
-rw-r--r--tests/ui/asm/powerpc/bad-reg.powerpc64.stderr168
-rw-r--r--tests/ui/asm/powerpc/bad-reg.powerpc64le.stderr162
-rw-r--r--tests/ui/asm/powerpc/bad-reg.rs30
-rw-r--r--tests/ui/asm/x86_64/goto.rs1
-rw-r--r--tests/ui/asm/x86_64/goto.stderr4
-rw-r--r--tests/ui/asm/x86_64/srcloc.rs1
-rw-r--r--tests/ui/asm/x86_64/srcloc.stderr50
-rw-r--r--tests/ui/associated-consts/traits-associated-consts-ice-56870.rs (renamed from tests/ui/issues/issue-56870.rs)1
-rw-r--r--tests/ui/associated-inherent-types/hr-do-not-blame-outlives-static-ice.rs17
-rw-r--r--tests/ui/associated-inherent-types/hr-do-not-blame-outlives-static-ice.stderr34
-rw-r--r--tests/ui/associated-type-bounds/duplicate-bound-err.rs114
-rw-r--r--tests/ui/associated-type-bounds/duplicate-bound-err.stderr268
-rw-r--r--tests/ui/associated-type-bounds/duplicate-bound.rs240
-rw-r--r--tests/ui/associated-type-bounds/duplicate.rs278
-rw-r--r--tests/ui/associated-type-bounds/duplicate.stderr751
-rw-r--r--tests/ui/associated-types/associated-types-for-unimpl-trait.fixed2
-rw-r--r--tests/ui/associated-types/associated-types-overridden-binding-2.stderr2
-rw-r--r--tests/ui/associated-types/associated-types-overridden-binding.stderr2
-rw-r--r--tests/ui/associated-types/duplicate-associated-type-resolution-59326.rs (renamed from tests/ui/issues/issue-59326.rs)1
-rw-r--r--tests/ui/associated-types/impl-trait-member-type-resolution-57399.rs (renamed from tests/ui/issues/issue-57399-self-return-impl-trait.rs)2
-rw-r--r--tests/ui/associated-types/projection-dyn-associated-type.rs28
-rw-r--r--tests/ui/associated-types/projection-dyn-associated-type.stderr52
-rw-r--r--tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.current.stderr (renamed from tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.stderr)6
-rw-r--r--tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.next.stderr21
-rw-r--r--tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.rs4
-rw-r--r--tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.rs14
-rw-r--r--tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.stderr63
-rw-r--r--tests/ui/async-await/future-sizes/async-awaiting-fut.rs2
-rw-r--r--tests/ui/async-await/future-sizes/large-arg.rs2
-rw-r--r--tests/ui/attributes/empty-repr.stderr1
-rw-r--r--tests/ui/attributes/fn-align-dyn.rs1
-rw-r--r--tests/ui/attributes/invalid_macro_export_argument.allow.stderr40
-rw-r--r--tests/ui/attributes/invalid_macro_export_argument.deny.stderr93
-rw-r--r--tests/ui/attributes/invalid_macro_export_argument.rs12
-rw-r--r--tests/ui/attributes/main-removed-2/main.rs1
-rw-r--r--tests/ui/attributes/malformed-attrs.rs5
-rw-r--r--tests/ui/attributes/malformed-attrs.stderr73
-rw-r--r--tests/ui/attributes/unsafe/double-unsafe-attributes.rs2
-rw-r--r--tests/ui/attributes/unsafe/double-unsafe-attributes.stderr6
-rw-r--r--tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.rs2
-rw-r--r--tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr6
-rw-r--r--tests/ui/autodiff/flag_nott.rs19
-rw-r--r--tests/ui/autodiff/zst.rs17
-rw-r--r--tests/ui/backtrace/apple-no-dsymutil.rs1
-rw-r--r--tests/ui/backtrace/dylib-dep.rs4
-rw-r--r--tests/ui/backtrace/line-tables-only.rs4
-rw-r--r--tests/ui/backtrace/synchronized-panic-handler.rs1
-rw-r--r--tests/ui/backtrace/synchronized-panic-handler.run.stderr4
-rw-r--r--tests/ui/binop/function-comparison-errors-59488.rs (renamed from tests/ui/issues/issue-59488.rs)1
-rw-r--r--tests/ui/binop/function-comparison-errors-59488.stderr (renamed from tests/ui/issues/issue-59488.stderr)20
-rw-r--r--tests/ui/borrowck/fn-item-check-type-params.stderr12
-rw-r--r--tests/ui/borrowck/format-args-temporary-scopes.e2024.stderr27
-rw-r--r--tests/ui/borrowck/format-args-temporary-scopes.rs21
-rw-r--r--tests/ui/borrowck/implementation-not-general-enough-ice-133252.stderr6
-rw-r--r--tests/ui/borrowck/issue-17545.stderr3
-rw-r--r--tests/ui/box/boxed-value-matching-57741.rs (renamed from tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741-1.rs)1
-rw-r--r--tests/ui/box/boxed-value-matching-57741.stderr (renamed from tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741-1.stderr)4
-rw-r--r--tests/ui/box/dereferencing-boxed-enum-in-match-57741.fixed (renamed from tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741.fixed)1
-rw-r--r--tests/ui/box/dereferencing-boxed-enum-in-match-57741.rs (renamed from tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741.rs)1
-rw-r--r--tests/ui/box/dereferencing-boxed-enum-in-match-57741.stderr (renamed from tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741.stderr)8
-rw-r--r--tests/ui/box/unit/unwind-unique.rs1
-rw-r--r--tests/ui/c-variadic/inherent-method.rs46
-rw-r--r--tests/ui/c-variadic/naked.rs40
-rw-r--r--tests/ui/c-variadic/no-closure.rs11
-rw-r--r--tests/ui/c-variadic/no-closure.stderr27
-rw-r--r--tests/ui/c-variadic/not-async.rs10
-rw-r--r--tests/ui/c-variadic/not-async.stderr30
-rw-r--r--tests/ui/c-variadic/not-dyn-compatible.rs35
-rw-r--r--tests/ui/c-variadic/not-dyn-compatible.stderr21
-rw-r--r--tests/ui/c-variadic/trait-method.rs74
-rw-r--r--tests/ui/c-variadic/unsupported-abi.rs123
-rw-r--r--tests/ui/c-variadic/unsupported-abi.stderr345
-rw-r--r--tests/ui/c-variadic/valid.rs1
-rw-r--r--tests/ui/cfg/assume-incomplete-release/assume-incomplete.rs1
-rw-r--r--tests/ui/check-cfg/cfg-crate-features.stderr2
-rw-r--r--tests/ui/check-cfg/report-in-external-macros.cargo.stderr2
-rw-r--r--tests/ui/check-cfg/report-in-external-macros.rustc.stderr2
-rw-r--r--tests/ui/check-cfg/well-known-values.stderr6
-rw-r--r--tests/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs1
-rw-r--r--tests/ui/closures/deduce-signature/obligation-with-leaking-placeholders.next.stderr2
-rw-r--r--tests/ui/closures/generic-typed-nested-closures-59494.rs (renamed from tests/ui/issues/issue-59494.rs)1
-rw-r--r--tests/ui/closures/generic-typed-nested-closures-59494.stderr (renamed from tests/ui/issues/issue-59494.stderr)2
-rw-r--r--tests/ui/closures/impl-closure-147146.rs7
-rw-r--r--tests/ui/closures/impl-closure-147146.stderr15
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/undeclared-lifetime.rs21
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-call/undeclared-lifetime.stderr19
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/c-variadic.rs69
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/c-variadic.stderr28
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.rs7
-rw-r--r--tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.stderr18
-rw-r--r--tests/ui/codegen/issue-82833-slice-miscompile.rs1
-rw-r--r--tests/ui/codegen/llvm-args-invalid-flag.rs1
-rw-r--r--tests/ui/codegen/mono-item-collector-default-impl-58375.rs (renamed from tests/ui/issues/issue-58375-monomorphize-default-impls.rs)1
-rw-r--r--tests/ui/codegen/remark-flag-functionality.rs1
-rw-r--r--tests/ui/codegen/virtual-function-elimination.rs1
-rw-r--r--tests/ui/codemap_tests/huge_multispan_highlight.ascii.svg4
-rw-r--r--tests/ui/codemap_tests/huge_multispan_highlight.unicode.svg4
-rw-r--r--tests/ui/coercion/coerce-block-tail.stderr7
-rw-r--r--tests/ui/coercion/coerce-box-new-to-unboxed.rs4
-rw-r--r--tests/ui/coercion/coerce-box-new-to-unboxed.stderr19
-rw-r--r--tests/ui/coercion/no_local_for_coerced_const-issue-143671.rs46
-rw-r--r--tests/ui/coherence/trait-implementation-coherence-check-57162.rs (renamed from tests/ui/issues/issue-57162.rs)1
-rw-r--r--tests/ui/command/command-current-dir.rs2
-rw-r--r--tests/ui/command/command-exec.rs2
-rw-r--r--tests/ui/command/command-pre-exec.rs2
-rw-r--r--tests/ui/command/command-uid-gid.rs2
-rw-r--r--tests/ui/compiletest-self-test/compile-flags-incremental.rs17
-rw-r--r--tests/ui/compiletest-self-test/test-aux-bin.rs1
-rw-r--r--tests/ui/const-generics/adt_const_params/auxiliary/unsized_const_param.rs2
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs2
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_bad.stderr42
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.rs5
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.stderr19
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.rs2
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.stderr24
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_good.rs8
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.rs4
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.stderr10
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs8
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.stderr28
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.rs4
-rw-r--r--tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.stderr10
-rw-r--r--tests/ui/const-generics/adt_const_params/nested_bad_const_param_ty.rs3
-rw-r--r--tests/ui/const-generics/adt_const_params/nested_bad_const_param_ty.stderr63
-rw-r--r--tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.stderr6
-rw-r--r--tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.rs4
-rw-r--r--tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.stderr6
-rw-r--r--tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.rs4
-rw-r--r--tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.stderr6
-rw-r--r--tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.rs4
-rw-r--r--tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.stderr6
-rw-r--r--tests/ui/const-generics/adt_const_params/unsized_field-1.rs5
-rw-r--r--tests/ui/const-generics/adt_const_params/unsized_field-1.stderr28
-rw-r--r--tests/ui/const-generics/adt_const_params/unsized_field-2.rs14
-rw-r--r--tests/ui/const-generics/adt_const_params/unsized_field-2.stderr27
-rw-r--r--tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.rs1
-rw-r--r--tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.stderr51
-rw-r--r--tests/ui/const-generics/const-param-with-additional-obligations.rs4
-rw-r--r--tests/ui/const-generics/forbid-non-structural_match-types.stderr2
-rw-r--r--tests/ui/const-generics/generic_arg_infer/in-signature.stderr36
-rw-r--r--tests/ui/const-generics/generic_arg_infer/paren_infer.rs (renamed from tests/ui/const-generics/generic_arg_infer/parend_infer.rs)1
-rw-r--r--tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.rs1
-rw-r--r--tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.stderr19
-rw-r--r--tests/ui/const-generics/generic_const_parameter_types/no_const_param_ty_bound.stderr2
-rw-r--r--tests/ui/const-generics/issue-66451.rs6
-rw-r--r--tests/ui/const-generics/issue-80471.stderr4
-rw-r--r--tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr2
-rw-r--r--tests/ui/const-generics/issues/issue-97278.stderr4
-rw-r--r--tests/ui/const-generics/slice-const-param-mismatch.adt_const_params.stderr22
-rw-r--r--tests/ui/const-generics/slice-const-param.rs2
-rw-r--r--tests/ui/const-generics/transmute-const-param-static-reference.adt_const_params.stderr12
-rw-r--r--tests/ui/const-generics/transmute-const-param-static-reference.rs2
-rw-r--r--tests/ui/const-generics/unsized_const_params/symbol_mangling_v0_str.rs4
-rw-r--r--tests/ui/consts/const-eval/ub-nonnull.rs4
-rw-r--r--tests/ui/consts/const-eval/ub-nonnull.stderr17
-rw-r--r--tests/ui/consts/const-eval/ub-ref-ptr.rs23
-rw-r--r--tests/ui/consts/const-eval/ub-ref-ptr.stderr67
-rw-r--r--tests/ui/consts/const_refs_to_static_fail.stderr2
-rw-r--r--tests/ui/consts/const_refs_to_static_fail_invalid.stderr4
-rw-r--r--tests/ui/consts/const_transmute_type_id7.rs16
-rw-r--r--tests/ui/consts/const_transmute_type_id7.stderr14
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static.stderr2
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr6
-rw-r--r--tests/ui/consts/oncecell-const-init-57781.rs (renamed from tests/ui/issues/issue-57781.rs)1
-rw-r--r--tests/ui/consts/promoted_const_call2.rs1
-rw-r--r--tests/ui/consts/promoted_const_call2.stderr17
-rw-r--r--tests/ui/consts/refs_check_const_eq-issue-88384.stderr4
-rw-r--r--tests/ui/consts/required-consts/collect-in-promoted-const.noopt.stderr6
-rw-r--r--tests/ui/consts/required-consts/collect-in-promoted-const.opt.stderr10
-rw-r--r--tests/ui/consts/required-consts/collect-in-promoted-const.rs2
-rw-r--r--tests/ui/coroutine/copy-fast-path-query-cycle.rs40
-rw-r--r--tests/ui/coroutine/gen_block_panic.rs1
-rw-r--r--tests/ui/coroutine/gen_block_panic.stderr2
-rw-r--r--tests/ui/coroutine/handle_opaques_before_coroutines.rs15
-rw-r--r--tests/ui/coroutine/moved-twice.rs (renamed from tests/crashes/122630.rs)11
-rw-r--r--tests/ui/coroutine/moved-twice.stderr24
-rw-r--r--tests/ui/cross-crate/exporting-impl-from-root-causes-ice-2472.rs5
-rw-r--r--tests/ui/darwin-objc/darwin-objc-bad-arg.rs36
-rw-r--r--tests/ui/darwin-objc/darwin-objc-bad-arg.stderr50
-rw-r--r--tests/ui/darwin-objc/darwin-objc-bad-const.rs17
-rw-r--r--tests/ui/darwin-objc/darwin-objc-bad-const.stderr19
-rw-r--r--tests/ui/darwin-objc/darwin-objc-bad-ref.rs31
-rw-r--r--tests/ui/darwin-objc/darwin-objc-bad-ref.stderr39
-rw-r--r--tests/ui/darwin-objc/darwin-objc-class-selector.rs31
-rw-r--r--tests/ui/darwin-objc/darwin-objc-class.rs39
-rw-r--r--tests/ui/darwin-objc/darwin-objc-selector.rs36
-rw-r--r--tests/ui/debuginfo/impl-copy-function-debuginfo-58463.rs (renamed from tests/ui/issues/issue-58463.rs)1
-rw-r--r--tests/ui/delegation/fn-header-variadic.rs1
-rw-r--r--tests/ui/delegation/fn-header-variadic.stderr4
-rw-r--r--tests/ui/diagnostic-flags/colored-session-opt-error.svg4
-rw-r--r--tests/ui/diagnostic-flags/terminal_urls.rs4
-rw-r--r--tests/ui/diagnostic-flags/terminal_urls.stderr11
-rw-r--r--tests/ui/diagnostic-flags/terminal_urls.svg48
-rw-r--r--tests/ui/diagnostic-flags/terminal_urls.windows.svg49
-rw-r--r--tests/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr4
-rw-r--r--tests/ui/did_you_mean/recursion_limit_deref.rs7
-rw-r--r--tests/ui/did_you_mean/recursion_limit_deref.stderr18
-rw-r--r--tests/ui/dist/cranelift-x86_64-unknown-linux-gnu-dist.rs1
-rw-r--r--tests/ui/drop/drop-trait-enum.rs1
-rw-r--r--tests/ui/drop/super-let-tail-expr-drop-order.rs192
-rw-r--r--tests/ui/drop/terminate-in-initializer.rs1
-rw-r--r--tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.rs (renamed from tests/ui/issues/issue-58734.rs)1
-rw-r--r--tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.stderr (renamed from tests/ui/issues/issue-58734.stderr)6
-rw-r--r--tests/ui/empty/empty-attributes.stderr4
-rw-r--r--tests/ui/error-codes/E0121.stderr11
-rw-r--r--tests/ui/error-codes/E0719.rs5
-rw-r--r--tests/ui/error-codes/E0719.stderr34
-rw-r--r--tests/ui/error-emitter/E0308-clarification.svg2
-rw-r--r--tests/ui/error-emitter/highlighting.svg2
-rw-r--r--tests/ui/error-emitter/highlighting.windows.svg2
-rw-r--r--tests/ui/error-emitter/multiline-multipart-suggestion.svg2
-rw-r--r--tests/ui/error-emitter/multiline-multipart-suggestion.windows.svg2
-rw-r--r--tests/ui/error-emitter/multiline-removal-suggestion.svg4
-rw-r--r--tests/ui/error-emitter/unicode-output.svg2
-rw-r--r--tests/ui/errors/auxiliary/remapped_dep.rs2
-rw-r--r--tests/ui/errors/remap-path-prefix-reverse.local-self.stderr2
-rw-r--r--tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr2
-rw-r--r--tests/ui/errors/remap-path-prefix-reverse.rs1
-rw-r--r--tests/ui/errors/remap-path-prefix.rs2
-rw-r--r--tests/ui/errors/span-format_args-issue-140578.rs32
-rw-r--r--tests/ui/errors/span-format_args-issue-140578.stderr43
-rw-r--r--tests/ui/explicit-tail-calls/c-variadic.rs14
-rw-r--r--tests/ui/explicit-tail-calls/c-variadic.stderr8
-rw-r--r--tests/ui/explicit-tail-calls/callee_is_track_caller.rs1
-rw-r--r--tests/ui/explicit-tail-calls/callee_is_track_caller.stderr2
-rw-r--r--tests/ui/explicit-tail-calls/callee_is_track_caller_polymorphic.rs1
-rw-r--r--tests/ui/explicit-tail-calls/callee_is_track_caller_polymorphic.stderr2
-rw-r--r--tests/ui/explicit-tail-calls/callee_is_weird.stderr2
-rw-r--r--tests/ui/explicit-tail-calls/drop-order.rs1
-rw-r--r--tests/ui/explicit-tail-calls/indexer.rs1
-rw-r--r--tests/ui/explicit-tail-calls/recursion-etc.rs1
-rw-r--r--tests/ui/extern/extern-types-field-offset.rs6
-rw-r--r--tests/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs1
-rw-r--r--tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs1
-rw-r--r--tests/ui/feature-gates/feature-gate-adt_const_params.rs6
-rw-r--r--tests/ui/feature-gates/feature-gate-adt_const_params.stderr12
-rw-r--r--tests/ui/feature-gates/feature-gate-c_variadic.rs1
-rw-r--r--tests/ui/feature-gates/feature-gate-c_variadic.stderr8
-rw-r--r--tests/ui/feature-gates/feature-gate-doc_cfg.rs2
-rw-r--r--tests/ui/feature-gates/feature-gate-macro-attr.stderr2
-rw-r--r--tests/ui/feature-gates/feature-gate-macro-derive.stderr4
-rw-r--r--tests/ui/feature-gates/feature-gate-never_patterns.stderr2
-rw-r--r--tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.rs4
-rw-r--r--tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr4
-rw-r--r--tests/ui/feature-gates/feature-gate-reborrow-coerce-shared.rs3
-rw-r--r--tests/ui/feature-gates/feature-gate-reborrow-coerce-shared.stderr13
-rw-r--r--tests/ui/feature-gates/feature-gate-reborrow.rs2
-rw-r--r--tests/ui/feature-gates/feature-gate-reborrow.stderr4
-rw-r--r--tests/ui/feature-gates/feature-gate-sanitize.stderr2
-rw-r--r--tests/ui/feature-gates/feature-gate-static_align-thread_local.rs11
-rw-r--r--tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs3
-rw-r--r--tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr79
-rw-r--r--tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs30
-rw-r--r--tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr389
-rw-r--r--tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.rs1
-rw-r--r--tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.stderr2
-rw-r--r--tests/ui/fn/issue-80179.stderr21
-rw-r--r--tests/ui/fn/suggest-return-closure.stderr30
-rw-r--r--tests/ui/fn/suggest-return-future.stderr22
-rw-r--r--tests/ui/force-inlining/inherent.rs21
-rw-r--r--tests/ui/force-inlining/inherent.stderr13
-rw-r--r--tests/ui/force-inlining/invalid.rs1
-rw-r--r--tests/ui/force-inlining/invalid.stderr38
-rw-r--r--tests/ui/frontmatter/proc-macro-observer.rs1
-rw-r--r--tests/ui/frontmatter/unclosed-6.rs12
-rw-r--r--tests/ui/frontmatter/unclosed-6.stderr19
-rw-r--r--tests/ui/generic-associated-types/bugs/hrtb-implied-1.stderr5
-rw-r--r--tests/ui/generics/generic-associated-type-deref-target-56237.rs (renamed from tests/ui/issues/issue-56237.rs)1
-rw-r--r--tests/ui/higher-ranked/do-not-blame-outlives-static-ice.rs12
-rw-r--r--tests/ui/higher-ranked/do-not-blame-outlives-static-ice.stderr17
-rw-r--r--tests/ui/higher-ranked/hrtb-associated-type-leak-check-55731.rs (renamed from tests/ui/issues/issue-55731.rs)1
-rw-r--r--tests/ui/higher-ranked/hrtb-associated-type-leak-check-55731.stderr (renamed from tests/ui/issues/issue-55731.stderr)2
-rw-r--r--tests/ui/higher-ranked/trait-bounds/issue-59311.stderr2
-rw-r--r--tests/ui/higher-ranked/trait-bounds/trivial-does-not-hold.stderr2
-rw-r--r--tests/ui/hygiene/issue-77523-def-site-async-await.rs1
-rw-r--r--tests/ui/hygiene/panic-location.run.stderr2
-rw-r--r--tests/ui/impl-trait/call_method_ambiguous.next.stderr17
-rw-r--r--tests/ui/impl-trait/call_method_ambiguous.rs3
-rw-r--r--tests/ui/impl-trait/call_method_on_inherent_impl.next.stderr17
-rw-r--r--tests/ui/impl-trait/call_method_on_inherent_impl.rs3
-rw-r--r--tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.current.stderr2
-rw-r--r--tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.next.stderr18
-rw-r--r--tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.rs3
-rw-r--r--tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.current.stderr (renamed from tests/ui/impl-trait/call_method_on_inherent_impl_ref.current.stderr)4
-rw-r--r--tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.next.stderr19
-rw-r--r--tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.rs24
-rw-r--r--tests/ui/impl-trait/call_method_on_inherent_impl_ref-ok.rs (renamed from tests/ui/impl-trait/call_method_on_inherent_impl_ref.rs)12
-rw-r--r--tests/ui/impl-trait/call_method_on_inherent_impl_ref.next.stderr31
-rw-r--r--tests/ui/impl-trait/diagnostics/highlight-difference-between-expected-trait-and-found-trait.svg4
-rw-r--r--tests/ui/impl-trait/hidden-type-is-opaque-2.default.stderr4
-rw-r--r--tests/ui/impl-trait/hidden-type-is-opaque-2.next.stderr4
-rw-r--r--tests/ui/impl-trait/method-resolution4.next.stderr9
-rw-r--r--tests/ui/impl-trait/method/broken-deref-chain.current.stderr19
-rw-r--r--tests/ui/impl-trait/method/broken-deref-chain.rs47
-rw-r--r--tests/ui/impl-trait/method/method-resolution.rs (renamed from tests/ui/impl-trait/method-resolution.rs)0
-rw-r--r--tests/ui/impl-trait/method/method-resolution2.next.stderr (renamed from tests/ui/impl-trait/method-resolution2.next.stderr)0
-rw-r--r--tests/ui/impl-trait/method/method-resolution2.rs (renamed from tests/ui/impl-trait/method-resolution2.rs)0
-rw-r--r--tests/ui/impl-trait/method/method-resolution3.current.stderr (renamed from tests/ui/impl-trait/method-resolution3.current.stderr)0
-rw-r--r--tests/ui/impl-trait/method/method-resolution3.next.stderr (renamed from tests/ui/impl-trait/method-resolution3.next.stderr)0
-rw-r--r--tests/ui/impl-trait/method/method-resolution3.rs (renamed from tests/ui/impl-trait/method-resolution3.rs)0
-rw-r--r--tests/ui/impl-trait/method/method-resolution4.rs (renamed from tests/ui/impl-trait/method-resolution4.rs)3
-rw-r--r--tests/ui/impl-trait/method/method-resolution5-deref-no-constrain.current.stderr19
-rw-r--r--tests/ui/impl-trait/method/method-resolution5-deref-no-constrain.rs23
-rw-r--r--tests/ui/impl-trait/method/method-resolution5-deref.rs30
-rw-r--r--tests/ui/impl-trait/method/would-constrain-opaque.current.stderr29
-rw-r--r--tests/ui/impl-trait/method/would-constrain-opaque.next.stderr27
-rw-r--r--tests/ui/impl-trait/method/would-constrain-opaque.rs39
-rw-r--r--tests/ui/impl-trait/non-defining-uses/ambiguous-ops.current.stderr62
-rw-r--r--tests/ui/impl-trait/non-defining-uses/ambiguous-ops.rs117
-rw-r--r--tests/ui/impl-trait/non-defining-uses/call-expr-incorrect-choice-diagnostics.current.stderr53
-rw-r--r--tests/ui/impl-trait/non-defining-uses/call-expr-incorrect-choice-diagnostics.next.stderr57
-rw-r--r--tests/ui/impl-trait/non-defining-uses/call-expr-incorrect-choice-diagnostics.rs52
-rw-r--r--tests/ui/impl-trait/non-defining-uses/deref-constrains-self-ty.current.stderr16
-rw-r--r--tests/ui/impl-trait/non-defining-uses/deref-constrains-self-ty.rs28
-rw-r--r--tests/ui/impl-trait/non-defining-uses/double-wrap-with-defining-use.current.stderr4
-rw-r--r--tests/ui/impl-trait/non-defining-uses/double-wrap-with-defining-use.rs1
-rw-r--r--tests/ui/impl-trait/non-defining-uses/function-call-on-infer.rs73
-rw-r--r--tests/ui/impl-trait/non-defining-uses/ice-issue-146191.current.stderr2
-rw-r--r--tests/ui/impl-trait/non-defining-uses/ice-issue-146191.next.stderr10
-rw-r--r--tests/ui/impl-trait/non-defining-uses/ice-issue-146191.rs1
-rw-r--r--tests/ui/impl-trait/non-defining-uses/impl-deref-function-call.rs56
-rw-r--r--tests/ui/impl-trait/non-defining-uses/shex_compat-regression-test.rs19
-rw-r--r--tests/ui/impl-trait/precise-capturing/external-macro.rs1
-rw-r--r--tests/ui/impl-trait/precise-capturing/migration-note.rs2
-rw-r--r--tests/ui/impl-trait/precise-capturing/migration-note.stderr54
-rw-r--r--tests/ui/impl-trait/recursive-bound-eval.next.stderr9
-rw-r--r--tests/ui/impl-trait/recursive-bound-eval.rs6
-rw-r--r--tests/ui/impl-trait/recursive-coroutine-boxed.next.stderr17
-rw-r--r--tests/ui/impl-trait/recursive-coroutine-boxed.rs3
-rw-r--r--tests/ui/impl-trait/two_tait_defining_each_other2.next.stderr8
-rw-r--r--tests/ui/impl-trait/two_tait_defining_each_other2.rs3
-rw-r--r--tests/ui/impl-trait/where-allowed.stderr2
-rw-r--r--tests/ui/implied-bounds/bevy_world_query.rs6
-rw-r--r--tests/ui/imports/auxiliary/reexported-trait-56175.rs17
-rw-r--r--tests/ui/imports/auxiliary/same-res-ambigious-extern-fail.rs16
-rw-r--r--tests/ui/imports/auxiliary/same-res-ambigious-extern-macro.rs8
-rw-r--r--tests/ui/imports/auxiliary/same-res-ambigious-extern.rs11
-rw-r--r--tests/ui/imports/private-types-suggested-without-extern-crate-56175.rs (renamed from tests/ui/issues/issue-56175.rs)3
-rw-r--r--tests/ui/imports/private-types-suggested-without-extern-crate-56175.stderr (renamed from tests/ui/issues/issue-56175.stderr)12
-rw-r--r--tests/ui/imports/same-res-ambigious.fail.stderr20
-rw-r--r--tests/ui/imports/same-res-ambigious.nightly-fail.stderr20
-rw-r--r--tests/ui/imports/same-res-ambigious.rs11
-rw-r--r--tests/ui/indexing/ambiguity-after-deref-step.rs9
-rw-r--r--tests/ui/indexing/ambiguity-after-deref-step.stderr17
-rw-r--r--tests/ui/indexing/index_message.stderr4
-rw-r--r--tests/ui/inference/issue-72616.rs1
-rw-r--r--tests/ui/inference/issue-72616.stderr19
-rw-r--r--tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.stderr2
-rw-r--r--tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.stderr2
-rw-r--r--tests/ui/inference/return-block-type-inference-15965.stderr6
-rw-r--r--tests/ui/infinite/auxiliary/aux-57271-lib.rs (renamed from tests/ui/issues/auxiliary/issue-57271-lib.rs)0
-rw-r--r--tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.rs28
-rw-r--r--tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.stderr8
-rw-r--r--tests/ui/infinite/infinite-struct.rs3
-rw-r--r--tests/ui/infinite/infinite-struct.stderr6
-rw-r--r--tests/ui/infinite/mutually-recursive-infinite-types-57271.rs (renamed from tests/ui/issues/issue-57271.rs)7
-rw-r--r--tests/ui/infinite/mutually-recursive-infinite-types-57271.stderr (renamed from tests/ui/issues/issue-57271.stderr)2
-rw-r--r--tests/ui/intrinsics/intrinsic-fmuladd.rs4
-rw-r--r--tests/ui/intrinsics/reify-intrinsic.stderr2
-rw-r--r--tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADFLAGS.stderr2
-rw-r--r--tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADFLAGSPC.stderr2
-rw-r--r--tests/ui/invalid-compile-flags/invalid-llvm-passes.rs1
-rw-r--r--tests/ui/invalid-compile-flags/print-without-arg.stderr2
-rw-r--r--tests/ui/invalid-compile-flags/print.stderr2
-rw-r--r--tests/ui/invalid/invalid-debugger-visualizer-option.rs2
-rw-r--r--tests/ui/invalid/invalid-debugger-visualizer-option.stderr22
-rw-r--r--tests/ui/invalid/invalid-debugger-visualizer-target.rs3
-rw-r--r--tests/ui/invalid/invalid-debugger-visualizer-target.stderr4
-rw-r--r--tests/ui/invalid/issue-114435-layout-type-err.rs3
-rw-r--r--tests/ui/issues/issue-18088.rs8
-rw-r--r--tests/ui/issues/issue-2151.stderr2
-rw-r--r--tests/ui/issues/issue-21950.rs12
-rw-r--r--tests/ui/issues/issue-2284.rs13
-rw-r--r--tests/ui/issues/issue-25089.rs1
-rw-r--r--tests/ui/issues/issue-26655.rs1
-rw-r--r--tests/ui/issues/issue-27592.stderr12
-rw-r--r--tests/ui/issues/issue-27842.stderr12
-rw-r--r--tests/ui/issues/issue-29485.rs1
-rw-r--r--tests/ui/issues/issue-30018-panic.rs1
-rw-r--r--tests/ui/issues/issue-44056.rs1
-rw-r--r--tests/ui/issues/issue-45731.rs4
-rw-r--r--tests/ui/issues/issue-56943.rs8
-rw-r--r--tests/ui/issues/issue-68696-catch-during-unwind.rs1
-rw-r--r--tests/ui/iterators/issue-58952-filter-type-length.rs2
-rw-r--r--tests/ui/keyword/raw-identifier-for-function-57198.rs (renamed from tests/ui/issues/issue-57198-pass.rs)1
-rw-r--r--tests/ui/keyword/soup.rs30
-rw-r--r--tests/ui/lang-items/missing-copy-lang-item-issue-19660.rs19
-rw-r--r--tests/ui/lang-items/missing-copy-lang-item-issue-19660.stderr8
-rw-r--r--tests/ui/layout/thaw-transmute-invalid-enum.rs1
-rw-r--r--tests/ui/layout/thaw-transmute-invalid-enum.stderr19
-rw-r--r--tests/ui/lazy-type-alias-impl-trait/branches3.stderr8
-rw-r--r--tests/ui/lifetimes/issue-105507.fixed2
-rw-r--r--tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.rs13
-rw-r--r--tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.stderr20
-rw-r--r--tests/ui/lifetimes/re-empty-in-error.stderr2
-rw-r--r--tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs6
-rw-r--r--tests/ui/linkage-attr/common-linkage-non-zero-init.rs1
-rw-r--r--tests/ui/linkage-attr/raw-dylib/elf/glibc-x86_64.rs1
-rw-r--r--tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.rs2
-rw-r--r--tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.stderr2
-rw-r--r--tests/ui/linking/no-gc-encapsulation-symbols.rs1
-rw-r--r--tests/ui/lint/unused-qualification-in-derive-expansion.rs1
-rw-r--r--tests/ui/lint/unused/unused-attr-duplicate.stderr24
-rw-r--r--tests/ui/lint/unused_parens_follow_ident.fixed17
-rw-r--r--tests/ui/lint/unused_parens_follow_ident.rs17
-rw-r--r--tests/ui/lint/unused_parens_follow_ident.stderr31
-rw-r--r--tests/ui/lto/debuginfo-lto-alloc.rs1
-rw-r--r--tests/ui/lto/debuginfo-lto.rs1
-rw-r--r--tests/ui/lto/dwarf-mixed-versions-lto.rs1
-rw-r--r--tests/ui/lto/fat-lto.rs1
-rw-r--r--tests/ui/lto/issue-100772.rs1
-rw-r--r--tests/ui/lto/lto-duplicate-symbols.rs1
-rw-r--r--tests/ui/lto/lto-many-codegen-units.rs1
-rw-r--r--tests/ui/lto/lto-rustc-loads-linker-plugin.rs1
-rw-r--r--tests/ui/lto/lto-still-runs-thread-dtors.rs1
-rw-r--r--tests/ui/macros/issue-61053-duplicate-binder.stderr4
-rw-r--r--tests/ui/macros/macro-local-data-key-priv.stderr2
-rw-r--r--tests/ui/macros/macro-rules-attr-error.rs19
-rw-r--r--tests/ui/macros/macro-rules-attr-error.stderr14
-rw-r--r--tests/ui/macros/macro-use-all-and-none.stderr3
-rw-r--r--tests/ui/macros/same-sequence-span.rs1
-rw-r--r--tests/ui/macros/same-sequence-span.stderr12
-rw-r--r--tests/ui/methods/overflow-if-subtyping.rs30
-rw-r--r--tests/ui/mir/lint/assignment-overlap.rs2
-rw-r--r--tests/ui/mismatched_types/auxiliary/aux-56943.rs (renamed from tests/ui/issues/auxiliary/issue-56943.rs)0
-rw-r--r--tests/ui/mismatched_types/type-mismatch-in-extern-crate-56943.rs9
-rw-r--r--tests/ui/mismatched_types/type-mismatch-in-extern-crate-56943.stderr (renamed from tests/ui/issues/issue-56943.stderr)6
-rw-r--r--tests/ui/modules/pub-use-handling-in-modules-56128.rs (renamed from tests/ui/issues/issue-56128.rs)0
-rw-r--r--tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr6
-rw-r--r--tests/ui/nll/closure-requirements/propagate-multiple-requirements.stderr6
-rw-r--r--tests/ui/nll/local-outlives-static-via-hrtb.stderr10
-rw-r--r--tests/ui/nll/polonius/location-insensitive-scopes-issue-117146.nll.stderr5
-rw-r--r--tests/ui/nll/polonius/location-insensitive-scopes-issue-117146.polonius.stderr5
-rw-r--r--tests/ui/nll/user-annotations/dump-fn-method.rs4
-rw-r--r--tests/ui/nll/user-annotations/dump-fn-method.stderr4
-rw-r--r--tests/ui/numbers-arithmetic/int-abs-overflow.rs1
-rw-r--r--tests/ui/numbers-arithmetic/issue-8460.rs1
-rw-r--r--tests/ui/panic-runtime/auxiliary/needs-abort.rs2
-rw-r--r--tests/ui/panic-runtime/auxiliary/needs-immediate-abort.rs7
-rw-r--r--tests/ui/panic-runtime/auxiliary/needs-unwind-immediate-abort.rs18
-rw-r--r--tests/ui/panic-runtime/bad-panic-flag1.rs2
-rw-r--r--tests/ui/panic-runtime/bad-panic-flag1.stderr2
-rw-r--r--tests/ui/panic-runtime/bad-panic-flag2.rs2
-rw-r--r--tests/ui/panic-runtime/bad-panic-flag2.stderr2
-rw-r--r--tests/ui/panic-runtime/immediate-abort-default-sysroot.rs15
-rw-r--r--tests/ui/panic-runtime/immediate-abort-default-sysroot.stderr4
-rw-r--r--tests/ui/panic-runtime/lto-unwind.rs1
-rw-r--r--tests/ui/panic-runtime/need-abort-got-immediate-abort.rs21
-rw-r--r--tests/ui/panic-runtime/need-abort-got-immediate-abort.stderr4
-rw-r--r--tests/ui/panic-runtime/need-immediate-abort-got-abort.rs20
-rw-r--r--tests/ui/panic-runtime/need-immediate-abort-got-abort.stderr4
-rw-r--r--tests/ui/panic-runtime/need-immediate-abort-got-unwind.rs20
-rw-r--r--tests/ui/panic-runtime/need-immediate-abort-got-unwind.stderr4
-rw-r--r--tests/ui/panic-runtime/need-unwind-got-immediate-abort.rs21
-rw-r--r--tests/ui/panic-runtime/need-unwind-got-immediate-abort.stderr4
-rw-r--r--tests/ui/panics/oom-panic-unwind.rs1
-rw-r--r--tests/ui/panics/panic-abort-backtrace-without-debuginfo.rs57
-rw-r--r--tests/ui/panics/panic-handler-chain-update-hook.rs1
-rw-r--r--tests/ui/panics/panic-handler-chain.rs1
-rw-r--r--tests/ui/panics/panic-handler-flail-wildly.rs1
-rw-r--r--tests/ui/panics/panic-handler-set-twice.rs1
-rw-r--r--tests/ui/panics/panic-in-dtor-drops-fields.rs1
-rw-r--r--tests/ui/panics/panic-recover-propagate.rs1
-rw-r--r--tests/ui/panics/rvalue-cleanup-during-box-panic.rs1
-rw-r--r--tests/ui/panics/unwind-force-no-unwind-tables.rs1
-rw-r--r--tests/ui/parser/expr-as-stmt.fixed4
-rw-r--r--tests/ui/parser/invalid-variable-definition-55587.rs (renamed from tests/ui/issues/issue-55587.rs)1
-rw-r--r--tests/ui/parser/invalid-variable-definition-55587.stderr (renamed from tests/ui/issues/issue-55587.stderr)2
-rw-r--r--tests/ui/parser/issues/issue-87086-colon-path-sep.rs3
-rw-r--r--tests/ui/parser/issues/issue-87086-colon-path-sep.stderr20
-rw-r--r--tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.rs1
-rw-r--r--tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.stderr2
-rw-r--r--tests/ui/parser/macro/bad-macro-definition.rs3
-rw-r--r--tests/ui/parser/macro/bad-macro-definition.stderr8
-rw-r--r--tests/ui/parser/macro/macro-attr-bad.rs6
-rw-r--r--tests/ui/parser/macro/macro-attr-bad.stderr26
-rw-r--r--tests/ui/parser/macro/macro-derive-bad.rs3
-rw-r--r--tests/ui/parser/macro/macro-derive-bad.stderr8
-rw-r--r--tests/ui/parser/macro/unicode-control-codepoints-macros.rs1
-rw-r--r--tests/ui/parser/macro/unicode-control-codepoints-macros.stderr10
-rw-r--r--tests/ui/parser/match-arm-without-body.rs4
-rw-r--r--tests/ui/parser/match-arm-without-body.stderr11
-rw-r--r--tests/ui/parser/tuple-index-suffix-proc-macro.rs1
-rw-r--r--tests/ui/parser/tuple-index-suffix-proc-macro.stderr8
-rw-r--r--tests/ui/parser/type-ascription-in-pattern.rs17
-rw-r--r--tests/ui/parser/type-ascription-in-pattern.stderr80
-rw-r--r--tests/ui/parser/variadic-ffi-semantic-restrictions.rs18
-rw-r--r--tests/ui/parser/variadic-ffi-semantic-restrictions.stderr36
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr22
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.rs4
-rw-r--r--tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr4
-rw-r--r--tests/ui/pattern/usefulness/issue-85222-types-containing-non-exhaustive-types.stderr16
-rw-r--r--tests/ui/print-request/print-lints-help.stderr2
-rw-r--r--tests/ui/print_type_sizes/async.rs2
-rw-r--r--tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.fixed20
-rw-r--r--tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs20
-rw-r--r--tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.stderr36
-rw-r--r--tests/ui/proc-macro/add-impl.rs1
-rw-r--r--tests/ui/proc-macro/ambiguous-builtin-attrs-test.rs1
-rw-r--r--tests/ui/proc-macro/ambiguous-builtin-attrs-test.stderr2
-rw-r--r--tests/ui/proc-macro/ambiguous-builtin-attrs.rs1
-rw-r--r--tests/ui/proc-macro/ambiguous-builtin-attrs.stderr30
-rw-r--r--tests/ui/proc-macro/append-impl.rs1
-rw-r--r--tests/ui/proc-macro/attr-args.rs1
-rw-r--r--tests/ui/proc-macro/attr-invalid-exprs.rs1
-rw-r--r--tests/ui/proc-macro/attr-invalid-exprs.stderr6
-rw-r--r--tests/ui/proc-macro/attr-on-trait.rs1
-rw-r--r--tests/ui/proc-macro/bang-macro.rs1
-rw-r--r--tests/ui/proc-macro/call-site.rs1
-rw-r--r--tests/ui/proc-macro/count_compound_ops.rs1
-rw-r--r--tests/ui/proc-macro/derive-bad.rs1
-rw-r--r--tests/ui/proc-macro/derive-bad.stderr6
-rw-r--r--tests/ui/proc-macro/derive-helper-shadowing.rs1
-rw-r--r--tests/ui/proc-macro/derive-helper-shadowing.stderr18
-rw-r--r--tests/ui/proc-macro/derive-same-struct.rs1
-rw-r--r--tests/ui/proc-macro/edition-imports-2018.rs1
-rw-r--r--tests/ui/proc-macro/env.rs1
-rw-r--r--tests/ui/proc-macro/expand-expr.rs5
-rw-r--r--tests/ui/proc-macro/expand-expr.stderr14
-rw-r--r--tests/ui/proc-macro/expand-to-unstable.rs1
-rw-r--r--tests/ui/proc-macro/expand-to-unstable.stderr2
-rw-r--r--tests/ui/proc-macro/expand-with-a-macro.rs1
-rw-r--r--tests/ui/proc-macro/gen-macro-rules-hygiene.rs1
-rw-r--r--tests/ui/proc-macro/gen-macro-rules-hygiene.stderr6
-rw-r--r--tests/ui/proc-macro/gen-macro-rules.rs1
-rw-r--r--tests/ui/proc-macro/generate-mod.rs1
-rw-r--r--tests/ui/proc-macro/generate-mod.stderr28
-rw-r--r--tests/ui/proc-macro/hygiene_example.rs1
-rw-r--r--tests/ui/proc-macro/is-available.rs1
-rw-r--r--tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.rs1
-rw-r--r--tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.stderr18
-rw-r--r--tests/ui/proc-macro/issue-107113-wrap.rs1
-rw-r--r--tests/ui/proc-macro/issue-107113-wrap.stderr2
-rw-r--r--tests/ui/proc-macro/issue-118809.rs1
-rw-r--r--tests/ui/proc-macro/issue-118809.stderr4
-rw-r--r--tests/ui/proc-macro/issue-38586.rs1
-rw-r--r--tests/ui/proc-macro/issue-38586.stderr2
-rw-r--r--tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs1
-rw-r--r--tests/ui/proc-macro/issue-79148.rs1
-rw-r--r--tests/ui/proc-macro/issue-79148.stderr4
-rw-r--r--tests/ui/proc-macro/issue-83510.rs1
-rw-r--r--tests/ui/proc-macro/issue-83510.stderr8
-rw-r--r--tests/ui/proc-macro/issue-91800.rs1
-rw-r--r--tests/ui/proc-macro/issue-91800.stderr14
-rw-r--r--tests/ui/proc-macro/lifetimes-rpass.rs1
-rw-r--r--tests/ui/proc-macro/lints_in_proc_macros.rs1
-rw-r--r--tests/ui/proc-macro/lints_in_proc_macros.stderr2
-rw-r--r--tests/ui/proc-macro/load-two.rs1
-rw-r--r--tests/ui/proc-macro/macro-crate-multi-decorator.rs1
-rw-r--r--tests/ui/proc-macro/macro_rules_edition_from_pm.rs1
-rw-r--r--tests/ui/proc-macro/match-expander.rs1
-rw-r--r--tests/ui/proc-macro/match-expander.stderr2
-rw-r--r--tests/ui/proc-macro/mixed-site-span.rs1
-rw-r--r--tests/ui/proc-macro/mixed-site-span.stderr104
-rw-r--r--tests/ui/proc-macro/modify-ast.rs1
-rw-r--r--tests/ui/proc-macro/panic-abort.rs2
-rw-r--r--tests/ui/proc-macro/panic-abort.stderr2
-rw-r--r--tests/ui/proc-macro/parent-source-spans.rs1
-rw-r--r--tests/ui/proc-macro/parent-source-spans.stderr42
-rw-r--r--tests/ui/proc-macro/pretty-print-hack-show.rs1
-rw-r--r--tests/ui/proc-macro/quote/basic.rs1
-rw-r--r--tests/ui/proc-macro/quote/not-quotable.stderr4
-rw-r--r--tests/ui/proc-macro/quote/not-repeatable.rs4
-rw-r--r--tests/ui/proc-macro/quote/not-repeatable.stderr11
-rw-r--r--tests/ui/proc-macro/span-api-tests.rs1
-rw-r--r--tests/ui/proc-macro/span-from-proc-macro.rs1
-rw-r--r--tests/ui/proc-macro/span-from-proc-macro.stderr8
-rw-r--r--tests/ui/proc-macro/weird-hygiene.rs1
-rw-r--r--tests/ui/proc-macro/weird-hygiene.stderr4
-rw-r--r--tests/ui/process/core-run-destroy.rs4
-rw-r--r--tests/ui/process/env-funky-keys.rs19
-rw-r--r--tests/ui/process/fds-are-cloexec.rs11
-rw-r--r--tests/ui/process/multi-panic.rs1
-rw-r--r--tests/ui/process/println-with-broken-pipe.rs4
-rw-r--r--tests/ui/process/process-envs.rs4
-rw-r--r--tests/ui/process/process-panic-after-fork.rs2
-rw-r--r--tests/ui/process/process-remove-from-env.rs4
-rw-r--r--tests/ui/process/process-sigpipe.rs4
-rw-r--r--tests/ui/process/process-spawn-failure.rs4
-rw-r--r--tests/ui/reborrow/custom_mut.rs13
-rw-r--r--tests/ui/reborrow/custom_mut.stderr29
-rw-r--r--tests/ui/reborrow/custom_mut_coerce_shared.rs28
-rw-r--r--tests/ui/reborrow/custom_mut_coerce_shared.stderr19
-rw-r--r--tests/ui/reborrow/option_mut.rs7
-rw-r--r--tests/ui/reborrow/option_mut.stderr21
-rw-r--r--tests/ui/reborrow/option_mut_coerce_shared.rs11
-rw-r--r--tests/ui/reborrow/option_mut_coerce_shared.stderr23
-rw-r--r--tests/ui/reborrow/pin_mut.rs10
-rw-r--r--tests/ui/reborrow/pin_mut.stderr21
-rw-r--r--tests/ui/reborrow/pin_mut_coerce_shared.rs13
-rw-r--r--tests/ui/reborrow/pin_mut_coerce_shared.stderr19
-rw-r--r--tests/ui/regions/multiple-sources-for-outlives-requirement.rs11
-rw-r--r--tests/ui/regions/multiple-sources-for-outlives-requirement.stderr20
-rw-r--r--tests/ui/regions/regions-infer-proc-static-upvar.stderr6
-rw-r--r--tests/ui/regions/regions-pattern-typing-issue-19552.stderr6
-rw-r--r--tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.stderr4
-rw-r--r--tests/ui/repr/repr-empty-packed.stderr1
-rw-r--r--tests/ui/resolve/missing-type-in-scope-58712.rs (renamed from tests/ui/issues/issue-58712.rs)1
-rw-r--r--tests/ui/resolve/missing-type-in-scope-58712.stderr (renamed from tests/ui/issues/issue-58712.stderr)4
-rw-r--r--tests/ui/resolve/prelude-order.rs1
-rw-r--r--tests/ui/resolve/prelude-order.stderr10
-rw-r--r--tests/ui/resolve/unused-macro-import.rs13
-rw-r--r--tests/ui/resolve/unused-macro-import.stderr14
-rw-r--r--tests/ui/return/infer-return-ty-for-fn-sig-issue-125488.stderr44
-rw-r--r--tests/ui/rfcs/rfc-2091-track-caller/file-is-nul-terminated.rs1
-rw-r--r--tests/ui/rfcs/rfc-3348-c-string-literals/edition-spans.rs1
-rw-r--r--tests/ui/runtime/backtrace-debuginfo.rs5
-rw-r--r--tests/ui/runtime/on-broken-pipe/child-processes.rs1
-rw-r--r--tests/ui/runtime/on-broken-pipe/inherit.rs1
-rw-r--r--tests/ui/runtime/out-of-stack.rs1
-rw-r--r--tests/ui/rust-2018/suggestions-not-always-applicable.fixed1
-rw-r--r--tests/ui/rust-2018/suggestions-not-always-applicable.rs1
-rw-r--r--tests/ui/rust-2021/reserved-prefixes-via-macro.rs1
-rw-r--r--tests/ui/rust-2024/reserved-guarded-strings-via-macro.rs1
-rw-r--r--tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs1
-rw-r--r--tests/ui/rustc_public-ir-print/async-closure.rs2
-rw-r--r--tests/ui/rustc_public-ir-print/async-closure.stdout44
-rw-r--r--tests/ui/sanitizer/cfi/transparent-has-regions.rs1
-rw-r--r--tests/ui/sanitizer/issue-111184-cfi-coroutine-witness.rs1
-rw-r--r--tests/ui/sepcomp/sepcomp-lib-lto.rs1
-rw-r--r--tests/ui/sepcomp/sepcomp-unwind.rs1
-rw-r--r--tests/ui/simd/auxiliary/simd-lane-limit.rs5
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-2.rs1
-rw-r--r--tests/ui/simd/intrinsic/generic-arithmetic-2.stderr56
-rw-r--r--tests/ui/simd/intrinsic/generic-elements.rs1
-rw-r--r--tests/ui/simd/intrinsic/generic-elements.stderr42
-rw-r--r--tests/ui/simd/masked-load-store-build-fail.rs1
-rw-r--r--tests/ui/simd/masked-load-store-build-fail.stderr16
-rw-r--r--tests/ui/simd/monomorphize-shuffle-index.generic.stderr2
-rw-r--r--tests/ui/simd/monomorphize-shuffle-index.rs1
-rw-r--r--tests/ui/simd/monomorphize-too-long.rs4
-rw-r--r--tests/ui/simd/monomorphize-too-long.stderr6
-rw-r--r--tests/ui/simd/monomorphize-zero-length.rs4
-rw-r--r--tests/ui/simd/monomorphize-zero-length.stderr6
-rw-r--r--tests/ui/simd/not-out-of-bounds.rs1
-rw-r--r--tests/ui/simd/not-out-of-bounds.stderr18
-rw-r--r--tests/ui/simd/simd-lane-limit-err-npow2.rs12
-rw-r--r--tests/ui/simd/simd-lane-limit-err-npow2.stderr8
-rw-r--r--tests/ui/simd/simd-lane-limit-err.rs11
-rw-r--r--tests/ui/simd/simd-lane-limit-err.stderr8
-rw-r--r--tests/ui/simd/simd-lane-limit-ok.rs14
-rw-r--r--tests/ui/simd/type-generic-monomorphisation-empty.rs4
-rw-r--r--tests/ui/simd/type-generic-monomorphisation-empty.stderr6
-rw-r--r--tests/ui/simd/type-generic-monomorphisation-oversized.rs5
-rw-r--r--tests/ui/simd/type-generic-monomorphisation-oversized.stderr6
-rw-r--r--tests/ui/span/issue-42234-unknown-receiver-type.stderr4
-rw-r--r--tests/ui/span/suggestion-non-ascii.stderr4
-rw-r--r--tests/ui/static/static-align.rs84
-rw-r--r--tests/ui/static/static-lifetime-bound.stderr6
-rw-r--r--tests/ui/static/static-region-bound.stderr6
-rw-r--r--tests/ui/std/park-timeout-wakeup-59020.rs (renamed from tests/ui/issues/issue-59020.rs)1
-rw-r--r--tests/ui/structs-enums/unit-like-struct-drop-run.rs1
-rw-r--r--tests/ui/structs/invalid-self-constructor-56835.rs (renamed from tests/ui/issues/issue-56835.rs)1
-rw-r--r--tests/ui/structs/invalid-self-constructor-56835.stderr (renamed from tests/ui/issues/issue-56835.stderr)4
-rw-r--r--tests/ui/suggestions/apitit-unimplemented-method.rs5
-rw-r--r--tests/ui/suggestions/apitit-unimplemented-method.stderr10
-rw-r--r--tests/ui/suggestions/auxiliary/dep.rs14
-rw-r--r--tests/ui/suggestions/auxiliary/hidden-struct.rs26
-rw-r--r--tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs18
-rw-r--r--tests/ui/suggestions/dont-suggest-foreign-doc-hidden.stderr44
-rw-r--r--tests/ui/suggestions/incompatible-types-in-try-expression-59756.fixed (renamed from tests/ui/issues/issue-59756.fixed)0
-rw-r--r--tests/ui/suggestions/incompatible-types-in-try-expression-59756.rs (renamed from tests/ui/issues/issue-59756.rs)1
-rw-r--r--tests/ui/suggestions/incompatible-types-in-try-expression-59756.stderr (renamed from tests/ui/issues/issue-59756.stderr)2
-rw-r--r--tests/ui/suggestions/incorrect-variant-literal.svg2
-rw-r--r--tests/ui/suggestions/issue-61963.rs1
-rw-r--r--tests/ui/suggestions/issue-61963.stderr6
-rw-r--r--tests/ui/suggestions/issue-97760.stderr7
-rw-r--r--tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.fixed2
-rw-r--r--tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed2
-rw-r--r--tests/ui/suggestions/missing-format-specifiers-issue-68293.rs29
-rw-r--r--tests/ui/suggestions/missing-format-specifiers-issue-68293.stderr49
-rw-r--r--tests/ui/suggestions/non_copy_move_out_of_tuple.rs8
-rw-r--r--tests/ui/suggestions/non_copy_move_out_of_tuple.stderr26
-rw-r--r--tests/ui/suggestions/only-replace-intended-coma-not-all-in-pattern.fixed18
-rw-r--r--tests/ui/suggestions/only-replace-intended-coma-not-all-in-pattern.rs18
-rw-r--r--tests/ui/suggestions/only-replace-intended-coma-not-all-in-pattern.stderr18
-rw-r--r--tests/ui/suggestions/return-cycle-2.stderr11
-rw-r--r--tests/ui/suggestions/return-cycle.stderr11
-rw-r--r--tests/ui/suggestions/suggest-fn-ptr-for-fn-item-in-fn-ret.stderr11
-rw-r--r--tests/ui/suggestions/suggest-ref-macro.rs1
-rw-r--r--tests/ui/suggestions/suggest-ref-macro.stderr12
-rw-r--r--tests/ui/suggestions/trait-impl-bound-suggestions.fixed4
-rw-r--r--tests/ui/symbol-names/const-generics-structural-demangling.rs8
-rw-r--r--tests/ui/test-attrs/test-panic-abort-nocapture.rs1
-rw-r--r--tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr4
-rw-r--r--tests/ui/test-attrs/test-panic-abort.rs1
-rw-r--r--tests/ui/test-attrs/test-panic-abort.run.stdout2
-rw-r--r--tests/ui/test-attrs/test-panic-while-printing.rs1
-rw-r--r--tests/ui/thread-local/long-docs.rs266
-rw-r--r--tests/ui/thread-local/no-unstable.rs17
-rw-r--r--tests/ui/thread-local/no-unstable.stderr57
-rw-r--r--tests/ui/threads-sendsync/task-stderr.rs1
-rw-r--r--tests/ui/threads-sendsync/unwind-resource.rs1
-rw-r--r--tests/ui/track-diagnostics/track.rs7
-rw-r--r--tests/ui/track-diagnostics/track.stderr6
-rw-r--r--tests/ui/trait-bounds/negative-bound-not-supported-58857.rs (renamed from tests/ui/issues/issue-58857.rs)1
-rw-r--r--tests/ui/trait-bounds/negative-bound-not-supported-58857.stderr (renamed from tests/ui/issues/issue-58857.stderr)2
-rw-r--r--tests/ui/traits/associated_type_bound/assoc-type-via-another-trait-issue-19479.rs (renamed from tests/ui/issues/issue-19479.rs)6
-rw-r--r--tests/ui/traits/cast-as-dyn-trait-wo-assoc-type-issue-21950.rs19
-rw-r--r--tests/ui/traits/cast-as-dyn-trait-wo-assoc-type-issue-21950.stderr (renamed from tests/ui/issues/issue-21950.stderr)2
-rw-r--r--tests/ui/traits/clone-unwind-rc-cleanup.rs1
-rw-r--r--tests/ui/traits/core-marker-name-shadowing-issue-2284.rs21
-rw-r--r--tests/ui/traits/generic-trait-impl-aliased-array-58212.rs (renamed from tests/ui/issues/issue-58212.rs)1
-rw-r--r--tests/ui/traits/inheritance/supertrait-operator-issue-18088.rs13
-rw-r--r--tests/ui/traits/next-solver/cycles/ignore-head-usages-provisional-cache.rs55
-rw-r--r--tests/ui/traits/next-solver/forced-ambiguity-typenum-ice.rs60
-rw-r--r--tests/ui/traits/next-solver/opaques/overflow-hr-fn-trait-sized-1.rs25
-rw-r--r--tests/ui/traits/next-solver/opaques/overflow-hr-fn-trait-sized-2.rs14
-rw-r--r--tests/ui/traits/next-solver/typeck/normalize-in-upvar-collection.rs2
-rw-r--r--tests/ui/traits/next-solver/well-formed-in-relate.stderr2
-rw-r--r--tests/ui/traits/next-solver/writeback-predicate-bound-region.rs14
-rw-r--r--tests/ui/traits/solver-cycles/129541-recursive-struct.rs3
-rw-r--r--tests/ui/traits/trait-object-lifetime-bounds-57156.rs (renamed from tests/ui/issues/issue-57156.rs)1
-rw-r--r--tests/ui/traits/trait-objects-with-supertraits-56229.rs (renamed from tests/ui/issues/issue-56229.rs)1
-rw-r--r--tests/ui/traits/trait-upcasting/illegal-upcast-to-impl-opaque.rs7
-rw-r--r--tests/ui/type-alias-impl-trait/closures_in_branches.stderr4
-rw-r--r--tests/ui/type-alias-impl-trait/issue-77179.stderr11
-rw-r--r--tests/ui/type-alias-impl-trait/method_resolution_trait_method_from_opaque.next.stderr10
-rw-r--r--tests/ui/type-alias-impl-trait/recursive-drop-elaboration-2.rs19
-rw-r--r--tests/ui/type-alias-impl-trait/recursive-drop-elaboration-2.stderr30
-rw-r--r--tests/ui/type-alias-impl-trait/recursive-drop-elaboration.rs24
-rw-r--r--tests/ui/type-alias-impl-trait/recursive-drop-elaboration.stderr58
-rw-r--r--tests/ui/type-alias-impl-trait/type-error-drop-elaboration.rs (renamed from tests/crashes/125185.rs)3
-rw-r--r--tests/ui/type-alias-impl-trait/type-error-drop-elaboration.stderr12
-rw-r--r--tests/ui/type-inference/box_has_sigdrop.rs9
-rw-r--r--tests/ui/type-inference/box_has_sigdrop.stderr17
-rw-r--r--tests/ui/type-inference/dropper_has_sigdrop.rs18
-rw-r--r--tests/ui/type-inference/regression-issue-81317.stderr2
-rw-r--r--tests/ui/type/pattern_types/const_generics.rs3
-rw-r--r--tests/ui/type/pattern_types/transmute.current.stderr (renamed from tests/ui/type/pattern_types/transmute.stderr)4
-rw-r--r--tests/ui/type/pattern_types/transmute.next.stderr21
-rw-r--r--tests/ui/type/pattern_types/transmute.rs3
-rw-r--r--tests/ui/typeck/coercion-check-for-indexing-expression-issue-40861.stderr2
-rw-r--r--tests/ui/typeck/invalid-sugg-for-derive-macro-issue-136343.rs1
-rw-r--r--tests/ui/typeck/invalid-sugg-for-derive-macro-issue-136343.stderr2
-rw-r--r--tests/ui/typeck/issue-13853.rs2
-rw-r--r--tests/ui/typeck/issue-13853.stderr12
-rw-r--r--tests/ui/typeck/issue-80779.stderr22
-rw-r--r--tests/ui/typeck/issue-98260.stderr11
-rw-r--r--tests/ui/typeck/self-constructor-type-args-not-allowed-57924.rs (renamed from tests/ui/issues/issue-57924.rs)1
-rw-r--r--tests/ui/typeck/self-constructor-type-args-not-allowed-57924.stderr (renamed from tests/ui/issues/issue-57924.stderr)2
-rw-r--r--tests/ui/typeck/self-constructor-type-error-56199.rs (renamed from tests/ui/issues/issue-56199.rs)1
-rw-r--r--tests/ui/typeck/self-constructor-type-error-56199.stderr (renamed from tests/ui/issues/issue-56199.stderr)8
-rw-r--r--tests/ui/typeck/typeck_type_placeholder_item.stderr141
-rw-r--r--tests/ui/typeck/typeck_type_placeholder_item_help.stderr11
-rw-r--r--tests/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr2
-rw-r--r--tests/ui/union/union-unsafe.rs73
-rw-r--r--tests/ui/union/union-unsafe.stderr54
-rw-r--r--tests/ui/unpretty/exhaustive.hir.stdout3
-rw-r--r--tests/ui/unpretty/flattened-format-args.stdout3
-rw-r--r--tests/ui/unstable-feature-bound/unstable_impl_coherence.disabled.stderr2
-rw-r--r--tests/ui/unstable-feature-bound/unstable_impl_coherence.enabled.stderr2
-rw-r--r--tests/ui/unstable-feature-bound/unstable_impl_method_selection.stderr2
-rw-r--r--tests/ui/variance/leaking-unnameables.stderr11
-rw-r--r--tests/ui/wf/wf-in-where-clause-static.current.stderr6
-rw-r--r--tests/ui/wf/wf-in-where-clause-static.next.stderr6
1110 files changed, 16715 insertions, 5441 deletions
diff --git a/tests/assembly-llvm/aarch64-pointer-auth.rs b/tests/assembly-llvm/aarch64-pointer-auth.rs
index 56a26df469f..e1ca6d77581 100644
--- a/tests/assembly-llvm/aarch64-pointer-auth.rs
+++ b/tests/assembly-llvm/aarch64-pointer-auth.rs
@@ -1,10 +1,13 @@
 // Test that PAC instructions are emitted when branch-protection is specified.
 
 //@ add-core-stubs
-//@ revisions: PACRET PAUTHLR_NOP PAUTHLR
+//@ revisions: GCS PACRET PAUTHLR_NOP PAUTHLR
 //@ assembly-output: emit-asm
 //@ needs-llvm-components: aarch64
 //@ compile-flags: --target aarch64-unknown-linux-gnu
+//@ [GCS] min-llvm-version: 21
+//@ [GCS] ignore-apple (XCode version needs updating)
+//@ [GCS] compile-flags: -Z branch-protection=gcs
 //@ [PACRET] compile-flags: -Z branch-protection=pac-ret,leaf
 //@ [PAUTHLR_NOP] compile-flags: -Z branch-protection=pac-ret,pc,leaf
 //@ [PAUTHLR] compile-flags: -C target-feature=+pauth-lr -Z branch-protection=pac-ret,pc,leaf
@@ -17,6 +20,7 @@
 extern crate minicore;
 use minicore::*;
 
+// GCS: .aeabi_attribute 2, 1 // Tag_Feature_GCS
 // PACRET: hint #25
 // PACRET: hint #29
 // PAUTHLR_NOP: hint #25
diff --git a/tests/assembly-llvm/naked-functions/wasm32.rs b/tests/assembly-llvm/naked-functions/wasm32.rs
index 77547e82041..4bf04dd3923 100644
--- a/tests/assembly-llvm/naked-functions/wasm32.rs
+++ b/tests/assembly-llvm/naked-functions/wasm32.rs
@@ -21,6 +21,7 @@ use minicore::*;
 // CHECK: .functype nop () -> ()
 // CHECK-NOT: .size
 // CHECK: end_function
+// CHECK-LABEL: .Lfunc_end_nop:
 #[no_mangle]
 #[unsafe(naked)]
 extern "C" fn nop() {
diff --git a/tests/assembly-llvm/riscv-soft-abi-with-float-features.rs b/tests/assembly-llvm/riscv-soft-abi-with-float-features.rs
index 72cbd3841c1..085ea9facd0 100644
--- a/tests/assembly-llvm/riscv-soft-abi-with-float-features.rs
+++ b/tests/assembly-llvm/riscv-soft-abi-with-float-features.rs
@@ -2,9 +2,6 @@
 //@ assembly-output: emit-asm
 //@ compile-flags: --target riscv64imac-unknown-none-elf -Ctarget-feature=+f,+d
 //@ needs-llvm-components: riscv
-//@ revisions: LLVM-PRE-20 LLVM-POST-20
-//@ [LLVM-PRE-20] max-llvm-major-version: 19
-//@ [LLVM-POST-20] min-llvm-version: 20
 
 #![feature(no_core, lang_items, f16)]
 #![crate_type = "lib"]
@@ -28,11 +25,8 @@ pub extern "C" fn read_f16(x: &f16) -> f16 {
 // CHECK-LABEL: read_f32
 #[no_mangle]
 pub extern "C" fn read_f32(x: &f32) -> f32 {
-    // LLVM-PRE-20: flw fa5, 0(a0)
-    // LLVM-PRE-20-NEXT: fmv.x.w a0, fa5
-    // LLVM-PRE-20-NEXT: ret
-    // LLVM-POST-20: lw a0, 0(a0)
-    // LLVM-POST-20-NEXT: ret
+    // CHECK: lw a0, 0(a0)
+    // CHECK-NEXT: ret
     *x
 }
 
diff --git a/tests/assembly-llvm/targets/targets-elf.rs b/tests/assembly-llvm/targets/targets-elf.rs
index b5c116cdfef..ebea9fe40f5 100644
--- a/tests/assembly-llvm/targets/targets-elf.rs
+++ b/tests/assembly-llvm/targets/targets-elf.rs
@@ -658,6 +658,9 @@
 //@ revisions: x86_64_unknown_managarm_mlibc
 //@ [x86_64_unknown_managarm_mlibc] compile-flags: --target x86_64-unknown-managarm-mlibc
 //@ [x86_64_unknown_managarm_mlibc] needs-llvm-components: x86
+//@ revisions: x86_64_unknown_motor
+//@ [x86_64_unknown_motor] compile-flags: --target x86_64-unknown-motor
+//@ [x86_64_unknown_motor] needs-llvm-components: x86
 //@ revisions: x86_64_unknown_netbsd
 //@ [x86_64_unknown_netbsd] compile-flags: --target x86_64-unknown-netbsd
 //@ [x86_64_unknown_netbsd] needs-llvm-components: x86
diff --git a/tests/assembly-llvm/x86_64-bigint-helpers.rs b/tests/assembly-llvm/x86_64-bigint-helpers.rs
index c5efda58fd6..64aa0257238 100644
--- a/tests/assembly-llvm/x86_64-bigint-helpers.rs
+++ b/tests/assembly-llvm/x86_64-bigint-helpers.rs
@@ -2,7 +2,6 @@
 //@ assembly-output: emit-asm
 //@ compile-flags: --crate-type=lib -Copt-level=3 -C target-cpu=x86-64-v4
 //@ compile-flags: -C llvm-args=-x86-asm-syntax=intel
-//@ min-llvm-version: 20
 
 #![no_std]
 #![feature(bigint_helper_methods)]
diff --git a/tests/assembly-llvm/x86_64-cmp.rs b/tests/assembly-llvm/x86_64-cmp.rs
index 26c9013d96f..1f1fe7fd005 100644
--- a/tests/assembly-llvm/x86_64-cmp.rs
+++ b/tests/assembly-llvm/x86_64-cmp.rs
@@ -1,12 +1,6 @@
-//@ revisions: LLVM-PRE-20-DEBUG LLVM-20-DEBUG LLVM-PRE-20-OPTIM LLVM-20-OPTIM
-//@ [LLVM-PRE-20-DEBUG] compile-flags: -C opt-level=0
-//@ [LLVM-PRE-20-DEBUG] max-llvm-major-version: 19
-//@ [LLVM-20-DEBUG] compile-flags: -C opt-level=0
-//@ [LLVM-20-DEBUG] min-llvm-version: 20
-//@ [LLVM-PRE-20-OPTIM] compile-flags: -C opt-level=3
-//@ [LLVM-PRE-20-OPTIM] max-llvm-major-version: 19
-//@ [LLVM-20-OPTIM] compile-flags: -C opt-level=3
-//@ [LLVM-20-OPTIM] min-llvm-version: 20
+//@ revisions: DEBUG OPTIM
+//@ [DEBUG] compile-flags: -C opt-level=0
+//@ [OPTIM] compile-flags: -C opt-level=3
 //@ assembly-output: emit-asm
 //@ compile-flags: --crate-type=lib -C llvm-args=-x86-asm-syntax=intel
 //@ only-x86_64
@@ -19,61 +13,22 @@ use std::intrinsics::three_way_compare;
 #[no_mangle]
 // CHECK-LABEL: signed_cmp:
 pub fn signed_cmp(a: i16, b: i16) -> std::cmp::Ordering {
-    // LLVM-PRE-20-DEBUG: cmp
-    // LLVM-PRE-20-DEBUG: setg
-    // LLVM-PRE-20-DEBUG: and
-    // LLVM-PRE-20-DEBUG: cmp
-    // LLVM-PRE-20-DEBUG: setl
-    // LLVM-PRE-20-DEBUG: and
-    // LLVM-PRE-20-DEBUG: sub
-    //
-    // LLVM-20-DEBUG: sub
-    // LLVM-20-DEBUG: setl
-    // LLVM-20-DEBUG: setg
-    // LLVM-20-DEBUG: sub
-    // LLVM-20-DEBUG: ret
-
-    // LLVM-PRE-20-OPTIM: xor
-    // LLVM-PRE-20-OPTIM: cmp
-    // LLVM-PRE-20-OPTIM: setne
-    // LLVM-PRE-20-OPTIM: mov
-    // LLVM-PRE-20-OPTIM: cmovge
-    // LLVM-PRE-20-OPTIM: ret
-    //
-    // LLVM-20-OPTIM: cmp
-    // LLVM-20-OPTIM: setl
-    // LLVM-20-OPTIM: setg
-    // LLVM-20-OPTIM: sub
-    // LLVM-20-OPTIM: ret
+    // DEBUG: sub
+    // OPTIM: cmp
+    // CHECK: setl
+    // CHECK: setg
+    // CHECK: sub
+    // CHECK: ret
     three_way_compare(a, b)
 }
 
 #[no_mangle]
 // CHECK-LABEL: unsigned_cmp:
 pub fn unsigned_cmp(a: u16, b: u16) -> std::cmp::Ordering {
-    // LLVM-PRE-20-DEBUG: cmp
-    // LLVM-PRE-20-DEBUG: seta
-    // LLVM-PRE-20-DEBUG: and
-    // LLVM-PRE-20-DEBUG: cmp
-    // LLVM-PRE-20-DEBUG: setb
-    // LLVM-PRE-20-DEBUG: and
-    // LLVM-PRE-20-DEBUG: sub
-    //
-    // LLVM-20-DEBUG: sub
-    // LLVM-20-DEBUG: seta
-    // LLVM-20-DEBUG: sbb
-    // LLVM-20-DEBUG: ret
-
-    // LLVM-PRE-20-OPTIM: xor
-    // LLVM-PRE-20-OPTIM: cmp
-    // LLVM-PRE-20-OPTIM: setne
-    // LLVM-PRE-20-OPTIM: mov
-    // LLVM-PRE-20-OPTIM: cmovae
-    // LLVM-PRE-20-OPTIM: ret
-    //
-    // LLVM-20-OPTIM: cmp
-    // LLVM-20-OPTIM: seta
-    // LLVM-20-OPTIM: sbb
-    // LLVM-20-OPTIM: ret
+    // DEBUG: sub
+    // OPTIM: cmp
+    // CHECK: seta
+    // CHECK: sbb
+    // CHECK: ret
     three_way_compare(a, b)
 }
diff --git a/tests/codegen-llvm/asm/powerpc-clobbers.rs b/tests/codegen-llvm/asm/powerpc-clobbers.rs
index f7fc7eea5d5..10d7ae4dba4 100644
--- a/tests/codegen-llvm/asm/powerpc-clobbers.rs
+++ b/tests/codegen-llvm/asm/powerpc-clobbers.rs
@@ -58,10 +58,10 @@ pub unsafe fn v0_clobber() {
 
 // Output format depends on the availability of altivec.
 // CHECK-LABEL: @clobber_abi
-// powerpc: asm sideeffect "", "={r0},={r3},={r4},={r5},={r6},={r7},={r8},={r9},={r10},={r11},={r12},={f0},={f1},={f2},={f3},={f4},={f5},={f6},={f7},={f8},={f9},={f10},={f11},={f12},={f13},~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{cr0},~{cr1},~{cr5},~{cr6},~{cr7},~{xer}"()
-// powerpc64: asm sideeffect "", "={r0},={r3},={r4},={r5},={r6},={r7},={r8},={r9},={r10},={r11},={r12},={f0},={f1},={f2},={f3},={f4},={f5},={f6},={f7},={f8},={f9},={f10},={f11},={f12},={f13},={v0},={v1},={v2},={v3},={v4},={v5},={v6},={v7},={v8},={v9},={v10},={v11},={v12},={v13},={v14},={v15},={v16},={v17},={v18},={v19},~{cr0},~{cr1},~{cr5},~{cr6},~{cr7},~{xer}"()
-// powerpc64le: asm sideeffect "", "={r0},={r3},={r4},={r5},={r6},={r7},={r8},={r9},={r10},={r11},={r12},={f0},={f1},={f2},={f3},={f4},={f5},={f6},={f7},={f8},={f9},={f10},={f11},={f12},={f13},={v0},={v1},={v2},={v3},={v4},={v5},={v6},={v7},={v8},={v9},={v10},={v11},={v12},={v13},={v14},={v15},={v16},={v17},={v18},={v19},~{cr0},~{cr1},~{cr5},~{cr6},~{cr7},~{xer}"()
-// aix64: asm sideeffect "", "={r0},={r3},={r4},={r5},={r6},={r7},={r8},={r9},={r10},={r11},={r12},={f0},={f1},={f2},={f3},={f4},={f5},={f6},={f7},={f8},={f9},={f10},={f11},={f12},={f13},={v0},={v1},={v2},={v3},={v4},={v5},={v6},={v7},={v8},={v9},={v10},={v11},={v12},={v13},={v14},={v15},={v16},={v17},={v18},={v19},~{cr0},~{cr1},~{cr5},~{cr6},~{cr7},~{xer}"()
+// powerpc: asm sideeffect "", "={r0},={r3},={r4},={r5},={r6},={r7},={r8},={r9},={r10},={r11},={r12},={f0},={f1},={f2},={f3},={f4},={f5},={f6},={f7},={f8},={f9},={f10},={f11},={f12},={f13},~{v0},~{v1},~{v2},~{v3},~{v4},~{v5},~{v6},~{v7},~{v8},~{v9},~{v10},~{v11},~{v12},~{v13},~{v14},~{v15},~{v16},~{v17},~{v18},~{v19},~{cr0},~{cr1},~{cr5},~{cr6},~{cr7},~{ctr},~{lr},~{xer}"()
+// powerpc64: asm sideeffect "", "={r0},={r3},={r4},={r5},={r6},={r7},={r8},={r9},={r10},={r11},={r12},={f0},={f1},={f2},={f3},={f4},={f5},={f6},={f7},={f8},={f9},={f10},={f11},={f12},={f13},={v0},={v1},={v2},={v3},={v4},={v5},={v6},={v7},={v8},={v9},={v10},={v11},={v12},={v13},={v14},={v15},={v16},={v17},={v18},={v19},~{cr0},~{cr1},~{cr5},~{cr6},~{cr7},~{ctr},~{lr},~{xer}"()
+// powerpc64le: asm sideeffect "", "={r0},={r3},={r4},={r5},={r6},={r7},={r8},={r9},={r10},={r11},={r12},={f0},={f1},={f2},={f3},={f4},={f5},={f6},={f7},={f8},={f9},={f10},={f11},={f12},={f13},={v0},={v1},={v2},={v3},={v4},={v5},={v6},={v7},={v8},={v9},={v10},={v11},={v12},={v13},={v14},={v15},={v16},={v17},={v18},={v19},~{cr0},~{cr1},~{cr5},~{cr6},~{cr7},~{ctr},~{lr},~{xer}"()
+// aix64: asm sideeffect "", "={r0},={r3},={r4},={r5},={r6},={r7},={r8},={r9},={r10},={r11},={r12},={f0},={f1},={f2},={f3},={f4},={f5},={f6},={f7},={f8},={f9},={f10},={f11},={f12},={f13},={v0},={v1},={v2},={v3},={v4},={v5},={v6},={v7},={v8},={v9},={v10},={v11},={v12},={v13},={v14},={v15},={v16},={v17},={v18},={v19},~{cr0},~{cr1},~{cr5},~{cr6},~{cr7},~{ctr},~{lr},~{xer}"()
 #[no_mangle]
 pub unsafe fn clobber_abi() {
     asm!("", clobber_abi("C"), options(nostack, nomem, preserves_flags));
diff --git a/tests/codegen-llvm/asm/readonly-not-pure.rs b/tests/codegen-llvm/asm/readonly-not-pure.rs
new file mode 100644
index 00000000000..a3c0e276c7f
--- /dev/null
+++ b/tests/codegen-llvm/asm/readonly-not-pure.rs
@@ -0,0 +1,48 @@
+//@ add-core-stubs
+//@ compile-flags: -Copt-level=3 --target x86_64-unknown-linux-gnu
+//@ needs-llvm-components: x86
+
+#![crate_type = "rlib"]
+#![feature(no_core)]
+#![no_core]
+
+// Test that when an inline assembly block specifies `readonly` but not `pure`, a detailed
+// `MemoryEffects` is provided to LLVM: this assembly block is not allowed to perform writes,
+// but it may have side-effects.
+
+extern crate minicore;
+use minicore::*;
+
+pub static mut VAR: i32 = 0;
+
+// CHECK-LABEL: @no_options
+// CHECK: call i32 asm
+#[no_mangle]
+pub unsafe fn no_options() -> i32 {
+    VAR = 1;
+    let _ignored: i32;
+    asm!("mov {0}, 1", out(reg) _ignored);
+    VAR
+}
+
+// CHECK-LABEL: @readonly_pure
+// CHECK-NOT: call i32 asm
+#[no_mangle]
+pub unsafe fn readonly_pure() -> i32 {
+    VAR = 1;
+    let _ignored: i32;
+    asm!("mov {0}, 1", out(reg) _ignored, options(pure, readonly));
+    VAR
+}
+
+// CHECK-LABEL: @readonly_not_pure
+// CHECK: call i32 asm {{.*}} #[[ATTR:[0-9]+]]
+#[no_mangle]
+pub unsafe fn readonly_not_pure() -> i32 {
+    VAR = 1;
+    let _ignored: i32;
+    asm!("mov {0}, 1", out(reg) _ignored, options(readonly));
+    VAR
+}
+
+// CHECK: attributes #[[ATTR]] = { nounwind memory(read, inaccessiblemem: readwrite) }
diff --git a/tests/codegen-llvm/asm/riscv-clobbers.rs b/tests/codegen-llvm/asm/riscv-clobbers.rs
index e55b6731098..0f235ddcdcc 100644
--- a/tests/codegen-llvm/asm/riscv-clobbers.rs
+++ b/tests/codegen-llvm/asm/riscv-clobbers.rs
@@ -17,7 +17,7 @@ extern crate minicore;
 use minicore::*;
 
 // CHECK-LABEL: @flags_clobber
-// CHECK: call void asm sideeffect "", "~{vtype},~{vl},~{vxsat},~{vxrm}"()
+// CHECK: call void asm sideeffect "", "~{fflags},~{vtype},~{vl},~{vxsat},~{vxrm}"()
 #[no_mangle]
 pub unsafe fn flags_clobber() {
     asm!("", options(nostack, nomem));
diff --git a/tests/codegen-llvm/autodiff/abi_handling.rs b/tests/codegen-llvm/autodiff/abi_handling.rs
new file mode 100644
index 00000000000..5c8126898a8
--- /dev/null
+++ b/tests/codegen-llvm/autodiff/abi_handling.rs
@@ -0,0 +1,210 @@
+//@ revisions: debug release
+
+//@[debug] compile-flags: -Zautodiff=Enable,NoTT -C opt-level=0 -Clto=fat
+//@[release] compile-flags: -Zautodiff=Enable,NoTT -C opt-level=3 -Clto=fat
+//@ no-prefer-dynamic
+//@ needs-enzyme
+
+// This test checks that Rust types are lowered to LLVM-IR types in a way
+// we expect and Enzyme can handle. We explicitly check release mode to
+// ensure that LLVM's O3 pipeline doesn't rewrite function signatures
+// into forms that Enzyme can't process correctly.
+
+#![feature(autodiff)]
+
+use std::autodiff::{autodiff_forward, autodiff_reverse};
+
+#[derive(Copy, Clone)]
+struct Input {
+    x: f32,
+    y: f32,
+}
+
+#[derive(Copy, Clone)]
+struct Wrapper {
+    z: f32,
+}
+
+#[derive(Copy, Clone)]
+struct NestedInput {
+    x: f32,
+    y: Wrapper,
+}
+
+fn square(x: f32) -> f32 {
+    x * x
+}
+
+// CHECK-LABEL: ; abi_handling::df1
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal { float, float }
+// debug-SAME: (ptr align 4 %x, ptr align 4 %bx_0)
+// release-NEXT: define internal fastcc float
+// release-SAME: (float %x.0.val, float %x.4.val)
+
+// CHECK-LABEL: ; abi_handling::f1
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal float
+// debug-SAME: (ptr align 4 %x)
+// release-NEXT: define internal fastcc noundef float
+// release-SAME: (float %x.0.val, float %x.4.val)
+#[autodiff_forward(df1, Dual, Dual)]
+#[inline(never)]
+fn f1(x: &[f32; 2]) -> f32 {
+    x[0] + x[1]
+}
+
+// CHECK-LABEL: ; abi_handling::df2
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal { float, float }
+// debug-SAME: (ptr %f, float %x, float %dret)
+// release-NEXT: define internal fastcc float
+// release-SAME: (float noundef %x)
+
+// CHECK-LABEL: ; abi_handling::f2
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal float
+// debug-SAME: (ptr %f, float %x)
+// release-NEXT: define internal fastcc noundef float
+// release-SAME: (float noundef %x)
+#[autodiff_reverse(df2, Const, Active, Active)]
+#[inline(never)]
+fn f2(f: fn(f32) -> f32, x: f32) -> f32 {
+    f(x)
+}
+
+// CHECK-LABEL: ; abi_handling::df3
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal { float, float }
+// debug-SAME: (ptr align 4 %x, ptr align 4 %bx_0, ptr align 4 %y, ptr align 4 %by_0)
+// release-NEXT: define internal fastcc { float, float }
+// release-SAME: (float %x.0.val)
+
+// CHECK-LABEL: ; abi_handling::f3
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal float
+// debug-SAME: (ptr align 4 %x, ptr align 4 %y)
+// release-NEXT: define internal fastcc noundef float
+// release-SAME: (float %x.0.val)
+#[autodiff_forward(df3, Dual, Dual, Dual)]
+#[inline(never)]
+fn f3<'a>(x: &'a f32, y: &'a f32) -> f32 {
+    *x * *y
+}
+
+// CHECK-LABEL: ; abi_handling::df4
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal { float, float }
+// debug-SAME: (float %x.0, float %x.1, float %bx_0.0, float %bx_0.1)
+// release-NEXT: define internal fastcc { float, float }
+// release-SAME: (float noundef %x.0, float noundef %x.1)
+
+// CHECK-LABEL: ; abi_handling::f4
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal float
+// debug-SAME: (float %x.0, float %x.1)
+// release-NEXT: define internal fastcc noundef float
+// release-SAME: (float noundef %x.0, float noundef %x.1)
+#[autodiff_forward(df4, Dual, Dual)]
+#[inline(never)]
+fn f4(x: (f32, f32)) -> f32 {
+    x.0 * x.1
+}
+
+// CHECK-LABEL: ; abi_handling::df5
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal { float, float }
+// debug-SAME: (float %i.0, float %i.1, float %bi_0.0, float %bi_0.1)
+// release-NEXT: define internal fastcc { float, float }
+// release-SAME: (float noundef %i.0, float noundef %i.1)
+
+// CHECK-LABEL: ; abi_handling::f5
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal float
+// debug-SAME: (float %i.0, float %i.1)
+// release-NEXT: define internal fastcc noundef float
+// release-SAME: (float noundef %i.0, float noundef %i.1)
+#[autodiff_forward(df5, Dual, Dual)]
+#[inline(never)]
+fn f5(i: Input) -> f32 {
+    i.x + i.y
+}
+
+// CHECK-LABEL: ; abi_handling::df6
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal { float, float }
+// debug-SAME: (float %i.0, float %i.1, float %bi_0.0, float %bi_0.1)
+// release-NEXT: define internal fastcc { float, float }
+// release-SAME: float noundef %i.0, float noundef %i.1
+// release-SAME: float noundef %bi_0.0, float noundef %bi_0.1
+
+// CHECK-LABEL: ; abi_handling::f6
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal float
+// debug-SAME: (float %i.0, float %i.1)
+// release-NEXT: define internal fastcc noundef float
+// release-SAME: (float noundef %i.0, float noundef %i.1)
+#[autodiff_forward(df6, Dual, Dual)]
+#[inline(never)]
+fn f6(i: NestedInput) -> f32 {
+    i.x + i.y.z * i.y.z
+}
+
+// CHECK-LABEL: ; abi_handling::df7
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal { float, float }
+// debug-SAME: (ptr align 4 %x.0, ptr align 4 %x.1, ptr align 4 %bx_0.0, ptr align 4 %bx_0.1)
+// release-NEXT: define internal fastcc { float, float }
+// release-SAME: (float %x.0.0.val, float %x.1.0.val)
+
+// CHECK-LABEL: ; abi_handling::f7
+// CHECK-NEXT: Function Attrs
+// debug-NEXT: define internal float
+// debug-SAME: (ptr align 4 %x.0, ptr align 4 %x.1)
+// release-NEXT: define internal fastcc noundef float
+// release-SAME: (float %x.0.0.val, float %x.1.0.val)
+#[autodiff_forward(df7, Dual, Dual)]
+#[inline(never)]
+fn f7(x: (&f32, &f32)) -> f32 {
+    x.0 * x.1
+}
+
+fn main() {
+    let x = std::hint::black_box(2.0);
+    let y = std::hint::black_box(3.0);
+    let z = std::hint::black_box(4.0);
+    static Y: f32 = std::hint::black_box(3.2);
+
+    let in_f1 = [x, y];
+    dbg!(f1(&in_f1));
+    let res_f1 = df1(&in_f1, &[1.0, 0.0]);
+    dbg!(res_f1);
+
+    dbg!(f2(square, x));
+    let res_f2 = df2(square, x, 1.0);
+    dbg!(res_f2);
+
+    dbg!(f3(&x, &Y));
+    let res_f3 = df3(&x, &Y, &1.0, &0.0);
+    dbg!(res_f3);
+
+    let in_f4 = (x, y);
+    dbg!(f4(in_f4));
+    let res_f4 = df4(in_f4, (1.0, 0.0));
+    dbg!(res_f4);
+
+    let in_f5 = Input { x, y };
+    dbg!(f5(in_f5));
+    let res_f5 = df5(in_f5, Input { x: 1.0, y: 0.0 });
+    dbg!(res_f5);
+
+    let in_f6 = NestedInput { x, y: Wrapper { z: y } };
+    dbg!(f6(in_f6));
+    let res_f6 = df6(in_f6, NestedInput { x, y: Wrapper { z } });
+    dbg!(res_f6);
+
+    let in_f7 = (&x, &y);
+    dbg!(f7(in_f7));
+    let res_f7 = df7(in_f7, (&1.0, &0.0));
+    dbg!(res_f7);
+}
diff --git a/tests/codegen-llvm/autodiff/batched.rs b/tests/codegen-llvm/autodiff/batched.rs
index 306a6ed9d1f..dc82403212f 100644
--- a/tests/codegen-llvm/autodiff/batched.rs
+++ b/tests/codegen-llvm/autodiff/batched.rs
@@ -1,4 +1,4 @@
-//@ compile-flags: -Zautodiff=Enable -C opt-level=3  -Clto=fat
+//@ compile-flags: -Zautodiff=Enable,NoTT -C opt-level=3  -Clto=fat
 //@ no-prefer-dynamic
 //@ needs-enzyme
 //
diff --git a/tests/codegen-llvm/autodiff/scalar.rs b/tests/codegen-llvm/autodiff/scalar.rs
index 55b989f920d..53672a89230 100644
--- a/tests/codegen-llvm/autodiff/scalar.rs
+++ b/tests/codegen-llvm/autodiff/scalar.rs
@@ -1,4 +1,4 @@
-//@ compile-flags: -Zautodiff=Enable -C opt-level=3  -Clto=fat
+//@ compile-flags: -Zautodiff=Enable,NoTT -C opt-level=3  -Clto=fat
 //@ no-prefer-dynamic
 //@ needs-enzyme
 #![feature(autodiff)]
diff --git a/tests/codegen-llvm/autodiff/sret.rs b/tests/codegen-llvm/autodiff/sret.rs
index dbc253ce894..498cd3fea01 100644
--- a/tests/codegen-llvm/autodiff/sret.rs
+++ b/tests/codegen-llvm/autodiff/sret.rs
@@ -1,4 +1,4 @@
-//@ compile-flags: -Zautodiff=Enable -C opt-level=3  -Clto=fat
+//@ compile-flags: -Zautodiff=Enable,NoTT -C opt-level=3  -Clto=fat
 //@ no-prefer-dynamic
 //@ needs-enzyme
 
diff --git a/tests/codegen-llvm/autodiff/typetree.rs b/tests/codegen-llvm/autodiff/typetree.rs
new file mode 100644
index 00000000000..1cb0c2fb68b
--- /dev/null
+++ b/tests/codegen-llvm/autodiff/typetree.rs
@@ -0,0 +1,33 @@
+//@ compile-flags: -Zautodiff=Enable -C opt-level=3 -Clto=fat
+//@ no-prefer-dynamic
+//@ needs-enzyme
+
+// Test that basic autodiff still works with our TypeTree infrastructure
+#![feature(autodiff)]
+
+use std::autodiff::autodiff_reverse;
+
+#[autodiff_reverse(d_simple, Duplicated, Active)]
+#[no_mangle]
+#[inline(never)]
+fn simple(x: &f64) -> f64 {
+    2.0 * x
+}
+
+// CHECK-LABEL: @simple
+// CHECK: fmul double
+
+// The derivative function should be generated normally
+// CHECK-LABEL: diffesimple
+// CHECK: fadd fast double
+
+fn main() {
+    let x = std::hint::black_box(3.0);
+    let output = simple(&x);
+    assert_eq!(6.0, output);
+
+    let mut df_dx = 0.0;
+    let output_ = d_simple(&x, &mut df_dx, 1.0);
+    assert_eq!(output, output_);
+    assert_eq!(2.0, df_dx);
+}
diff --git a/tests/codegen-llvm/autodiff/void_ret.rs b/tests/codegen-llvm/autodiff/void_ret.rs
new file mode 100644
index 00000000000..98c6b98eef4
--- /dev/null
+++ b/tests/codegen-llvm/autodiff/void_ret.rs
@@ -0,0 +1,41 @@
+//@ compile-flags: -Zautodiff=Enable,NoTT,NoPostopt -C no-prepopulate-passes -C opt-level=3  -Clto=fat
+//@ no-prefer-dynamic
+//@ needs-enzyme
+
+#![feature(autodiff)]
+use std::autodiff::*;
+
+// Usually we would store the return value of the differentiated function.
+// However, if the return type is void or an empty struct,
+// we don't need to store anything. Verify this, since it caused a bug.
+
+// CHECK:; void_ret::main
+// CHECK-NEXT:    ; Function Attrs:
+// CHECK-NEXT:    define internal
+// CHECK-NOT: store {} undef, ptr undef
+// CHECK: ret void
+
+#[autodiff_reverse(bar, Duplicated, Duplicated)]
+pub fn foo(r: &[f64; 10], res: &mut f64) {
+    let mut output = [0.0; 10];
+    output[0] = r[0];
+    output[1] = r[1] * r[2];
+    output[2] = r[4] * r[5];
+    output[3] = r[2] * r[6];
+    output[4] = r[1] * r[7];
+    output[5] = r[2] * r[8];
+    output[6] = r[1] * r[9];
+    output[7] = r[5] * r[6];
+    output[8] = r[5] * r[7];
+    output[9] = r[4] * r[8];
+    *res = output.iter().sum();
+}
+fn main() {
+    let inputs = Box::new([3.1; 10]);
+    let mut d_inputs = Box::new([0.0; 10]);
+    let mut res = Box::new(0.0);
+    let mut d_res = Box::new(1.0);
+
+    bar(&inputs, &mut d_inputs, &mut res, &mut d_res);
+    dbg!(&d_inputs);
+}
diff --git a/tests/codegen-llvm/auxiliary/darwin_objc_aux.rs b/tests/codegen-llvm/auxiliary/darwin_objc_aux.rs
new file mode 100644
index 00000000000..3c35d003c8a
--- /dev/null
+++ b/tests/codegen-llvm/auxiliary/darwin_objc_aux.rs
@@ -0,0 +1,27 @@
+#![crate_type = "lib"]
+#![feature(darwin_objc)]
+
+use std::os::darwin::objc;
+
+#[link(name = "Foundation", kind = "framework")]
+unsafe extern "C" {}
+
+#[inline(always)]
+pub fn inline_get_object_class() -> objc::Class {
+    objc::class!("NSObject")
+}
+
+#[inline(always)]
+pub fn inline_get_alloc_selector() -> objc::SEL {
+    objc::selector!("alloc")
+}
+
+#[inline(never)]
+pub fn never_inline_get_string_class() -> objc::Class {
+    objc::class!("NSString")
+}
+
+#[inline(never)]
+pub fn never_inline_get_init_selector() -> objc::SEL {
+    objc::selector!("init")
+}
diff --git a/tests/codegen-llvm/branch-protection.rs b/tests/codegen-llvm/branch-protection.rs
index d67e494cc0d..f92259c941c 100644
--- a/tests/codegen-llvm/branch-protection.rs
+++ b/tests/codegen-llvm/branch-protection.rs
@@ -1,9 +1,10 @@
 // Test that the correct module flags are emitted with different branch protection flags.
 
 //@ add-core-stubs
-//@ revisions: BTI PACRET LEAF BKEY PAUTHLR PAUTHLR_BKEY PAUTHLR_LEAF PAUTHLR_BTI NONE
+//@ revisions: BTI GCS PACRET LEAF BKEY PAUTHLR PAUTHLR_BKEY PAUTHLR_LEAF PAUTHLR_BTI NONE
 //@ needs-llvm-components: aarch64
 //@ [BTI] compile-flags: -Z branch-protection=bti
+//@ [GCS] compile-flags: -Z branch-protection=gcs
 //@ [PACRET] compile-flags: -Z branch-protection=pac-ret
 //@ [LEAF] compile-flags: -Z branch-protection=pac-ret,leaf
 //@ [BKEY] compile-flags: -Z branch-protection=pac-ret,b-key
@@ -32,6 +33,9 @@ pub fn test() {}
 // BTI: !"sign-return-address-all", i32 0
 // BTI: !"sign-return-address-with-bkey", i32 0
 
+// GCS: attributes [[ATTR]] = {{.*}} "guarded-control-stack"
+// GCS: !"guarded-control-stack", i32 1
+
 // PACRET: attributes [[ATTR]] = {{.*}} "sign-return-address"="non-leaf"
 // PACRET-SAME: "sign-return-address-key"="a_key"
 // PACRET: !"branch-target-enforcement", i32 0
diff --git a/tests/codegen-llvm/c-variadic-lifetime.rs b/tests/codegen-llvm/c-variadic-lifetime.rs
index 5b2f8af18c8..c6d3602ef51 100644
--- a/tests/codegen-llvm/c-variadic-lifetime.rs
+++ b/tests/codegen-llvm/c-variadic-lifetime.rs
@@ -8,7 +8,7 @@
 
 #[unsafe(no_mangle)]
 unsafe extern "C" fn variadic(a: f64, mut args: ...) -> f64 {
-    // CHECK: call void @llvm.lifetime.start.p0(i64 {{[0-9]+}}, ptr nonnull %args)
+    // CHECK: call void @llvm.lifetime.start.p0({{(i64 [0-9]+, )?}}ptr nonnull %args)
     // CHECK: call void @llvm.va_start.p0(ptr nonnull %args)
 
     let b = args.arg::<f64>();
@@ -17,5 +17,5 @@ unsafe extern "C" fn variadic(a: f64, mut args: ...) -> f64 {
     a + b + c
 
     // CHECK: call void @llvm.va_end.p0(ptr nonnull %args)
-    // CHECK: call void @llvm.lifetime.end.p0(i64 {{[0-9]+}}, ptr nonnull %args)
+    // CHECK: call void @llvm.lifetime.end.p0({{(i64 [0-9]+, )?}}ptr nonnull %args)
 }
diff --git a/tests/codegen-llvm/cffi/c-variadic-inline.rs b/tests/codegen-llvm/cffi/c-variadic-inline.rs
new file mode 100644
index 00000000000..369b7e571ca
--- /dev/null
+++ b/tests/codegen-llvm/cffi/c-variadic-inline.rs
@@ -0,0 +1,47 @@
+//@ compile-flags: -C opt-level=3
+#![feature(c_variadic)]
+
+// Test that the inline attributes are accepted on C-variadic functions.
+//
+// Currently LLVM is unable to inline C-variadic functions, but that is valid because despite
+// the name even `#[inline(always)]` is just a hint.
+
+#[inline(always)]
+unsafe extern "C" fn inline_always(mut ap: ...) -> u32 {
+    ap.arg::<u32>()
+}
+
+#[inline]
+unsafe extern "C" fn inline(mut ap: ...) -> u32 {
+    ap.arg::<u32>()
+}
+
+#[inline(never)]
+unsafe extern "C" fn inline_never(mut ap: ...) -> u32 {
+    ap.arg::<u32>()
+}
+
+#[cold]
+unsafe extern "C" fn cold(mut ap: ...) -> u32 {
+    ap.arg::<u32>()
+}
+
+#[unsafe(no_mangle)]
+#[inline(never)]
+fn helper() {
+    // CHECK-LABEL: helper
+    // CHECK-LABEL: call c_variadic_inline::inline_always
+    // CHECK-LABEL: call c_variadic_inline::inline
+    // CHECK-LABEL: call c_variadic_inline::inline_never
+    // CHECK-LABEL: call c_variadic_inline::cold
+    unsafe {
+        inline_always(1);
+        inline(2);
+        inline_never(3);
+        cold(4);
+    }
+}
+
+fn main() {
+    helper()
+}
diff --git a/tests/codegen-llvm/comparison-operators-2-struct.rs b/tests/codegen-llvm/comparison-operators-2-struct.rs
index e179066ebfd..d44f92f511b 100644
--- a/tests/codegen-llvm/comparison-operators-2-struct.rs
+++ b/tests/codegen-llvm/comparison-operators-2-struct.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: -C opt-level=1
-//@ min-llvm-version: 20
 
 // The `derive(PartialOrd)` for a 2-field type doesn't override `lt`/`le`/`gt`/`ge`.
 // This double-checks that the `Option<Ordering>` intermediate values used
diff --git a/tests/codegen-llvm/comparison-operators-2-tuple.rs b/tests/codegen-llvm/comparison-operators-2-tuple.rs
index 6a7e489c82d..37a7c5dfdaf 100644
--- a/tests/codegen-llvm/comparison-operators-2-tuple.rs
+++ b/tests/codegen-llvm/comparison-operators-2-tuple.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: -C opt-level=1 -Z merge-functions=disabled
-//@ min-llvm-version: 20
 
 #![crate_type = "lib"]
 
diff --git a/tests/codegen-llvm/darwin-no-objc.rs b/tests/codegen-llvm/darwin-no-objc.rs
new file mode 100644
index 00000000000..fda3671fb6d
--- /dev/null
+++ b/tests/codegen-llvm/darwin-no-objc.rs
@@ -0,0 +1,52 @@
+// Test that we don't generate Objective-C definitions or image info unnecessarily.
+
+//@ add-core-stubs
+//@ revisions: i686_apple_darwin
+//@ [i686_apple_darwin] compile-flags: --target i686-apple-darwin
+//@ [i686_apple_darwin] needs-llvm-components: x86
+//@ revisions: x86_64_macos
+//@ [x86_64_macos] compile-flags: --target x86_64-apple-darwin
+//@ [x86_64_macos] needs-llvm-components: x86
+//@ revisions: aarch64_macos
+//@ [aarch64_macos] compile-flags: --target aarch64-apple-darwin
+//@ [aarch64_macos] needs-llvm-components: aarch64
+//@ revisions: i386_ios
+//@ [i386_ios] compile-flags: --target i386-apple-ios
+//@ [i386_ios] needs-llvm-components: x86
+//@ revisions: x86_64_ios
+//@ [x86_64_ios] compile-flags: --target x86_64-apple-ios
+//@ [x86_64_ios] needs-llvm-components: x86
+//@ revisions: armv7s_ios
+//@ [armv7s_ios] compile-flags: --target armv7s-apple-ios
+//@ [armv7s_ios] needs-llvm-components: arm
+//@ revisions: aarch64_ios
+//@ [aarch64_ios] compile-flags: --target aarch64-apple-ios
+//@ [aarch64_ios] needs-llvm-components: aarch64
+//@ revisions: aarch64_ios_sim
+//@ [aarch64_ios_sim] compile-flags: --target aarch64-apple-ios-sim
+//@ [aarch64_ios_sim] needs-llvm-components: aarch64
+
+#![crate_type = "lib"]
+#![feature(no_core, lang_items)]
+#![no_core]
+
+extern crate minicore;
+use minicore::*;
+
+#[no_mangle]
+pub fn foo() {}
+
+// CHECK-NOT: %struct._class_t
+// CHECK-NOT: %struct._objc_module
+// CHECK-NOT: @OBJC_CLASS_NAME_
+// CHECK-NOT: @"OBJC_CLASS_$_{{[0-9A-Z_a-z]+}}"
+// CHECK-NOT: @"OBJC_CLASSLIST_REFERENCES_$_.{{[0-9]+}}"
+// CHECK-NOT: @OBJC_METH_VAR_NAME_
+// CHECK-NOT: @OBJC_SELECTOR_REFERENCES_
+// CHECK-NOT: @OBJC_MODULES
+
+// CHECK-NOT: !"Objective-C Version"
+// CHECK-NOT: !"Objective-C Image Info Version"
+// CHECK-NOT: !"Objective-C Image Info Section"
+// CHECK-NOT: !"Objective-C Is Simulated"
+// CHECK-NOT: !"Objective-C Class Properties"
diff --git a/tests/codegen-llvm/darwin-objc-abi-v1.rs b/tests/codegen-llvm/darwin-objc-abi-v1.rs
new file mode 100644
index 00000000000..0fc1de9332a
--- /dev/null
+++ b/tests/codegen-llvm/darwin-objc-abi-v1.rs
@@ -0,0 +1,100 @@
+// ignore-tidy-linelength
+//@ add-core-stubs
+//@ revisions: i686_apple_darwin
+//@ [i686_apple_darwin] compile-flags: --target i686-apple-darwin
+//@ [i686_apple_darwin] needs-llvm-components: x86
+
+#![crate_type = "lib"]
+#![feature(no_core, lang_items, rustc_attrs)]
+#![no_core]
+
+extern crate minicore;
+use minicore::*;
+
+#[no_mangle]
+pub fn get_class() -> *mut () {
+    unsafe extern "C" {
+        #[rustc_objc_class = "MyClass"]
+        safe static VAL: *mut ();
+    }
+    VAL
+}
+
+#[no_mangle]
+pub fn get_class_again() -> *mut () {
+    // Codegen should de-duplicate this class with the one from get_class above.
+    unsafe extern "C" {
+        #[rustc_objc_class = "MyClass"]
+        safe static VAL: *mut ();
+    }
+    VAL
+}
+
+#[no_mangle]
+pub fn get_selector() -> *mut () {
+    unsafe extern "C" {
+        #[rustc_objc_selector = "myMethod"]
+        safe static VAL: *mut ();
+    }
+    VAL
+}
+
+#[no_mangle]
+pub fn get_selector_again() -> *mut () {
+    // Codegen should de-duplicate this selector with the one from get_selector above.
+    unsafe extern "C" {
+        #[rustc_objc_selector = "myMethod"]
+        safe static VAL: *mut ();
+    }
+    VAL
+}
+
+#[no_mangle]
+pub fn get_other_class() -> *mut () {
+    unsafe extern "C" {
+        #[rustc_objc_class = "OtherClass"]
+        safe static VAL: *mut ();
+    }
+    VAL
+}
+
+#[no_mangle]
+pub fn get_other_selector() -> *mut () {
+    unsafe extern "C" {
+        #[rustc_objc_selector = "otherMethod"]
+        safe static VAL: *mut ();
+    }
+    VAL
+}
+
+// CHECK: %struct._objc_module = type { i32, i32, ptr, ptr }
+
+// CHECK: @OBJC_CLASS_NAME_.{{[0-9]+}} = private unnamed_addr constant [8 x i8] c"MyClass\00", section "__TEXT,__cstring,cstring_literals", align 1
+// CHECK: @OBJC_CLASS_REFERENCES_.{{[0-9]+}} = private global ptr @OBJC_CLASS_NAME_.{{[0-9]+}}, section "__OBJC,__cls_refs,literal_pointers,no_dead_strip", align 4
+// CHECK-NOT: @OBJC_CLASS_NAME_
+// CHECK-NOT: @OBJC_CLASS_REFERENCES_
+
+// CHECK: @OBJC_METH_VAR_NAME_.{{[0-9]+}} = private unnamed_addr constant [9 x i8] c"myMethod\00", section "__TEXT,__cstring,cstring_literals", align 1
+// CHECK: @OBJC_SELECTOR_REFERENCES_.{{[0-9]+}} = private externally_initialized global ptr @OBJC_METH_VAR_NAME_.{{[0-9]+}}, section "__OBJC,__message_refs,literal_pointers,no_dead_strip", align 4
+// CHECK-NOT: @OBJC_METH_VAR_NAME_
+// CHECK-NOT: @OBJC_SELECTOR_REFERENCES_
+
+// CHECK: @OBJC_CLASS_NAME_.{{[0-9]+}} = private unnamed_addr constant [11 x i8] c"OtherClass\00", section "__TEXT,__cstring,cstring_literals", align 1
+// CHECK: @OBJC_CLASS_REFERENCES_.{{[0-9]+}} = private global ptr @OBJC_CLASS_NAME_.{{[0-9]+}}, section "__OBJC,__cls_refs,literal_pointers,no_dead_strip", align 4
+
+// CHECK: @OBJC_METH_VAR_NAME_.{{[0-9]+}} = private unnamed_addr constant [12 x i8] c"otherMethod\00", section "__TEXT,__cstring,cstring_literals", align 1
+// CHECK: @OBJC_SELECTOR_REFERENCES_.{{[0-9]+}} = private externally_initialized global ptr @OBJC_METH_VAR_NAME_.{{[0-9]+}}, section "__OBJC,__message_refs,literal_pointers,no_dead_strip", align 4
+
+// CHECK: @OBJC_CLASS_NAME_.{{[0-9]+}} = private unnamed_addr constant [1 x i8] zeroinitializer, section "__TEXT,__cstring,cstring_literals", align 1
+// CHECK: @OBJC_MODULES = private global %struct._objc_module { i32 7, i32 16, ptr @OBJC_CLASS_NAME_.{{[0-9]+}}, ptr null }, section "__OBJC,__module_info,regular,no_dead_strip", align 4
+
+// CHECK: load ptr, ptr @OBJC_CLASS_REFERENCES_.{{[0-9]+}}, align 4
+// CHECK: load ptr, ptr @OBJC_SELECTOR_REFERENCES_.{{[0-9]+}}, align 4
+// CHECK: load ptr, ptr @OBJC_CLASS_REFERENCES_.{{[0-9]+}}, align 4
+// CHECK: load ptr, ptr @OBJC_SELECTOR_REFERENCES_.{{[0-9]+}}, align 4
+
+// CHECK: !{{[0-9]+}} = !{i32 1, !"Objective-C Version", i32 1}
+// CHECK: !{{[0-9]+}} = !{i32 1, !"Objective-C Image Info Version", i32 0}
+// CHECK: !{{[0-9]+}} = !{i32 1, !"Objective-C Image Info Section", !"__OBJC,__image_info,regular"}
+// CHECK-NOT: !{{[0-9]+}} = !{i32 1, !"Objective-C Is Simulated", i32 32}
+// CHECK: !{{[0-9]+}} = !{i32 1, !"Objective-C Class Properties", i32 64}
diff --git a/tests/codegen-llvm/darwin-objc-abi-v2.rs b/tests/codegen-llvm/darwin-objc-abi-v2.rs
new file mode 100644
index 00000000000..f142371d582
--- /dev/null
+++ b/tests/codegen-llvm/darwin-objc-abi-v2.rs
@@ -0,0 +1,185 @@
+// ignore-tidy-linelength
+//@ add-core-stubs
+//@ revisions: x86_64_macos
+//@ [x86_64_macos] compile-flags: --target x86_64-apple-darwin
+//@ [x86_64_macos] needs-llvm-components: x86
+//@ revisions: aarch64_macos
+//@ [aarch64_macos] compile-flags: --target aarch64-apple-darwin
+//@ [aarch64_macos] needs-llvm-components: aarch64
+//@ revisions: i386_ios
+//@ [i386_ios] compile-flags: --target i386-apple-ios
+//@ [i386_ios] needs-llvm-components: x86
+//@ revisions: x86_64_ios
+//@ [x86_64_ios] compile-flags: --target x86_64-apple-ios
+//@ [x86_64_ios] needs-llvm-components: x86
+//@ revisions: armv7s_ios
+//@ [armv7s_ios] compile-flags: --target armv7s-apple-ios
+//@ [armv7s_ios] needs-llvm-components: arm
+//@ revisions: aarch64_ios
+//@ [aarch64_ios] compile-flags: --target aarch64-apple-ios
+//@ [aarch64_ios] needs-llvm-components: aarch64
+//@ revisions: aarch64_ios_sim
+//@ [aarch64_ios_sim] compile-flags: --target aarch64-apple-ios-sim
+//@ [aarch64_ios_sim] needs-llvm-components: aarch64
+
+#![crate_type = "lib"]
+#![feature(no_core, lang_items, rustc_attrs)]
+#![no_core]
+
+extern crate minicore;
+use minicore::*;
+
+#[no_mangle]
+pub fn get_class() -> *mut () {
+    unsafe extern "C" {
+        #[rustc_objc_class = "MyClass"]
+        safe static VAL: *mut ();
+    }
+    VAL
+}
+
+#[no_mangle]
+pub fn get_class_again() -> *mut () {
+    // Codegen should de-duplicate this class with the one from get_class above.
+    unsafe extern "C" {
+        #[rustc_objc_class = "MyClass"]
+        safe static VAL: *mut ();
+    }
+    VAL
+}
+
+#[no_mangle]
+pub fn get_selector() -> *mut () {
+    unsafe extern "C" {
+        #[rustc_objc_selector = "myMethod"]
+        safe static VAL: *mut ();
+    }
+    VAL
+}
+
+#[no_mangle]
+pub fn get_selector_again() -> *mut () {
+    // Codegen should de-duplicate this selector with the one from get_selector above.
+    unsafe extern "C" {
+        #[rustc_objc_selector = "myMethod"]
+        safe static VAL: *mut ();
+    }
+    VAL
+}
+
+#[no_mangle]
+pub fn get_other_class() -> *mut () {
+    unsafe extern "C" {
+        #[rustc_objc_class = "OtherClass"]
+        safe static VAL: *mut ();
+    }
+    VAL
+}
+
+#[no_mangle]
+pub fn get_other_selector() -> *mut () {
+    unsafe extern "C" {
+        #[rustc_objc_selector = "otherMethod"]
+        safe static VAL: *mut ();
+    }
+    VAL
+}
+
+// CHECK: %struct._class_t = type { ptr, ptr, ptr, ptr, ptr }
+
+// CHECK: @"OBJC_CLASS_$_MyClass" = external global %struct._class_t
+// CHECK: @"OBJC_CLASSLIST_REFERENCES_$_.{{[0-9]+}}" = internal global ptr @"OBJC_CLASS_$_MyClass", section "__DATA,__objc_classrefs,regular,no_dead_strip",
+// x86_64_macos-SAME: align 8
+// aarch64_macos-SAME: align 8
+// i386_ios-SAME: align 4
+// x86_64_ios-SAME: align 8
+// armv7s_ios-SAME: align 4
+// aarch64_ios-SAME: align 8
+// aarch64_ios_sim-SAME: align 8
+// CHECK-NOT: @"OBJC_CLASS_$_MyClass"
+// CHECK-NOT: @"OBJC_CLASSLIST_REFERENCES_$_
+
+// CHECK: @OBJC_METH_VAR_NAME_.{{[0-9]+}} = private unnamed_addr constant [9 x i8] c"myMethod\00", section "__TEXT,__objc_methname,cstring_literals", align 1
+// CHECK: @OBJC_SELECTOR_REFERENCES_.{{[0-9]+}} = internal externally_initialized global ptr @OBJC_METH_VAR_NAME_.{{[0-9]+}}, section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip",
+// x86_64_macos-SAME: align 8
+// aarch64_macos-SAME: align 8
+// i386_ios-SAME: align 4
+// x86_64_ios-SAME: align 8
+// armv7s_ios-SAME: align 4
+// aarch64_ios-SAME: align 8
+// aarch64_ios_sim-SAME: align 8
+// CHECK-NOT: @OBJC_METH_VAR_NAME_
+// CHECK-NOT: @OBJC_SELECTOR_REFERENCES_
+
+// CHECK: @"OBJC_CLASS_$_OtherClass" = external global %struct._class_t
+// CHECK: @"OBJC_CLASSLIST_REFERENCES_$_.{{[0-9]+}}" = internal global ptr @"OBJC_CLASS_$_OtherClass", section "__DATA,__objc_classrefs,regular,no_dead_strip",
+// x86_64_macos-SAME: align 8
+// aarch64_macos-SAME: align 8
+// i386_ios-SAME: align 4
+// x86_64_ios-SAME: align 8
+// armv7s_ios-SAME: align 4
+// aarch64_ios-SAME: align 8
+// aarch64_ios_sim-SAME: align 8
+
+// CHECK: @OBJC_METH_VAR_NAME_.{{[0-9]+}} = private unnamed_addr constant [12 x i8] c"otherMethod\00", section "__TEXT,__objc_methname,cstring_literals", align 1
+// CHECK: @OBJC_SELECTOR_REFERENCES_.{{[0-9]+}} = internal externally_initialized global ptr @OBJC_METH_VAR_NAME_.{{[0-9]+}}, section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip",
+// x86_64_macos-SAME: align 8
+// aarch64_macos-SAME: align 8
+// i386_ios-SAME: align 4
+// x86_64_ios-SAME: align 8
+// armv7s_ios-SAME: align 4
+// aarch64_ios-SAME: align 8
+// aarch64_ios_sim-SAME: align 8
+
+// CHECK-NOT: @OBJC_CLASS_NAME_
+// CHECK-NOT: @OBJC_MODULES
+
+// CHECK: load ptr, ptr @"OBJC_CLASSLIST_REFERENCES_$_.{{[0-9]+}}",
+// x86_64_macos-SAME: align 8
+// aarch64_macos-SAME: align 8
+// i386_ios-SAME: align 4
+// x86_64_ios-SAME: align 8
+// armv7s_ios-SAME: align 4
+// aarch64_ios-SAME: align 8
+// aarch64_ios_sim-SAME: align 8
+
+// CHECK: load ptr, ptr @OBJC_SELECTOR_REFERENCES_.{{[0-9]+}},
+// x86_64_macos-SAME: align 8
+// aarch64_macos-SAME: align 8
+// i386_ios-SAME: align 4
+// x86_64_ios-SAME: align 8
+// armv7s_ios-SAME: align 4
+// aarch64_ios-SAME: align 8
+// aarch64_ios_sim-SAME: align 8
+
+// CHECK: load ptr, ptr @"OBJC_CLASSLIST_REFERENCES_$_.{{[0-9]+}}",
+// x86_64_macos-SAME: align 8
+// aarch64_macos-SAME: align 8
+// i386_ios-SAME: align 4
+// x86_64_ios-SAME: align 8
+// armv7s_ios-SAME: align 4
+// aarch64_ios-SAME: align 8
+// aarch64_ios_sim-SAME: align 8
+
+// CHECK: load ptr, ptr @OBJC_SELECTOR_REFERENCES_.{{[0-9]+}},
+// x86_64_macos-SAME: align 8
+// aarch64_macos-SAME: align 8
+// i386_ios-SAME: align 4
+// x86_64_ios-SAME: align 8
+// armv7s_ios-SAME: align 4
+// aarch64_ios-SAME: align 8
+// aarch64_ios_sim-SAME: align 8
+
+// CHECK: !{{[0-9]+}} = !{i32 1, !"Objective-C Version", i32 2}
+// CHECK: !{{[0-9]+}} = !{i32 1, !"Objective-C Image Info Version", i32 0}
+// CHECK: !{{[0-9]+}} = !{i32 1, !"Objective-C Image Info Section", !"__DATA,__objc_imageinfo,regular,no_dead_strip"}
+
+// x86_64_macos-NOT: !{{[0-9]+}} = !{i32 1, !"Objective-C Is Simulated", i32 32}
+// aarch64_macos-NOT: !{{[0-9]+}} = !{i32 1, !"Objective-C Is Simulated", i32 32}
+// i386_ios: !{{[0-9]+}} = !{i32 1, !"Objective-C Is Simulated", i32 32}
+// x86_64_ios: !{{[0-9]+}} = !{i32 1, !"Objective-C Is Simulated", i32 32}
+// armv7s_ios-NOT: !{{[0-9]+}} = !{i32 1, !"Objective-C Is Simulated", i32 32}
+// aarch64_ios-NOT: !{{[0-9]+}} = !{i32 1, !"Objective-C Is Simulated", i32 32}
+// aarch64_ios_sim: !{{[0-9]+}} = !{i32 1, !"Objective-C Is Simulated", i32 32}
+
+// CHECK: !{{[0-9]+}} = !{i32 1, !"Objective-C Class Properties", i32 64}
diff --git a/tests/codegen-llvm/darwin-objc-cross-crate.rs b/tests/codegen-llvm/darwin-objc-cross-crate.rs
new file mode 100644
index 00000000000..74ad9a27346
--- /dev/null
+++ b/tests/codegen-llvm/darwin-objc-cross-crate.rs
@@ -0,0 +1,58 @@
+// Test that Objective-C class and selector references inlined across crates
+// get defined in this CGU but non-inline references don't.
+
+// ignore-tidy-linelength
+//@ aux-build: darwin_objc_aux.rs
+//@ revisions: x86_64_macos aarch64_macos
+//@ [x86_64_macos] only-x86_64-apple-darwin
+//@ [aarch64_macos] only-aarch64-apple-darwin
+
+#![crate_type = "lib"]
+#![feature(darwin_objc)]
+
+use std::os::darwin::objc;
+
+extern crate darwin_objc_aux as aux;
+
+#[no_mangle]
+pub fn get_object_class() -> objc::Class {
+    aux::inline_get_object_class()
+}
+
+#[no_mangle]
+pub fn get_alloc_selector() -> objc::SEL {
+    aux::inline_get_alloc_selector()
+}
+
+#[no_mangle]
+pub fn get_string_class() -> objc::Class {
+    aux::never_inline_get_string_class()
+}
+
+#[no_mangle]
+pub fn get_init_selector() -> objc::SEL {
+    aux::never_inline_get_init_selector()
+}
+
+// CHECK: %struct._class_t = type { ptr, ptr, ptr, ptr, ptr }
+
+// CHECK: @"OBJC_CLASS_$_NSObject" = external global %struct._class_t
+// CHECK: @"OBJC_CLASSLIST_REFERENCES_$_.{{[0-9]+}}" = internal global ptr @"OBJC_CLASS_$_NSObject", section "__DATA,__objc_classrefs,regular,no_dead_strip", align 8
+
+// CHECK: @OBJC_METH_VAR_NAME_.{{[0-9]+}} = private unnamed_addr constant [6 x i8] c"alloc\00", section "__TEXT,__objc_methname,cstring_literals", align 1
+// CHECK: @OBJC_SELECTOR_REFERENCES_.{{[0-9]+}} = internal externally_initialized global ptr @OBJC_METH_VAR_NAME_.{{[0-9]+}}, section "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", align 8
+
+// CHECK-NOT: @"OBJC_CLASS_$_NSString" = external global %struct._class_t
+// CHECK-NOT: @"OBJC_CLASSLIST_REFERENCES_$_.{{[0-9]+}}" = internal global ptr @"OBJC_CLASS_$_NSString"
+
+// CHECK-NOT: @OBJC_METH_VAR_NAME_.{{[0-9]+}} = private unnamed_addr constant [5 x i8] c"init\00"
+// CHECK-NOT: @OBJC_SELECTOR_REFERENCES_.{{[0-9]+}} = internal externally_initialized global ptr @OBJC_METH_VAR_NAME_.{{[0-9]+}}
+
+// CHECK: load ptr, ptr @"OBJC_CLASSLIST_REFERENCES_$_.{{[0-9]+}}", align 8
+// CHECK: load ptr, ptr @OBJC_SELECTOR_REFERENCES_.{{[0-9]+}}, align 8
+
+// CHECK: !{{[0-9]+}} = !{i32 1, !"Objective-C Version", i32 2}
+// CHECK: !{{[0-9]+}} = !{i32 1, !"Objective-C Image Info Version", i32 0}
+// CHECK: !{{[0-9]+}} = !{i32 1, !"Objective-C Image Info Section", !"__DATA,__objc_imageinfo,regular,no_dead_strip"}
+// CHECK-NOT: !{{[0-9]+}} = !{i32 1, !"Objective-C Is Simulated", i32 32}
+// CHECK: !{{[0-9]+}} = !{i32 1, !"Objective-C Class Properties", i32 64}
diff --git a/tests/codegen-llvm/debug-fndef-size.rs b/tests/codegen-llvm/debug-fndef-size.rs
index 8f716c34e7b..02629bd748c 100644
--- a/tests/codegen-llvm/debug-fndef-size.rs
+++ b/tests/codegen-llvm/debug-fndef-size.rs
@@ -16,5 +16,5 @@ pub fn main() {
 
 // CHECK: %compare.dbg.spill = alloca [0 x i8], align 1
 // CHECK: dbg{{.}}declare({{(metadata )?}}ptr %compare.dbg.spill, {{(metadata )?}}![[VAR:.*]], {{(metadata )?}}!DIExpression()
-// CHECK: ![[TYPE:.*]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "fn(&i32, &i32) -> core::cmp::Ordering", baseType: !{{.*}}, align: 8, dwarfAddressSpace: {{.*}})
-// CHECK: ![[VAR]] = !DILocalVariable(name: "compare", scope: !{{.*}}, file: !{{.*}}, line: {{.*}}, type: ![[TYPE]], align: 8)
+// CHECK-DAG: ![[TYPE:.*]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "fn(&i32, &i32) -> core::cmp::Ordering", baseType: !{{.*}}, align: 8, dwarfAddressSpace: {{.*}})
+// CHECK-DAG: ![[VAR]] = !DILocalVariable(name: "compare", scope: !{{.*}}, file: !{{.*}}, line: {{.*}}, type: ![[TYPE]], align: 8)
diff --git a/tests/codegen-llvm/debuginfo-dse.rs b/tests/codegen-llvm/debuginfo-dse.rs
new file mode 100644
index 00000000000..fd0c9f1c676
--- /dev/null
+++ b/tests/codegen-llvm/debuginfo-dse.rs
@@ -0,0 +1,362 @@
+//@ compile-flags: -Copt-level=3 -g -Zverify-llvm-ir -Zmerge-functions=disabled
+//@ revisions: CODEGEN OPTIMIZED
+//@[CODEGEN] compile-flags: -Cno-prepopulate-passes
+//@ only-64bit
+// ignore-tidy-linelength
+
+#![crate_type = "lib"]
+#![feature(repr_simd, rustc_attrs)]
+
+// The pass mode is direct and the backend represent is scalar.
+type Scalar = i32; // scalar(i32)
+type Scalar_Ref = &'static i32; // scalar(ptr)
+
+// The pass modes are pair and the backend represents are scalar pair.
+type Tuple_Scalar_Scalar = (i32, i32);
+struct Tuple_Ref_Scalar(&'static i32, i32);
+struct Tuple_ArrayRef_Scalar(&'static [i32; 16], i32); // pair(ptr, i32)
+impl Default for Tuple_ArrayRef_Scalar {
+    fn default() -> Tuple_ArrayRef_Scalar {
+        Tuple_ArrayRef_Scalar(&[0; 16], 0)
+    }
+}
+struct Tuple_Scalar_ArrayRef(i32, &'static [i32; 16]); // pair(i32, ptr)
+impl Default for Tuple_Scalar_ArrayRef {
+    fn default() -> Tuple_Scalar_ArrayRef {
+        Tuple_Scalar_ArrayRef(0, &[0; 16])
+    }
+}
+// The pass mode is indirect and the backend represent is memory.
+type Tuple_SliceRef_Scalar = (&'static [i32], i32);
+
+// The pass mode is pair and the backend represent is scalar pair.
+type SliceRef = &'static [i32]; // pair(ptr, i32)
+// The pass mode is indirect and the backend represent is memory.
+type Array = [i32; 16];
+// The pass mode is direct and the backend represent is scalar.
+type ArrayRef = &'static [i32; 16];
+
+// The pass mode is indirect and the backend represent is memory.
+type Typle_i32_i64_i8 = (i32, i64, i8);
+// The pass mode is indirect and the backend represent is memory.
+#[repr(C)]
+struct Aggregate_i32_Array_i8(i32, &'static [i32; 16], i8);
+
+type ZST = ();
+
+impl Default for Aggregate_i32_Array_i8 {
+    fn default() -> Aggregate_i32_Array_i8 {
+        Aggregate_i32_Array_i8(0, &[0; 16], 0)
+    }
+}
+// The pass mode is cast and the backend represent is scalar.
+#[derive(Default)]
+struct Aggregate_4xi8(i8, i8, i8, i8); // scalar(i32)
+
+// The pass mode is indirect and the backend represent is simd vector.
+#[repr(simd)]
+struct Simd_i32x4([i32; 4]);
+
+unsafe extern "Rust" {
+    #[rustc_nounwind]
+    safe fn opaque_fn();
+    #[rustc_nounwind]
+    safe fn opaque_ptr(_: *const core::ffi::c_void);
+}
+
+#[inline(never)]
+#[rustc_nounwind]
+fn opaque_use<T>(p: &T) {
+    opaque_ptr(&raw const p as *const _);
+}
+
+#[inline(never)]
+#[rustc_nounwind]
+fn opaque_read<T: Default>() -> T {
+    core::hint::black_box(T::default())
+}
+
+#[unsafe(no_mangle)]
+fn local_var() {
+    // CHECK-LABEL: define{{( dso_local)?}} void @local_var
+    let local_var_scalar: Scalar = opaque_read();
+    opaque_use(&local_var_scalar);
+    let dead_local_var_scalar: Scalar = opaque_read();
+    let local_var_aggregate_4xi8: Aggregate_4xi8 = opaque_read();
+    opaque_use(&local_var_aggregate_4xi8);
+    let local_var_aggregate_i32_array_i8: Aggregate_i32_Array_i8 = opaque_read();
+    opaque_use(&local_var_aggregate_i32_array_i8);
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+    // CHECK-NEXT: #dbg_value(ptr %local_var_scalar, [[ref_local_var_scalar:![0-9]+]], !DIExpression()
+    let ref_local_var_scalar = &local_var_scalar;
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_dead_local_var_scalar:![0-9]+]], !DIExpression()
+    let ref_dead_local_var_scalar = &dead_local_var_scalar;
+    // CHECK-NEXT: #dbg_value(ptr %local_var_aggregate_4xi8, [[ref_local_var_aggregate_4xi8:![0-9]+]], !DIExpression()
+    let ref_local_var_aggregate_4xi8 = &local_var_aggregate_4xi8;
+    // CHECK-NEXT: #dbg_value(ptr %local_var_aggregate_4xi8, [[ref_0_local_var_aggregate_4xi8:![0-9]+]], !DIExpression()
+    let ref_0_local_var_aggregate_4xi8 = &local_var_aggregate_4xi8.0;
+    // CHECK-NEXT: #dbg_value(ptr %local_var_aggregate_4xi8, [[ref_2_local_var_aggregate_4xi8:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 2, DW_OP_stack_value)
+    let ref_2_local_var_aggregate_4xi8 = &local_var_aggregate_4xi8.2;
+    // This introduces an extra load instruction.
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_1_1_local_var_aggregate_i32_array_i8:![0-9]+]], !DIExpression()
+    let ref_1_1_local_var_aggregate_i32_array_i8 = &local_var_aggregate_i32_array_i8.1[1];
+    // CHECK-NEXT: #dbg_value(ptr %local_var_aggregate_i32_array_i8, [[ref_2_local_var_aggregate_i32_array_i8:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 16, DW_OP_stack_value)
+    let ref_2_local_var_aggregate_i32_array_i8 = &local_var_aggregate_i32_array_i8.2;
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+}
+
+#[unsafe(no_mangle)]
+fn zst(zst: ZST, zst_ref: &ZST) {
+    // CHECK-LABEL: define{{( dso_local)?}} void @zst
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_zst:![0-9]+]], !DIExpression()
+    let ref_zst = &zst;
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_zst_ref:![0-9]+]], !DIExpression()
+    let ref_zst_ref = &zst_ref;
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+}
+
+// It only makes sense if the argument is a reference and it refer to projections.
+#[unsafe(no_mangle)]
+fn direct(
+    scalar: Scalar,
+    scalar_ref: Scalar_Ref,
+    array_ref: ArrayRef,
+    aggregate_4xi8_ref: &Aggregate_4xi8,
+) {
+    // CHECK-LABEL: define{{( dso_local)?}} void @direct
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_scalar:![0-9]+]], !DIExpression()
+    let ref_scalar = &scalar;
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_scalar_ref:![0-9]+]], !DIExpression()
+    let ref_scalar_ref = &scalar_ref;
+    // CHECK-NEXT: #dbg_value(ptr %array_ref, [[ref_0_array_ref:![0-9]+]], !DIExpression()
+    let ref_0_array_ref = &array_ref[0];
+    // CHECK-NEXT: #dbg_value(ptr %array_ref, [[ref_1_array_ref:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 4, DW_OP_stack_value)
+    let ref_1_array_ref = &array_ref[1];
+    // CHECK-NEXT: #dbg_value(ptr %aggregate_4xi8_ref, [[ref_1_aggregate_4xi8_ref:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 1, DW_OP_stack_value)
+    let ref_1_aggregate_4xi8_ref = &aggregate_4xi8_ref.1;
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+}
+
+// Arguments are passed through registers, the final values are poison.
+#[unsafe(no_mangle)]
+fn cast(aggregate_4xi8: Aggregate_4xi8) {
+    // CHECK-LABEL: define{{( dso_local)?}} void @cast(i32 %0)
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+    // The temporary allocated variable is eliminated.
+    // CODEGEN-NEXT: #dbg_value(ptr %aggregate_4xi8, [[ref_aggregate_4xi8:![0-9]+]], !DIExpression()
+    // OPTIMIZED-NEXT: #dbg_value(ptr undef, [[ref_aggregate_4xi8:![0-9]+]], !DIExpression()
+    let ref_aggregate_4xi8 = &aggregate_4xi8;
+    // CODEGEN-NEXT: #dbg_value(ptr %aggregate_4xi8, [[ref_0_aggregate_4xi8:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 1, DW_OP_stack_value)
+    // OPTIMIZED-NEXT: #dbg_value(ptr undef, [[ref_0_aggregate_4xi8:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 1, DW_OP_stack_value)
+    let ref_0_aggregate_4xi8 = &aggregate_4xi8.1;
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+}
+
+// Arguments are passed indirectly via a pointer.
+// The reference of argument is the pointer itself.
+#[unsafe(no_mangle)]
+fn indirect(
+    tuple_sliceref_scalar: Tuple_SliceRef_Scalar,
+    array: Array,
+    typle_i32_i64_i8: Typle_i32_i64_i8,
+    simd_i32x4: Simd_i32x4,
+) {
+    // CHECK-LABEL: define{{( dso_local)?}} void @indirect
+    // CHECK-SAME: (ptr{{.*}} %tuple_sliceref_scalar, ptr{{.*}} %array, ptr{{.*}} %typle_i32_i64_i8, ptr{{.*}} %simd_i32x4)
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+    // CHECK-NEXT: #dbg_value(ptr %tuple_sliceref_scalar, [[ref_tuple_sliceref_scalar:![0-9]+]], !DIExpression()
+    let ref_tuple_sliceref_scalar = &tuple_sliceref_scalar;
+    // CHECK-NEXT: #dbg_value(ptr %tuple_sliceref_scalar, [[ref_1_tuple_sliceref_scalar:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 16, DW_OP_stack_value)
+    let ref_1_tuple_sliceref_scalar = &tuple_sliceref_scalar.1;
+    // CHECK-NEXT: #dbg_value(ptr %array, [[ref_1_array:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 4, DW_OP_stack_value)
+    let ref_1_array = &array[1];
+    // CHECK-NEXT: #dbg_value(ptr %typle_i32_i64_i8, [[ref_1_typle_i32_i64_i8:![0-9]+]], !DIExpression()
+    let ref_1_typle_i32_i64_i8 = &typle_i32_i64_i8.1;
+    // CHECK-NEXT: #dbg_value(ptr %simd_i32x4, [[ref_simd_i32x4:![0-9]+]], !DIExpression()
+    let ref_simd_i32x4 = &simd_i32x4;
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+}
+
+// They are different MIR statements, but they have the same LLVM IR statement due to the ABI of arguments.
+// Both `direct_ref` and `indirect_byval` are passed as a pointer here.
+#[unsafe(no_mangle)]
+fn direct_ref_and_indirect(
+    direct_ref: &Aggregate_i32_Array_i8,
+    indirect_byval: Aggregate_i32_Array_i8,
+) {
+    // CHECK-LABEL: define{{( dso_local)?}} void @direct_ref_and_indirect
+    // CHECK-SAME: (ptr{{.*}} %direct_ref, ptr{{.*}} %indirect_byval)
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_direct_ref:![0-9]+]], !DIExpression()
+    let ref_direct_ref: &&Aggregate_i32_Array_i8 = &direct_ref;
+    // CHECK-NEXT: #dbg_value(ptr %direct_ref, [[ref_1_direct_ref:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 8, DW_OP_stack_value)
+    let ref_1_direct_ref = &direct_ref.1;
+    // CHECK-NEXT: #dbg_value(ptr %indirect_byval, [[ref_indirect_byval:![0-9]+]], !DIExpression()
+    let ref_indirect_byval: &Aggregate_i32_Array_i8 = &indirect_byval;
+    // CHECK-NEXT: #dbg_value(ptr %indirect_byval, [[ref_1_indirect_byval:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 8, DW_OP_stack_value)
+    let ref_1_indirect_byval = &indirect_byval.1;
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+}
+
+#[unsafe(no_mangle)]
+fn pair(
+    tuple_scalar_scalar: Tuple_Scalar_Scalar,
+    tuple_ref_scalar: Tuple_Ref_Scalar,
+    tuple_arrayref_scalar: Tuple_ArrayRef_Scalar,
+    tuple_scalar_arrayref: Tuple_Scalar_ArrayRef,
+    sliceref: SliceRef,
+) {
+    // CHECK-LABEL: define{{( dso_local)?}} void @pair
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_0_tuple_scalar_scalar:![0-9]+]], !DIExpression()
+    let ref_0_tuple_scalar_scalar = &tuple_scalar_scalar.0;
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_0_tuple_ref_scalar:![0-9]+]], !DIExpression()
+    let ref_0_tuple_ref_scalar = &tuple_ref_scalar.0;
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_1_tuple_ref_scalar:![0-9]+]], !DIExpression()
+    let ref_1_tuple_ref_scalar = &tuple_ref_scalar.1;
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_0_tuple_arrayref_scalar:![0-9]+]], !DIExpression()
+    let ref_0_tuple_arrayref_scalar = &tuple_arrayref_scalar.0;
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_1_tuple_arrayref_scalar:![0-9]+]], !DIExpression()
+    let ref_1_tuple_arrayref_scalar = &tuple_arrayref_scalar.1;
+    // FIXME: This can be a valid value.
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_0_1_tuple_arrayref_scalar:![0-9]+]], !DIExpression()
+    let ref_0_1_tuple_arrayref_scalar = &tuple_arrayref_scalar.0[1];
+    // FIXME: This can be a valid value.
+    // CHECK-NEXT: #dbg_value(ptr poison, [[ref_1_1_tuple_scalar_arrayref:![0-9]+]], !DIExpression()
+    let ref_1_1_tuple_scalar_arrayref = &tuple_scalar_arrayref.1[1];
+    // CHECK: #dbg_value(ptr %sliceref.0, [[ref_1_sliceref:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 4, DW_OP_stack_value)
+    let ref_1_sliceref = &sliceref[1];
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+}
+
+#[repr(C)]
+#[derive(Clone, Copy)]
+pub struct Foo(i32, i64, i32);
+
+#[repr(C)]
+pub struct Bar<'a> {
+    a: i32,
+    b: i64,
+    foo: &'a Foo,
+}
+
+#[unsafe(no_mangle)]
+pub fn dead_first(dead_first_foo: &Foo) -> &i32 {
+    // CHECK-LABEL: def {{.*}} ptr @dead_first
+    // CHECK-SAME: (ptr {{.*}} [[ARG_dead_first_foo:%.*]])
+    // CODEGEN: #dbg_declare(ptr %dead_first_foo.dbg.spill, [[ARG_dead_first_foo:![0-9]+]], !DIExpression()
+    // OPTIMIZED: #dbg_value(ptr %dead_first_foo, [[ARG_dead_first_foo:![0-9]+]], !DIExpression()
+    // CHECK: #dbg_value(ptr %dead_first_foo, [[VAR_dead_first_v0:![0-9]+]], !DIExpression()
+    // CHECK: %dead_first_v0 = getelementptr{{.*}} i8, ptr %dead_first_foo, i64 16
+    // CODEGEN: #dbg_declare(ptr %dead_first_v0.dbg.spill, [[VAR_dead_first_v0]], !DIExpression()
+    // OPTIMIZED: #dbg_value(ptr %dead_first_v0, [[VAR_dead_first_v0]], !DIExpression()
+    let mut dead_first_v0 = &dead_first_foo.0;
+    dead_first_v0 = &dead_first_foo.2;
+    dead_first_v0
+}
+
+#[unsafe(no_mangle)]
+pub fn fragment(fragment_v1: Foo, mut fragment_v2: Foo) -> Foo {
+    // CHECK-LABEL: define{{( dso_local)?}} void @fragment
+    // CHECK-SAME: (ptr {{.*}}, ptr {{.*}} [[ARG_fragment_v1:%.*]], ptr {{.*}} [[ARG_fragment_v2:%.*]])
+    // CHECK: #dbg_declare(ptr [[ARG_fragment_v1]]
+    // CHECK-NEXT: #dbg_declare(ptr [[ARG_fragment_v2]]
+    // CHECK-NEXT: #dbg_value(ptr [[ARG_fragment_v2]], [[VAR_fragment_f:![0-9]+]], !DIExpression(DW_OP_LLVM_fragment, 0, 64)
+    // CHECK-NEXT: #dbg_value(ptr [[ARG_fragment_v1]], [[VAR_fragment_f:![0-9]+]], !DIExpression(DW_OP_LLVM_fragment, 64, 64)
+    let fragment_f = || {
+        fragment_v2 = fragment_v1;
+    };
+    fragment_v2 = fragment_v1;
+    fragment_v2
+}
+
+#[unsafe(no_mangle)]
+pub fn deref(bar: Bar) -> i32 {
+    // CHECK-LABEL: define{{.*}} i32 @deref
+    // We are unable to represent dereference within this expression.
+    // CHECK: #dbg_value(ptr poison, [[VAR_deref_dead:![0-9]+]], !DIExpression()
+    let deref_dead = &bar.foo.2;
+    bar.a
+}
+
+#[unsafe(no_mangle)]
+fn index(slice: &[i32; 4], idx: usize) -> i32 {
+    // CHECK-LABEL: define{{.*}} i32 @index
+    // CHECK: call void @opaque_fn()
+    opaque_fn();
+    // CHECK: #dbg_value(ptr poison, [[VAR_index_from_var:![0-9]+]], !DIExpression()
+    let index_from_var = &slice[idx];
+    // CHECK: #dbg_value(ptr %slice, [[VAR_const_index_from_start:![0-9]+]], !DIExpression()
+    // CHECK-NEXT: #dbg_value(ptr poison, [[VAR_const_index_from_end:![0-9]+]], !DIExpression()
+    let [ref const_index_from_start, .., ref const_index_from_end] = slice[..] else {
+        return 0;
+    };
+    slice[0]
+}
+
+// CHECK-DAG: [[ref_local_var_scalar]] = !DILocalVariable(name: "ref_local_var_scalar"
+// CHECK-DAG: [[ref_dead_local_var_scalar]] = !DILocalVariable(name: "ref_dead_local_var_scalar"
+// CHECK-DAG: [[ref_local_var_aggregate_4xi8]] = !DILocalVariable(name: "ref_local_var_aggregate_4xi8"
+// CHECK-DAG: [[ref_0_local_var_aggregate_4xi8]] = !DILocalVariable(name: "ref_0_local_var_aggregate_4xi8"
+// CHECK-DAG: [[ref_2_local_var_aggregate_4xi8]] = !DILocalVariable(name: "ref_2_local_var_aggregate_4xi8"
+// CHECK-DAG: [[ref_1_1_local_var_aggregate_i32_array_i8]] = !DILocalVariable(name: "ref_1_1_local_var_aggregate_i32_array_i8"
+// CHECK-DAG: [[ref_2_local_var_aggregate_i32_array_i8]] = !DILocalVariable(name: "ref_2_local_var_aggregate_i32_array_i8"
+
+// CHECK-DAG: [[ref_zst]] = !DILocalVariable(name: "ref_zst"
+// CHECK-DAG: [[ref_zst_ref]] = !DILocalVariable(name: "ref_zst_ref"
+
+// CHECK-DAG: [[ref_scalar]] = !DILocalVariable(name: "ref_scalar"
+// CHECK-DAG: [[ref_scalar_ref]] = !DILocalVariable(name: "ref_scalar_ref"
+// CHECK-DAG: [[ref_0_array_ref]] = !DILocalVariable(name: "ref_0_array_ref"
+// CHECK-DAG: [[ref_1_array_ref]] = !DILocalVariable(name: "ref_1_array_ref"
+// CHECK-DAG: [[ref_1_aggregate_4xi8_ref]] = !DILocalVariable(name: "ref_1_aggregate_4xi8_ref"
+
+// CHECK-DAG: [[ref_aggregate_4xi8]] = !DILocalVariable(name: "ref_aggregate_4xi8"
+// CHECK-DAG: [[ref_0_aggregate_4xi8]] = !DILocalVariable(name: "ref_0_aggregate_4xi8"
+
+// CHECK-DAG: [[ref_tuple_sliceref_scalar]] = !DILocalVariable(name: "ref_tuple_sliceref_scalar"
+// CHECK-DAG: [[ref_1_tuple_sliceref_scalar]] = !DILocalVariable(name: "ref_1_tuple_sliceref_scalar"
+// CHECK-DAG: [[ref_1_array]] = !DILocalVariable(name: "ref_1_array"
+// CHECK-DAG: [[ref_1_typle_i32_i64_i8]] = !DILocalVariable(name: "ref_1_typle_i32_i64_i8"
+// CHECK-DAG: [[ref_simd_i32x4]] = !DILocalVariable(name: "ref_simd_i32x4"
+
+// CHECK-DAG: [[ref_direct_ref]] = !DILocalVariable(name: "ref_direct_ref"
+// CHECK-DAG: [[ref_1_direct_ref]] = !DILocalVariable(name: "ref_1_direct_ref"
+// CHECK-DAG: [[ref_indirect_byval]] = !DILocalVariable(name: "ref_indirect_byval"
+// CHECK-DAG: [[ref_1_indirect_byval]] = !DILocalVariable(name: "ref_1_indirect_byval"
+
+// CHECK-DAG: [[ref_0_tuple_scalar_scalar]] = !DILocalVariable(name: "ref_0_tuple_scalar_scalar"
+// CHECK-DAG: [[ref_0_tuple_ref_scalar]] = !DILocalVariable(name: "ref_0_tuple_ref_scalar"
+// CHECK-DAG: [[ref_1_tuple_ref_scalar]] = !DILocalVariable(name: "ref_1_tuple_ref_scalar"
+// CHECK-DAG: [[ref_0_tuple_arrayref_scalar]] = !DILocalVariable(name: "ref_0_tuple_arrayref_scalar"
+// CHECK-DAG: [[ref_1_tuple_arrayref_scalar]] = !DILocalVariable(name: "ref_1_tuple_arrayref_scalar"
+// CHECK-DAG: [[ref_0_1_tuple_arrayref_scalar]] = !DILocalVariable(name: "ref_0_1_tuple_arrayref_scalar"
+// CHECK-DAG: [[ref_1_1_tuple_scalar_arrayref]] = !DILocalVariable(name: "ref_1_1_tuple_scalar_arrayref"
+// CHECK-DAG: [[ref_1_sliceref]] = !DILocalVariable(name: "ref_1_sliceref"
+
+// CHECK-DAG: [[ARG_dead_first_foo]] = !DILocalVariable(name: "dead_first_foo"
+// CHECK-DAG: [[VAR_dead_first_v0]] = !DILocalVariable(name: "dead_first_v0"
+
+// CHECK-DAG: [[VAR_fragment_f]] = !DILocalVariable(name: "fragment_f"
+
+// CHECK-DAG: [[VAR_deref_dead]] = !DILocalVariable(name: "deref_dead"
+
+// CHECK-DAG: [[VAR_index_from_var]] = !DILocalVariable(name: "index_from_var"
+// CHECK-DAG: [[VAR_const_index_from_start]] = !DILocalVariable(name: "const_index_from_start"
+// CHECK-DAG: [[VAR_const_index_from_end]] = !DILocalVariable(name: "const_index_from_end"
diff --git a/tests/codegen-llvm/enum/enum-aggregate.rs b/tests/codegen-llvm/enum/enum-aggregate.rs
index f58d7ef12b6..7d450a89e2e 100644
--- a/tests/codegen-llvm/enum/enum-aggregate.rs
+++ b/tests/codegen-llvm/enum/enum-aggregate.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: -Copt-level=0 -Cno-prepopulate-passes
-//@ min-llvm-version: 19
 //@ only-64bit
 
 #![crate_type = "lib"]
diff --git a/tests/codegen-llvm/enum/enum-discriminant-eq.rs b/tests/codegen-llvm/enum/enum-discriminant-eq.rs
index a1ab5e5c6e2..68cd58643e8 100644
--- a/tests/codegen-llvm/enum/enum-discriminant-eq.rs
+++ b/tests/codegen-llvm/enum/enum-discriminant-eq.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: -Copt-level=3 -Zmerge-functions=disabled
-//@ min-llvm-version: 20
 //@ only-64bit
 //@ revisions: LLVM20 LLVM21
 //@ [LLVM21] min-llvm-version: 21
diff --git a/tests/codegen-llvm/global-allocator-attributes.rs b/tests/codegen-llvm/global-allocator-attributes.rs
new file mode 100644
index 00000000000..472ca772075
--- /dev/null
+++ b/tests/codegen-llvm/global-allocator-attributes.rs
@@ -0,0 +1,41 @@
+//@ compile-flags: -C opt-level=3
+#![crate_type = "lib"]
+
+mod foobar {
+    use std::alloc::{GlobalAlloc, Layout};
+
+    struct Allocator;
+
+    unsafe impl GlobalAlloc for Allocator {
+        unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
+            // CHECK-LABEL: ; __rustc::__rust_alloc
+            // CHECK-NEXT: ; Function Attrs: {{.*}}allockind("alloc,uninitialized,aligned") allocsize(0){{.*}}
+            // CHECK-NEXT: define{{.*}} noalias{{.*}} ptr @{{.*}}__rust_alloc(i[[SIZE:[0-9]+]] {{.*}}%size, i[[SIZE]] allocalign{{.*}} %align)
+            panic!()
+        }
+
+        unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
+            // CHECK-LABEL: ; __rustc::__rust_dealloc
+            // CHECK-NEXT: ; Function Attrs: {{.*}}allockind("free"){{.*}}
+            // CHECK-NEXT: define{{.*}} void @{{.*}}__rust_dealloc(ptr allocptr{{.*}} %ptr, i[[SIZE]] {{.*}} %size, i[[SIZE]] {{.*}} %align)
+            panic!()
+        }
+
+        unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 {
+            // CHECK-LABEL: ; __rustc::__rust_realloc
+            // CHECK-NEXT: ; Function Attrs: {{.*}}allockind("realloc,aligned") allocsize(3){{.*}}
+            // CHECK-NEXT: define{{.*}} noalias{{.*}} ptr @{{.*}}__rust_realloc(ptr allocptr{{.*}} %ptr, i[[SIZE]] {{.*}} %size, i[[SIZE]] allocalign{{.*}} %align, i[[SIZE]] {{.*}} %new_size)
+            panic!()
+        }
+
+        unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 {
+            // CHECK-LABEL: ; __rustc::__rust_alloc_zeroed
+            // CHECK-NEXT: ; Function Attrs: {{.*}}allockind("alloc,zeroed,aligned") allocsize(0){{.*}}
+            // CHECK-NEXT: define{{.*}} noalias{{.*}} ptr @{{.*}}__rust_alloc_zeroed(i[[SIZE]] {{.*}} %size, i[[SIZE]] allocalign{{.*}} %align)
+            panic!()
+        }
+    }
+
+    #[global_allocator]
+    static GLOBAL: Allocator = Allocator;
+}
diff --git a/tests/codegen-llvm/integer-cmp.rs b/tests/codegen-llvm/integer-cmp.rs
index 812fa8e4a42..2233a575f8e 100644
--- a/tests/codegen-llvm/integer-cmp.rs
+++ b/tests/codegen-llvm/integer-cmp.rs
@@ -1,9 +1,6 @@
 // This is test for more optimal Ord implementation for integers.
 // See <https://github.com/rust-lang/rust/issues/63758> for more info.
 
-//@ revisions: llvm-pre-20 llvm-20
-//@ [llvm-20] min-llvm-version: 20
-//@ [llvm-pre-20] max-llvm-major-version: 19
 //@ compile-flags: -C opt-level=3 -Zmerge-functions=disabled
 
 #![crate_type = "lib"]
@@ -13,50 +10,29 @@ use std::cmp::Ordering;
 // CHECK-LABEL: @cmp_signed
 #[no_mangle]
 pub fn cmp_signed(a: i64, b: i64) -> Ordering {
-    // llvm-20: call{{.*}} i8 @llvm.scmp.i8.i64
-    // llvm-pre-20: icmp slt
-    // llvm-pre-20: icmp ne
-    // llvm-pre-20: zext i1
-    // llvm-pre-20: select i1
+    // CHECK: call{{.*}} i8 @llvm.scmp.i8.i64
     a.cmp(&b)
 }
 
 // CHECK-LABEL: @cmp_unsigned
 #[no_mangle]
 pub fn cmp_unsigned(a: u32, b: u32) -> Ordering {
-    // llvm-20: call{{.*}} i8 @llvm.ucmp.i8.i32
-    // llvm-pre-20: icmp ult
-    // llvm-pre-20: icmp ne
-    // llvm-pre-20: zext i1
-    // llvm-pre-20: select i1
+    // CHECK: call{{.*}} i8 @llvm.ucmp.i8.i32
     a.cmp(&b)
 }
 
 // CHECK-LABEL: @cmp_char
 #[no_mangle]
 pub fn cmp_char(a: char, b: char) -> Ordering {
-    // llvm-20: call{{.*}} i8 @llvm.ucmp.i8.i32
-    // llvm-pre-20: icmp ult
-    // llvm-pre-20: icmp ne
-    // llvm-pre-20: zext i1
-    // llvm-pre-20: select i1
+    // CHECK: call{{.*}} i8 @llvm.ucmp.i8.i32
     a.cmp(&b)
 }
 
 // CHECK-LABEL: @cmp_tuple
 #[no_mangle]
 pub fn cmp_tuple(a: (i16, u16), b: (i16, u16)) -> Ordering {
-    // llvm-20-DAG: call{{.*}} i8 @llvm.ucmp.i8.i16
-    // llvm-20-DAG: call{{.*}} i8 @llvm.scmp.i8.i16
-    // llvm-20: ret i8
-    // llvm-pre-20: icmp slt
-    // llvm-pre-20: icmp ne
-    // llvm-pre-20: zext i1
-    // llvm-pre-20: select i1
-    // llvm-pre-20: icmp ult
-    // llvm-pre-20: icmp ne
-    // llvm-pre-20: zext i1
-    // llvm-pre-20: select i1
-    // llvm-pre-20: select i1
+    // CHECK-DAG: call{{.*}} i8 @llvm.ucmp.i8.i16
+    // CHECK-DAG: call{{.*}} i8 @llvm.scmp.i8.i16
+    // CHECK: ret i8
     a.cmp(&b)
 }
diff --git a/tests/codegen-llvm/intrinsic-no-unnamed-attr.rs b/tests/codegen-llvm/intrinsic-no-unnamed-attr.rs
index 4bec579831d..255f20e6ff6 100644
--- a/tests/codegen-llvm/intrinsic-no-unnamed-attr.rs
+++ b/tests/codegen-llvm/intrinsic-no-unnamed-attr.rs
@@ -7,7 +7,5 @@ use std::intrinsics::sqrtf32;
 // CHECK: @llvm.sqrt.f32(float) #{{[0-9]*}}
 
 fn main() {
-    unsafe {
-        sqrtf32(0.0f32);
-    }
+    sqrtf32(0.0f32);
 }
diff --git a/tests/codegen-llvm/intrinsics/three_way_compare.rs b/tests/codegen-llvm/intrinsics/three_way_compare.rs
index 95fcb636f7c..89bf69561e9 100644
--- a/tests/codegen-llvm/intrinsics/three_way_compare.rs
+++ b/tests/codegen-llvm/intrinsics/three_way_compare.rs
@@ -2,7 +2,6 @@
 //@ [DEBUG] compile-flags: -C opt-level=0
 //@ [OPTIM] compile-flags: -C opt-level=3
 //@ compile-flags: -C no-prepopulate-passes
-//@ min-llvm-version: 20
 
 #![crate_type = "lib"]
 #![feature(core_intrinsics)]
diff --git a/tests/codegen-llvm/issues/and-masked-comparison-131162.rs b/tests/codegen-llvm/issues/and-masked-comparison-131162.rs
index bdf021092fd..fc4b0341a31 100644
--- a/tests/codegen-llvm/issues/and-masked-comparison-131162.rs
+++ b/tests/codegen-llvm/issues/and-masked-comparison-131162.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: -Copt-level=3
-//@ min-llvm-version: 20
 
 #![crate_type = "lib"]
 
diff --git a/tests/codegen-llvm/issues/cows-dont-have-branches-117763.rs b/tests/codegen-llvm/issues/cows-dont-have-branches-117763.rs
new file mode 100644
index 00000000000..b97729fa146
--- /dev/null
+++ b/tests/codegen-llvm/issues/cows-dont-have-branches-117763.rs
@@ -0,0 +1,17 @@
+//@ compile-flags: -Copt-level=3
+//@ needs-deterministic-layouts
+
+// Currently Vec<T> and &[T] have layouts that start with (pointer, len)
+// which makes the conversion branchless.
+// A nice-to-have property, not guaranteed.
+#![crate_type = "cdylib"]
+
+// CHECK-LABEL: @branchless_cow_slices
+#[no_mangle]
+pub fn branchless_cow_slices<'a>(cow: &'a std::borrow::Cow<'a, [u8]>) -> &'a [u8] {
+    // CHECK-NOT: br
+    // CHECK-NOT: select
+    // CHECK-NOT: icmp
+    // CHECK: ret { ptr, {{i32|i64}} }
+    &*cow
+}
diff --git a/tests/codegen-llvm/issues/issue-101082.rs b/tests/codegen-llvm/issues/issue-101082.rs
index 8d15921ddb4..0c1f90f951a 100644
--- a/tests/codegen-llvm/issues/issue-101082.rs
+++ b/tests/codegen-llvm/issues/issue-101082.rs
@@ -1,6 +1,5 @@
 //@ compile-flags: -Copt-level=3
 //@ revisions: host x86-64 x86-64-v3
-//@ min-llvm-version: 20
 
 //@[host] ignore-x86_64
 
diff --git a/tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs b/tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs
index 853a1ff36b1..a0b453fac8e 100644
--- a/tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs
+++ b/tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs
@@ -1,4 +1,7 @@
 //@ compile-flags: -Copt-level=3
+//@ revisions: new old
+//@ [old] max-llvm-major-version: 21
+//@ [new] min-llvm-version: 22
 
 #![crate_type = "lib"]
 
@@ -22,8 +25,8 @@ pub unsafe fn update(s: *mut State) {
     // CHECK-NOT: memcpy
     // CHECK-NOT: 75{{3|4}}
 
-    // CHECK: %[[TAG:.+]] = load i8, ptr %s, align 1
-    // CHECK-NEXT: trunc nuw i8 %[[TAG]] to i1
+    // old: %[[TAG:.+]] = load i8, ptr %s, align 1
+    // old-NEXT: trunc nuw i8 %[[TAG]] to i1
 
     // CHECK-NOT: load
     // CHECK-NOT: store
diff --git a/tests/codegen-llvm/issues/issue-129795.rs b/tests/codegen-llvm/issues/issue-129795.rs
index dc64ee35c97..7a928389fab 100644
--- a/tests/codegen-llvm/issues/issue-129795.rs
+++ b/tests/codegen-llvm/issues/issue-129795.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: -Copt-level=3
-//@ min-llvm-version: 20
 #![crate_type = "lib"]
 
 // Ensure that a modulo operation with an operand that is known to be
diff --git a/tests/codegen-llvm/issues/iter-max-no-unwrap-failed-129583.rs b/tests/codegen-llvm/issues/iter-max-no-unwrap-failed-129583.rs
index 4d3fa4993ef..4c4eebeabb5 100644
--- a/tests/codegen-llvm/issues/iter-max-no-unwrap-failed-129583.rs
+++ b/tests/codegen-llvm/issues/iter-max-no-unwrap-failed-129583.rs
@@ -3,7 +3,6 @@
 // use a larger value to prevent unrolling.
 
 //@ compile-flags: -Copt-level=3
-//@ min-llvm-version: 20
 
 #![crate_type = "lib"]
 
diff --git a/tests/codegen-llvm/issues/looping-over-ne-bytes-133528.rs b/tests/codegen-llvm/issues/looping-over-ne-bytes-133528.rs
index 35acf765d69..b686f8c4b3a 100644
--- a/tests/codegen-llvm/issues/looping-over-ne-bytes-133528.rs
+++ b/tests/codegen-llvm/issues/looping-over-ne-bytes-133528.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: -Copt-level=3
-//@ min-llvm-version: 20
 #![crate_type = "lib"]
 
 /// Ensure the function is properly optimized
diff --git a/tests/codegen-llvm/option-niche-eq.rs b/tests/codegen-llvm/option-niche-eq.rs
index 3900cb79aa2..e9c3fa2407e 100644
--- a/tests/codegen-llvm/option-niche-eq.rs
+++ b/tests/codegen-llvm/option-niche-eq.rs
@@ -1,5 +1,4 @@
 //@ revisions: REGULAR LLVM21
-//@ min-llvm-version: 20
 //@ compile-flags: -Copt-level=3 -Zmerge-functions=disabled
 //@ [LLVM21] min-llvm-version: 21
 #![crate_type = "lib"]
diff --git a/tests/codegen-llvm/pattern_type_symbols.rs b/tests/codegen-llvm/pattern_type_symbols.rs
index e86a9ef27de..a90262ff12d 100644
--- a/tests/codegen-llvm/pattern_type_symbols.rs
+++ b/tests/codegen-llvm/pattern_type_symbols.rs
@@ -16,7 +16,7 @@ pub fn bar() {
     // CHECK: call pattern_type_symbols::foo::<u32>
     // CHECK: call void @_RINvC[[CRATE_IDENT:[a-zA-Z0-9]{12}]]_20pattern_type_symbols3foomEB2_
     foo::<u32>();
-    // CHECK: call pattern_type_symbols::foo::<(u32, [(); 0], [(); 999999999])>
-    // CHECK: call void @_RINvC[[CRATE_IDENT]]_20pattern_type_symbols3fooTmAum0_Aum3b9ac9ff_EEB2_
+    // CHECK: call pattern_type_symbols::foo::<u32 is 0..=999999999>
+    // CHECK: call void @_RINvC[[CRATE_IDENT]]_20pattern_type_symbols3fooWmRm0_m3b9ac9ff_EB2_
     foo::<NanoU32>();
 }
diff --git a/tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs b/tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs
index 561f081c700..ffff4b35994 100644
--- a/tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs
+++ b/tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs
@@ -1,15 +1,19 @@
+//@ add-core-stubs
 //@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
 //@ revisions: riscv64 loongarch64
 
-//@[riscv64] only-riscv64
 //@[riscv64] compile-flags: --target riscv64gc-unknown-linux-gnu
 //@[riscv64] needs-llvm-components: riscv
 
-//@[loongarch64] only-loongarch64
 //@[loongarch64] compile-flags: --target loongarch64-unknown-linux-gnu
 //@[loongarch64] needs-llvm-components: loongarch
 
 #![crate_type = "lib"]
+#![feature(no_core)]
+#![no_core]
+
+extern crate minicore;
+use minicore::*;
 
 #[no_mangle]
 // riscv64:     define noundef i8 @arg_attr_u8(i8 noundef zeroext %x)
diff --git a/tests/codegen-llvm/slice-last-elements-optimization.rs b/tests/codegen-llvm/slice-last-elements-optimization.rs
index d982cda709d..77fc1d21cd9 100644
--- a/tests/codegen-llvm/slice-last-elements-optimization.rs
+++ b/tests/codegen-llvm/slice-last-elements-optimization.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: -Copt-level=3
-//@ min-llvm-version: 20
 #![crate_type = "lib"]
 
 // This test verifies that LLVM 20 properly optimizes the bounds check
diff --git a/tests/codegen-llvm/swap-small-types.rs b/tests/codegen-llvm/swap-small-types.rs
index 7aa613ae9c2..0799ff76331 100644
--- a/tests/codegen-llvm/swap-small-types.rs
+++ b/tests/codegen-llvm/swap-small-types.rs
@@ -1,6 +1,5 @@
 //@ compile-flags: -Copt-level=3 -Z merge-functions=disabled
 //@ only-x86_64
-//@ min-llvm-version: 20
 //@ ignore-std-debug-assertions (`ptr::swap_nonoverlapping` has one which blocks some optimizations)
 
 #![crate_type = "lib"]
diff --git a/tests/codegen-llvm/try_question_mark_nop.rs b/tests/codegen-llvm/try_question_mark_nop.rs
index 398c9a580bc..a09fa0a4901 100644
--- a/tests/codegen-llvm/try_question_mark_nop.rs
+++ b/tests/codegen-llvm/try_question_mark_nop.rs
@@ -1,9 +1,6 @@
 //@ compile-flags: -Copt-level=3 -Z merge-functions=disabled
 //@ edition: 2021
 //@ only-x86_64
-//@ revisions: NINETEEN TWENTY
-//@[NINETEEN] exact-llvm-major-version: 19
-//@[TWENTY] min-llvm-version: 20
 
 #![crate_type = "lib"]
 #![feature(try_blocks)]
@@ -17,13 +14,9 @@ pub fn option_nop_match_32(x: Option<u32>) -> Option<u32> {
     // CHECK: start:
     // CHECK-NEXT: [[TRUNC:%.*]] = trunc nuw i32 %0 to i1
 
-    // NINETEEN-NEXT: [[SELECT:%.*]] = select i1 [[TRUNC]], i32 %0, i32 0
-    // NINETEEN-NEXT: [[REG2:%.*]] = insertvalue { i32, i32 } poison, i32 [[SELECT]], 0
-    // NINETEEN-NEXT: [[REG3:%.*]] = insertvalue { i32, i32 } [[REG2]], i32 %1, 1
-
-    // TWENTY-NEXT: [[SELECT:%.*]] = select i1 [[TRUNC]], i32 %1, i32 undef
-    // TWENTY-NEXT: [[REG2:%.*]] = insertvalue { i32, i32 } poison, i32 %0, 0
-    // TWENTY-NEXT: [[REG3:%.*]] = insertvalue { i32, i32 } [[REG2]], i32 [[SELECT]], 1
+    // CHECK-NEXT: [[SELECT:%.*]] = select i1 [[TRUNC]], i32 %1, i32 undef
+    // CHECK-NEXT: [[REG2:%.*]] = insertvalue { i32, i32 } poison, i32 %0, 0
+    // CHECK-NEXT: [[REG3:%.*]] = insertvalue { i32, i32 } [[REG2]], i32 [[SELECT]], 1
 
     // CHECK-NEXT: ret { i32, i32 } [[REG3]]
     match x {
@@ -36,8 +29,8 @@ pub fn option_nop_match_32(x: Option<u32>) -> Option<u32> {
 #[no_mangle]
 pub fn option_nop_traits_32(x: Option<u32>) -> Option<u32> {
     // CHECK: start:
-    // TWENTY-NEXT: %[[IS_SOME:.+]] = trunc nuw i32 %0 to i1
-    // TWENTY-NEXT: select i1 %[[IS_SOME]], i32 %1, i32 undef
+    // CHECK-NEXT: %[[IS_SOME:.+]] = trunc nuw i32 %0 to i1
+    // CHECK-NEXT: select i1 %[[IS_SOME]], i32 %1, i32 undef
     // CHECK-NEXT: insertvalue { i32, i32 }
     // CHECK-NEXT: insertvalue { i32, i32 }
     // CHECK-NEXT: ret { i32, i32 }
@@ -96,13 +89,9 @@ pub fn option_nop_match_64(x: Option<u64>) -> Option<u64> {
     // CHECK: start:
     // CHECK-NEXT: [[TRUNC:%.*]] = trunc nuw i64 %0 to i1
 
-    // NINETEEN-NEXT: [[SELECT:%.*]] = select i1 [[TRUNC]], i64 %0, i64 0
-    // NINETEEN-NEXT: [[REG2:%.*]] = insertvalue { i64, i64 } poison, i64 [[SELECT]], 0
-    // NINETEEN-NEXT: [[REG3:%.*]] = insertvalue { i64, i64 } [[REG2]], i64 %1, 1
-
-    // TWENTY-NEXT: [[SELECT:%.*]] = select i1 [[TRUNC]], i64 %1, i64 undef
-    // TWENTY-NEXT: [[REG2:%.*]] = insertvalue { i64, i64 } poison, i64 %0, 0
-    // TWENTY-NEXT: [[REG3:%.*]] = insertvalue { i64, i64 } [[REG2]], i64 [[SELECT]], 1
+    // CHECK-NEXT: [[SELECT:%.*]] = select i1 [[TRUNC]], i64 %1, i64 undef
+    // CHECK-NEXT: [[REG2:%.*]] = insertvalue { i64, i64 } poison, i64 %0, 0
+    // CHECK-NEXT: [[REG3:%.*]] = insertvalue { i64, i64 } [[REG2]], i64 [[SELECT]], 1
 
     // CHECK-NEXT: ret { i64, i64 } [[REG3]]
     match x {
@@ -115,8 +104,8 @@ pub fn option_nop_match_64(x: Option<u64>) -> Option<u64> {
 #[no_mangle]
 pub fn option_nop_traits_64(x: Option<u64>) -> Option<u64> {
     // CHECK: start:
-    // TWENTY-NEXT: %[[TRUNC:[0-9]+]] = trunc nuw i64 %0 to i1
-    // TWENTY-NEXT: %[[SEL:\.[0-9]+]] = select i1 %[[TRUNC]], i64 %1, i64 undef
+    // CHECK-NEXT: %[[TRUNC:[0-9]+]] = trunc nuw i64 %0 to i1
+    // CHECK-NEXT: %[[SEL:\.[0-9]+]] = select i1 %[[TRUNC]], i64 %1, i64 undef
     // CHECK-NEXT: insertvalue { i64, i64 }
     // CHECK-NEXT: insertvalue { i64, i64 }
     // CHECK-NEXT: ret { i64, i64 }
diff --git a/tests/codegen-llvm/union-aggregate.rs b/tests/codegen-llvm/union-aggregate.rs
index aac66c5dcdd..7faa66804fe 100644
--- a/tests/codegen-llvm/union-aggregate.rs
+++ b/tests/codegen-llvm/union-aggregate.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: -Copt-level=0 -Cno-prepopulate-passes
-//@ min-llvm-version: 19
 //@ only-64bit
 
 #![crate_type = "lib"]
diff --git a/tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs b/tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs
index 8d2745ba2f7..2ce1d1b2e00 100644
--- a/tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs
+++ b/tests/codegen-llvm/unwind-abis/c-unwind-abi-panic-abort.rs
@@ -1,4 +1,9 @@
 //@ compile-flags: -C panic=abort
+//@ revisions: NONWASM WASM WASMEXN
+//@ [NONWASM] ignore-wasm32
+//@ [WASM] only-wasm32
+//@ [WASMEXN] only-wasm32
+//@ [WASMEXN] compile-flags: -Ctarget-feature=+exception-handling
 
 // Test that `nounwind` attributes are also applied to extern `C-unwind` Rust functions
 // when the code is compiled with `panic=abort`.
@@ -9,7 +14,9 @@
 #[no_mangle]
 pub unsafe extern "C-unwind" fn rust_item_that_can_unwind() {
     // Handle both legacy and v0 symbol mangling.
-    // CHECK: call void @{{.*core9panicking19panic_cannot_unwind}}
+    // NONWASM: call void @{{.*core9panicking19panic_cannot_unwind}}
+    // WASMEXN: call void @{{.*core9panicking19panic_cannot_unwind}}
+    // WASM-NOT: call void @{{.*core9panicking19panic_cannot_unwind}}
     may_unwind();
 }
 
diff --git a/tests/codegen-llvm/unwind-and-panic-abort.rs b/tests/codegen-llvm/unwind-and-panic-abort.rs
index 8efa140058a..c2838be00af 100644
--- a/tests/codegen-llvm/unwind-and-panic-abort.rs
+++ b/tests/codegen-llvm/unwind-and-panic-abort.rs
@@ -1,4 +1,9 @@
 //@ compile-flags: -C panic=abort
+//@ revisions: NONWASM WASM WASMEXN
+//@ [NONWASM] ignore-wasm32
+//@ [WASM] only-wasm32
+//@ [WASMEXN] only-wasm32
+//@ [WASMEXN] compile-flags: -Ctarget-feature=+exception-handling
 
 #![crate_type = "lib"]
 
@@ -9,7 +14,9 @@ extern "C-unwind" {
 // CHECK: Function Attrs:{{.*}}nounwind
 // CHECK-NEXT: define{{.*}}void @foo
 // Handle both legacy and v0 symbol mangling.
-// CHECK: call void @{{.*core9panicking19panic_cannot_unwind}}
+// NONWASM: call void @{{.*core9panicking19panic_cannot_unwind}}
+// WASMEXN: call void @{{.*core9panicking19panic_cannot_unwind}}
+// WASM-NOT: call void @{{.*core9panicking19panic_cannot_unwind}}
 #[no_mangle]
 pub unsafe extern "C" fn foo() {
     bar();
diff --git a/tests/codegen-llvm/vec_pop_push_noop.rs b/tests/codegen-llvm/vec_pop_push_noop.rs
index 3e375219fe0..977c220b3ba 100644
--- a/tests/codegen-llvm/vec_pop_push_noop.rs
+++ b/tests/codegen-llvm/vec_pop_push_noop.rs
@@ -1,4 +1,7 @@
 //@ compile-flags: -Copt-level=3
+//@ revisions: new old
+//@ [old] max-llvm-major-version: 21
+//@ [new] min-llvm-version: 22
 
 #![crate_type = "lib"]
 
@@ -7,7 +10,7 @@
 pub fn noop(v: &mut Vec<u8>) {
     // CHECK-NOT: grow_one
     // CHECK-NOT: call
-    // CHECK: tail call void @llvm.assume
+    // old: tail call void @llvm.assume
     // CHECK-NOT: grow_one
     // CHECK-NOT: call
     // CHECK: {{ret|[}]}}
diff --git a/tests/codegen-llvm/vecdeque_pop_push.rs b/tests/codegen-llvm/vecdeque_pop_push.rs
index 5afa1b2248b..6f9ad6674d6 100644
--- a/tests/codegen-llvm/vecdeque_pop_push.rs
+++ b/tests/codegen-llvm/vecdeque_pop_push.rs
@@ -1,4 +1,7 @@
 //@ compile-flags: -Copt-level=3
+//@ revisions: new old
+//@ [old] max-llvm-major-version: 21
+//@ [new] min-llvm-version: 22
 
 #![crate_type = "lib"]
 
@@ -8,7 +11,7 @@ use std::collections::VecDeque;
 // CHECK-LABEL: @noop_back(
 pub fn noop_back(v: &mut VecDeque<u8>) {
     // CHECK-NOT: grow
-    // CHECK: tail call void @llvm.assume
+    // old: tail call void @llvm.assume
     // CHECK-NOT: grow
     // CHECK: ret
     if let Some(x) = v.pop_back() {
diff --git a/tests/codegen-llvm/wasm_exceptions.rs b/tests/codegen-llvm/wasm_exceptions.rs
index 796b69b722b..e718f599a3c 100644
--- a/tests/codegen-llvm/wasm_exceptions.rs
+++ b/tests/codegen-llvm/wasm_exceptions.rs
@@ -1,8 +1,9 @@
 //@ only-wasm32
-//@ compile-flags: -C panic=unwind -Z emscripten-wasm-eh
+//@ revisions: WASM WASMEXN
+//@ [WASMEXN] compile-flags: -C panic=unwind -Z emscripten-wasm-eh
 
 #![crate_type = "lib"]
-#![feature(core_intrinsics, wasm_exception_handling_intrinsics)]
+#![feature(core_intrinsics, wasm_exception_handling_intrinsics, link_llvm_intrinsics)]
 
 extern "C-unwind" {
     fn may_panic();
@@ -22,7 +23,8 @@ impl Drop for LogOnDrop {
     }
 }
 
-// CHECK-LABEL: @test_cleanup() {{.*}} @__gxx_wasm_personality_v0
+// WASM-LABEL: @test_cleanup() {{.*}}
+// WASMEXN-LABEL: @test_cleanup() {{.*}} @__gxx_wasm_personality_v0
 #[no_mangle]
 pub fn test_cleanup() {
     let _log_on_drop = LogOnDrop;
@@ -30,12 +32,16 @@ pub fn test_cleanup() {
         may_panic();
     }
 
-    // CHECK-NOT: call
-    // CHECK: invoke void @may_panic()
-    // CHECK: %cleanuppad = cleanuppad within none []
+    // WASMEXN-NOT: call
+    // WASMEXN: invoke void @may_panic()
+    // WASMEXN: %cleanuppad = cleanuppad within none []
+    //
+    // WASM: call void @may_panic()
+    // WASM-NOT: invoke void @may_panic()
 }
 
-// CHECK-LABEL: @test_rtry() {{.*}} @__gxx_wasm_personality_v0
+// WASM-LABEL: @test_rtry() {{.*}}
+// WASMEXN-LABEL: @test_rtry() {{.*}} @__gxx_wasm_personality_v0
 #[no_mangle]
 pub fn test_rtry() {
     unsafe {
@@ -51,23 +57,40 @@ pub fn test_rtry() {
         );
     }
 
-    // CHECK-NOT: call
-    // CHECK: invoke void @may_panic()
-    // CHECK: {{.*}} = catchswitch within none [label {{.*}}] unwind to caller
-    // CHECK: {{.*}} = catchpad within {{.*}} [ptr null]
-    // CHECK: catchret
+    // WASMEXN-NOT: call
+    // WASMEXN: invoke void @may_panic()
+    // WASMEXN: {{.*}} = catchswitch within none [label {{.*}}] unwind to caller
+    // WASMEXN: {{.*}} = catchpad within {{.*}} [ptr null]
+    // WASMEXN: catchret
+
+    // WASM: call void @may_panic()
+    // WASM-NOT: invoke void @may_panic()
+    // WASM-NOT: catchswitch
+    // WASM-NOT: catchpad
+    // WASM-NOT: catchret
 }
 
 // Make sure the intrinsic is not inferred as nounwind. This is a regression test for #132416.
-// CHECK-LABEL: @test_intrinsic() {{.*}} @__gxx_wasm_personality_v0
+//
+// Note that this test uses the raw `wasm_throw` intrinsic because the one from
+// libstd was built with `-Cpanic=abort` and it's technically not valid to use
+// when this crate is compiled with `-Cpanic=unwind`.
+//
+// WASMEXN-LABEL: @test_intrinsic() {{.*}} @__gxx_wasm_personality_v0
 #[no_mangle]
+#[cfg(wasmexn)]
 pub fn test_intrinsic() {
     let _log_on_drop = LogOnDrop;
+
+    unsafe extern "C-unwind" {
+        #[link_name = "llvm.wasm.throw"]
+        fn wasm_throw(tag: i32, ptr: *mut u8) -> !;
+    }
     unsafe {
-        core::arch::wasm32::throw::<0>(core::ptr::null_mut());
+        wasm_throw(0, core::ptr::null_mut());
     }
 
-    // CHECK-NOT: call
-    // CHECK: invoke void @llvm.wasm.throw(i32 noundef 0, ptr noundef null)
-    // CHECK: %cleanuppad = cleanuppad within none []
+    // WASMEXN-NOT: call
+    // WASMEXN: invoke void @llvm.wasm.throw(i32 noundef 0, ptr noundef null)
+    // WASMEXN: %cleanuppad = cleanuppad within none []
 }
diff --git a/tests/coverage/issue-83601.cov-map b/tests/coverage/issue-83601.cov-map
index d1d751ff24b..e42b5591c0f 100644
--- a/tests/coverage/issue-83601.cov-map
+++ b/tests/coverage/issue-83601.cov-map
@@ -1,30 +1,22 @@
 Function name: issue_83601::main
-Raw bytes (76): 0x[01, 01, 01, 05, 09, 0e, 01, 06, 01, 00, 0a, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 05, 01, 09, 00, 0c, 05, 00, 0f, 00, 15, 05, 01, 05, 00, 0f, 02, 01, 05, 00, 0d, 02, 00, 0e, 00, 14, 02, 01, 05, 00, 0d, 02, 00, 0e, 00, 14, 02, 01, 05, 00, 0d, 02, 00, 0e, 00, 14, 02, 01, 01, 00, 02]
+Raw bytes (74): 0x[01, 01, 00, 0e, 01, 06, 01, 00, 0a, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 01, 01, 00, 02]
 Number of files: 1
 - file 0 => $DIR/issue-83601.rs
-Number of expressions: 1
-- expression 0 operands: lhs = Counter(1), rhs = Counter(2)
+Number of expressions: 0
 Number of file 0 mappings: 14
 - Code(Counter(0)) at (prev + 6, 1) to (start + 0, 10)
 - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12)
 - Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21)
 - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
-- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 12)
-- Code(Counter(1)) at (prev + 0, 15) to (start + 0, 21)
-- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 15)
-- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 13)
-    = (c1 - c2)
-- Code(Expression(0, Sub)) at (prev + 0, 14) to (start + 0, 20)
-    = (c1 - c2)
-- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 13)
-    = (c1 - c2)
-- Code(Expression(0, Sub)) at (prev + 0, 14) to (start + 0, 20)
-    = (c1 - c2)
-- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 13)
-    = (c1 - c2)
-- Code(Expression(0, Sub)) at (prev + 0, 14) to (start + 0, 20)
-    = (c1 - c2)
-- Code(Expression(0, Sub)) at (prev + 1, 1) to (start + 0, 2)
-    = (c1 - c2)
-Highest counter ID seen: c1
+- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12)
+- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
+- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
+- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
+- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
+- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2)
+Highest counter ID seen: c0
 
diff --git a/tests/coverage/issue-84561.cov-map b/tests/coverage/issue-84561.cov-map
index 2b643ea599e..e5bb1afdcc2 100644
--- a/tests/coverage/issue-84561.cov-map
+++ b/tests/coverage/issue-84561.cov-map
@@ -73,20 +73,20 @@ Number of file 0 mappings: 4
 Highest counter ID seen: c0
 
 Function name: issue_84561::test3
-Raw bytes (409): 0x[01, 01, 0a, 0d, 11, 0d, 15, 0d, 19, 1d, 21, 29, 2d, 25, 29, 25, 29, 25, 29, 27, 31, 29, 2d, 4d, 01, 08, 01, 00, 0b, 01, 01, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 05, 01, 09, 00, 0c, 05, 00, 0f, 00, 15, 05, 01, 05, 00, 0f, 09, 01, 05, 00, 0d, 09, 00, 0e, 00, 14, 09, 01, 05, 00, 0d, 09, 00, 0e, 00, 14, 09, 01, 05, 00, 0d, 09, 00, 0e, 00, 14, 09, 02, 05, 00, 0f, 09, 01, 05, 00, 0f, 09, 01, 05, 00, 0f, 09, 01, 09, 00, 0c, 09, 00, 0f, 00, 15, 09, 01, 05, 00, 0f, 0d, 01, 05, 00, 0f, 0d, 01, 05, 00, 0f, 00, 00, 20, 00, 30, 0d, 01, 05, 00, 0d, 0d, 00, 0e, 00, 14, 0d, 01, 05, 00, 0d, 0d, 00, 0e, 00, 14, 0d, 02, 05, 00, 0f, 00, 00, 20, 00, 24, 00, 00, 29, 00, 30, 00, 00, 33, 00, 41, 00, 00, 4b, 00, 5a, 0d, 01, 05, 00, 0f, 00, 05, 09, 00, 0d, 00, 03, 09, 00, 10, 00, 02, 0d, 00, 1b, 00, 02, 0d, 00, 1c, 0d, 04, 09, 00, 10, 0d, 00, 13, 00, 2e, 0d, 02, 05, 00, 0f, 0d, 04, 05, 00, 0f, 0d, 04, 05, 00, 0f, 0d, 04, 09, 00, 0c, 0d, 00, 0f, 00, 15, 0d, 01, 05, 00, 0f, 0d, 04, 08, 00, 0f, 11, 01, 09, 00, 13, 02, 05, 09, 00, 13, 0d, 05, 08, 00, 0f, 15, 01, 09, 00, 13, 00, 03, 0d, 00, 1d, 06, 03, 09, 00, 13, 00, 03, 0d, 00, 1d, 0d, 03, 05, 00, 0f, 0d, 01, 0c, 00, 13, 19, 01, 0d, 00, 13, 0a, 02, 0d, 00, 13, 1d, 04, 05, 00, 0f, 1d, 02, 0c, 00, 13, 21, 01, 0d, 00, 13, 0e, 02, 0d, 00, 13, 27, 03, 05, 00, 0f, 25, 01, 0c, 00, 13, 29, 01, 0d, 00, 17, 29, 04, 0d, 00, 13, 1e, 02, 0d, 00, 17, 1e, 01, 14, 00, 1b, 00, 01, 15, 00, 1b, 1e, 02, 15, 00, 1b, 2d, 04, 0d, 00, 13, 22, 03, 09, 00, 19, 31, 02, 05, 00, 0f, 31, 03, 09, 00, 22, 00, 02, 05, 00, 0f, 00, 03, 09, 00, 2c, 00, 02, 01, 00, 02]
+Raw bytes (409): 0x[01, 01, 0a, 01, 05, 01, 09, 01, 0d, 11, 15, 1d, 21, 19, 1d, 19, 1d, 19, 1d, 27, 25, 1d, 21, 4d, 01, 08, 01, 00, 0b, 01, 01, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 02, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0f, 00, 00, 20, 00, 30, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 14, 01, 02, 05, 00, 0f, 00, 00, 20, 00, 24, 00, 00, 29, 00, 30, 00, 00, 33, 00, 41, 00, 00, 4b, 00, 5a, 01, 01, 05, 00, 0f, 00, 05, 09, 00, 0d, 00, 03, 09, 00, 10, 00, 02, 0d, 00, 1b, 00, 02, 0d, 00, 1c, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 02, 05, 00, 0f, 01, 04, 05, 00, 0f, 01, 04, 05, 00, 0f, 01, 04, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 04, 08, 00, 0f, 05, 01, 09, 00, 13, 02, 05, 09, 00, 13, 01, 05, 08, 00, 0f, 09, 01, 09, 00, 13, 00, 03, 0d, 00, 1d, 06, 03, 09, 00, 13, 00, 03, 0d, 00, 1d, 01, 03, 05, 00, 0f, 01, 01, 0c, 00, 13, 0d, 01, 0d, 00, 13, 0a, 02, 0d, 00, 13, 11, 04, 05, 00, 0f, 11, 02, 0c, 00, 13, 15, 01, 0d, 00, 13, 0e, 02, 0d, 00, 13, 27, 03, 05, 00, 0f, 19, 01, 0c, 00, 13, 1d, 01, 0d, 00, 17, 1d, 04, 0d, 00, 13, 1e, 02, 0d, 00, 17, 1e, 01, 14, 00, 1b, 00, 01, 15, 00, 1b, 1e, 02, 15, 00, 1b, 21, 04, 0d, 00, 13, 22, 03, 09, 00, 19, 25, 02, 05, 00, 0f, 25, 03, 09, 00, 22, 00, 02, 05, 00, 0f, 00, 03, 09, 00, 2c, 00, 02, 01, 00, 02]
 Number of files: 1
 - file 0 => $DIR/issue-84561.rs
 Number of expressions: 10
-- expression 0 operands: lhs = Counter(3), rhs = Counter(4)
-- expression 1 operands: lhs = Counter(3), rhs = Counter(5)
-- expression 2 operands: lhs = Counter(3), rhs = Counter(6)
-- expression 3 operands: lhs = Counter(7), rhs = Counter(8)
-- expression 4 operands: lhs = Counter(10), rhs = Counter(11)
-- expression 5 operands: lhs = Counter(9), rhs = Counter(10)
-- expression 6 operands: lhs = Counter(9), rhs = Counter(10)
-- expression 7 operands: lhs = Counter(9), rhs = Counter(10)
-- expression 8 operands: lhs = Expression(9, Add), rhs = Counter(12)
-- expression 9 operands: lhs = Counter(10), rhs = Counter(11)
+- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
+- expression 1 operands: lhs = Counter(0), rhs = Counter(2)
+- expression 2 operands: lhs = Counter(0), rhs = Counter(3)
+- expression 3 operands: lhs = Counter(4), rhs = Counter(5)
+- expression 4 operands: lhs = Counter(7), rhs = Counter(8)
+- expression 5 operands: lhs = Counter(6), rhs = Counter(7)
+- expression 6 operands: lhs = Counter(6), rhs = Counter(7)
+- expression 7 operands: lhs = Counter(6), rhs = Counter(7)
+- expression 8 operands: lhs = Expression(9, Add), rhs = Counter(9)
+- expression 9 operands: lhs = Counter(7), rhs = Counter(8)
 Number of file 0 mappings: 77
 - Code(Counter(0)) at (prev + 8, 1) to (start + 0, 11)
 - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16)
@@ -94,85 +94,85 @@ Number of file 0 mappings: 77
 - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12)
 - Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21)
 - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
-- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 12)
-- Code(Counter(1)) at (prev + 0, 15) to (start + 0, 21)
-- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 15)
-- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 13)
-- Code(Counter(2)) at (prev + 0, 14) to (start + 0, 20)
-- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 13)
-- Code(Counter(2)) at (prev + 0, 14) to (start + 0, 20)
-- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 13)
-- Code(Counter(2)) at (prev + 0, 14) to (start + 0, 20)
-- Code(Counter(2)) at (prev + 2, 5) to (start + 0, 15)
-- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 15)
-- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 15)
-- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 12)
-- Code(Counter(2)) at (prev + 0, 15) to (start + 0, 21)
-- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 15)
-- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 15)
-- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12)
+- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
+- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
+- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
+- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
+- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12)
+- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
 - Code(Zero) at (prev + 0, 32) to (start + 0, 48)
-- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 13)
-- Code(Counter(3)) at (prev + 0, 14) to (start + 0, 20)
-- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 13)
-- Code(Counter(3)) at (prev + 0, 14) to (start + 0, 20)
-- Code(Counter(3)) at (prev + 2, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
+- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13)
+- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 20)
+- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15)
 - Code(Zero) at (prev + 0, 32) to (start + 0, 36)
 - Code(Zero) at (prev + 0, 41) to (start + 0, 48)
 - Code(Zero) at (prev + 0, 51) to (start + 0, 65)
 - Code(Zero) at (prev + 0, 75) to (start + 0, 90)
-- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
 - Code(Zero) at (prev + 5, 9) to (start + 0, 13)
 - Code(Zero) at (prev + 3, 9) to (start + 0, 16)
 - Code(Zero) at (prev + 2, 13) to (start + 0, 27)
 - Code(Zero) at (prev + 2, 13) to (start + 0, 28)
-- Code(Counter(3)) at (prev + 4, 9) to (start + 0, 16)
-- Code(Counter(3)) at (prev + 0, 19) to (start + 0, 46)
-- Code(Counter(3)) at (prev + 2, 5) to (start + 0, 15)
-- Code(Counter(3)) at (prev + 4, 5) to (start + 0, 15)
-- Code(Counter(3)) at (prev + 4, 5) to (start + 0, 15)
-- Code(Counter(3)) at (prev + 4, 9) to (start + 0, 12)
-- Code(Counter(3)) at (prev + 0, 15) to (start + 0, 21)
-- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 15)
-- Code(Counter(3)) at (prev + 4, 8) to (start + 0, 15)
-- Code(Counter(4)) at (prev + 1, 9) to (start + 0, 19)
+- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16)
+- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46)
+- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 12)
+- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21)
+- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 4, 8) to (start + 0, 15)
+- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 19)
 - Code(Expression(0, Sub)) at (prev + 5, 9) to (start + 0, 19)
-    = (c3 - c4)
-- Code(Counter(3)) at (prev + 5, 8) to (start + 0, 15)
-- Code(Counter(5)) at (prev + 1, 9) to (start + 0, 19)
+    = (c0 - c1)
+- Code(Counter(0)) at (prev + 5, 8) to (start + 0, 15)
+- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 19)
 - Code(Zero) at (prev + 3, 13) to (start + 0, 29)
 - Code(Expression(1, Sub)) at (prev + 3, 9) to (start + 0, 19)
-    = (c3 - c5)
+    = (c0 - c2)
 - Code(Zero) at (prev + 3, 13) to (start + 0, 29)
-- Code(Counter(3)) at (prev + 3, 5) to (start + 0, 15)
-- Code(Counter(3)) at (prev + 1, 12) to (start + 0, 19)
-- Code(Counter(6)) at (prev + 1, 13) to (start + 0, 19)
+- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 15)
+- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 19)
+- Code(Counter(3)) at (prev + 1, 13) to (start + 0, 19)
 - Code(Expression(2, Sub)) at (prev + 2, 13) to (start + 0, 19)
-    = (c3 - c6)
-- Code(Counter(7)) at (prev + 4, 5) to (start + 0, 15)
-- Code(Counter(7)) at (prev + 2, 12) to (start + 0, 19)
-- Code(Counter(8)) at (prev + 1, 13) to (start + 0, 19)
+    = (c0 - c3)
+- Code(Counter(4)) at (prev + 4, 5) to (start + 0, 15)
+- Code(Counter(4)) at (prev + 2, 12) to (start + 0, 19)
+- Code(Counter(5)) at (prev + 1, 13) to (start + 0, 19)
 - Code(Expression(3, Sub)) at (prev + 2, 13) to (start + 0, 19)
-    = (c7 - c8)
+    = (c4 - c5)
 - Code(Expression(9, Add)) at (prev + 3, 5) to (start + 0, 15)
-    = (c10 + c11)
-- Code(Counter(9)) at (prev + 1, 12) to (start + 0, 19)
-- Code(Counter(10)) at (prev + 1, 13) to (start + 0, 23)
-- Code(Counter(10)) at (prev + 4, 13) to (start + 0, 19)
+    = (c7 + c8)
+- Code(Counter(6)) at (prev + 1, 12) to (start + 0, 19)
+- Code(Counter(7)) at (prev + 1, 13) to (start + 0, 23)
+- Code(Counter(7)) at (prev + 4, 13) to (start + 0, 19)
 - Code(Expression(7, Sub)) at (prev + 2, 13) to (start + 0, 23)
-    = (c9 - c10)
+    = (c6 - c7)
 - Code(Expression(7, Sub)) at (prev + 1, 20) to (start + 0, 27)
-    = (c9 - c10)
+    = (c6 - c7)
 - Code(Zero) at (prev + 1, 21) to (start + 0, 27)
 - Code(Expression(7, Sub)) at (prev + 2, 21) to (start + 0, 27)
-    = (c9 - c10)
-- Code(Counter(11)) at (prev + 4, 13) to (start + 0, 19)
+    = (c6 - c7)
+- Code(Counter(8)) at (prev + 4, 13) to (start + 0, 19)
 - Code(Expression(8, Sub)) at (prev + 3, 9) to (start + 0, 25)
-    = ((c10 + c11) - c12)
-- Code(Counter(12)) at (prev + 2, 5) to (start + 0, 15)
-- Code(Counter(12)) at (prev + 3, 9) to (start + 0, 34)
+    = ((c7 + c8) - c9)
+- Code(Counter(9)) at (prev + 2, 5) to (start + 0, 15)
+- Code(Counter(9)) at (prev + 3, 9) to (start + 0, 34)
 - Code(Zero) at (prev + 2, 5) to (start + 0, 15)
 - Code(Zero) at (prev + 3, 9) to (start + 0, 44)
 - Code(Zero) at (prev + 2, 1) to (start + 0, 2)
-Highest counter ID seen: c12
+Highest counter ID seen: c9
 
diff --git a/tests/crashes/117808.rs b/tests/crashes/117808.rs
deleted file mode 100644
index 2c727986dd0..00000000000
--- a/tests/crashes/117808.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-//@ known-bug: #117808
-//@ edition:2021
-//@ needs-rustc-debug-assertions
-
-use std::future::Future;
-
-fn hrc<R, F: for<'a> AsyncClosure<'a, (), R>>(f: F) -> F {
-    f
-}
-
-fn main() {
-    hrc(|x| async {});
-}
-
-trait AsyncClosure<'a, I, R>
-where
-    I: 'a,
-{
-}
-
-impl<'a, I, R, Fut, F> AsyncClosure<'a, I, R> for F
-where
-    I: 'a,
-    F: Fn(&'a I) -> Fut,
-    Fut: Future<Output = R> + Send + 'a,
-{
-}
diff --git a/tests/crashes/120016.rs b/tests/crashes/120016.rs
index 7eda330e7ad..12f54dbc3d9 100644
--- a/tests/crashes/120016.rs
+++ b/tests/crashes/120016.rs
@@ -1,19 +1,19 @@
 //@ known-bug: #120016
-//@ compile-flags: -Zcrate-attr=feature(const_async_blocks)
+//@ compile-flags: -Zvalidate-mir
 //@ edition: 2021
 
-#![feature(type_alias_impl_trait, const_async_blocks)]
+#![feature(type_alias_impl_trait)]
 
 struct Bug {
     V1: [(); {
-        type F = impl std::future::Future<Output = impl Sized>;
+        type F = impl Sized;
         #[define_opaque(F)]
         fn concrete_use() -> F {
-            //~^ ERROR to be a future that resolves to `u8`, but it resolves to `()`
-            async {}
+            //~^ ERROR
+            1i32
         }
-        let f: F = async { 1 };
-        //~^ ERROR `async` blocks are not allowed in constants
+        let f: F = 0u32;
+
         1
     }],
 }
diff --git a/tests/crashes/120175.rs b/tests/crashes/120175.rs
index e441454bed2..e06da5a8e0a 100644
--- a/tests/crashes/120175.rs
+++ b/tests/crashes/120175.rs
@@ -1,5 +1,6 @@
 //@ known-bug: #120175
 //@ needs-rustc-debug-assertions
+//@ ignore-apple (raw-dylib doesn't work on Apple targets yet)
 
 #![feature(extern_types)]
 #![feature(raw_dylib_elf)]
diff --git a/tests/crashes/122904-2.rs b/tests/crashes/122904-2.rs
deleted file mode 100644
index db66b8625db..00000000000
--- a/tests/crashes/122904-2.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-//@ known-bug: #122904
-trait T {}
-
-type Alias<'a> = impl T;
-
-struct S;
-impl<'a> T for &'a S {}
-
-#[define_opaque(Alias)]
-fn with_positive(fun: impl Fn(Alias<'_>)) {
-    with_positive(|&n| ());
-}
-
-#[define_opaque(Alias)]
-fn main(Alias<'_>) {
-    with_positive(|&a| ());
-}
diff --git a/tests/crashes/125772.rs b/tests/crashes/125772.rs
index 2965cfc9e7c..2b6cffd9463 100644
--- a/tests/crashes/125772.rs
+++ b/tests/crashes/125772.rs
@@ -1,5 +1,5 @@
 //@ known-bug: rust-lang/rust#125772
-//@ only-x86_64
+//@ only-64bit
 #![feature(generic_const_exprs)]
 
 struct Outer<const A: i64, const B: i64>();
diff --git a/tests/crashes/129095.rs b/tests/crashes/129095.rs
deleted file mode 100644
index b1bb74708c2..00000000000
--- a/tests/crashes/129095.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-//@ known-bug: rust-lang/rust#129095
-//@ compile-flags: -Zmir-enable-passes=+GVN -Zmir-enable-passes=+Inline -Zvalidate-mir
-
-#![feature(adt_const_params, unsized_const_params)]
-#![allow(incomplete_features)]
-
-pub fn function_with_bytes<const BYTES: &'static [u8; 4]>() -> &'static [u8] {
-    BYTES
-}
-
-pub fn main() {
-    assert_eq!(function_with_bytes::<b"AAAAA">(), &[0x41, 0x41, 0x41, 0x41]);
-}
diff --git a/tests/crashes/131292.rs b/tests/crashes/131292.rs
index 01e0eca0bd6..05b93d06b05 100644
--- a/tests/crashes/131292.rs
+++ b/tests/crashes/131292.rs
@@ -1,5 +1,5 @@
 //@ known-bug: #131292
-//@ only-x86_64
+//@ needs-asm-support
 use std::arch::asm;
 
 unsafe fn f6() {
diff --git a/tests/crashes/132142.rs b/tests/crashes/132142.rs
deleted file mode 100644
index 813bf0bf0a8..00000000000
--- a/tests/crashes/132142.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-//@ known-bug: #132142
-
-async extern "cmse-nonsecure-entry" fn fun(...) {}
diff --git a/tests/crashes/134174.rs b/tests/crashes/134174.rs
deleted file mode 100644
index 899cdc6faf3..00000000000
--- a/tests/crashes/134174.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-//@ known-bug: #134175
-//@compile-flags: -Zvalidate-mir -Zinline-mir=yes
-use std::vec::IntoIter;
-
-pub(crate) trait Foo: Iterator<Item = <Self as Foo>::Key> {
-    type Key;
-}
-
-impl Foo for IntoIter<i16> {}
-
-fn sum_foo<F: Foo<Key = i32>>(f: F) -> i32 {
-    f.fold(0, |a, b| a + b)
-}
-
-fn main() {
-    let x = sum_foo(vec![11, 10, 1].into_iter());
-}
diff --git a/tests/crashes/134654.rs b/tests/crashes/134654.rs
deleted file mode 100644
index f2323fe4ecd..00000000000
--- a/tests/crashes/134654.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-//@ known-bug: #134654
-//@ compile-flags: -Zmir-enable-passes=+GVN -Zmir-enable-passes=+Inline -Zvalidate-mir
-//@ only-x86_64
-
-#![feature(adt_const_params, unsized_const_params)]
-#![allow(incomplete_features)]
-
-fn function_with_bytes<const BYTES:
-    &'static [u8; 0xa9008fb6c9d81e42_0e25730562a601c8_u128]>() -> &'static [u8] {
-    BYTES
-}
-
-fn main() {
-    function_with_bytes::<b"aa">() == &[];
-}
diff --git a/tests/crashes/135570.rs b/tests/crashes/135570.rs
deleted file mode 100644
index 7919ceb26d5..00000000000
--- a/tests/crashes/135570.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-//@ known-bug: #135570
-//@compile-flags: -Zvalidate-mir -Zmir-enable-passes=+Inline -Copt-level=0 -Zmir-enable-passes=+GVN
-//@ only-x86_64
-
-#![feature(adt_const_params, unsized_const_params)]
-#![allow(incomplete_features)]
-
-fn function_with_bytes<const BYTES: &'static [u8; 0xc7b889180b67b07d_bc1a3c88783d35b5_u128]>(
-) -> &'static [u8] {
-    BYTES
-}
-
-fn main() {
-    function_with_bytes::<b"aa">() == &[];
-}
diff --git a/tests/crashes/136381.rs b/tests/crashes/136381.rs
deleted file mode 100644
index 13ccc14a2c5..00000000000
--- a/tests/crashes/136381.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-//@ known-bug: #136381
-//@ compile-flags: -Zvalidate-mir -Zmir-enable-passes=+GVN
-#![feature(trait_upcasting)]
-
-trait A {}
-trait B: A {
-    fn c(&self);
-}
-impl B for i32 {
-    fn c(self) {
-        todo!();
-    }
-}
-
-fn main() {
-    let baz: &dyn B = &1;
-    let bar: &dyn A = baz;
-}
diff --git a/tests/crashes/137190-1.rs b/tests/crashes/137190-1.rs
deleted file mode 100644
index bdfe883b712..00000000000
--- a/tests/crashes/137190-1.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-//@ known-bug: #137190
-//@ compile-flags: -Zmir-opt-level=2 -Zvalidate-mir
-trait A {
-    fn b(&self);
-}
-trait C: A {}
-impl C for () {}
-fn main() {
-    (&() as &dyn C as &dyn A).b();
-}
diff --git a/tests/crashes/137468.rs b/tests/crashes/137468.rs
deleted file mode 100644
index cceb0502bd2..00000000000
--- a/tests/crashes/137468.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-//@ known-bug: #137468
-//@ compile-flags: -Copt-level=0 -Zmir-enable-passes=+GVN -Zvalidate-mir
-trait Supertrait<T> {}
-
-trait Identity {
-    type Selff;
-}
-
-trait Trait<P>: Supertrait<()> + Supertrait<<P as Identity>::Selff> {}
-
-impl<P> Trait<P> for () {}
-
-fn main() {
-    let x: &dyn Trait<()> = &();
-    let x: &dyn Supertrait<()> = x;
-}
diff --git a/tests/crashes/139556.rs b/tests/crashes/139556.rs
deleted file mode 100644
index 60dc8d7c3af..00000000000
--- a/tests/crashes/139556.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-//@ known-bug: #139556
-
-trait T {}
-
-type Alias<'a> = impl T;
-
-struct S;
-impl<'a> T for &'a S {}
-
-#[define_opaque(Alias)]
-fn with_positive(fun: impl Fn(Alias<'_>)) {
-    with_positive(|&n| ());
-}
diff --git a/tests/crashes/34127.rs b/tests/crashes/34127.rs
index ea36b48ecba..26ebe722475 100644
--- a/tests/crashes/34127.rs
+++ b/tests/crashes/34127.rs
@@ -1,6 +1,6 @@
 //@ compile-flags: -g -Copt-level=0 -Z verify-llvm-ir
 //@ known-bug: #34127
-//@ only-x86_64
+//@ only-64bit
 
 pub fn main() {
 let _a = [(); 1 << 63];
diff --git a/tests/debuginfo/opt/dead_refs.rs b/tests/debuginfo/opt/dead_refs.rs
new file mode 100644
index 00000000000..61e74157334
--- /dev/null
+++ b/tests/debuginfo/opt/dead_refs.rs
@@ -0,0 +1,50 @@
+//@ min-lldb-version: 1800
+//@ min-gdb-version: 13.0
+//@ compile-flags: -g -Copt-level=3
+//@ disable-gdb-pretty-printers
+
+// Checks that we still can access dead variables from debuginfos.
+
+// === GDB TESTS ===================================================================================
+
+// gdb-command:run
+// gdb-command:print *ref_v0
+// gdb-check:$1 = 0
+
+// gdb-command:print *ref_v1
+// gdb-check:$2 = 1
+
+// gdb-command:print *ref_v2
+// gdb-check:$3 = 2
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+// lldb-command:v *ref_v0
+// lldb-check:[...] 0
+
+// lldb-command:v *ref_v1
+// lldb-check:[...] 1
+
+// lldb-command:v *ref_v2
+// lldb-check:[...] 2
+
+#![allow(unused_variables)]
+
+use std::hint::black_box;
+
+pub struct Foo(i32, i64, i32);
+
+#[inline(never)]
+#[no_mangle]
+fn test_ref(ref_foo: &Foo) -> i32 {
+    let ref_v0 = &ref_foo.0;
+    let ref_v1 = &ref_foo.1;
+    let ref_v2 = &ref_foo.2;
+    ref_foo.0 // #break
+}
+
+fn main() {
+    let foo = black_box(Foo(0, 1, 2));
+    black_box(test_ref(&foo));
+}
diff --git a/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir b/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir
index a18d7e7478f..a1fe278c652 100644
--- a/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/address_of.address_of_reborrow.SimplifyCfg-initial.after.mir
@@ -1,30 +1,30 @@
 // MIR for `address_of_reborrow` after SimplifyCfg-initial
 
 | User Type Annotations
-| 0: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:8:10: 8:18, inferred_ty: *const [i32; 10]
+| 0: user_ty: Canonical { value: Ty(*const ^c_0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:8:10: 8:18, inferred_ty: *const [i32; 10]
 | 1: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [Region(U0)] }, span: $DIR/address_of.rs:10:10: 10:25, inferred_ty: *const dyn std::marker::Send
-| 2: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:14:12: 14:20, inferred_ty: *const [i32; 10]
-| 3: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:14:12: 14:20, inferred_ty: *const [i32; 10]
+| 2: user_ty: Canonical { value: Ty(*const ^c_0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:14:12: 14:20, inferred_ty: *const [i32; 10]
+| 3: user_ty: Canonical { value: Ty(*const ^c_0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:14:12: 14:20, inferred_ty: *const [i32; 10]
 | 4: user_ty: Canonical { value: Ty(*const [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:15:12: 15:28, inferred_ty: *const [i32; 10]
 | 5: user_ty: Canonical { value: Ty(*const [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:15:12: 15:28, inferred_ty: *const [i32; 10]
 | 6: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [Region(U0)] }, span: $DIR/address_of.rs:16:12: 16:27, inferred_ty: *const dyn std::marker::Send
 | 7: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [Region(U0)] }, span: $DIR/address_of.rs:16:12: 16:27, inferred_ty: *const dyn std::marker::Send
 | 8: user_ty: Canonical { value: Ty(*const [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:17:12: 17:24, inferred_ty: *const [i32]
 | 9: user_ty: Canonical { value: Ty(*const [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:17:12: 17:24, inferred_ty: *const [i32]
-| 10: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:19:10: 19:18, inferred_ty: *const [i32; 10]
+| 10: user_ty: Canonical { value: Ty(*const ^c_0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:19:10: 19:18, inferred_ty: *const [i32; 10]
 | 11: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [Region(U0)] }, span: $DIR/address_of.rs:21:10: 21:25, inferred_ty: *const dyn std::marker::Send
-| 12: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:24:12: 24:20, inferred_ty: *const [i32; 10]
-| 13: user_ty: Canonical { value: Ty(*const ^0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:24:12: 24:20, inferred_ty: *const [i32; 10]
+| 12: user_ty: Canonical { value: Ty(*const ^c_0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:24:12: 24:20, inferred_ty: *const [i32; 10]
+| 13: user_ty: Canonical { value: Ty(*const ^c_0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:24:12: 24:20, inferred_ty: *const [i32; 10]
 | 14: user_ty: Canonical { value: Ty(*const [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:25:12: 25:28, inferred_ty: *const [i32; 10]
 | 15: user_ty: Canonical { value: Ty(*const [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:25:12: 25:28, inferred_ty: *const [i32; 10]
 | 16: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [Region(U0)] }, span: $DIR/address_of.rs:26:12: 26:27, inferred_ty: *const dyn std::marker::Send
 | 17: user_ty: Canonical { value: Ty(*const dyn std::marker::Send), max_universe: U0, variables: [Region(U0)] }, span: $DIR/address_of.rs:26:12: 26:27, inferred_ty: *const dyn std::marker::Send
 | 18: user_ty: Canonical { value: Ty(*const [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:27:12: 27:24, inferred_ty: *const [i32]
 | 19: user_ty: Canonical { value: Ty(*const [i32]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:27:12: 27:24, inferred_ty: *const [i32]
-| 20: user_ty: Canonical { value: Ty(*mut ^0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:29:10: 29:16, inferred_ty: *mut [i32; 10]
+| 20: user_ty: Canonical { value: Ty(*mut ^c_0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:29:10: 29:16, inferred_ty: *mut [i32; 10]
 | 21: user_ty: Canonical { value: Ty(*mut dyn std::marker::Send), max_universe: U0, variables: [Region(U0)] }, span: $DIR/address_of.rs:31:10: 31:23, inferred_ty: *mut dyn std::marker::Send
-| 22: user_ty: Canonical { value: Ty(*mut ^0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:34:12: 34:18, inferred_ty: *mut [i32; 10]
-| 23: user_ty: Canonical { value: Ty(*mut ^0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:34:12: 34:18, inferred_ty: *mut [i32; 10]
+| 22: user_ty: Canonical { value: Ty(*mut ^c_0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:34:12: 34:18, inferred_ty: *mut [i32; 10]
+| 23: user_ty: Canonical { value: Ty(*mut ^c_0), max_universe: U0, variables: [Ty { ui: U0, sub_root: 0 }] }, span: $DIR/address_of.rs:34:12: 34:18, inferred_ty: *mut [i32; 10]
 | 24: user_ty: Canonical { value: Ty(*mut [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:35:12: 35:26, inferred_ty: *mut [i32; 10]
 | 25: user_ty: Canonical { value: Ty(*mut [i32; 10]), max_universe: U0, variables: [] }, span: $DIR/address_of.rs:35:12: 35:26, inferred_ty: *mut [i32; 10]
 | 26: user_ty: Canonical { value: Ty(*mut dyn std::marker::Send), max_universe: U0, variables: [Region(U0)] }, span: $DIR/address_of.rs:36:12: 36:25, inferred_ty: *mut dyn std::marker::Send
diff --git a/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-abort.mir b/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-abort.mir
index 347e4119cd0..050aac7c3ff 100644
--- a/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-abort.mir
+++ b/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-abort.mir
@@ -1,7 +1,7 @@
 // MIR for `a::{closure#0}` 0 coroutine_drop_async
 
 fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>) -> Poll<()> {
-    debug _task_context => _19;
+    debug _task_context => _2;
     debug x => ((*(_1.0: &mut {async fn body of a<T>()})).0: T);
     let mut _0: std::task::Poll<()>;
     let _3: T;
@@ -20,15 +20,14 @@ fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>)
     let mut _16: &mut impl std::future::Future<Output = ()>;
     let mut _17: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
     let mut _18: isize;
-    let mut _19: &mut std::task::Context<'_>;
-    let mut _20: u32;
+    let mut _19: u32;
     scope 1 {
         debug x => (((*(_1.0: &mut {async fn body of a<T>()})) as variant#4).0: T);
     }
 
     bb0: {
-        _20 = discriminant((*(_1.0: &mut {async fn body of a<T>()})));
-        switchInt(move _20) -> [0: bb9, 3: bb12, 4: bb13, otherwise: bb14];
+        _19 = discriminant((*(_1.0: &mut {async fn body of a<T>()})));
+        switchInt(move _19) -> [0: bb9, 3: bb12, 4: bb13, otherwise: bb14];
     }
 
     bb1: {
diff --git a/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-unwind.mir b/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-unwind.mir
index b1cf5373f91..796e95ff3d8 100644
--- a/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-unwind.mir
+++ b/tests/mir-opt/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-unwind.mir
@@ -1,7 +1,7 @@
 // MIR for `a::{closure#0}` 0 coroutine_drop_async
 
 fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>) -> Poll<()> {
-    debug _task_context => _19;
+    debug _task_context => _2;
     debug x => ((*(_1.0: &mut {async fn body of a<T>()})).0: T);
     let mut _0: std::task::Poll<()>;
     let _3: T;
@@ -20,15 +20,14 @@ fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>)
     let mut _16: &mut impl std::future::Future<Output = ()>;
     let mut _17: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
     let mut _18: isize;
-    let mut _19: &mut std::task::Context<'_>;
-    let mut _20: u32;
+    let mut _19: u32;
     scope 1 {
         debug x => (((*(_1.0: &mut {async fn body of a<T>()})) as variant#4).0: T);
     }
 
     bb0: {
-        _20 = discriminant((*(_1.0: &mut {async fn body of a<T>()})));
-        switchInt(move _20) -> [0: bb12, 2: bb18, 3: bb16, 4: bb17, otherwise: bb19];
+        _19 = discriminant((*(_1.0: &mut {async fn body of a<T>()})));
+        switchInt(move _19) -> [0: bb12, 2: bb18, 3: bb16, 4: bb17, otherwise: bb19];
     }
 
     bb1: {
diff --git a/tests/mir-opt/building/async_await.a-{closure#0}.coroutine_resume.0.mir b/tests/mir-opt/building/async_await.a-{closure#0}.coroutine_resume.0.mir
index 7480324b177..2e2876cb3fc 100644
--- a/tests/mir-opt/building/async_await.a-{closure#0}.coroutine_resume.0.mir
+++ b/tests/mir-opt/building/async_await.a-{closure#0}.coroutine_resume.0.mir
@@ -10,19 +10,17 @@
 } */
 
 fn a::{closure#0}(_1: Pin<&mut {async fn body of a()}>, _2: &mut Context<'_>) -> Poll<()> {
-    debug _task_context => _4;
+    debug _task_context => _2;
     let mut _0: std::task::Poll<()>;
     let mut _3: ();
-    let mut _4: &mut std::task::Context<'_>;
-    let mut _5: u32;
+    let mut _4: u32;
 
     bb0: {
-        _5 = discriminant((*(_1.0: &mut {async fn body of a()})));
-        switchInt(move _5) -> [0: bb1, 1: bb4, otherwise: bb5];
+        _4 = discriminant((*(_1.0: &mut {async fn body of a()})));
+        switchInt(move _4) -> [0: bb1, 1: bb4, otherwise: bb5];
     }
 
     bb1: {
-        _4 = move _2;
         _3 = const ();
         goto -> bb3;
     }
diff --git a/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir b/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir
index 9bff257e063..20fc4112ef2 100644
--- a/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir
+++ b/tests/mir-opt/building/async_await.b-{closure#0}.coroutine_resume.0.mir
@@ -1,7 +1,7 @@
 // MIR for `b::{closure#0}` 0 coroutine_resume
 /* coroutine_layout = CoroutineLayout {
     field_tys: {
-        _0: CoroutineSavedTy {
+        _s0: CoroutineSavedTy {
             ty: Coroutine(
                 DefId(0:5 ~ async_await[ccf8]::a::{closure#0}),
                 [
@@ -18,7 +18,7 @@
             },
             ignore_for_traits: false,
         },
-        _1: CoroutineSavedTy {
+        _s1: CoroutineSavedTy {
             ty: Coroutine(
                 DefId(0:5 ~ async_await[ccf8]::a::{closure#0}),
                 [
@@ -40,17 +40,17 @@
         Unresumed(0): [],
         Returned (1): [],
         Panicked (2): [],
-        Suspend0 (3): [_0],
-        Suspend1 (4): [_1],
+        Suspend0 (3): [_s0],
+        Suspend1 (4): [_s1],
     },
     storage_conflicts: BitMatrix(2x2) {
-        (_0, _0),
-        (_1, _1),
+        (_s0, _s0),
+        (_s1, _s1),
     },
 } */
 
 fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) -> Poll<()> {
-    debug _task_context => _38;
+    debug _task_context => _2;
     let mut _0: std::task::Poll<()>;
     let _3: ();
     let mut _4: {async fn body of a()};
@@ -85,8 +85,7 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->
     let mut _35: &mut std::task::Context<'_>;
     let mut _36: ();
     let mut _37: ();
-    let mut _38: &mut std::task::Context<'_>;
-    let mut _39: u32;
+    let mut _38: u32;
     scope 1 {
         debug __awaitee => (((*(_1.0: &mut {async fn body of b()})) as variant#3).0: {async fn body of a()});
         let _17: ();
@@ -103,12 +102,11 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->
     }
 
     bb0: {
-        _39 = discriminant((*(_1.0: &mut {async fn body of b()})));
-        switchInt(move _39) -> [0: bb1, 1: bb29, 3: bb27, 4: bb28, otherwise: bb8];
+        _38 = discriminant((*(_1.0: &mut {async fn body of b()})));
+        switchInt(move _38) -> [0: bb1, 1: bb29, 3: bb27, 4: bb28, otherwise: bb8];
     }
 
     bb1: {
-        _38 = move _2;
         StorageLive(_3);
         StorageLive(_4);
         StorageLive(_5);
@@ -143,7 +141,7 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->
         StorageLive(_13);
         StorageLive(_14);
         StorageLive(_15);
-        _15 = copy _38;
+        _15 = copy _2;
         _14 = move _15;
         goto -> bb6;
     }
@@ -198,7 +196,7 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->
 
     bb11: {
         StorageDead(_20);
-        _38 = move _19;
+        _2 = move _19;
         StorageDead(_19);
         _7 = const ();
         goto -> bb4;
@@ -245,7 +243,7 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->
         StorageLive(_29);
         StorageLive(_30);
         StorageLive(_31);
-        _31 = copy _38;
+        _31 = copy _2;
         _30 = move _31;
         goto -> bb18;
     }
@@ -295,7 +293,7 @@ fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) ->
 
     bb22: {
         StorageDead(_36);
-        _38 = move _35;
+        _2 = move _35;
         StorageDead(_35);
         _7 = const ();
         goto -> bb16;
diff --git a/tests/mir-opt/building/coroutine.main-{closure#0}.StateTransform.after.mir b/tests/mir-opt/building/coroutine.main-{closure#0}.StateTransform.after.mir
new file mode 100644
index 00000000000..d8fdb446135
--- /dev/null
+++ b/tests/mir-opt/building/coroutine.main-{closure#0}.StateTransform.after.mir
@@ -0,0 +1,207 @@
+// MIR for `main::{closure#0}` after StateTransform
+/* coroutine_layout = CoroutineLayout {
+    field_tys: {
+        _s0: CoroutineSavedTy {
+            ty: std::string::String,
+            source_info: SourceInfo {
+                span: $DIR/coroutine.rs:18:6: 18:9 (#0),
+                scope: scope[0],
+            },
+            ignore_for_traits: false,
+        },
+    },
+    variant_fields: {
+        Unresumed(0): [],
+        Returned (1): [],
+        Panicked (2): [],
+        Suspend0 (3): [_s0],
+        Suspend1 (4): [_s0],
+    },
+    storage_conflicts: BitMatrix(1x1) {
+        (_s0, _s0),
+    },
+} */
+
+fn main::{closure#0}(_1: Pin<&mut {coroutine@$DIR/coroutine.rs:18:5: 18:18}>, _2: String) -> CoroutineState<(&str, String, &Location<'_>), ()> {
+    debug arg => (((*(_1.0: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18})) as variant#4).0: std::string::String);
+    let mut _0: std::ops::CoroutineState<(&str, std::string::String, &std::panic::Location<'_>), ()>;
+    let _3: std::string::String;
+    let mut _4: (&str, std::string::String, &std::panic::Location<'_>);
+    let mut _5: std::string::String;
+    let mut _6: &std::string::String;
+    let mut _7: &std::panic::Location<'_>;
+    let _8: std::string::String;
+    let mut _9: (&str, std::string::String, &std::panic::Location<'_>);
+    let mut _10: &str;
+    let _11: &str;
+    let mut _12: std::string::String;
+    let mut _13: &std::string::String;
+    let mut _14: &std::panic::Location<'_>;
+    let _15: &std::panic::Location<'_>;
+    let mut _16: ();
+    let mut _17: u32;
+    let mut _18: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18};
+    let mut _19: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18};
+    let mut _20: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18};
+    let mut _21: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18};
+    let mut _22: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18};
+    let mut _23: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18};
+    let mut _24: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18};
+    let mut _25: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18};
+
+    bb0: {
+        _18 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18});
+        _17 = discriminant((*_18));
+        switchInt(move _17) -> [0: bb1, 1: bb19, 3: bb17, 4: bb18, otherwise: bb20];
+    }
+
+    bb1: {
+        _19 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18});
+        (((*_19) as variant#4).0: std::string::String) = move _2;
+        StorageLive(_3);
+        StorageLive(_4);
+        StorageLive(_5);
+        StorageLive(_6);
+        _20 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18});
+        _6 = &(((*_20) as variant#4).0: std::string::String);
+        _5 = <String as Clone>::clone(move _6) -> [return: bb2, unwind unreachable];
+    }
+
+    bb2: {
+        StorageDead(_6);
+        StorageLive(_7);
+        _7 = Location::<'_>::caller() -> [return: bb3, unwind unreachable];
+    }
+
+    bb3: {
+        _4 = (const "first", move _5, move _7);
+        StorageDead(_7);
+        goto -> bb4;
+    }
+
+    bb4: {
+        StorageDead(_5);
+        _0 = CoroutineState::<(&str, String, &Location<'_>), ()>::Yielded(move _4);
+        StorageDead(_3);
+        StorageDead(_4);
+        _21 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18});
+        discriminant((*_21)) = 3;
+        return;
+    }
+
+    bb5: {
+        goto -> bb6;
+    }
+
+    bb6: {
+        StorageDead(_4);
+        drop(_3) -> [return: bb7, unwind unreachable];
+    }
+
+    bb7: {
+        StorageDead(_3);
+        StorageLive(_8);
+        StorageLive(_9);
+        StorageLive(_10);
+        StorageLive(_11);
+        _11 = const "second";
+        _10 = &(*_11);
+        StorageLive(_12);
+        StorageLive(_13);
+        _22 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18});
+        _13 = &(((*_22) as variant#4).0: std::string::String);
+        _12 = <String as Clone>::clone(move _13) -> [return: bb8, unwind unreachable];
+    }
+
+    bb8: {
+        StorageDead(_13);
+        StorageLive(_14);
+        StorageLive(_15);
+        _15 = Location::<'_>::caller() -> [return: bb9, unwind unreachable];
+    }
+
+    bb9: {
+        _14 = &(*_15);
+        _9 = (move _10, move _12, move _14);
+        StorageDead(_14);
+        goto -> bb10;
+    }
+
+    bb10: {
+        StorageDead(_12);
+        StorageDead(_10);
+        _0 = CoroutineState::<(&str, String, &Location<'_>), ()>::Yielded(move _9);
+        StorageDead(_8);
+        StorageDead(_9);
+        StorageDead(_11);
+        StorageDead(_15);
+        _23 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18});
+        discriminant((*_23)) = 4;
+        return;
+    }
+
+    bb11: {
+        goto -> bb12;
+    }
+
+    bb12: {
+        StorageDead(_9);
+        drop(_8) -> [return: bb13, unwind unreachable];
+    }
+
+    bb13: {
+        StorageDead(_15);
+        StorageDead(_11);
+        StorageDead(_8);
+        _16 = const ();
+        _24 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18});
+        drop((((*_24) as variant#4).0: std::string::String)) -> [return: bb14, unwind unreachable];
+    }
+
+    bb14: {
+        goto -> bb16;
+    }
+
+    bb15: {
+        _0 = CoroutineState::<(&str, String, &Location<'_>), ()>::Complete(move _16);
+        _25 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:18:5: 18:18});
+        discriminant((*_25)) = 1;
+        return;
+    }
+
+    bb16: {
+        goto -> bb15;
+    }
+
+    bb17: {
+        StorageLive(_3);
+        StorageLive(_4);
+        _3 = move _2;
+        goto -> bb5;
+    }
+
+    bb18: {
+        StorageLive(_8);
+        StorageLive(_9);
+        StorageLive(_11);
+        StorageLive(_15);
+        _8 = move _2;
+        goto -> bb11;
+    }
+
+    bb19: {
+        assert(const false, "coroutine resumed after completion") -> [success: bb19, unwind unreachable];
+    }
+
+    bb20: {
+        unreachable;
+    }
+}
+
+ALLOC0 (size: 6, align: 1) {
+    73 65 63 6f 6e 64                               │ second
+}
+
+ALLOC1 (size: 5, align: 1) {
+    66 69 72 73 74                                  │ first
+}
diff --git a/tests/mir-opt/building/coroutine.main-{closure#1}.StateTransform.after.mir b/tests/mir-opt/building/coroutine.main-{closure#1}.StateTransform.after.mir
new file mode 100644
index 00000000000..dd17afad656
--- /dev/null
+++ b/tests/mir-opt/building/coroutine.main-{closure#1}.StateTransform.after.mir
@@ -0,0 +1,207 @@
+// MIR for `main::{closure#1}` after StateTransform
+/* coroutine_layout = CoroutineLayout {
+    field_tys: {
+        _s0: CoroutineSavedTy {
+            ty: std::string::String,
+            source_info: SourceInfo {
+                span: $DIR/coroutine.rs:25:6: 25:9 (#0),
+                scope: scope[0],
+            },
+            ignore_for_traits: false,
+        },
+    },
+    variant_fields: {
+        Unresumed(0): [],
+        Returned (1): [],
+        Panicked (2): [],
+        Suspend0 (3): [_s0],
+        Suspend1 (4): [_s0],
+    },
+    storage_conflicts: BitMatrix(1x1) {
+        (_s0, _s0),
+    },
+} */
+
+fn main::{closure#1}(_1: Pin<&mut {coroutine@$DIR/coroutine.rs:25:5: 25:18}>, _2: String) -> CoroutineState<(&str, String, &Location<'_>), ()> {
+    debug arg => (((*(_1.0: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18})) as variant#4).0: std::string::String);
+    let mut _0: std::ops::CoroutineState<(&str, std::string::String, &std::panic::Location<'_>), ()>;
+    let _3: std::string::String;
+    let mut _4: (&str, std::string::String, &std::panic::Location<'_>);
+    let mut _5: std::string::String;
+    let mut _6: &std::string::String;
+    let mut _7: &std::panic::Location<'_>;
+    let _8: std::string::String;
+    let mut _9: (&str, std::string::String, &std::panic::Location<'_>);
+    let mut _10: &str;
+    let _11: &str;
+    let mut _12: std::string::String;
+    let mut _13: &std::string::String;
+    let mut _14: &std::panic::Location<'_>;
+    let _15: &std::panic::Location<'_>;
+    let mut _16: ();
+    let mut _17: u32;
+    let mut _18: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18};
+    let mut _19: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18};
+    let mut _20: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18};
+    let mut _21: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18};
+    let mut _22: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18};
+    let mut _23: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18};
+    let mut _24: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18};
+    let mut _25: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18};
+
+    bb0: {
+        _18 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18});
+        _17 = discriminant((*_18));
+        switchInt(move _17) -> [0: bb1, 1: bb19, 3: bb17, 4: bb18, otherwise: bb20];
+    }
+
+    bb1: {
+        _19 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18});
+        (((*_19) as variant#4).0: std::string::String) = move _2;
+        StorageLive(_3);
+        StorageLive(_4);
+        StorageLive(_5);
+        StorageLive(_6);
+        _20 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18});
+        _6 = &(((*_20) as variant#4).0: std::string::String);
+        _5 = <String as Clone>::clone(move _6) -> [return: bb2, unwind unreachable];
+    }
+
+    bb2: {
+        StorageDead(_6);
+        StorageLive(_7);
+        _7 = Location::<'_>::caller() -> [return: bb3, unwind unreachable];
+    }
+
+    bb3: {
+        _4 = (const "first", move _5, move _7);
+        StorageDead(_7);
+        goto -> bb4;
+    }
+
+    bb4: {
+        StorageDead(_5);
+        _0 = CoroutineState::<(&str, String, &Location<'_>), ()>::Yielded(move _4);
+        StorageDead(_3);
+        StorageDead(_4);
+        _21 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18});
+        discriminant((*_21)) = 3;
+        return;
+    }
+
+    bb5: {
+        goto -> bb6;
+    }
+
+    bb6: {
+        StorageDead(_4);
+        drop(_3) -> [return: bb7, unwind unreachable];
+    }
+
+    bb7: {
+        StorageDead(_3);
+        StorageLive(_8);
+        StorageLive(_9);
+        StorageLive(_10);
+        StorageLive(_11);
+        _11 = const "second";
+        _10 = &(*_11);
+        StorageLive(_12);
+        StorageLive(_13);
+        _22 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18});
+        _13 = &(((*_22) as variant#4).0: std::string::String);
+        _12 = <String as Clone>::clone(move _13) -> [return: bb8, unwind unreachable];
+    }
+
+    bb8: {
+        StorageDead(_13);
+        StorageLive(_14);
+        StorageLive(_15);
+        _15 = Location::<'_>::caller() -> [return: bb9, unwind unreachable];
+    }
+
+    bb9: {
+        _14 = &(*_15);
+        _9 = (move _10, move _12, move _14);
+        StorageDead(_14);
+        goto -> bb10;
+    }
+
+    bb10: {
+        StorageDead(_12);
+        StorageDead(_10);
+        _0 = CoroutineState::<(&str, String, &Location<'_>), ()>::Yielded(move _9);
+        StorageDead(_8);
+        StorageDead(_9);
+        StorageDead(_11);
+        StorageDead(_15);
+        _23 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18});
+        discriminant((*_23)) = 4;
+        return;
+    }
+
+    bb11: {
+        goto -> bb12;
+    }
+
+    bb12: {
+        StorageDead(_9);
+        drop(_8) -> [return: bb13, unwind unreachable];
+    }
+
+    bb13: {
+        StorageDead(_15);
+        StorageDead(_11);
+        StorageDead(_8);
+        _16 = const ();
+        _24 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18});
+        drop((((*_24) as variant#4).0: std::string::String)) -> [return: bb14, unwind unreachable];
+    }
+
+    bb14: {
+        goto -> bb16;
+    }
+
+    bb15: {
+        _0 = CoroutineState::<(&str, String, &Location<'_>), ()>::Complete(move _16);
+        _25 = deref_copy (_1.0: &mut {coroutine@$DIR/coroutine.rs:25:5: 25:18});
+        discriminant((*_25)) = 1;
+        return;
+    }
+
+    bb16: {
+        goto -> bb15;
+    }
+
+    bb17: {
+        StorageLive(_3);
+        StorageLive(_4);
+        _3 = move _2;
+        goto -> bb5;
+    }
+
+    bb18: {
+        StorageLive(_8);
+        StorageLive(_9);
+        StorageLive(_11);
+        StorageLive(_15);
+        _8 = move _2;
+        goto -> bb11;
+    }
+
+    bb19: {
+        assert(const false, "coroutine resumed after completion") -> [success: bb19, unwind unreachable];
+    }
+
+    bb20: {
+        unreachable;
+    }
+}
+
+ALLOC0 (size: 6, align: 1) {
+    73 65 63 6f 6e 64                               │ second
+}
+
+ALLOC1 (size: 5, align: 1) {
+    66 69 72 73 74                                  │ first
+}
diff --git a/tests/mir-opt/building/coroutine.rs b/tests/mir-opt/building/coroutine.rs
new file mode 100644
index 00000000000..6d50c4d90b1
--- /dev/null
+++ b/tests/mir-opt/building/coroutine.rs
@@ -0,0 +1,29 @@
+// skip-filecheck
+//@ edition:2024
+//@ compile-flags: -Zmir-opt-level=0 -C panic=abort
+
+#![feature(stmt_expr_attributes)]
+#![feature(closure_track_caller)]
+#![feature(coroutine_trait)]
+#![feature(coroutines)]
+
+use std::ops::{Coroutine, CoroutineState};
+use std::panic::Location;
+use std::pin::Pin;
+
+// EMIT_MIR coroutine.main-{closure#0}.StateTransform.after.mir
+// EMIT_MIR coroutine.main-{closure#1}.StateTransform.after.mir
+fn main() {
+    let simple = #[coroutine]
+    |arg: String| {
+        yield ("first", arg.clone(), Location::caller());
+        yield ("second", arg.clone(), Location::caller());
+    };
+
+    let track_caller = #[track_caller]
+    #[coroutine]
+    |arg: String| {
+        yield ("first", arg.clone(), Location::caller());
+        yield ("second", arg.clone(), Location::caller());
+    };
+}
diff --git a/tests/mir-opt/building/custom/arrays.arrays.built.after.mir b/tests/mir-opt/building/custom/arrays.arrays.built.after.mir
index 30d11e31e4d..f9f24c8eabe 100644
--- a/tests/mir-opt/building/custom/arrays.arrays.built.after.mir
+++ b/tests/mir-opt/building/custom/arrays.arrays.built.after.mir
@@ -3,12 +3,16 @@
 fn arrays() -> usize {
     let mut _0: usize;
     let mut _1: [i32; C];
-    let mut _2: usize;
+    let mut _2: *const [i32; C];
+    let mut _3: *const [i32];
+    let mut _4: usize;
 
     bb0: {
         _1 = [const 5_i32; C];
-        _2 = Len(_1);
-        _0 = copy _2;
+        _2 = &raw const _1;
+        _3 = copy _2 as *const [i32] (PointerCoercion(Unsize, AsCast));
+        _4 = PtrMetadata(copy _3);
+        _0 = copy _4;
         return;
     }
 }
diff --git a/tests/mir-opt/building/custom/arrays.rs b/tests/mir-opt/building/custom/arrays.rs
index 4bd6f93e113..e9cdded4a0e 100644
--- a/tests/mir-opt/building/custom/arrays.rs
+++ b/tests/mir-opt/building/custom/arrays.rs
@@ -10,7 +10,9 @@ fn arrays<const C: usize>() -> usize {
     mir! {
         {
             let x = [5_i32; C];
-            let c = Len(x);
+            let y = &raw const x;
+            let z = CastUnsize::<_, *const [i32]>(y);
+            let c = PtrMetadata(z);
             RET = c;
             Return()
         }
diff --git a/tests/mir-opt/building/match/array_len.const_array_len.built.after.panic-abort.mir b/tests/mir-opt/building/match/array_len.const_array_len.built.after.panic-abort.mir
new file mode 100644
index 00000000000..8d16f074b1e
--- /dev/null
+++ b/tests/mir-opt/building/match/array_len.const_array_len.built.after.panic-abort.mir
@@ -0,0 +1,155 @@
+// MIR for `const_array_len` after built
+
+fn const_array_len(_1: [T; 5]) -> () {
+    debug x => _1;
+    let mut _0: ();
+    let _6: ();
+    let mut _7: T;
+    let _8: ();
+    let mut _9: T;
+    let _10: ();
+    let mut _11: [T; 2];
+    let _12: ();
+    let mut _13: T;
+    scope 1 {
+        debug a => _2;
+        debug b => _3;
+        debug rest => _4;
+        debug e => _5;
+        let _2: T;
+        let _3: T;
+        let _4: [T; 2];
+        let _5: T;
+    }
+
+    bb0: {
+        PlaceMention(_1);
+        falseEdge -> [real: bb2, imaginary: bb1];
+    }
+
+    bb1: {
+        goto -> bb7;
+    }
+
+    bb2: {
+        StorageLive(_2);
+        _2 = move _1[0 of 5];
+        StorageLive(_3);
+        _3 = move _1[1 of 5];
+        StorageLive(_4);
+        _4 = move _1[2..4];
+        StorageLive(_5);
+        _5 = move _1[4 of 5];
+        StorageLive(_6);
+        StorageLive(_7);
+        _7 = move _2;
+        _6 = opaque::<T>(move _7) -> [return: bb3, unwind: bb17];
+    }
+
+    bb3: {
+        StorageDead(_7);
+        StorageDead(_6);
+        StorageLive(_8);
+        StorageLive(_9);
+        _9 = move _3;
+        _8 = opaque::<T>(move _9) -> [return: bb4, unwind: bb16];
+    }
+
+    bb4: {
+        StorageDead(_9);
+        StorageDead(_8);
+        StorageLive(_10);
+        StorageLive(_11);
+        _11 = move _4;
+        _10 = opaque::<[T; 2]>(move _11) -> [return: bb5, unwind: bb15];
+    }
+
+    bb5: {
+        StorageDead(_11);
+        StorageDead(_10);
+        StorageLive(_12);
+        StorageLive(_13);
+        _13 = move _5;
+        _12 = opaque::<T>(move _13) -> [return: bb6, unwind: bb14];
+    }
+
+    bb6: {
+        StorageDead(_13);
+        StorageDead(_12);
+        _0 = const ();
+        drop(_5) -> [return: bb8, unwind: bb19];
+    }
+
+    bb7: {
+        _0 = const ();
+        goto -> bb12;
+    }
+
+    bb8: {
+        StorageDead(_5);
+        drop(_4) -> [return: bb9, unwind: bb20];
+    }
+
+    bb9: {
+        StorageDead(_4);
+        drop(_3) -> [return: bb10, unwind: bb21];
+    }
+
+    bb10: {
+        StorageDead(_3);
+        drop(_2) -> [return: bb11, unwind: bb22];
+    }
+
+    bb11: {
+        StorageDead(_2);
+        goto -> bb12;
+    }
+
+    bb12: {
+        drop(_1) -> [return: bb13, unwind: bb23];
+    }
+
+    bb13: {
+        return;
+    }
+
+    bb14 (cleanup): {
+        drop(_13) -> [return: bb18, unwind terminate(cleanup)];
+    }
+
+    bb15 (cleanup): {
+        drop(_11) -> [return: bb18, unwind terminate(cleanup)];
+    }
+
+    bb16 (cleanup): {
+        drop(_9) -> [return: bb18, unwind terminate(cleanup)];
+    }
+
+    bb17 (cleanup): {
+        drop(_7) -> [return: bb18, unwind terminate(cleanup)];
+    }
+
+    bb18 (cleanup): {
+        drop(_5) -> [return: bb19, unwind terminate(cleanup)];
+    }
+
+    bb19 (cleanup): {
+        drop(_4) -> [return: bb20, unwind terminate(cleanup)];
+    }
+
+    bb20 (cleanup): {
+        drop(_3) -> [return: bb21, unwind terminate(cleanup)];
+    }
+
+    bb21 (cleanup): {
+        drop(_2) -> [return: bb22, unwind terminate(cleanup)];
+    }
+
+    bb22 (cleanup): {
+        drop(_1) -> [return: bb23, unwind terminate(cleanup)];
+    }
+
+    bb23 (cleanup): {
+        resume;
+    }
+}
diff --git a/tests/mir-opt/building/match/array_len.const_array_len.built.after.panic-unwind.mir b/tests/mir-opt/building/match/array_len.const_array_len.built.after.panic-unwind.mir
new file mode 100644
index 00000000000..8d16f074b1e
--- /dev/null
+++ b/tests/mir-opt/building/match/array_len.const_array_len.built.after.panic-unwind.mir
@@ -0,0 +1,155 @@
+// MIR for `const_array_len` after built
+
+fn const_array_len(_1: [T; 5]) -> () {
+    debug x => _1;
+    let mut _0: ();
+    let _6: ();
+    let mut _7: T;
+    let _8: ();
+    let mut _9: T;
+    let _10: ();
+    let mut _11: [T; 2];
+    let _12: ();
+    let mut _13: T;
+    scope 1 {
+        debug a => _2;
+        debug b => _3;
+        debug rest => _4;
+        debug e => _5;
+        let _2: T;
+        let _3: T;
+        let _4: [T; 2];
+        let _5: T;
+    }
+
+    bb0: {
+        PlaceMention(_1);
+        falseEdge -> [real: bb2, imaginary: bb1];
+    }
+
+    bb1: {
+        goto -> bb7;
+    }
+
+    bb2: {
+        StorageLive(_2);
+        _2 = move _1[0 of 5];
+        StorageLive(_3);
+        _3 = move _1[1 of 5];
+        StorageLive(_4);
+        _4 = move _1[2..4];
+        StorageLive(_5);
+        _5 = move _1[4 of 5];
+        StorageLive(_6);
+        StorageLive(_7);
+        _7 = move _2;
+        _6 = opaque::<T>(move _7) -> [return: bb3, unwind: bb17];
+    }
+
+    bb3: {
+        StorageDead(_7);
+        StorageDead(_6);
+        StorageLive(_8);
+        StorageLive(_9);
+        _9 = move _3;
+        _8 = opaque::<T>(move _9) -> [return: bb4, unwind: bb16];
+    }
+
+    bb4: {
+        StorageDead(_9);
+        StorageDead(_8);
+        StorageLive(_10);
+        StorageLive(_11);
+        _11 = move _4;
+        _10 = opaque::<[T; 2]>(move _11) -> [return: bb5, unwind: bb15];
+    }
+
+    bb5: {
+        StorageDead(_11);
+        StorageDead(_10);
+        StorageLive(_12);
+        StorageLive(_13);
+        _13 = move _5;
+        _12 = opaque::<T>(move _13) -> [return: bb6, unwind: bb14];
+    }
+
+    bb6: {
+        StorageDead(_13);
+        StorageDead(_12);
+        _0 = const ();
+        drop(_5) -> [return: bb8, unwind: bb19];
+    }
+
+    bb7: {
+        _0 = const ();
+        goto -> bb12;
+    }
+
+    bb8: {
+        StorageDead(_5);
+        drop(_4) -> [return: bb9, unwind: bb20];
+    }
+
+    bb9: {
+        StorageDead(_4);
+        drop(_3) -> [return: bb10, unwind: bb21];
+    }
+
+    bb10: {
+        StorageDead(_3);
+        drop(_2) -> [return: bb11, unwind: bb22];
+    }
+
+    bb11: {
+        StorageDead(_2);
+        goto -> bb12;
+    }
+
+    bb12: {
+        drop(_1) -> [return: bb13, unwind: bb23];
+    }
+
+    bb13: {
+        return;
+    }
+
+    bb14 (cleanup): {
+        drop(_13) -> [return: bb18, unwind terminate(cleanup)];
+    }
+
+    bb15 (cleanup): {
+        drop(_11) -> [return: bb18, unwind terminate(cleanup)];
+    }
+
+    bb16 (cleanup): {
+        drop(_9) -> [return: bb18, unwind terminate(cleanup)];
+    }
+
+    bb17 (cleanup): {
+        drop(_7) -> [return: bb18, unwind terminate(cleanup)];
+    }
+
+    bb18 (cleanup): {
+        drop(_5) -> [return: bb19, unwind terminate(cleanup)];
+    }
+
+    bb19 (cleanup): {
+        drop(_4) -> [return: bb20, unwind terminate(cleanup)];
+    }
+
+    bb20 (cleanup): {
+        drop(_3) -> [return: bb21, unwind terminate(cleanup)];
+    }
+
+    bb21 (cleanup): {
+        drop(_2) -> [return: bb22, unwind terminate(cleanup)];
+    }
+
+    bb22 (cleanup): {
+        drop(_1) -> [return: bb23, unwind terminate(cleanup)];
+    }
+
+    bb23 (cleanup): {
+        resume;
+    }
+}
diff --git a/tests/mir-opt/building/match/array_len.rs b/tests/mir-opt/building/match/array_len.rs
new file mode 100644
index 00000000000..0d889ada9b6
--- /dev/null
+++ b/tests/mir-opt/building/match/array_len.rs
@@ -0,0 +1,31 @@
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+//@ compile-flags: -Zmir-opt-level=0
+
+fn opaque<T>(x: T) {}
+
+// EMIT_MIR array_len.const_array_len.built.after.mir
+fn const_array_len<T>(x: [T; 5]) {
+    // CHECK-LABEL: fn const_array_len(
+    // CHECK-NOT: Len
+    // CHECK-NOT: PtrMetadata
+    // CHECK: = const 5_usize;
+    if let [a, b, rest @ .., e] = x {
+        opaque(a);
+        opaque(b);
+        opaque(rest);
+        opaque(e);
+    }
+}
+
+// EMIT_MIR array_len.slice_len.built.after.mir
+fn slice_len<T>(x: &[T]) {
+    // CHECK-LABEL: fn slice_len(
+    // CHECK-NOT: Len
+    // CHECK: = PtrMetadata(copy _1);
+    if let [a, b, rest @ .., e] = x {
+        opaque(a);
+        opaque(b);
+        opaque(rest);
+        opaque(e);
+    }
+}
diff --git a/tests/mir-opt/building/match/array_len.slice_len.built.after.panic-abort.mir b/tests/mir-opt/building/match/array_len.slice_len.built.after.panic-abort.mir
new file mode 100644
index 00000000000..d73f5a1b6f7
--- /dev/null
+++ b/tests/mir-opt/building/match/array_len.slice_len.built.after.panic-abort.mir
@@ -0,0 +1,115 @@
+// MIR for `slice_len` after built
+
+fn slice_len(_1: &[T]) -> () {
+    debug x => _1;
+    let mut _0: ();
+    let mut _2: usize;
+    let mut _3: usize;
+    let mut _4: usize;
+    let mut _5: bool;
+    let _10: ();
+    let mut _11: &T;
+    let _12: ();
+    let mut _13: &T;
+    let _14: ();
+    let mut _15: &[T];
+    let _16: ();
+    let mut _17: &T;
+    scope 1 {
+        debug a => _6;
+        debug b => _7;
+        debug rest => _8;
+        debug e => _9;
+        let _6: &T;
+        let _7: &T;
+        let _8: &[T];
+        let _9: &T;
+    }
+
+    bb0: {
+        PlaceMention(_1);
+        _3 = PtrMetadata(copy _1);
+        _2 = move _3;
+        _4 = const 3_usize;
+        _5 = Ge(move _2, move _4);
+        switchInt(move _5) -> [0: bb1, otherwise: bb2];
+    }
+
+    bb1: {
+        goto -> bb9;
+    }
+
+    bb2: {
+        falseEdge -> [real: bb4, imaginary: bb1];
+    }
+
+    bb3: {
+        goto -> bb1;
+    }
+
+    bb4: {
+        StorageLive(_6);
+        _6 = &(*_1)[0 of 3];
+        StorageLive(_7);
+        _7 = &(*_1)[1 of 3];
+        StorageLive(_8);
+        _8 = &(*_1)[2:-1];
+        StorageLive(_9);
+        _9 = &(*_1)[-1 of 3];
+        StorageLive(_10);
+        StorageLive(_11);
+        _11 = copy _6;
+        _10 = opaque::<&T>(move _11) -> [return: bb5, unwind: bb11];
+    }
+
+    bb5: {
+        StorageDead(_11);
+        StorageDead(_10);
+        StorageLive(_12);
+        StorageLive(_13);
+        _13 = copy _7;
+        _12 = opaque::<&T>(move _13) -> [return: bb6, unwind: bb11];
+    }
+
+    bb6: {
+        StorageDead(_13);
+        StorageDead(_12);
+        StorageLive(_14);
+        StorageLive(_15);
+        _15 = copy _8;
+        _14 = opaque::<&[T]>(move _15) -> [return: bb7, unwind: bb11];
+    }
+
+    bb7: {
+        StorageDead(_15);
+        StorageDead(_14);
+        StorageLive(_16);
+        StorageLive(_17);
+        _17 = copy _9;
+        _16 = opaque::<&T>(move _17) -> [return: bb8, unwind: bb11];
+    }
+
+    bb8: {
+        StorageDead(_17);
+        StorageDead(_16);
+        _0 = const ();
+        StorageDead(_9);
+        StorageDead(_8);
+        StorageDead(_7);
+        StorageDead(_6);
+        goto -> bb10;
+    }
+
+    bb9: {
+        _0 = const ();
+        goto -> bb10;
+    }
+
+    bb10: {
+        return;
+    }
+
+    bb11 (cleanup): {
+        resume;
+    }
+}
diff --git a/tests/mir-opt/building/match/array_len.slice_len.built.after.panic-unwind.mir b/tests/mir-opt/building/match/array_len.slice_len.built.after.panic-unwind.mir
new file mode 100644
index 00000000000..d73f5a1b6f7
--- /dev/null
+++ b/tests/mir-opt/building/match/array_len.slice_len.built.after.panic-unwind.mir
@@ -0,0 +1,115 @@
+// MIR for `slice_len` after built
+
+fn slice_len(_1: &[T]) -> () {
+    debug x => _1;
+    let mut _0: ();
+    let mut _2: usize;
+    let mut _3: usize;
+    let mut _4: usize;
+    let mut _5: bool;
+    let _10: ();
+    let mut _11: &T;
+    let _12: ();
+    let mut _13: &T;
+    let _14: ();
+    let mut _15: &[T];
+    let _16: ();
+    let mut _17: &T;
+    scope 1 {
+        debug a => _6;
+        debug b => _7;
+        debug rest => _8;
+        debug e => _9;
+        let _6: &T;
+        let _7: &T;
+        let _8: &[T];
+        let _9: &T;
+    }
+
+    bb0: {
+        PlaceMention(_1);
+        _3 = PtrMetadata(copy _1);
+        _2 = move _3;
+        _4 = const 3_usize;
+        _5 = Ge(move _2, move _4);
+        switchInt(move _5) -> [0: bb1, otherwise: bb2];
+    }
+
+    bb1: {
+        goto -> bb9;
+    }
+
+    bb2: {
+        falseEdge -> [real: bb4, imaginary: bb1];
+    }
+
+    bb3: {
+        goto -> bb1;
+    }
+
+    bb4: {
+        StorageLive(_6);
+        _6 = &(*_1)[0 of 3];
+        StorageLive(_7);
+        _7 = &(*_1)[1 of 3];
+        StorageLive(_8);
+        _8 = &(*_1)[2:-1];
+        StorageLive(_9);
+        _9 = &(*_1)[-1 of 3];
+        StorageLive(_10);
+        StorageLive(_11);
+        _11 = copy _6;
+        _10 = opaque::<&T>(move _11) -> [return: bb5, unwind: bb11];
+    }
+
+    bb5: {
+        StorageDead(_11);
+        StorageDead(_10);
+        StorageLive(_12);
+        StorageLive(_13);
+        _13 = copy _7;
+        _12 = opaque::<&T>(move _13) -> [return: bb6, unwind: bb11];
+    }
+
+    bb6: {
+        StorageDead(_13);
+        StorageDead(_12);
+        StorageLive(_14);
+        StorageLive(_15);
+        _15 = copy _8;
+        _14 = opaque::<&[T]>(move _15) -> [return: bb7, unwind: bb11];
+    }
+
+    bb7: {
+        StorageDead(_15);
+        StorageDead(_14);
+        StorageLive(_16);
+        StorageLive(_17);
+        _17 = copy _9;
+        _16 = opaque::<&T>(move _17) -> [return: bb8, unwind: bb11];
+    }
+
+    bb8: {
+        StorageDead(_17);
+        StorageDead(_16);
+        _0 = const ();
+        StorageDead(_9);
+        StorageDead(_8);
+        StorageDead(_7);
+        StorageDead(_6);
+        goto -> bb10;
+    }
+
+    bb9: {
+        _0 = const ();
+        goto -> bb10;
+    }
+
+    bb10: {
+        return;
+    }
+
+    bb11 (cleanup): {
+        resume;
+    }
+}
diff --git a/tests/mir-opt/coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.panic-abort.mir b/tests/mir-opt/coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.panic-abort.mir
index 7e033916fd3..33fbca7f77e 100644
--- a/tests/mir-opt/coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.panic-abort.mir
+++ b/tests/mir-opt/coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.panic-abort.mir
@@ -7,15 +7,14 @@ fn main::{closure#0}(_1: *mut {coroutine@$DIR/coroutine_drop_cleanup.rs:12:5: 12
     let _4: ();
     let mut _5: ();
     let mut _6: ();
-    let mut _7: ();
-    let mut _8: u32;
+    let mut _7: u32;
     scope 1 {
         debug _s => (((*_1) as variant#3).0: std::string::String);
     }
 
     bb0: {
-        _8 = discriminant((*_1));
-        switchInt(move _8) -> [0: bb5, 3: bb8, otherwise: bb9];
+        _7 = discriminant((*_1));
+        switchInt(move _7) -> [0: bb5, 3: bb8, otherwise: bb9];
     }
 
     bb1: {
diff --git a/tests/mir-opt/coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.panic-unwind.mir b/tests/mir-opt/coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.panic-unwind.mir
index 613ef2909b5..69e7219af9f 100644
--- a/tests/mir-opt/coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.panic-unwind.mir
+++ b/tests/mir-opt/coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.panic-unwind.mir
@@ -7,15 +7,14 @@ fn main::{closure#0}(_1: *mut {coroutine@$DIR/coroutine_drop_cleanup.rs:12:5: 12
     let _4: ();
     let mut _5: ();
     let mut _6: ();
-    let mut _7: ();
-    let mut _8: u32;
+    let mut _7: u32;
     scope 1 {
         debug _s => (((*_1) as variant#3).0: std::string::String);
     }
 
     bb0: {
-        _8 = discriminant((*_1));
-        switchInt(move _8) -> [0: bb7, 3: bb10, otherwise: bb11];
+        _7 = discriminant((*_1));
+        switchInt(move _7) -> [0: bb7, 3: bb10, otherwise: bb11];
     }
 
     bb1: {
diff --git a/tests/mir-opt/coroutine_tiny.main-{closure#0}.coroutine_resume.0.mir b/tests/mir-opt/coroutine_tiny.main-{closure#0}.coroutine_resume.0.mir
index f8b3f68d21e..9905cc3e00f 100644
--- a/tests/mir-opt/coroutine_tiny.main-{closure#0}.coroutine_resume.0.mir
+++ b/tests/mir-opt/coroutine_tiny.main-{closure#0}.coroutine_resume.0.mir
@@ -1,7 +1,7 @@
 // MIR for `main::{closure#0}` 0 coroutine_resume
 /* coroutine_layout = CoroutineLayout {
     field_tys: {
-        _0: CoroutineSavedTy {
+        _s0: CoroutineSavedTy {
             ty: HasDrop,
             source_info: SourceInfo {
                 span: $DIR/coroutine_tiny.rs:22:13: 22:15 (#0),
@@ -14,15 +14,15 @@
         Unresumed(0): [],
         Returned (1): [],
         Panicked (2): [],
-        Suspend0 (3): [_0],
+        Suspend0 (3): [_s0],
     },
     storage_conflicts: BitMatrix(1x1) {
-        (_0, _0),
+        (_s0, _s0),
     },
 } */
 
 fn main::{closure#0}(_1: Pin<&mut {coroutine@$DIR/coroutine_tiny.rs:21:5: 21:13}>, _2: u8) -> CoroutineState<(), ()> {
-    debug _x => _10;
+    debug _x => _2;
     let mut _0: std::ops::CoroutineState<(), ()>;
     let _3: HasDrop;
     let mut _4: !;
@@ -31,19 +31,17 @@ fn main::{closure#0}(_1: Pin<&mut {coroutine@$DIR/coroutine_tiny.rs:21:5: 21:13}
     let mut _7: ();
     let _8: ();
     let mut _9: ();
-    let _10: u8;
-    let mut _11: u32;
+    let mut _10: u32;
     scope 1 {
         debug _d => (((*(_1.0: &mut {coroutine@$DIR/coroutine_tiny.rs:21:5: 21:13})) as variant#3).0: HasDrop);
     }
 
     bb0: {
-        _11 = discriminant((*(_1.0: &mut {coroutine@$DIR/coroutine_tiny.rs:21:5: 21:13})));
-        switchInt(move _11) -> [0: bb1, 3: bb5, otherwise: bb6];
+        _10 = discriminant((*(_1.0: &mut {coroutine@$DIR/coroutine_tiny.rs:21:5: 21:13})));
+        switchInt(move _10) -> [0: bb1, 3: bb5, otherwise: bb6];
     }
 
     bb1: {
-        _10 = move _2;
         nop;
         (((*(_1.0: &mut {coroutine@$DIR/coroutine_tiny.rs:21:5: 21:13})) as variant#3).0: HasDrop) = HasDrop;
         StorageLive(_4);
diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-abort.diff
new file mode 100644
index 00000000000..fd9ef54fe77
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-abort.diff
@@ -0,0 +1,77 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+  
+  fn main() -> () {
+      let mut _0: ();
+      let _1: u32;
+      let mut _2: &[u32];
+      let mut _3: &[u32; 3];
+      let _4: &[u32; 3];
+      let _5: [u32; 3];
+      let _6: usize;
+      let mut _7: usize;
+      let mut _8: bool;
+      let mut _10: &[u32];
+      let _11: usize;
+      let mut _12: usize;
+      let mut _13: bool;
+      let mut _14: &[u32; 3];
+      scope 1 {
+          debug local => _1;
+          let _9: u32;
+          scope 2 {
+              debug constant => _9;
+          }
+      }
+  
+      bb0: {
+          StorageLive(_1);
+          StorageLive(_2);
+          StorageLive(_3);
+          StorageLive(_4);
+          _14 = const main::promoted[0];
+          _4 = copy _14;
+          _3 = copy _4;
+          _2 = move _3 as &[u32] (PointerCoercion(Unsize, AsCast));
+          StorageDead(_3);
+          StorageLive(_6);
+          _6 = const 1_usize;
+-         _7 = PtrMetadata(copy _2);
+-         _8 = Lt(copy _6, copy _7);
+-         assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable];
++         _7 = const 3_usize;
++         _8 = const true;
++         assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind unreachable];
+      }
+  
+      bb1: {
+-         _1 = copy (*_2)[_6];
++         _1 = copy (*_2)[1 of 2];
+          StorageDead(_6);
+          StorageDead(_4);
+          StorageDead(_2);
+          StorageLive(_9);
+          StorageLive(_10);
+          _10 = const main::SLICE;
+          StorageLive(_11);
+          _11 = const 1_usize;
+-         _12 = PtrMetadata(copy _10);
+-         _13 = Lt(copy _11, copy _12);
+-         assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb2, unwind unreachable];
++         _12 = const 3_usize;
++         _13 = const true;
++         assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb2, unwind unreachable];
+      }
+  
+      bb2: {
+-         _9 = copy (*_10)[_11];
++         _9 = copy (*_10)[1 of 2];
+          StorageDead(_11);
+          StorageDead(_10);
+          _0 = const ();
+          StorageDead(_9);
+          StorageDead(_1);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-unwind.diff
new file mode 100644
index 00000000000..1fec08c2562
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.32bit.panic-unwind.diff
@@ -0,0 +1,77 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+  
+  fn main() -> () {
+      let mut _0: ();
+      let _1: u32;
+      let mut _2: &[u32];
+      let mut _3: &[u32; 3];
+      let _4: &[u32; 3];
+      let _5: [u32; 3];
+      let _6: usize;
+      let mut _7: usize;
+      let mut _8: bool;
+      let mut _10: &[u32];
+      let _11: usize;
+      let mut _12: usize;
+      let mut _13: bool;
+      let mut _14: &[u32; 3];
+      scope 1 {
+          debug local => _1;
+          let _9: u32;
+          scope 2 {
+              debug constant => _9;
+          }
+      }
+  
+      bb0: {
+          StorageLive(_1);
+          StorageLive(_2);
+          StorageLive(_3);
+          StorageLive(_4);
+          _14 = const main::promoted[0];
+          _4 = copy _14;
+          _3 = copy _4;
+          _2 = move _3 as &[u32] (PointerCoercion(Unsize, AsCast));
+          StorageDead(_3);
+          StorageLive(_6);
+          _6 = const 1_usize;
+-         _7 = PtrMetadata(copy _2);
+-         _8 = Lt(copy _6, copy _7);
+-         assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue];
++         _7 = const 3_usize;
++         _8 = const true;
++         assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind continue];
+      }
+  
+      bb1: {
+-         _1 = copy (*_2)[_6];
++         _1 = copy (*_2)[1 of 2];
+          StorageDead(_6);
+          StorageDead(_4);
+          StorageDead(_2);
+          StorageLive(_9);
+          StorageLive(_10);
+          _10 = const main::SLICE;
+          StorageLive(_11);
+          _11 = const 1_usize;
+-         _12 = PtrMetadata(copy _10);
+-         _13 = Lt(copy _11, copy _12);
+-         assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb2, unwind continue];
++         _12 = const 3_usize;
++         _13 = const true;
++         assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb2, unwind continue];
+      }
+  
+      bb2: {
+-         _9 = copy (*_10)[_11];
++         _9 = copy (*_10)[1 of 2];
+          StorageDead(_11);
+          StorageDead(_10);
+          _0 = const ();
+          StorageDead(_9);
+          StorageDead(_1);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-abort.diff
new file mode 100644
index 00000000000..fd9ef54fe77
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-abort.diff
@@ -0,0 +1,77 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+  
+  fn main() -> () {
+      let mut _0: ();
+      let _1: u32;
+      let mut _2: &[u32];
+      let mut _3: &[u32; 3];
+      let _4: &[u32; 3];
+      let _5: [u32; 3];
+      let _6: usize;
+      let mut _7: usize;
+      let mut _8: bool;
+      let mut _10: &[u32];
+      let _11: usize;
+      let mut _12: usize;
+      let mut _13: bool;
+      let mut _14: &[u32; 3];
+      scope 1 {
+          debug local => _1;
+          let _9: u32;
+          scope 2 {
+              debug constant => _9;
+          }
+      }
+  
+      bb0: {
+          StorageLive(_1);
+          StorageLive(_2);
+          StorageLive(_3);
+          StorageLive(_4);
+          _14 = const main::promoted[0];
+          _4 = copy _14;
+          _3 = copy _4;
+          _2 = move _3 as &[u32] (PointerCoercion(Unsize, AsCast));
+          StorageDead(_3);
+          StorageLive(_6);
+          _6 = const 1_usize;
+-         _7 = PtrMetadata(copy _2);
+-         _8 = Lt(copy _6, copy _7);
+-         assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind unreachable];
++         _7 = const 3_usize;
++         _8 = const true;
++         assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind unreachable];
+      }
+  
+      bb1: {
+-         _1 = copy (*_2)[_6];
++         _1 = copy (*_2)[1 of 2];
+          StorageDead(_6);
+          StorageDead(_4);
+          StorageDead(_2);
+          StorageLive(_9);
+          StorageLive(_10);
+          _10 = const main::SLICE;
+          StorageLive(_11);
+          _11 = const 1_usize;
+-         _12 = PtrMetadata(copy _10);
+-         _13 = Lt(copy _11, copy _12);
+-         assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb2, unwind unreachable];
++         _12 = const 3_usize;
++         _13 = const true;
++         assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb2, unwind unreachable];
+      }
+  
+      bb2: {
+-         _9 = copy (*_10)[_11];
++         _9 = copy (*_10)[1 of 2];
+          StorageDead(_11);
+          StorageDead(_10);
+          _0 = const ();
+          StorageDead(_9);
+          StorageDead(_1);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-unwind.diff
new file mode 100644
index 00000000000..1fec08c2562
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/slice_len.main.DataflowConstProp.64bit.panic-unwind.diff
@@ -0,0 +1,77 @@
+- // MIR for `main` before DataflowConstProp
++ // MIR for `main` after DataflowConstProp
+  
+  fn main() -> () {
+      let mut _0: ();
+      let _1: u32;
+      let mut _2: &[u32];
+      let mut _3: &[u32; 3];
+      let _4: &[u32; 3];
+      let _5: [u32; 3];
+      let _6: usize;
+      let mut _7: usize;
+      let mut _8: bool;
+      let mut _10: &[u32];
+      let _11: usize;
+      let mut _12: usize;
+      let mut _13: bool;
+      let mut _14: &[u32; 3];
+      scope 1 {
+          debug local => _1;
+          let _9: u32;
+          scope 2 {
+              debug constant => _9;
+          }
+      }
+  
+      bb0: {
+          StorageLive(_1);
+          StorageLive(_2);
+          StorageLive(_3);
+          StorageLive(_4);
+          _14 = const main::promoted[0];
+          _4 = copy _14;
+          _3 = copy _4;
+          _2 = move _3 as &[u32] (PointerCoercion(Unsize, AsCast));
+          StorageDead(_3);
+          StorageLive(_6);
+          _6 = const 1_usize;
+-         _7 = PtrMetadata(copy _2);
+-         _8 = Lt(copy _6, copy _7);
+-         assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, copy _6) -> [success: bb1, unwind continue];
++         _7 = const 3_usize;
++         _8 = const true;
++         assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb1, unwind continue];
+      }
+  
+      bb1: {
+-         _1 = copy (*_2)[_6];
++         _1 = copy (*_2)[1 of 2];
+          StorageDead(_6);
+          StorageDead(_4);
+          StorageDead(_2);
+          StorageLive(_9);
+          StorageLive(_10);
+          _10 = const main::SLICE;
+          StorageLive(_11);
+          _11 = const 1_usize;
+-         _12 = PtrMetadata(copy _10);
+-         _13 = Lt(copy _11, copy _12);
+-         assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, copy _11) -> [success: bb2, unwind continue];
++         _12 = const 3_usize;
++         _13 = const true;
++         assert(const true, "index out of bounds: the length is {} but the index is {}", const 3_usize, const 1_usize) -> [success: bb2, unwind continue];
+      }
+  
+      bb2: {
+-         _9 = copy (*_10)[_11];
++         _9 = copy (*_10)[1 of 2];
+          StorageDead(_11);
+          StorageDead(_10);
+          _0 = const ();
+          StorageDead(_9);
+          StorageDead(_1);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.rs b/tests/mir-opt/dataflow-const-prop/slice_len.rs
new file mode 100644
index 00000000000..e0e68f9fde5
--- /dev/null
+++ b/tests/mir-opt/dataflow-const-prop/slice_len.rs
@@ -0,0 +1,34 @@
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+//@ test-mir-pass: DataflowConstProp
+//@ compile-flags: -Zmir-enable-passes=+InstSimplify-after-simplifycfg
+// EMIT_MIR_FOR_EACH_BIT_WIDTH
+
+// EMIT_MIR slice_len.main.DataflowConstProp.diff
+
+// CHECK-LABEL: fn main(
+fn main() {
+    // CHECK: debug local => [[local:_.*]];
+    // CHECK: debug constant => [[constant:_.*]];
+
+    // CHECK-NOT: {{_.*}} = Len(
+    // CHECK-NOT: {{_.*}} = Lt(
+    // CHECK-NOT: assert(move _
+    // CHECK: {{_.*}} = const 3_usize;
+    // CHECK: {{_.*}} = const true;
+    // CHECK: assert(const true,
+
+    // CHECK: [[local]] = copy (*{{_.*}})[1 of 2];
+    let local = (&[1u32, 2, 3] as &[u32])[1];
+
+    // CHECK-NOT: {{_.*}} = Len(
+    // CHECK-NOT: {{_.*}} = Lt(
+    // CHECK-NOT: assert(move _
+    const SLICE: &[u32] = &[1, 2, 3];
+    // CHECK: {{_.*}} = const 3_usize;
+    // CHECK: {{_.*}} = const true;
+    // CHECK: assert(const true,
+
+    // CHECK-NOT: [[constant]] = {{copy|move}} (*{{_.*}})[_
+    // CHECK: [[constant]] = copy (*{{_.*}})[1 of 2];
+    let constant = SLICE[1];
+}
diff --git a/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff
index ff18df1efcf..d584de6861c 100644
--- a/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff
+++ b/tests/mir-opt/dead-store-elimination/cycle.cycle.DeadStoreElimination-initial.diff
@@ -19,10 +19,6 @@
 -         _3 = copy _2;
 -         _2 = copy _1;
 -         _1 = copy _5;
-+         nop;
-+         nop;
-+         nop;
-+         nop;
           _4 = cond() -> [return: bb1, unwind continue];
       }
   
diff --git a/tests/mir-opt/dead-store-elimination/ref.dead_first.DeadStoreElimination-initial.diff b/tests/mir-opt/dead-store-elimination/ref.dead_first.DeadStoreElimination-initial.diff
new file mode 100644
index 00000000000..2a793e24990
--- /dev/null
+++ b/tests/mir-opt/dead-store-elimination/ref.dead_first.DeadStoreElimination-initial.diff
@@ -0,0 +1,30 @@
+- // MIR for `dead_first` before DeadStoreElimination-initial
++ // MIR for `dead_first` after DeadStoreElimination-initial
+  
+  fn dead_first(_1: &Foo) -> &i32 {
+      debug v => _1;
+      let mut _0: &i32;
+      let mut _2: &i32;
+      let mut _3: &i32;
+      let _4: &i32;
+      scope 1 {
+          debug a => _2;
+      }
+  
+      bb0: {
+          StorageLive(_2);
+-         _2 = &((*_1).2: i32);
++         // DBG: _2 = &((*_1).2: i32);
+          StorageLive(_3);
+          StorageLive(_4);
+          _4 = &((*_1).0: i32);
+          _3 = &(*_4);
+          _2 = move _3;
+          StorageDead(_3);
+          StorageDead(_4);
+          _0 = &(*_2);
+          StorageDead(_2);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/dead-store-elimination/ref.rs b/tests/mir-opt/dead-store-elimination/ref.rs
new file mode 100644
index 00000000000..2d3200edab9
--- /dev/null
+++ b/tests/mir-opt/dead-store-elimination/ref.rs
@@ -0,0 +1,31 @@
+//@ test-mir-pass: DeadStoreElimination-initial
+
+pub struct Foo {
+    a: i32,
+    b: i64,
+    c: i32,
+}
+
+// EMIT_MIR ref.tuple.DeadStoreElimination-initial.diff
+pub fn tuple(v: (i32, &Foo)) -> i32 {
+    // CHECK-LABEL: fn tuple
+    // CHECK: debug _dead => [[dead:_[0-9]+]];
+    // CHECK: bb0:
+    // CHECK: DBG: [[dead]] = &((*_3).2: i32)
+    let _dead = &v.1.c;
+    v.1.a
+}
+
+// EMIT_MIR ref.dead_first.DeadStoreElimination-initial.diff
+pub fn dead_first(v: &Foo) -> &i32 {
+    // CHECK-LABEL: fn dead_first
+    // CHECK: debug a => [[var_a:_[0-9]+]];
+    // CHECK: bb0:
+    // CHECK: DBG: [[var_a]] = &((*_1).2: i32)
+    // CHECK: [[tmp_4:_[0-9]+]] = &((*_1).0: i32)
+    // CHECK: [[tmp_3:_[0-9]+]] = &(*[[tmp_4]])
+    // CHECK: [[var_a]] = move [[tmp_3]]
+    let mut a = &v.c;
+    a = &v.a;
+    a
+}
diff --git a/tests/mir-opt/dead-store-elimination/ref.tuple.DeadStoreElimination-initial.diff b/tests/mir-opt/dead-store-elimination/ref.tuple.DeadStoreElimination-initial.diff
new file mode 100644
index 00000000000..0b96569cbe4
--- /dev/null
+++ b/tests/mir-opt/dead-store-elimination/ref.tuple.DeadStoreElimination-initial.diff
@@ -0,0 +1,25 @@
+- // MIR for `tuple` before DeadStoreElimination-initial
++ // MIR for `tuple` after DeadStoreElimination-initial
+  
+  fn tuple(_1: (i32, &Foo)) -> i32 {
+      debug v => _1;
+      let mut _0: i32;
+      let _2: &i32;
+      let mut _3: &Foo;
+      let mut _4: &Foo;
+      scope 1 {
+          debug _dead => _2;
+      }
+  
+      bb0: {
+-         StorageLive(_2);
+-         _3 = deref_copy (_1.1: &Foo);
+-         _2 = &((*_3).2: i32);
++         // DBG: _2 = &((*_3).2: i32);
+          _4 = deref_copy (_1.1: &Foo);
+          _0 = copy ((*_4).0: i32);
+-         StorageDead(_2);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/debuginfo/simplifycfg.drop_debuginfo.SimplifyCfg-final.diff b/tests/mir-opt/debuginfo/simplifycfg.drop_debuginfo.SimplifyCfg-final.diff
new file mode 100644
index 00000000000..d4a73351ee4
--- /dev/null
+++ b/tests/mir-opt/debuginfo/simplifycfg.drop_debuginfo.SimplifyCfg-final.diff
@@ -0,0 +1,26 @@
+- // MIR for `drop_debuginfo` before SimplifyCfg-final
++ // MIR for `drop_debuginfo` after SimplifyCfg-final
+  
+  fn drop_debuginfo(_1: &Foo, _2: bool) -> i32 {
+      debug foo_a => _3;
+      debug foo_b => _4;
+      let mut _0: i32;
+      let mut _3: &i32;
+      let mut _4: &i64;
+  
+      bb0: {
+-         switchInt(copy _2) -> [1: bb1, otherwise: bb2];
+-     }
+- 
+-     bb1: {
+-         // DBG: _3 = &((*_1).0: i32);
+-         goto -> bb2;
+-     }
+- 
+-     bb2: {
+          // DBG: _4 = &((*_1).1: i64);
+          _0 = copy ((*_1).2: i32);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_1.SimplifyCfg-final.diff b/tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_1.SimplifyCfg-final.diff
new file mode 100644
index 00000000000..1c12358ad89
--- /dev/null
+++ b/tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_1.SimplifyCfg-final.diff
@@ -0,0 +1,30 @@
+- // MIR for `preserve_debuginfo_1` before SimplifyCfg-final
++ // MIR for `preserve_debuginfo_1` after SimplifyCfg-final
+  
+  fn preserve_debuginfo_1(_1: &Foo, _2: &mut bool) -> i32 {
+      debug foo_a => _3;
+      debug foo_b => _4;
+      debug foo_c => _5;
+      let mut _0: i32;
+      let mut _3: &i32;
+      let mut _4: &i64;
+      let mut _5: &i32;
+  
+      bb0: {
+-         goto -> bb1;
+-     }
+- 
+-     bb1: {
+          (*_2) = const true;
+          // DBG: _3 = &((*_1).0: i32);
+-         goto -> bb2;
+-     }
+- 
+-     bb2: {
+          // DBG: _4 = &((*_1).1: i64);
+          _0 = copy ((*_1).2: i32);
+          // DBG: _5 = &((*_1).2: i32);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_2.SimplifyCfg-final.diff b/tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_2.SimplifyCfg-final.diff
new file mode 100644
index 00000000000..de8e5612c87
--- /dev/null
+++ b/tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_2.SimplifyCfg-final.diff
@@ -0,0 +1,29 @@
+- // MIR for `preserve_debuginfo_2` before SimplifyCfg-final
++ // MIR for `preserve_debuginfo_2` after SimplifyCfg-final
+  
+  fn preserve_debuginfo_2(_1: &Foo) -> i32 {
+      debug foo_a => _2;
+      debug foo_b => _3;
+      debug foo_c => _4;
+      let mut _0: i32;
+      let mut _2: &i32;
+      let mut _3: &i64;
+      let mut _4: &i32;
+  
+      bb0: {
+-         goto -> bb1;
+-     }
+- 
+-     bb1: {
+          // DBG: _2 = &((*_1).0: i32);
+-         goto -> bb2;
+-     }
+- 
+-     bb2: {
+          // DBG: _3 = &((*_1).1: i64);
+          _0 = copy ((*_1).2: i32);
+          // DBG: _4 = &((*_1).2: i32);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_3.SimplifyCfg-final.diff b/tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_3.SimplifyCfg-final.diff
new file mode 100644
index 00000000000..11372a262a7
--- /dev/null
+++ b/tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_3.SimplifyCfg-final.diff
@@ -0,0 +1,37 @@
+- // MIR for `preserve_debuginfo_3` before SimplifyCfg-final
++ // MIR for `preserve_debuginfo_3` after SimplifyCfg-final
+  
+  fn preserve_debuginfo_3(_1: &Foo, _2: bool) -> i32 {
+      debug foo_a => _3;
+      debug foo_b => _4;
+      debug foo_c => _5;
+      let mut _0: i32;
+      let mut _3: &i32;
+      let mut _4: &i64;
+      let mut _5: &i32;
+  
+      bb0: {
+-         switchInt(copy _2) -> [1: bb1, otherwise: bb2];
++         switchInt(copy _2) -> [1: bb2, otherwise: bb1];
+      }
+  
+      bb1: {
+-         // DBG: _3 = &((*_1).0: i32);
+-         goto -> bb3;
+-     }
+- 
+-     bb2: {
+          // DBG: _4 = &((*_1).1: i64);
+          _0 = copy ((*_1).2: i32);
+          return;
+      }
+  
+-     bb3: {
++     bb2: {
++         // DBG: _3 = &((*_1).0: i32);
+          // DBG: _5 = &((*_1).2: i32);
+          _0 = copy ((*_1).0: i32);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_identical_succs.SimplifyCfg-final.diff b/tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_identical_succs.SimplifyCfg-final.diff
new file mode 100644
index 00000000000..0c6a75237d8
--- /dev/null
+++ b/tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_identical_succs.SimplifyCfg-final.diff
@@ -0,0 +1,29 @@
+- // MIR for `preserve_debuginfo_identical_succs` before SimplifyCfg-final
++ // MIR for `preserve_debuginfo_identical_succs` after SimplifyCfg-final
+  
+  fn preserve_debuginfo_identical_succs(_1: &Foo, _2: bool) -> i32 {
+      debug foo_a => _3;
+      debug foo_b => _4;
+      debug foo_c => _5;
+      let mut _0: i32;
+      let mut _3: &i32;
+      let mut _4: &i64;
+      let mut _5: &i32;
+  
+      bb0: {
+-         switchInt(copy _2) -> [1: bb1, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+          // DBG: _3 = &((*_1).0: i32);
+-         goto -> bb2;
+-     }
+- 
+-     bb2: {
+          // DBG: _4 = &((*_1).1: i64);
+          _0 = copy ((*_1).2: i32);
+          // DBG: _5 = &((*_1).2: i32);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/debuginfo/simplifycfg.rs b/tests/mir-opt/debuginfo/simplifycfg.rs
new file mode 100644
index 00000000000..2bd510fd3b9
--- /dev/null
+++ b/tests/mir-opt/debuginfo/simplifycfg.rs
@@ -0,0 +1,207 @@
+//@ test-mir-pass: SimplifyCfg-final
+//@ compile-flags: -Zmir-enable-passes=+DeadStoreElimination-initial
+
+#![feature(core_intrinsics, custom_mir)]
+#![crate_type = "lib"]
+
+use std::intrinsics::mir::*;
+
+pub struct Foo {
+    a: i32,
+    b: i64,
+    c: i32,
+}
+
+// EMIT_MIR simplifycfg.drop_debuginfo.SimplifyCfg-final.diff
+#[custom_mir(dialect = "runtime", phase = "post-cleanup")]
+pub fn drop_debuginfo(foo: &Foo, c: bool) -> i32 {
+    // CHECK-LABEL: fn drop_debuginfo
+    // CHECK: debug foo_b => [[foo_b:_[0-9]+]];
+    // CHECK: bb0: {
+    // CHECK-NEXT: DBG: [[foo_b]] = &((*_1).1: i64)
+    // CHECK-NEXT: _0 = copy ((*_1).2: i32);
+    // CHECK-NEXT: return;
+    mir! {
+        let _foo_a: &i32;
+        let _foo_b: &i64;
+        debug foo_a => _foo_a;
+        debug foo_b => _foo_b;
+        {
+            match c {
+                true => tmp,
+                _ => ret,
+            }
+        }
+        tmp = {
+            // Because we don't know if `c` is always true, we must drop this debuginfo.
+            _foo_a = &(*foo).a;
+            Goto(ret)
+        }
+        ret = {
+            _foo_b = &(*foo).b;
+            RET = (*foo).c;
+            Return()
+        }
+    }
+}
+
+// EMIT_MIR simplifycfg.preserve_debuginfo_1.SimplifyCfg-final.diff
+#[custom_mir(dialect = "runtime", phase = "post-cleanup")]
+pub fn preserve_debuginfo_1(foo: &Foo, v: &mut bool) -> i32 {
+    // CHECK-LABEL: fn preserve_debuginfo_1
+    // CHECK: debug foo_a => [[foo_a:_[0-9]+]];
+    // CHECK: debug foo_b => [[foo_b:_[0-9]+]];
+    // CHECK: debug foo_c => [[foo_c:_[0-9]+]];
+    // CHECK: bb0: {
+    // CHECK-NEXT: (*_2) = const true;
+    // CHECK-NEXT: DBG: [[foo_a]] = &((*_1).0: i32)
+    // CHECK-NEXT: DBG: [[foo_b]] = &((*_1).1: i64)
+    // CHECK-NEXT: _0 = copy ((*_1).2: i32);
+    // CHECK-NEXT: DBG: [[foo_c]] = &((*_1).2: i32)
+    // CHECK-NEXT: return;
+    mir! {
+        let _foo_a: &i32;
+        let _foo_b: &i64;
+        let _foo_c: &i32;
+        debug foo_a => _foo_a;
+        debug foo_b => _foo_b;
+        debug foo_c => _foo_c;
+        {
+            Goto(tmp)
+        }
+        tmp = {
+            *v = true;
+            _foo_a = &(*foo).a;
+            Goto(ret)
+        }
+        ret = {
+            _foo_b = &(*foo).b;
+            RET = (*foo).c;
+            _foo_c = &(*foo).c;
+            Return()
+        }
+    }
+}
+
+// EMIT_MIR simplifycfg.preserve_debuginfo_2.SimplifyCfg-final.diff
+#[custom_mir(dialect = "runtime", phase = "post-cleanup")]
+pub fn preserve_debuginfo_2(foo: &Foo) -> i32 {
+    // CHECK-LABEL: fn preserve_debuginfo_2
+    // CHECK: debug foo_a => [[foo_a:_[0-9]+]];
+    // CHECK: debug foo_b => [[foo_b:_[0-9]+]];
+    // CHECK: debug foo_c => [[foo_c:_[0-9]+]];
+    // CHECK: bb0: {
+    // CHECK-NEXT: DBG: [[foo_a]] = &((*_1).0: i32)
+    // CHECK-NEXT: DBG: [[foo_b]] = &((*_1).1: i64)
+    // CHECK-NEXT: _0 = copy ((*_1).2: i32);
+    // CHECK-NEXT: DBG: [[foo_c]] = &((*_1).2: i32)
+    // CHECK-NEXT: return;
+    mir! {
+        let _foo_a: &i32;
+        let _foo_b: &i64;
+        let _foo_c: &i32;
+        debug foo_a => _foo_a;
+        debug foo_b => _foo_b;
+        debug foo_c => _foo_c;
+        {
+            Goto(tmp)
+        }
+        tmp = {
+            _foo_a = &(*foo).a;
+            Goto(ret)
+        }
+        ret = {
+            _foo_b = &(*foo).b;
+            RET = (*foo).c;
+            _foo_c = &(*foo).c;
+            Return()
+        }
+    }
+}
+
+// EMIT_MIR simplifycfg.preserve_debuginfo_3.SimplifyCfg-final.diff
+#[custom_mir(dialect = "runtime", phase = "post-cleanup")]
+pub fn preserve_debuginfo_3(foo: &Foo, c: bool) -> i32 {
+    // CHECK-LABEL: fn preserve_debuginfo_3
+    // CHECK: debug foo_a => [[foo_a:_[0-9]+]];
+    // CHECK: debug foo_b => [[foo_b:_[0-9]+]];
+    // CHECK: debug foo_c => [[foo_c:_[0-9]+]];
+    // CHECK: bb0: {
+    // CHECK-NEXT: switchInt(copy _2) -> [1: bb2, otherwise: bb1];
+    // CHECK: bb1: {
+    // CHECK-NEXT: DBG: [[foo_b]] = &((*_1).1: i64)
+    // CHECK-NEXT: _0 = copy ((*_1).2: i32);
+    // CHECK-NEXT: return;
+    // CHECK: bb2: {
+    // CHECK-NEXT: DBG: [[foo_a]] = &((*_1).0: i32)
+    // CHECK-NEXT: DBG: [[foo_c]] = &((*_1).2: i32)
+    // CHECK-NEXT: _0 = copy ((*_1).0: i32);
+    // CHECK-NEXT: return;
+    mir! {
+        let _foo_a: &i32;
+        let _foo_b: &i64;
+        let _foo_c: &i32;
+        debug foo_a => _foo_a;
+        debug foo_b => _foo_b;
+        debug foo_c => _foo_c;
+        {
+            match c {
+                true => tmp,
+                _ => ret,
+            }
+        }
+        tmp = {
+            _foo_a = &(*foo).a;
+            Goto(ret_1)
+        }
+        ret = {
+            _foo_b = &(*foo).b;
+            RET = (*foo).c;
+            Return()
+        }
+        ret_1 = {
+            _foo_c = &(*foo).c;
+            RET = (*foo).a;
+            Return()
+        }
+    }
+}
+
+// EMIT_MIR simplifycfg.preserve_debuginfo_identical_succs.SimplifyCfg-final.diff
+#[custom_mir(dialect = "runtime", phase = "post-cleanup")]
+pub fn preserve_debuginfo_identical_succs(foo: &Foo, c: bool) -> i32 {
+    // CHECK-LABEL: fn preserve_debuginfo_identical_succs
+    // CHECK: debug foo_a => [[foo_a:_[0-9]+]];
+    // CHECK: debug foo_b => [[foo_b:_[0-9]+]];
+    // CHECK: debug foo_c => [[foo_c:_[0-9]+]];
+    // CHECK: bb0: {
+    // CHECK-NEXT: DBG: [[foo_a]] = &((*_1).0: i32)
+    // CHECK-NEXT: DBG: [[foo_b]] = &((*_1).1: i64)
+    // CHECK-NEXT: _0 = copy ((*_1).2: i32);
+    // CHECK-NEXT: DBG: [[foo_c]] = &((*_1).2: i32)
+    // CHECK-NEXT: return;
+    mir! {
+        let _foo_a: &i32;
+        let _foo_b: &i64;
+        let _foo_c: &i32;
+        debug foo_a => _foo_a;
+        debug foo_b => _foo_b;
+        debug foo_c => _foo_c;
+        {
+            match c {
+                true => tmp,
+                _ => tmp,
+            }
+        }
+        tmp = {
+            _foo_a = &(*foo).a;
+            Goto(ret)
+        }
+        ret = {
+            _foo_b = &(*foo).b;
+            RET = (*foo).c;
+            _foo_c = &(*foo).c;
+            Return()
+        }
+    }
+}
diff --git a/tests/mir-opt/dest-prop/aggregate.rewrap.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/aggregate.rewrap.DestinationPropagation.panic-abort.diff
new file mode 100644
index 00000000000..e80660f176b
--- /dev/null
+++ b/tests/mir-opt/dest-prop/aggregate.rewrap.DestinationPropagation.panic-abort.diff
@@ -0,0 +1,19 @@
+- // MIR for `rewrap` before DestinationPropagation
++ // MIR for `rewrap` after DestinationPropagation
+  
+  fn rewrap() -> (u8,) {
+      let mut _0: (u8,);
+      let mut _1: (u8,);
+      let mut _2: (u8,);
+  
+      bb0: {
+-         (_1.0: u8) = const 0_u8;
+-         _0 = copy _1;
++         (_0.0: u8) = const 0_u8;
++         nop;
+          _2 = (copy (_0.0: u8),);
+          _0 = copy _2;
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/dest-prop/aggregate.rewrap.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/aggregate.rewrap.DestinationPropagation.panic-unwind.diff
new file mode 100644
index 00000000000..e80660f176b
--- /dev/null
+++ b/tests/mir-opt/dest-prop/aggregate.rewrap.DestinationPropagation.panic-unwind.diff
@@ -0,0 +1,19 @@
+- // MIR for `rewrap` before DestinationPropagation
++ // MIR for `rewrap` after DestinationPropagation
+  
+  fn rewrap() -> (u8,) {
+      let mut _0: (u8,);
+      let mut _1: (u8,);
+      let mut _2: (u8,);
+  
+      bb0: {
+-         (_1.0: u8) = const 0_u8;
+-         _0 = copy _1;
++         (_0.0: u8) = const 0_u8;
++         nop;
+          _2 = (copy (_0.0: u8),);
+          _0 = copy _2;
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/dest-prop/aggregate.rs b/tests/mir-opt/dest-prop/aggregate.rs
new file mode 100644
index 00000000000..636852159eb
--- /dev/null
+++ b/tests/mir-opt/dest-prop/aggregate.rs
@@ -0,0 +1,51 @@
+//@ test-mir-pass: DestinationPropagation
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+
+#![feature(custom_mir, core_intrinsics)]
+#![allow(internal_features)]
+
+use std::intrinsics::mir::*;
+use std::mem::MaybeUninit;
+
+fn dump_var<T>(_: T) {}
+
+// EMIT_MIR aggregate.rewrap.DestinationPropagation.diff
+#[custom_mir(dialect = "runtime")]
+fn rewrap() -> (u8,) {
+    // CHECK-LABEL: fn rewrap(
+    // CHECK: (_0.0: u8) = const 0_u8;
+    // CHECK: _2 = (copy (_0.0: u8),);
+    // CHECK: _0 = copy _2;
+    mir! {
+        let _1: (u8,);
+        let _2: (u8,);
+        {
+            _1.0 = 0;
+            RET = _1;
+            _2 = (RET.0, );
+            RET = _2;
+            Return()
+        }
+    }
+}
+
+// EMIT_MIR aggregate.swap.DestinationPropagation.diff
+#[custom_mir(dialect = "runtime")]
+fn swap() -> (MaybeUninit<[u8; 10]>, MaybeUninit<[u8; 10]>) {
+    // CHECK-LABEL: fn swap(
+    // CHECK: _0 = const
+    // CHECK: _2 = copy _0;
+    // CHECK: _0 = (copy (_2.1: {{.*}}), copy (_2.0: {{.*}}));
+    mir! {
+        let _1: (MaybeUninit<[u8; 10]>, MaybeUninit<[u8; 10]>);
+        let _2: (MaybeUninit<[u8; 10]>, MaybeUninit<[u8; 10]>);
+        let _3: ();
+        {
+            _1 = const { (MaybeUninit::new([0; 10]), MaybeUninit::new([1; 10])) };
+            _2 = _1;
+            _1 = (_2.1, _2.0);
+            RET = _1;
+            Return()
+        }
+    }
+}
diff --git a/tests/mir-opt/dest-prop/aggregate.swap.DestinationPropagation.panic-abort.diff b/tests/mir-opt/dest-prop/aggregate.swap.DestinationPropagation.panic-abort.diff
new file mode 100644
index 00000000000..3aaad3aaf69
--- /dev/null
+++ b/tests/mir-opt/dest-prop/aggregate.swap.DestinationPropagation.panic-abort.diff
@@ -0,0 +1,22 @@
+- // MIR for `swap` before DestinationPropagation
++ // MIR for `swap` after DestinationPropagation
+  
+  fn swap() -> (MaybeUninit<[u8; 10]>, MaybeUninit<[u8; 10]>) {
+      let mut _0: (std::mem::MaybeUninit<[u8; 10]>, std::mem::MaybeUninit<[u8; 10]>);
+      let mut _1: (std::mem::MaybeUninit<[u8; 10]>, std::mem::MaybeUninit<[u8; 10]>);
+      let mut _2: (std::mem::MaybeUninit<[u8; 10]>, std::mem::MaybeUninit<[u8; 10]>);
+      let mut _3: ();
+  
+      bb0: {
+-         _1 = const swap::{constant#6};
+-         _2 = copy _1;
+-         _1 = (copy (_2.1: std::mem::MaybeUninit<[u8; 10]>), copy (_2.0: std::mem::MaybeUninit<[u8; 10]>));
+-         _0 = copy _1;
++         _0 = const swap::{constant#6};
++         _2 = copy _0;
++         _0 = (copy (_2.1: std::mem::MaybeUninit<[u8; 10]>), copy (_2.0: std::mem::MaybeUninit<[u8; 10]>));
++         nop;
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/dest-prop/aggregate.swap.DestinationPropagation.panic-unwind.diff b/tests/mir-opt/dest-prop/aggregate.swap.DestinationPropagation.panic-unwind.diff
new file mode 100644
index 00000000000..3aaad3aaf69
--- /dev/null
+++ b/tests/mir-opt/dest-prop/aggregate.swap.DestinationPropagation.panic-unwind.diff
@@ -0,0 +1,22 @@
+- // MIR for `swap` before DestinationPropagation
++ // MIR for `swap` after DestinationPropagation
+  
+  fn swap() -> (MaybeUninit<[u8; 10]>, MaybeUninit<[u8; 10]>) {
+      let mut _0: (std::mem::MaybeUninit<[u8; 10]>, std::mem::MaybeUninit<[u8; 10]>);
+      let mut _1: (std::mem::MaybeUninit<[u8; 10]>, std::mem::MaybeUninit<[u8; 10]>);
+      let mut _2: (std::mem::MaybeUninit<[u8; 10]>, std::mem::MaybeUninit<[u8; 10]>);
+      let mut _3: ();
+  
+      bb0: {
+-         _1 = const swap::{constant#6};
+-         _2 = copy _1;
+-         _1 = (copy (_2.1: std::mem::MaybeUninit<[u8; 10]>), copy (_2.0: std::mem::MaybeUninit<[u8; 10]>));
+-         _0 = copy _1;
++         _0 = const swap::{constant#6};
++         _2 = copy _0;
++         _0 = (copy (_2.1: std::mem::MaybeUninit<[u8; 10]>), copy (_2.0: std::mem::MaybeUninit<[u8; 10]>));
++         nop;
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff b/tests/mir-opt/dest-prop/nrvo_borrowed.nrvo.DestinationPropagation.panic-abort.diff
index 6dce3ec5303..e9fbcf20a72 100644
--- a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-abort.diff
+++ b/tests/mir-opt/dest-prop/nrvo_borrowed.nrvo.DestinationPropagation.panic-abort.diff
@@ -1,5 +1,5 @@
-- // MIR for `nrvo` before RenameReturnPlace
-+ // MIR for `nrvo` after RenameReturnPlace
+- // MIR for `nrvo` before DestinationPropagation
++ // MIR for `nrvo` after DestinationPropagation
   
   fn nrvo(_1: for<'a> fn(&'a mut [u8; 1024])) -> [u8; 1024] {
       debug init => _1;
@@ -10,32 +10,33 @@
       let mut _5: &mut [u8; 1024];
       let mut _6: &mut [u8; 1024];
       scope 1 {
--         debug buf => _2;
-+         debug buf => _0;
+          debug buf => _2;
       }
   
       bb0: {
--         StorageLive(_2);
--         _2 = [const 0_u8; 1024];
-+         _0 = [const 0_u8; 1024];
+          StorageLive(_2);
+          _2 = [const 0_u8; 1024];
           StorageLive(_3);
-          StorageLive(_4);
-          _4 = copy _1;
+-         StorageLive(_4);
+-         _4 = copy _1;
++         nop;
++         nop;
           StorageLive(_5);
           StorageLive(_6);
--         _6 = &mut _2;
-+         _6 = &mut _0;
+          _6 = &mut _2;
           _5 = &mut (*_6);
-          _3 = move _4(move _5) -> [return: bb1, unwind unreachable];
+-         _3 = move _4(move _5) -> [return: bb1, unwind unreachable];
++         _3 = move _1(move _5) -> [return: bb1, unwind unreachable];
       }
   
       bb1: {
           StorageDead(_5);
-          StorageDead(_4);
+-         StorageDead(_4);
++         nop;
           StorageDead(_6);
           StorageDead(_3);
--         _0 = copy _2;
--         StorageDead(_2);
+          _0 = copy _2;
+          StorageDead(_2);
           return;
       }
   }
diff --git a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff b/tests/mir-opt/dest-prop/nrvo_borrowed.nrvo.DestinationPropagation.panic-unwind.diff
index 54cbe2871f1..95d5fe1b930 100644
--- a/tests/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.panic-unwind.diff
+++ b/tests/mir-opt/dest-prop/nrvo_borrowed.nrvo.DestinationPropagation.panic-unwind.diff
@@ -1,5 +1,5 @@
-- // MIR for `nrvo` before RenameReturnPlace
-+ // MIR for `nrvo` after RenameReturnPlace
+- // MIR for `nrvo` before DestinationPropagation
++ // MIR for `nrvo` after DestinationPropagation
   
   fn nrvo(_1: for<'a> fn(&'a mut [u8; 1024])) -> [u8; 1024] {
       debug init => _1;
@@ -10,32 +10,33 @@
       let mut _5: &mut [u8; 1024];
       let mut _6: &mut [u8; 1024];
       scope 1 {
--         debug buf => _2;
-+         debug buf => _0;
+          debug buf => _2;
       }
   
       bb0: {
--         StorageLive(_2);
--         _2 = [const 0_u8; 1024];
-+         _0 = [const 0_u8; 1024];
+          StorageLive(_2);
+          _2 = [const 0_u8; 1024];
           StorageLive(_3);
-          StorageLive(_4);
-          _4 = copy _1;
+-         StorageLive(_4);
+-         _4 = copy _1;
++         nop;
++         nop;
           StorageLive(_5);
           StorageLive(_6);
--         _6 = &mut _2;
-+         _6 = &mut _0;
+          _6 = &mut _2;
           _5 = &mut (*_6);
-          _3 = move _4(move _5) -> [return: bb1, unwind continue];
+-         _3 = move _4(move _5) -> [return: bb1, unwind continue];
++         _3 = move _1(move _5) -> [return: bb1, unwind continue];
       }
   
       bb1: {
           StorageDead(_5);
-          StorageDead(_4);
+-         StorageDead(_4);
++         nop;
           StorageDead(_6);
           StorageDead(_3);
--         _0 = copy _2;
--         StorageDead(_2);
+          _0 = copy _2;
+          StorageDead(_2);
           return;
       }
   }
diff --git a/tests/mir-opt/nrvo_simple.rs b/tests/mir-opt/dest-prop/nrvo_borrowed.rs
index df540472e1c..6f3076d4c13 100644
--- a/tests/mir-opt/nrvo_simple.rs
+++ b/tests/mir-opt/dest-prop/nrvo_borrowed.rs
@@ -1,8 +1,8 @@
 // skip-filecheck
 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
-//@ test-mir-pass: RenameReturnPlace
+//@ test-mir-pass: DestinationPropagation
 
-// EMIT_MIR nrvo_simple.nrvo.RenameReturnPlace.diff
+// EMIT_MIR nrvo_borrowed.nrvo.DestinationPropagation.diff
 fn nrvo(init: fn(&mut [u8; 1024])) -> [u8; 1024] {
     let mut buf = [0; 1024];
     init(&mut buf);
diff --git a/tests/mir-opt/nrvo_miscompile_111005.rs b/tests/mir-opt/dest-prop/nrvo_miscompile_111005.rs
index 131f7b8f6f9..17e6450278a 100644
--- a/tests/mir-opt/nrvo_miscompile_111005.rs
+++ b/tests/mir-opt/dest-prop/nrvo_miscompile_111005.rs
@@ -1,18 +1,17 @@
 // This is a miscompilation, #111005 to track
 
-//@ test-mir-pass: RenameReturnPlace
+//@ test-mir-pass: DestinationPropagation
 
 #![feature(custom_mir, core_intrinsics)]
 extern crate core;
 use core::intrinsics::mir::*;
 
-// EMIT_MIR nrvo_miscompile_111005.wrong.RenameReturnPlace.diff
+// EMIT_MIR nrvo_miscompile_111005.wrong.DestinationPropagation.diff
 #[custom_mir(dialect = "runtime", phase = "initial")]
 pub fn wrong(arg: char) -> char {
     // CHECK-LABEL: fn wrong(
     // CHECK: _0 = copy _1;
-    // FIXME: This is wrong:
-    // CHECK-NEXT: _0 = const 'b';
+    // CHECK-NEXT: _1 = const 'b';
     // CHECK-NEXT: return;
     mir! {
         {
diff --git a/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff b/tests/mir-opt/dest-prop/nrvo_miscompile_111005.wrong.DestinationPropagation.diff
index d248c76f261..60cf9236f6c 100644
--- a/tests/mir-opt/nrvo_miscompile_111005.wrong.RenameReturnPlace.diff
+++ b/tests/mir-opt/dest-prop/nrvo_miscompile_111005.wrong.DestinationPropagation.diff
@@ -1,5 +1,5 @@
-- // MIR for `wrong` before RenameReturnPlace
-+ // MIR for `wrong` after RenameReturnPlace
+- // MIR for `wrong` before DestinationPropagation
++ // MIR for `wrong` after DestinationPropagation
   
   fn wrong(_1: char) -> char {
       let mut _0: char;
@@ -9,8 +9,9 @@
 -         _2 = copy _1;
 -         _0 = copy _2;
 -         _2 = const 'b';
++         nop;
 +         _0 = copy _1;
-+         _0 = const 'b';
++         _1 = const 'b';
           return;
       }
   }
diff --git a/tests/mir-opt/gvn.array_len.GVN.panic-abort.diff b/tests/mir-opt/gvn.array_len.GVN.panic-abort.diff
index 0d0477fe772..59b65a52f4e 100644
--- a/tests/mir-opt/gvn.array_len.GVN.panic-abort.diff
+++ b/tests/mir-opt/gvn.array_len.GVN.panic-abort.diff
@@ -12,8 +12,7 @@
       }
   
       bb0: {
--         StorageLive(_2);
-+         nop;
+          StorageLive(_2);
           StorageLive(_3);
           _3 = &(*_1);
           _2 = move _3 as &[i32] (PointerCoercion(Unsize, Implicit));
@@ -23,8 +22,7 @@
 -         _0 = PtrMetadata(move _4);
 +         _0 = const 42_usize;
           StorageDead(_4);
--         StorageDead(_2);
-+         nop;
+          StorageDead(_2);
           return;
       }
   }
diff --git a/tests/mir-opt/gvn.array_len.GVN.panic-unwind.diff b/tests/mir-opt/gvn.array_len.GVN.panic-unwind.diff
index 0d0477fe772..59b65a52f4e 100644
--- a/tests/mir-opt/gvn.array_len.GVN.panic-unwind.diff
+++ b/tests/mir-opt/gvn.array_len.GVN.panic-unwind.diff
@@ -12,8 +12,7 @@
       }
   
       bb0: {
--         StorageLive(_2);
-+         nop;
+          StorageLive(_2);
           StorageLive(_3);
           _3 = &(*_1);
           _2 = move _3 as &[i32] (PointerCoercion(Unsize, Implicit));
@@ -23,8 +22,7 @@
 -         _0 = PtrMetadata(move _4);
 +         _0 = const 42_usize;
           StorageDead(_4);
--         StorageDead(_2);
-+         nop;
+          StorageDead(_2);
           return;
       }
   }
diff --git a/tests/mir-opt/inline/forced_closure_inherent.caller-{closure#0}.ForceInline.panic-abort.diff b/tests/mir-opt/inline/forced_closure_inherent.caller-{closure#0}.ForceInline.panic-abort.diff
new file mode 100644
index 00000000000..8e03432c2af
--- /dev/null
+++ b/tests/mir-opt/inline/forced_closure_inherent.caller-{closure#0}.ForceInline.panic-abort.diff
@@ -0,0 +1,21 @@
+- // MIR for `caller::{closure#0}` before ForceInline
++ // MIR for `caller::{closure#0}` after ForceInline
+  
+  fn caller::{closure#0}(_1: &{closure@$DIR/forced_closure_inherent.rs:14:6: 14:8}) -> () {
+      let mut _0: ();
+      let _2: ();
++     scope 1 (inlined Foo::callee_forced) {
++     }
+  
+      bb0: {
+          StorageLive(_2);
+-         _2 = Foo::callee_forced() -> [return: bb1, unwind unreachable];
+-     }
+- 
+-     bb1: {
+          StorageDead(_2);
+          _0 = const ();
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/inline/forced_closure_inherent.caller-{closure#0}.ForceInline.panic-unwind.diff b/tests/mir-opt/inline/forced_closure_inherent.caller-{closure#0}.ForceInline.panic-unwind.diff
new file mode 100644
index 00000000000..0e41fd89dac
--- /dev/null
+++ b/tests/mir-opt/inline/forced_closure_inherent.caller-{closure#0}.ForceInline.panic-unwind.diff
@@ -0,0 +1,21 @@
+- // MIR for `caller::{closure#0}` before ForceInline
++ // MIR for `caller::{closure#0}` after ForceInline
+  
+  fn caller::{closure#0}(_1: &{closure@$DIR/forced_closure_inherent.rs:14:6: 14:8}) -> () {
+      let mut _0: ();
+      let _2: ();
++     scope 1 (inlined Foo::callee_forced) {
++     }
+  
+      bb0: {
+          StorageLive(_2);
+-         _2 = Foo::callee_forced() -> [return: bb1, unwind continue];
+-     }
+- 
+-     bb1: {
+          StorageDead(_2);
+          _0 = const ();
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/inline/forced_closure_inherent.rs b/tests/mir-opt/inline/forced_closure_inherent.rs
new file mode 100644
index 00000000000..949c7d6ecbf
--- /dev/null
+++ b/tests/mir-opt/inline/forced_closure_inherent.rs
@@ -0,0 +1,19 @@
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+//@ compile-flags: -Copt-level=0 --crate-type=lib
+#![feature(rustc_attrs)]
+
+struct Foo {}
+
+impl Foo {
+    #[rustc_force_inline]
+    pub fn callee_forced() {}
+}
+
+// EMIT_MIR forced_closure_inherent.caller-{closure#0}.ForceInline.diff
+pub fn caller() {
+    (|| {
+        Foo::callee_forced();
+        // CHECK-LABEL: fn caller::{closure#0}(
+        // CHECK: (inlined Foo::callee_forced)
+    })();
+}
diff --git a/tests/mir-opt/inline/forced_inherent.caller.ForceInline.panic-abort.diff b/tests/mir-opt/inline/forced_inherent.caller.ForceInline.panic-abort.diff
new file mode 100644
index 00000000000..6ea1894af98
--- /dev/null
+++ b/tests/mir-opt/inline/forced_inherent.caller.ForceInline.panic-abort.diff
@@ -0,0 +1,21 @@
+- // MIR for `caller` before ForceInline
++ // MIR for `caller` after ForceInline
+  
+  fn caller() -> () {
+      let mut _0: ();
+      let _1: ();
++     scope 1 (inlined Foo::bar) {
++     }
+  
+      bb0: {
+          StorageLive(_1);
+-         _1 = Foo::bar() -> [return: bb1, unwind unreachable];
+-     }
+- 
+-     bb1: {
+          StorageDead(_1);
+          _0 = const ();
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/inline/forced_inherent.caller.ForceInline.panic-unwind.diff b/tests/mir-opt/inline/forced_inherent.caller.ForceInline.panic-unwind.diff
new file mode 100644
index 00000000000..dd91c338772
--- /dev/null
+++ b/tests/mir-opt/inline/forced_inherent.caller.ForceInline.panic-unwind.diff
@@ -0,0 +1,21 @@
+- // MIR for `caller` before ForceInline
++ // MIR for `caller` after ForceInline
+  
+  fn caller() -> () {
+      let mut _0: ();
+      let _1: ();
++     scope 1 (inlined Foo::bar) {
++     }
+  
+      bb0: {
+          StorageLive(_1);
+-         _1 = Foo::bar() -> [return: bb1, unwind continue];
+-     }
+- 
+-     bb1: {
+          StorageDead(_1);
+          _0 = const ();
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/inline/forced_inherent.rs b/tests/mir-opt/inline/forced_inherent.rs
new file mode 100644
index 00000000000..24bf8daa644
--- /dev/null
+++ b/tests/mir-opt/inline/forced_inherent.rs
@@ -0,0 +1,17 @@
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+//@ compile-flags: -Copt-level=0 --crate-type=lib
+#![feature(rustc_attrs)]
+
+struct Foo;
+
+impl Foo {
+    #[rustc_force_inline]
+    fn bar() {}
+}
+
+// EMIT_MIR forced_inherent.caller.ForceInline.diff
+fn caller() {
+    Foo::bar();
+    // CHECK-LABEL: fn caller(
+    // CHECK: (inlined Foo::bar)
+}
diff --git a/tests/mir-opt/inline/forced_inherent_ambiguous.caller.ForceInline.panic-abort.diff b/tests/mir-opt/inline/forced_inherent_ambiguous.caller.ForceInline.panic-abort.diff
new file mode 100644
index 00000000000..6ea1894af98
--- /dev/null
+++ b/tests/mir-opt/inline/forced_inherent_ambiguous.caller.ForceInline.panic-abort.diff
@@ -0,0 +1,21 @@
+- // MIR for `caller` before ForceInline
++ // MIR for `caller` after ForceInline
+  
+  fn caller() -> () {
+      let mut _0: ();
+      let _1: ();
++     scope 1 (inlined Foo::bar) {
++     }
+  
+      bb0: {
+          StorageLive(_1);
+-         _1 = Foo::bar() -> [return: bb1, unwind unreachable];
+-     }
+- 
+-     bb1: {
+          StorageDead(_1);
+          _0 = const ();
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/inline/forced_inherent_ambiguous.caller.ForceInline.panic-unwind.diff b/tests/mir-opt/inline/forced_inherent_ambiguous.caller.ForceInline.panic-unwind.diff
new file mode 100644
index 00000000000..dd91c338772
--- /dev/null
+++ b/tests/mir-opt/inline/forced_inherent_ambiguous.caller.ForceInline.panic-unwind.diff
@@ -0,0 +1,21 @@
+- // MIR for `caller` before ForceInline
++ // MIR for `caller` after ForceInline
+  
+  fn caller() -> () {
+      let mut _0: ();
+      let _1: ();
++     scope 1 (inlined Foo::bar) {
++     }
+  
+      bb0: {
+          StorageLive(_1);
+-         _1 = Foo::bar() -> [return: bb1, unwind continue];
+-     }
+- 
+-     bb1: {
+          StorageDead(_1);
+          _0 = const ();
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/inline/forced_inherent_ambiguous.rs b/tests/mir-opt/inline/forced_inherent_ambiguous.rs
new file mode 100644
index 00000000000..e3c5d3e4f9e
--- /dev/null
+++ b/tests/mir-opt/inline/forced_inherent_ambiguous.rs
@@ -0,0 +1,25 @@
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+//@ compile-flags: -Copt-level=0 --crate-type=lib
+#![feature(rustc_attrs)]
+
+struct Foo;
+
+impl Foo {
+    #[rustc_force_inline]
+    fn bar() {}
+}
+
+trait Tr {
+    fn bar();
+}
+
+impl Tr for Foo {
+    fn bar() {}
+}
+
+// EMIT_MIR forced_inherent_ambiguous.caller.ForceInline.diff
+fn caller() {
+    Foo::bar();
+    // CHECK-LABEL: fn caller(
+    // CHECK: (inlined Foo::bar)
+}
diff --git a/tests/mir-opt/inline/forced_inherent_async.caller.ForceInline.panic-abort.diff b/tests/mir-opt/inline/forced_inherent_async.caller.ForceInline.panic-abort.diff
new file mode 100644
index 00000000000..6495ddbafba
--- /dev/null
+++ b/tests/mir-opt/inline/forced_inherent_async.caller.ForceInline.panic-abort.diff
@@ -0,0 +1,12 @@
+- // MIR for `caller` before ForceInline
++ // MIR for `caller` after ForceInline
+  
+  fn caller() -> {async fn body of caller()} {
+      let mut _0: {async fn body of caller()};
+  
+      bb0: {
+          _0 = {coroutine@$DIR/forced_inherent_async.rs:14:19: 18:2 (#0)};
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/inline/forced_inherent_async.caller.ForceInline.panic-unwind.diff b/tests/mir-opt/inline/forced_inherent_async.caller.ForceInline.panic-unwind.diff
new file mode 100644
index 00000000000..6495ddbafba
--- /dev/null
+++ b/tests/mir-opt/inline/forced_inherent_async.caller.ForceInline.panic-unwind.diff
@@ -0,0 +1,12 @@
+- // MIR for `caller` before ForceInline
++ // MIR for `caller` after ForceInline
+  
+  fn caller() -> {async fn body of caller()} {
+      let mut _0: {async fn body of caller()};
+  
+      bb0: {
+          _0 = {coroutine@$DIR/forced_inherent_async.rs:14:19: 18:2 (#0)};
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/inline/forced_inherent_async.rs b/tests/mir-opt/inline/forced_inherent_async.rs
new file mode 100644
index 00000000000..ce58a0ac48f
--- /dev/null
+++ b/tests/mir-opt/inline/forced_inherent_async.rs
@@ -0,0 +1,18 @@
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+//@ compile-flags: -Copt-level=0 --crate-type=lib
+//@ edition: 2021
+#![feature(rustc_attrs)]
+
+struct Foo {}
+
+impl Foo {
+    #[rustc_force_inline]
+    pub fn callee_forced() {}
+}
+
+// EMIT_MIR forced_inherent_async.caller.ForceInline.diff
+async fn caller() {
+    Foo::callee_forced();
+    // CHECK-LABEL: fn caller(
+    // CHECK: (inlined Foo::callee_forced)
+}
diff --git a/tests/mir-opt/inline/forced_inherent_dead_code.caller.ForceInline.panic-abort.diff b/tests/mir-opt/inline/forced_inherent_dead_code.caller.ForceInline.panic-abort.diff
new file mode 100644
index 00000000000..edaf2820d85
--- /dev/null
+++ b/tests/mir-opt/inline/forced_inherent_dead_code.caller.ForceInline.panic-abort.diff
@@ -0,0 +1,21 @@
+- // MIR for `caller` before ForceInline
++ // MIR for `caller` after ForceInline
+  
+  fn caller() -> () {
+      let mut _0: ();
+      let _1: ();
++     scope 1 (inlined Foo::callee_forced) {
++     }
+  
+      bb0: {
+          StorageLive(_1);
+-         _1 = Foo::callee_forced() -> [return: bb1, unwind unreachable];
+-     }
+- 
+-     bb1: {
+          StorageDead(_1);
+          _0 = const ();
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/inline/forced_inherent_dead_code.caller.ForceInline.panic-unwind.diff b/tests/mir-opt/inline/forced_inherent_dead_code.caller.ForceInline.panic-unwind.diff
new file mode 100644
index 00000000000..22f8b14a724
--- /dev/null
+++ b/tests/mir-opt/inline/forced_inherent_dead_code.caller.ForceInline.panic-unwind.diff
@@ -0,0 +1,21 @@
+- // MIR for `caller` before ForceInline
++ // MIR for `caller` after ForceInline
+  
+  fn caller() -> () {
+      let mut _0: ();
+      let _1: ();
++     scope 1 (inlined Foo::callee_forced) {
++     }
+  
+      bb0: {
+          StorageLive(_1);
+-         _1 = Foo::callee_forced() -> [return: bb1, unwind continue];
+-     }
+- 
+-     bb1: {
+          StorageDead(_1);
+          _0 = const ();
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/inline/forced_inherent_dead_code.rs b/tests/mir-opt/inline/forced_inherent_dead_code.rs
new file mode 100644
index 00000000000..057a4cac528
--- /dev/null
+++ b/tests/mir-opt/inline/forced_inherent_dead_code.rs
@@ -0,0 +1,21 @@
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+//@ compile-flags: -Copt-level=0 -Clink-dead-code
+#![feature(rustc_attrs)]
+
+struct Foo {}
+
+impl Foo {
+    #[rustc_force_inline]
+    pub fn callee_forced() {}
+}
+
+// EMIT_MIR forced_inherent_dead_code.caller.ForceInline.diff
+pub fn caller() {
+    Foo::callee_forced();
+    // CHECK-LABEL: fn caller(
+    // CHECK: (inlined Foo::callee_forced)
+}
+
+fn main() {
+    caller();
+}
diff --git a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff
index f6c111a2228..9509739413b 100644
--- a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff
+++ b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff
@@ -84,7 +84,6 @@
           _5 = copy _2;
 -         _0 = drop_in_place::<Option<B>>(move _5) -> [return: bb2, unwind unreachable];
 +         StorageLive(_15);
-+         StorageLive(_16);
 +         _15 = discriminant((*_5));
 +         switchInt(move _15) -> [0: bb5, otherwise: bb6];
       }
@@ -110,7 +109,6 @@
 +     }
 + 
 +     bb5: {
-+         StorageDead(_16);
 +         StorageDead(_15);
           StorageDead(_5);
           return;
diff --git a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff
index 18324276425..34f89da19f5 100644
--- a/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff
+++ b/tests/mir-opt/inline/inline_shims.drop.Inline.panic-unwind.diff
@@ -27,13 +27,11 @@
           _5 = copy _2;
 -         _0 = drop_in_place::<Option<B>>(move _5) -> [return: bb2, unwind continue];
 +         StorageLive(_6);
-+         StorageLive(_7);
 +         _6 = discriminant((*_5));
 +         switchInt(move _6) -> [0: bb2, otherwise: bb3];
       }
   
       bb2: {
-+         StorageDead(_7);
 +         StorageDead(_6);
           StorageDead(_5);
           return;
diff --git a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff
index 22e6ea722dd..0acb33febe5 100644
--- a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff
+++ b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-abort.diff
@@ -39,8 +39,8 @@
 +                 let mut _28: &mut std::task::Context<'_>;
 +                 let mut _29: ();
 +                 let mut _30: ();
-+                 let mut _31: &mut std::task::Context<'_>;
-+                 let mut _32: u32;
++                 let mut _31: u32;
++                 let mut _32: &mut {async fn body of ActionPermit<'_, T>::perform()};
 +                 let mut _33: &mut {async fn body of ActionPermit<'_, T>::perform()};
 +                 let mut _34: &mut {async fn body of ActionPermit<'_, T>::perform()};
 +                 let mut _35: &mut {async fn body of ActionPermit<'_, T>::perform()};
@@ -48,7 +48,6 @@
 +                 let mut _37: &mut {async fn body of ActionPermit<'_, T>::perform()};
 +                 let mut _38: &mut {async fn body of ActionPermit<'_, T>::perform()};
 +                 let mut _39: &mut {async fn body of ActionPermit<'_, T>::perform()};
-+                 let mut _40: &mut {async fn body of ActionPermit<'_, T>::perform()};
 +                 scope 7 {
 +                     let mut _15: std::future::Ready<()>;
 +                     scope 8 {
@@ -58,14 +57,14 @@
 +                         scope 12 (inlined Pin::<&mut std::future::Ready<()>>::new_unchecked) {
 +                         }
 +                         scope 13 (inlined <std::future::Ready<()> as Future>::poll) {
-+                             let mut _42: ();
-+                             let mut _43: std::option::Option<()>;
-+                             let mut _44: &mut std::option::Option<()>;
-+                             let mut _45: &mut std::future::Ready<()>;
-+                             let mut _46: &mut std::pin::Pin<&mut std::future::Ready<()>>;
++                             let mut _41: ();
++                             let mut _42: std::option::Option<()>;
++                             let mut _43: &mut std::option::Option<()>;
++                             let mut _44: &mut std::future::Ready<()>;
++                             let mut _45: &mut std::pin::Pin<&mut std::future::Ready<()>>;
 +                             scope 14 (inlined <Pin<&mut std::future::Ready<()>> as DerefMut>::deref_mut) {
 +                                 scope 15 (inlined Pin::<&mut std::future::Ready<()>>::as_mut) {
-+                                     let mut _47: &mut &mut std::future::Ready<()>;
++                                     let mut _46: &mut &mut std::future::Ready<()>;
 +                                     scope 16 (inlined Pin::<&mut std::future::Ready<()>>::new_unchecked) {
 +                                     }
 +                                     scope 18 (inlined <&mut std::future::Ready<()> as DerefMut>::deref_mut) {
@@ -75,22 +74,22 @@
 +                                 }
 +                             }
 +                             scope 19 (inlined Option::<()>::take) {
-+                                 let mut _48: std::option::Option<()>;
++                                 let mut _47: std::option::Option<()>;
 +                                 scope 20 (inlined std::mem::replace::<Option<()>>) {
 +                                     scope 21 {
 +                                     }
 +                                 }
 +                             }
 +                             scope 22 (inlined #[track_caller] Option::<()>::expect) {
-+                                 let mut _49: isize;
-+                                 let mut _50: !;
++                                 let mut _48: isize;
++                                 let mut _49: !;
 +                                 scope 23 {
 +                                 }
 +                             }
 +                         }
 +                     }
 +                     scope 10 (inlined ready::<()>) {
-+                         let mut _41: std::option::Option<()>;
++                         let mut _40: std::option::Option<()>;
 +                     }
 +                     scope 11 (inlined <std::future::Ready<()> as IntoFuture>::into_future) {
 +                     }
@@ -130,11 +129,8 @@
           _10 = deref_copy (_1.1: &mut std::task::Context<'_>);
           _9 = &mut (*_10);
 -         _7 = <{async fn body of ActionPermit<'_, T>::perform()} as Future>::poll(move _8, move _9) -> [return: bb3, unwind unreachable];
-+         StorageLive(_11);
-+         StorageLive(_15);
 +         StorageLive(_16);
 +         StorageLive(_25);
-+         StorageLive(_27);
 +         StorageLive(_30);
 +         StorageLive(_31);
 +         StorageLive(_32);
@@ -145,10 +141,9 @@
 +         StorageLive(_37);
 +         StorageLive(_38);
 +         StorageLive(_39);
-+         StorageLive(_40);
-+         _33 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         _32 = discriminant((*_33));
-+         switchInt(move _32) -> [0: bb3, 1: bb10, 3: bb9, otherwise: bb5];
++         _32 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         _31 = discriminant((*_32));
++         switchInt(move _31) -> [0: bb3, 1: bb10, 3: bb9, otherwise: bb5];
       }
   
 -     bb3: {
@@ -158,7 +153,6 @@
 +     }
 + 
 +     bb2: {
-+         StorageDead(_40);
 +         StorageDead(_39);
 +         StorageDead(_38);
 +         StorageDead(_37);
@@ -169,11 +163,8 @@
 +         StorageDead(_32);
 +         StorageDead(_31);
 +         StorageDead(_30);
-+         StorageDead(_27);
 +         StorageDead(_25);
 +         StorageDead(_16);
-+         StorageDead(_15);
-+         StorageDead(_11);
           StorageDead(_9);
           StorageDead(_8);
           StorageDead(_7);
@@ -186,23 +177,22 @@
       }
   
 +     bb3: {
-+         _31 = move _9;
++         _33 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
 +         _34 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         _35 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         (((*_34) as variant#3).0: ActionPermit<'_, T>) = move ((*_35).0: ActionPermit<'_, T>);
++         (((*_33) as variant#3).0: ActionPermit<'_, T>) = move ((*_34).0: ActionPermit<'_, T>);
 +         StorageLive(_12);
 +         StorageLive(_13);
 +         StorageLive(_14);
 +         _14 = ();
-+         StorageLive(_41);
-+         _41 = Option::<()>::Some(copy _14);
-+         _13 = std::future::Ready::<()>(move _41);
-+         StorageDead(_41);
++         StorageLive(_40);
++         _40 = Option::<()>::Some(copy _14);
++         _13 = std::future::Ready::<()>(move _40);
++         StorageDead(_40);
 +         StorageDead(_14);
 +         _12 = move _13;
 +         StorageDead(_13);
-+         _36 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         (((*_36) as variant#3).1: std::future::Ready<()>) = move _12;
++         _35 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         (((*_35) as variant#3).1: std::future::Ready<()>) = move _12;
 +         goto -> bb4;
 +     }
 + 
@@ -214,39 +204,31 @@
 +         StorageLive(_19);
 +         StorageLive(_20);
 +         StorageLive(_21);
-+         _37 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         _21 = &mut (((*_37) as variant#3).1: std::future::Ready<()>);
++         _36 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         _21 = &mut (((*_36) as variant#3).1: std::future::Ready<()>);
 +         _20 = &mut (*_21);
 +         _19 = Pin::<&mut std::future::Ready<()>> { pointer: copy _20 };
 +         StorageDead(_20);
 +         StorageLive(_22);
 +         StorageLive(_23);
 +         StorageLive(_24);
-+         _24 = copy _31;
++         _24 = copy _9;
 +         _23 = move _24;
 +         _22 = &mut (*_23);
 +         StorageDead(_24);
-+         StorageLive(_45);
-+         StorageLive(_46);
-+         StorageLive(_50);
-+         StorageLive(_42);
-+         StorageLive(_43);
 +         StorageLive(_44);
-+         _46 = &mut _19;
++         StorageLive(_49);
++         StorageLive(_41);
++         StorageLive(_42);
++         _44 = copy (_19.0: &mut std::future::Ready<()>);
 +         StorageLive(_47);
-+         _47 = &mut (_19.0: &mut std::future::Ready<()>);
-+         _45 = copy (_19.0: &mut std::future::Ready<()>);
++         _47 = Option::<()>::None;
++         _42 = copy ((*_44).0: std::option::Option<()>);
++         ((*_44).0: std::option::Option<()>) = copy _47;
 +         StorageDead(_47);
-+         _44 = &mut ((*_45).0: std::option::Option<()>);
 +         StorageLive(_48);
-+         _48 = Option::<()>::None;
-+         _43 = copy ((*_45).0: std::option::Option<()>);
-+         ((*_45).0: std::option::Option<()>) = copy _48;
-+         StorageDead(_48);
-+         StorageDead(_44);
-+         StorageLive(_49);
-+         _49 = discriminant(_43);
-+         switchInt(move _49) -> [0: bb11, 1: bb12, otherwise: bb5];
++         _48 = discriminant(_42);
++         switchInt(move _48) -> [0: bb11, 1: bb12, otherwise: bb5];
       }
 + 
 +     bb5: {
@@ -266,8 +248,8 @@
 +         StorageDead(_12);
 +         StorageDead(_28);
 +         StorageDead(_29);
-+         _38 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         discriminant((*_38)) = 3;
++         _37 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         discriminant((*_37)) = 3;
 +         goto -> bb2;
 +     }
 + 
@@ -281,14 +263,14 @@
 +         StorageDead(_18);
 +         StorageDead(_17);
 +         StorageDead(_12);
-+         _39 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         drop((((*_39) as variant#3).0: ActionPermit<'_, T>)) -> [return: bb8, unwind unreachable];
++         _38 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         drop((((*_38) as variant#3).0: ActionPermit<'_, T>)) -> [return: bb8, unwind unreachable];
 +     }
 + 
 +     bb8: {
 +         _7 = Poll::<()>::Ready(move _30);
-+         _40 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         discriminant((*_40)) = 1;
++         _39 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         discriminant((*_39)) = 1;
 +         goto -> bb2;
 +     }
 + 
@@ -298,7 +280,7 @@
 +         StorageLive(_29);
 +         _28 = move _9;
 +         StorageDead(_29);
-+         _31 = move _28;
++         _9 = move _28;
 +         StorageDead(_28);
 +         _16 = const ();
 +         goto -> bb4;
@@ -309,18 +291,17 @@
 +     }
 + 
 +     bb11: {
-+         _50 = option::expect_failed(const "`Ready` polled after completion") -> unwind unreachable;
++         _49 = option::expect_failed(const "`Ready` polled after completion") -> unwind unreachable;
 +     }
 + 
 +     bb12: {
-+         _42 = move ((_43 as Some).0: ());
-+         StorageDead(_49);
-+         StorageDead(_43);
-+         _18 = Poll::<()>::Ready(move _42);
++         _41 = move ((_42 as Some).0: ());
++         StorageDead(_48);
 +         StorageDead(_42);
-+         StorageDead(_50);
-+         StorageDead(_46);
-+         StorageDead(_45);
++         _18 = Poll::<()>::Ready(move _41);
++         StorageDead(_41);
++         StorageDead(_49);
++         StorageDead(_44);
 +         StorageDead(_22);
 +         StorageDead(_19);
 +         _25 = discriminant(_18);
diff --git a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff
index 8b027e988b8..98ee46c29b1 100644
--- a/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff
+++ b/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff
@@ -39,8 +39,8 @@
 +                 let mut _28: &mut std::task::Context<'_>;
 +                 let mut _29: ();
 +                 let mut _30: ();
-+                 let mut _31: &mut std::task::Context<'_>;
-+                 let mut _32: u32;
++                 let mut _31: u32;
++                 let mut _32: &mut {async fn body of ActionPermit<'_, T>::perform()};
 +                 let mut _33: &mut {async fn body of ActionPermit<'_, T>::perform()};
 +                 let mut _34: &mut {async fn body of ActionPermit<'_, T>::perform()};
 +                 let mut _35: &mut {async fn body of ActionPermit<'_, T>::perform()};
@@ -50,7 +50,6 @@
 +                 let mut _39: &mut {async fn body of ActionPermit<'_, T>::perform()};
 +                 let mut _40: &mut {async fn body of ActionPermit<'_, T>::perform()};
 +                 let mut _41: &mut {async fn body of ActionPermit<'_, T>::perform()};
-+                 let mut _42: &mut {async fn body of ActionPermit<'_, T>::perform()};
 +                 scope 7 {
 +                     let mut _15: std::future::Ready<()>;
 +                     scope 8 {
@@ -60,14 +59,14 @@
 +                         scope 12 (inlined Pin::<&mut std::future::Ready<()>>::new_unchecked) {
 +                         }
 +                         scope 13 (inlined <std::future::Ready<()> as Future>::poll) {
-+                             let mut _44: ();
-+                             let mut _45: std::option::Option<()>;
-+                             let mut _46: &mut std::option::Option<()>;
-+                             let mut _47: &mut std::future::Ready<()>;
-+                             let mut _48: &mut std::pin::Pin<&mut std::future::Ready<()>>;
++                             let mut _43: ();
++                             let mut _44: std::option::Option<()>;
++                             let mut _45: &mut std::option::Option<()>;
++                             let mut _46: &mut std::future::Ready<()>;
++                             let mut _47: &mut std::pin::Pin<&mut std::future::Ready<()>>;
 +                             scope 14 (inlined <Pin<&mut std::future::Ready<()>> as DerefMut>::deref_mut) {
 +                                 scope 15 (inlined Pin::<&mut std::future::Ready<()>>::as_mut) {
-+                                     let mut _49: &mut &mut std::future::Ready<()>;
++                                     let mut _48: &mut &mut std::future::Ready<()>;
 +                                     scope 16 (inlined Pin::<&mut std::future::Ready<()>>::new_unchecked) {
 +                                     }
 +                                     scope 18 (inlined <&mut std::future::Ready<()> as DerefMut>::deref_mut) {
@@ -77,22 +76,22 @@
 +                                 }
 +                             }
 +                             scope 19 (inlined Option::<()>::take) {
-+                                 let mut _50: std::option::Option<()>;
++                                 let mut _49: std::option::Option<()>;
 +                                 scope 20 (inlined std::mem::replace::<Option<()>>) {
 +                                     scope 21 {
 +                                     }
 +                                 }
 +                             }
 +                             scope 22 (inlined #[track_caller] Option::<()>::expect) {
-+                                 let mut _51: isize;
-+                                 let mut _52: !;
++                                 let mut _50: isize;
++                                 let mut _51: !;
 +                                 scope 23 {
 +                                 }
 +                             }
 +                         }
 +                     }
 +                     scope 10 (inlined ready::<()>) {
-+                         let mut _43: std::option::Option<()>;
++                         let mut _42: std::option::Option<()>;
 +                     }
 +                     scope 11 (inlined <std::future::Ready<()> as IntoFuture>::into_future) {
 +                     }
@@ -132,11 +131,8 @@
           _10 = deref_copy (_1.1: &mut std::task::Context<'_>);
           _9 = &mut (*_10);
 -         _7 = <{async fn body of ActionPermit<'_, T>::perform()} as Future>::poll(move _8, move _9) -> [return: bb3, unwind: bb5];
-+         StorageLive(_11);
-+         StorageLive(_15);
 +         StorageLive(_16);
 +         StorageLive(_25);
-+         StorageLive(_27);
 +         StorageLive(_30);
 +         StorageLive(_31);
 +         StorageLive(_32);
@@ -149,10 +145,9 @@
 +         StorageLive(_39);
 +         StorageLive(_40);
 +         StorageLive(_41);
-+         StorageLive(_42);
-+         _33 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         _32 = discriminant((*_33));
-+         switchInt(move _32) -> [0: bb5, 1: bb15, 2: bb14, 3: bb13, otherwise: bb7];
++         _32 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         _31 = discriminant((*_32));
++         switchInt(move _31) -> [0: bb5, 1: bb15, 2: bb14, 3: bb13, otherwise: bb7];
       }
   
 -     bb3: {
@@ -170,7 +165,6 @@
 +     }
 + 
 +     bb4: {
-+         StorageDead(_42);
 +         StorageDead(_41);
 +         StorageDead(_40);
 +         StorageDead(_39);
@@ -183,11 +177,8 @@
 +         StorageDead(_32);
 +         StorageDead(_31);
 +         StorageDead(_30);
-+         StorageDead(_27);
 +         StorageDead(_25);
 +         StorageDead(_16);
-+         StorageDead(_15);
-+         StorageDead(_11);
           StorageDead(_9);
           StorageDead(_8);
           StorageDead(_7);
@@ -203,23 +194,22 @@
 -         StorageDead(_2);
 -         return;
 +     bb5: {
-+         _31 = move _9;
++         _33 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
 +         _34 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         _35 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         (((*_34) as variant#3).0: ActionPermit<'_, T>) = move ((*_35).0: ActionPermit<'_, T>);
++         (((*_33) as variant#3).0: ActionPermit<'_, T>) = move ((*_34).0: ActionPermit<'_, T>);
 +         StorageLive(_12);
 +         StorageLive(_13);
 +         StorageLive(_14);
 +         _14 = ();
-+         StorageLive(_43);
-+         _43 = Option::<()>::Some(copy _14);
-+         _13 = std::future::Ready::<()>(move _43);
-+         StorageDead(_43);
++         StorageLive(_42);
++         _42 = Option::<()>::Some(copy _14);
++         _13 = std::future::Ready::<()>(move _42);
++         StorageDead(_42);
 +         StorageDead(_14);
 +         _12 = move _13;
 +         StorageDead(_13);
-+         _36 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         (((*_36) as variant#3).1: std::future::Ready<()>) = move _12;
++         _35 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         (((*_35) as variant#3).1: std::future::Ready<()>) = move _12;
 +         goto -> bb6;
       }
   
@@ -231,39 +221,31 @@
 +         StorageLive(_19);
 +         StorageLive(_20);
 +         StorageLive(_21);
-+         _37 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         _21 = &mut (((*_37) as variant#3).1: std::future::Ready<()>);
++         _36 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         _21 = &mut (((*_36) as variant#3).1: std::future::Ready<()>);
 +         _20 = &mut (*_21);
 +         _19 = Pin::<&mut std::future::Ready<()>> { pointer: copy _20 };
 +         StorageDead(_20);
 +         StorageLive(_22);
 +         StorageLive(_23);
 +         StorageLive(_24);
-+         _24 = copy _31;
++         _24 = copy _9;
 +         _23 = move _24;
 +         _22 = &mut (*_23);
 +         StorageDead(_24);
-+         StorageLive(_47);
-+         StorageLive(_48);
-+         StorageLive(_52);
-+         StorageLive(_44);
-+         StorageLive(_45);
 +         StorageLive(_46);
-+         _48 = &mut _19;
++         StorageLive(_51);
++         StorageLive(_43);
++         StorageLive(_44);
++         _46 = copy (_19.0: &mut std::future::Ready<()>);
 +         StorageLive(_49);
-+         _49 = &mut (_19.0: &mut std::future::Ready<()>);
-+         _47 = copy (_19.0: &mut std::future::Ready<()>);
++         _49 = Option::<()>::None;
++         _44 = copy ((*_46).0: std::option::Option<()>);
++         ((*_46).0: std::option::Option<()>) = copy _49;
 +         StorageDead(_49);
-+         _46 = &mut ((*_47).0: std::option::Option<()>);
 +         StorageLive(_50);
-+         _50 = Option::<()>::None;
-+         _45 = copy ((*_47).0: std::option::Option<()>);
-+         ((*_47).0: std::option::Option<()>) = copy _50;
-+         StorageDead(_50);
-+         StorageDead(_46);
-+         StorageLive(_51);
-+         _51 = discriminant(_45);
-+         switchInt(move _51) -> [0: bb16, 1: bb17, otherwise: bb7];
++         _50 = discriminant(_44);
++         switchInt(move _50) -> [0: bb16, 1: bb17, otherwise: bb7];
       }
   
 -     bb6 (cleanup): {
@@ -285,8 +267,8 @@
 +         StorageDead(_12);
 +         StorageDead(_28);
 +         StorageDead(_29);
-+         _38 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         discriminant((*_38)) = 3;
++         _37 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         discriminant((*_37)) = 3;
 +         goto -> bb4;
 +     }
 + 
@@ -300,14 +282,14 @@
 +         StorageDead(_18);
 +         StorageDead(_17);
 +         StorageDead(_12);
-+         _39 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         drop((((*_39) as variant#3).0: ActionPermit<'_, T>)) -> [return: bb10, unwind: bb12];
++         _38 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         drop((((*_38) as variant#3).0: ActionPermit<'_, T>)) -> [return: bb10, unwind: bb12];
 +     }
 + 
 +     bb10: {
 +         _7 = Poll::<()>::Ready(move _30);
-+         _40 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         discriminant((*_40)) = 1;
++         _39 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         discriminant((*_39)) = 1;
 +         goto -> bb4;
 +     }
 + 
@@ -319,13 +301,13 @@
 +         StorageDead(_18);
 +         StorageDead(_17);
 +         StorageDead(_12);
-+         _41 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         drop((((*_41) as variant#3).0: ActionPermit<'_, T>)) -> [return: bb12, unwind terminate(cleanup)];
++         _40 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         drop((((*_40) as variant#3).0: ActionPermit<'_, T>)) -> [return: bb12, unwind terminate(cleanup)];
 +     }
 + 
 +     bb12 (cleanup): {
-+         _42 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
-+         discriminant((*_42)) = 2;
++         _41 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()});
++         discriminant((*_41)) = 2;
 +         goto -> bb2;
 +     }
 + 
@@ -335,7 +317,7 @@
 +         StorageLive(_29);
 +         _28 = move _9;
 +         StorageDead(_29);
-+         _31 = move _28;
++         _9 = move _28;
 +         StorageDead(_28);
 +         _16 = const ();
 +         goto -> bb6;
@@ -350,18 +332,17 @@
 +     }
 + 
 +     bb16: {
-+         _52 = option::expect_failed(const "`Ready` polled after completion") -> bb11;
++         _51 = option::expect_failed(const "`Ready` polled after completion") -> bb11;
 +     }
 + 
 +     bb17: {
-+         _44 = move ((_45 as Some).0: ());
-+         StorageDead(_51);
-+         StorageDead(_45);
-+         _18 = Poll::<()>::Ready(move _44);
++         _43 = move ((_44 as Some).0: ());
++         StorageDead(_50);
 +         StorageDead(_44);
-+         StorageDead(_52);
-+         StorageDead(_48);
-+         StorageDead(_47);
++         _18 = Poll::<()>::Ready(move _43);
++         StorageDead(_43);
++         StorageDead(_51);
++         StorageDead(_46);
 +         StorageDead(_22);
 +         StorageDead(_19);
 +         _25 = discriminant(_18);
diff --git a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff
new file mode 100644
index 00000000000..feba0fe7c4a
--- /dev/null
+++ b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff
@@ -0,0 +1,71 @@
+- // MIR for `norm2` before InstSimplify-after-simplifycfg
++ // MIR for `norm2` after InstSimplify-after-simplifycfg
+  
+  fn norm2(_1: [f32; 2]) -> f32 {
+      debug x => _1;
+      let mut _0: f32;
+      let _2: f32;
+      let _3: usize;
+      let mut _4: bool;
+      let _6: usize;
+      let mut _7: bool;
+      let mut _8: f32;
+      let mut _9: f32;
+      let mut _10: f32;
+      let mut _11: f32;
+      let mut _12: f32;
+      let mut _13: f32;
+      scope 1 {
+          debug a => _2;
+          let _5: f32;
+          scope 2 {
+              debug b => _5;
+          }
+      }
+  
+      bb0: {
+          StorageLive(_2);
+          StorageLive(_3);
+          _3 = const 0_usize;
+          _4 = Lt(copy _3, const 2_usize);
+          assert(move _4, "index out of bounds: the length is {} but the index is {}", const 2_usize, copy _3) -> [success: bb1, unwind unreachable];
+      }
+  
+      bb1: {
+          _2 = copy _1[_3];
+          StorageDead(_3);
+          StorageLive(_5);
+          StorageLive(_6);
+          _6 = const 1_usize;
+          _7 = Lt(copy _6, const 2_usize);
+          assert(move _7, "index out of bounds: the length is {} but the index is {}", const 2_usize, copy _6) -> [success: bb2, unwind unreachable];
+      }
+  
+      bb2: {
+          _5 = copy _1[_6];
+          StorageDead(_6);
+          StorageLive(_8);
+          StorageLive(_9);
+          _9 = copy _2;
+          StorageLive(_10);
+          _10 = copy _2;
+          _8 = Mul(move _9, move _10);
+          StorageDead(_10);
+          StorageDead(_9);
+          StorageLive(_11);
+          StorageLive(_12);
+          _12 = copy _5;
+          StorageLive(_13);
+          _13 = copy _5;
+          _11 = Mul(move _12, move _13);
+          StorageDead(_13);
+          StorageDead(_12);
+          _0 = Add(move _8, move _11);
+          StorageDead(_11);
+          StorageDead(_8);
+          StorageDead(_5);
+          StorageDead(_2);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff
new file mode 100644
index 00000000000..0ccf6a825c4
--- /dev/null
+++ b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff
@@ -0,0 +1,71 @@
+- // MIR for `norm2` before InstSimplify-after-simplifycfg
++ // MIR for `norm2` after InstSimplify-after-simplifycfg
+  
+  fn norm2(_1: [f32; 2]) -> f32 {
+      debug x => _1;
+      let mut _0: f32;
+      let _2: f32;
+      let _3: usize;
+      let mut _4: bool;
+      let _6: usize;
+      let mut _7: bool;
+      let mut _8: f32;
+      let mut _9: f32;
+      let mut _10: f32;
+      let mut _11: f32;
+      let mut _12: f32;
+      let mut _13: f32;
+      scope 1 {
+          debug a => _2;
+          let _5: f32;
+          scope 2 {
+              debug b => _5;
+          }
+      }
+  
+      bb0: {
+          StorageLive(_2);
+          StorageLive(_3);
+          _3 = const 0_usize;
+          _4 = Lt(copy _3, const 2_usize);
+          assert(move _4, "index out of bounds: the length is {} but the index is {}", const 2_usize, copy _3) -> [success: bb1, unwind continue];
+      }
+  
+      bb1: {
+          _2 = copy _1[_3];
+          StorageDead(_3);
+          StorageLive(_5);
+          StorageLive(_6);
+          _6 = const 1_usize;
+          _7 = Lt(copy _6, const 2_usize);
+          assert(move _7, "index out of bounds: the length is {} but the index is {}", const 2_usize, copy _6) -> [success: bb2, unwind continue];
+      }
+  
+      bb2: {
+          _5 = copy _1[_6];
+          StorageDead(_6);
+          StorageLive(_8);
+          StorageLive(_9);
+          _9 = copy _2;
+          StorageLive(_10);
+          _10 = copy _2;
+          _8 = Mul(move _9, move _10);
+          StorageDead(_10);
+          StorageDead(_9);
+          StorageLive(_11);
+          StorageLive(_12);
+          _12 = copy _5;
+          StorageLive(_13);
+          _13 = copy _5;
+          _11 = Mul(move _12, move _13);
+          StorageDead(_13);
+          StorageDead(_12);
+          _0 = Add(move _8, move _11);
+          StorageDead(_11);
+          StorageDead(_8);
+          StorageDead(_5);
+          StorageDead(_2);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/instsimplify/combine_array_len.normN.InstSimplify-after-simplifycfg.panic-abort.diff b/tests/mir-opt/instsimplify/combine_array_len.normN.InstSimplify-after-simplifycfg.panic-abort.diff
new file mode 100644
index 00000000000..e9cb2c58177
--- /dev/null
+++ b/tests/mir-opt/instsimplify/combine_array_len.normN.InstSimplify-after-simplifycfg.panic-abort.diff
@@ -0,0 +1,71 @@
+- // MIR for `normN` before InstSimplify-after-simplifycfg
++ // MIR for `normN` after InstSimplify-after-simplifycfg
+  
+  fn normN(_1: [f32; N]) -> f32 {
+      debug x => _1;
+      let mut _0: f32;
+      let _2: f32;
+      let _3: usize;
+      let mut _4: bool;
+      let _6: usize;
+      let mut _7: bool;
+      let mut _8: f32;
+      let mut _9: f32;
+      let mut _10: f32;
+      let mut _11: f32;
+      let mut _12: f32;
+      let mut _13: f32;
+      scope 1 {
+          debug a => _2;
+          let _5: f32;
+          scope 2 {
+              debug b => _5;
+          }
+      }
+  
+      bb0: {
+          StorageLive(_2);
+          StorageLive(_3);
+          _3 = const 0_usize;
+          _4 = Lt(copy _3, const N);
+          assert(move _4, "index out of bounds: the length is {} but the index is {}", const N, copy _3) -> [success: bb1, unwind unreachable];
+      }
+  
+      bb1: {
+          _2 = copy _1[_3];
+          StorageDead(_3);
+          StorageLive(_5);
+          StorageLive(_6);
+          _6 = const 1_usize;
+          _7 = Lt(copy _6, const N);
+          assert(move _7, "index out of bounds: the length is {} but the index is {}", const N, copy _6) -> [success: bb2, unwind unreachable];
+      }
+  
+      bb2: {
+          _5 = copy _1[_6];
+          StorageDead(_6);
+          StorageLive(_8);
+          StorageLive(_9);
+          _9 = copy _2;
+          StorageLive(_10);
+          _10 = copy _2;
+          _8 = Mul(move _9, move _10);
+          StorageDead(_10);
+          StorageDead(_9);
+          StorageLive(_11);
+          StorageLive(_12);
+          _12 = copy _5;
+          StorageLive(_13);
+          _13 = copy _5;
+          _11 = Mul(move _12, move _13);
+          StorageDead(_13);
+          StorageDead(_12);
+          _0 = Add(move _8, move _11);
+          StorageDead(_11);
+          StorageDead(_8);
+          StorageDead(_5);
+          StorageDead(_2);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/instsimplify/combine_array_len.normN.InstSimplify-after-simplifycfg.panic-unwind.diff b/tests/mir-opt/instsimplify/combine_array_len.normN.InstSimplify-after-simplifycfg.panic-unwind.diff
new file mode 100644
index 00000000000..0ddc70f2003
--- /dev/null
+++ b/tests/mir-opt/instsimplify/combine_array_len.normN.InstSimplify-after-simplifycfg.panic-unwind.diff
@@ -0,0 +1,71 @@
+- // MIR for `normN` before InstSimplify-after-simplifycfg
++ // MIR for `normN` after InstSimplify-after-simplifycfg
+  
+  fn normN(_1: [f32; N]) -> f32 {
+      debug x => _1;
+      let mut _0: f32;
+      let _2: f32;
+      let _3: usize;
+      let mut _4: bool;
+      let _6: usize;
+      let mut _7: bool;
+      let mut _8: f32;
+      let mut _9: f32;
+      let mut _10: f32;
+      let mut _11: f32;
+      let mut _12: f32;
+      let mut _13: f32;
+      scope 1 {
+          debug a => _2;
+          let _5: f32;
+          scope 2 {
+              debug b => _5;
+          }
+      }
+  
+      bb0: {
+          StorageLive(_2);
+          StorageLive(_3);
+          _3 = const 0_usize;
+          _4 = Lt(copy _3, const N);
+          assert(move _4, "index out of bounds: the length is {} but the index is {}", const N, copy _3) -> [success: bb1, unwind continue];
+      }
+  
+      bb1: {
+          _2 = copy _1[_3];
+          StorageDead(_3);
+          StorageLive(_5);
+          StorageLive(_6);
+          _6 = const 1_usize;
+          _7 = Lt(copy _6, const N);
+          assert(move _7, "index out of bounds: the length is {} but the index is {}", const N, copy _6) -> [success: bb2, unwind continue];
+      }
+  
+      bb2: {
+          _5 = copy _1[_6];
+          StorageDead(_6);
+          StorageLive(_8);
+          StorageLive(_9);
+          _9 = copy _2;
+          StorageLive(_10);
+          _10 = copy _2;
+          _8 = Mul(move _9, move _10);
+          StorageDead(_10);
+          StorageDead(_9);
+          StorageLive(_11);
+          StorageLive(_12);
+          _12 = copy _5;
+          StorageLive(_13);
+          _13 = copy _5;
+          _11 = Mul(move _12, move _13);
+          StorageDead(_13);
+          StorageDead(_12);
+          _0 = Add(move _8, move _11);
+          StorageDead(_11);
+          StorageDead(_8);
+          StorageDead(_5);
+          StorageDead(_2);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/instsimplify/combine_array_len.rs b/tests/mir-opt/instsimplify/combine_array_len.rs
new file mode 100644
index 00000000000..1c4d42d3bbe
--- /dev/null
+++ b/tests/mir-opt/instsimplify/combine_array_len.rs
@@ -0,0 +1,25 @@
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+//@ test-mir-pass: InstSimplify-after-simplifycfg
+
+// EMIT_MIR combine_array_len.norm2.InstSimplify-after-simplifycfg.diff
+fn norm2(x: [f32; 2]) -> f32 {
+    // CHECK-LABEL: fn norm2(
+    // CHECK-NOT: PtrMetadata(
+    let a = x[0];
+    let b = x[1];
+    a * a + b * b
+}
+
+// EMIT_MIR combine_array_len.normN.InstSimplify-after-simplifycfg.diff
+fn normN<const N: usize>(x: [f32; N]) -> f32 {
+    // CHECK-LABEL: fn normN(
+    // CHECK-NOT: PtrMetadata(
+    let a = x[0];
+    let b = x[1];
+    a * a + b * b
+}
+
+fn main() {
+    assert_eq!(norm2([3.0, 4.0]), 5.0 * 5.0);
+    assert_eq!(normN([3.0, 4.0]), 5.0 * 5.0);
+}
diff --git a/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff b/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff
index ac88fe67bb8..3ea7387a48d 100644
--- a/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff
+++ b/tests/mir-opt/issue_101973.inner.GVN.panic-abort.diff
@@ -30,7 +30,6 @@
           StorageLive(_4);
           StorageLive(_5);
           _5 = copy _1;
-          nop;
 -         StorageLive(_14);
 -         _14 = BitAnd(copy _5, const 255_u32);
 -         _4 = BitOr(const 0_u32, move _14);
diff --git a/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff b/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff
index 96c3cae2d33..832db856b2c 100644
--- a/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff
+++ b/tests/mir-opt/issue_101973.inner.GVN.panic-unwind.diff
@@ -30,7 +30,6 @@
           StorageLive(_4);
           StorageLive(_5);
           _5 = copy _1;
-          nop;
 -         StorageLive(_14);
 -         _14 = BitAnd(copy _5, const 255_u32);
 -         _4 = BitOr(const 0_u32, move _14);
diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff
index 08dee3697e0..614d9ad440d 100644
--- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff
+++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff
@@ -7,18 +7,16 @@
       let _2: &[T];
       let _3: &[T; 3];
       let _4: [T; 3];
-      let mut _5: usize;
-      let mut _6: bool;
-      let mut _10: !;
+      let mut _8: !;
       scope 1 {
           debug v => _2;
+          let _5: &T;
+          let _6: &T;
           let _7: &T;
-          let _8: &T;
-          let _9: &T;
           scope 2 {
-              debug v1 => _7;
-              debug v2 => _8;
-              debug v3 => _9;
+              debug v1 => _5;
+              debug v2 => _6;
+              debug v3 => _7;
           }
       }
   
@@ -27,25 +25,17 @@
           _4 = [copy _1, copy _1, copy _1];
           _3 = &_4;
           _2 = copy _3 as &[T] (PointerCoercion(Unsize, Implicit));
-          nop;
-          nop;
           goto -> bb2;
       }
   
       bb1: {
-          _10 = core::panicking::panic(const "internal error: entered unreachable code") -> unwind unreachable;
+          _8 = core::panicking::panic(const "internal error: entered unreachable code") -> unwind unreachable;
       }
   
       bb2: {
-          StorageLive(_7);
-          _7 = &(*_2)[0 of 3];
-          StorageLive(_8);
-          _8 = &(*_2)[1 of 3];
-          StorageLive(_9);
-          _9 = &(*_2)[2 of 3];
-          StorageDead(_9);
-          StorageDead(_8);
-          StorageDead(_7);
+          // DBG: _5 = &(*_2)[0 of 3];
+          // DBG: _6 = &(*_2)[1 of 3];
+          // DBG: _7 = &(*_2)[2 of 3];
           StorageDead(_4);
           return;
       }
diff --git a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff
index aa44a2ad532..57a88cf8984 100644
--- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff
+++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff
@@ -7,18 +7,16 @@
       let _2: &[T];
       let _3: &[T; 3];
       let _4: [T; 3];
-      let mut _5: usize;
-      let mut _6: bool;
-      let mut _10: !;
+      let mut _8: !;
       scope 1 {
           debug v => _2;
+          let _5: &T;
+          let _6: &T;
           let _7: &T;
-          let _8: &T;
-          let _9: &T;
           scope 2 {
-              debug v1 => _7;
-              debug v2 => _8;
-              debug v3 => _9;
+              debug v1 => _5;
+              debug v2 => _6;
+              debug v3 => _7;
           }
       }
   
@@ -27,25 +25,17 @@
           _4 = [copy _1, copy _1, copy _1];
           _3 = &_4;
           _2 = copy _3 as &[T] (PointerCoercion(Unsize, Implicit));
-          nop;
-          nop;
           goto -> bb2;
       }
   
       bb1: {
-          _10 = core::panicking::panic(const "internal error: entered unreachable code") -> unwind continue;
+          _8 = core::panicking::panic(const "internal error: entered unreachable code") -> unwind continue;
       }
   
       bb2: {
-          StorageLive(_7);
-          _7 = &(*_2)[0 of 3];
-          StorageLive(_8);
-          _8 = &(*_2)[1 of 3];
-          StorageLive(_9);
-          _9 = &(*_2)[2 of 3];
-          StorageDead(_9);
-          StorageDead(_8);
-          StorageDead(_7);
+          // DBG: _5 = &(*_2)[0 of 3];
+          // DBG: _6 = &(*_2)[1 of 3];
+          // DBG: _7 = &(*_2)[2 of 3];
           StorageDead(_4);
           return;
       }
diff --git a/tests/mir-opt/lower_array_len.array_len_raw.GVN.panic-abort.diff b/tests/mir-opt/lower_array_len.array_len_raw.GVN.panic-abort.diff
index 180a7db0297..714a12804e6 100644
--- a/tests/mir-opt/lower_array_len.array_len_raw.GVN.panic-abort.diff
+++ b/tests/mir-opt/lower_array_len.array_len_raw.GVN.panic-abort.diff
@@ -18,8 +18,7 @@
       }
   
       bb0: {
--         StorageLive(_2);
-+         nop;
+          StorageLive(_2);
           StorageLive(_3);
           StorageLive(_4);
           _4 = &_1;
@@ -41,8 +40,7 @@
       bb1: {
           StorageDead(_6);
           StorageDead(_5);
--         StorageDead(_2);
-+         nop;
+          StorageDead(_2);
           StorageDead(_7);
           return;
       }
diff --git a/tests/mir-opt/lower_array_len.array_len_raw.GVN.panic-unwind.diff b/tests/mir-opt/lower_array_len.array_len_raw.GVN.panic-unwind.diff
index 180a7db0297..714a12804e6 100644
--- a/tests/mir-opt/lower_array_len.array_len_raw.GVN.panic-unwind.diff
+++ b/tests/mir-opt/lower_array_len.array_len_raw.GVN.panic-unwind.diff
@@ -18,8 +18,7 @@
       }
   
       bb0: {
--         StorageLive(_2);
-+         nop;
+          StorageLive(_2);
           StorageLive(_3);
           StorageLive(_4);
           _4 = &_1;
@@ -41,8 +40,7 @@
       bb1: {
           StorageDead(_6);
           StorageDead(_5);
--         StorageDead(_2);
-+         nop;
+          StorageDead(_2);
           StorageDead(_7);
           return;
       }
diff --git a/tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-abort.diff b/tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-abort.diff
index 49964f8b49e..b236b22f067 100644
--- a/tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-abort.diff
+++ b/tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-abort.diff
@@ -17,8 +17,7 @@
       }
   
       bb0: {
--         StorageLive(_2);
-+         nop;
+          StorageLive(_2);
           StorageLive(_3);
           StorageLive(_4);
           _4 = &mut _1;
@@ -38,8 +37,7 @@
       bb1: {
           StorageDead(_6);
           StorageDead(_5);
--         StorageDead(_2);
-+         nop;
+          StorageDead(_2);
           return;
       }
   }
diff --git a/tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-unwind.diff b/tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-unwind.diff
index 49964f8b49e..b236b22f067 100644
--- a/tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-unwind.diff
+++ b/tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-unwind.diff
@@ -17,8 +17,7 @@
       }
   
       bb0: {
--         StorageLive(_2);
-+         nop;
+          StorageLive(_2);
           StorageLive(_3);
           StorageLive(_4);
           _4 = &mut _1;
@@ -38,8 +37,7 @@
       bb1: {
           StorageDead(_6);
           StorageDead(_5);
--         StorageDead(_2);
-+         nop;
+          StorageDead(_2);
           return;
       }
   }
diff --git a/tests/mir-opt/pre-codegen/checked_ops.rs b/tests/mir-opt/pre-codegen/checked_ops.rs
index 8fd340503f5..dfbc0f4a110 100644
--- a/tests/mir-opt/pre-codegen/checked_ops.rs
+++ b/tests/mir-opt/pre-codegen/checked_ops.rs
@@ -44,8 +44,7 @@ pub fn saturating_sub_at_home(lhs: u32, rhs: u32) -> u32 {
     // CHECK-LABEL: fn saturating_sub_at_home
     // CHECK: [[DELTA:_[0-9]+]] = SubUnchecked(copy _1, copy _2)
     // CHECK: [[TEMP1:_.+]] = Option::<u32>::Some({{move|copy}} [[DELTA]]);
-    // CHECK: [[TEMP2:_.+]] = {{move|copy}} (([[TEMP1]] as Some).0: u32);
-    // CHECK: _0 = {{move|copy}} [[TEMP2]];
+    // CHECK: _0 = {{move|copy}} (([[TEMP1]] as Some).0: u32);
     u32::checked_sub(lhs, rhs).unwrap_or(0)
 }
 
diff --git a/tests/mir-opt/pre-codegen/checked_ops.saturating_sub_at_home.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/checked_ops.saturating_sub_at_home.PreCodegen.after.panic-abort.mir
index 5b4fdeda857..dc7567b57e7 100644
--- a/tests/mir-opt/pre-codegen/checked_ops.saturating_sub_at_home.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/checked_ops.saturating_sub_at_home.PreCodegen.after.panic-abort.mir
@@ -10,7 +10,6 @@ fn saturating_sub_at_home(_1: u32, _2: u32) -> u32 {
         let mut _4: u32;
     }
     scope 2 (inlined Option::<u32>::unwrap_or) {
-        let _6: u32;
         scope 3 {
         }
     }
@@ -28,10 +27,7 @@ fn saturating_sub_at_home(_1: u32, _2: u32) -> u32 {
         _5 = Option::<u32>::Some(move _4);
         StorageDead(_4);
         StorageDead(_3);
-        StorageLive(_6);
-        _6 = move ((_5 as Some).0: u32);
-        _0 = move _6;
-        StorageDead(_6);
+        _0 = move ((_5 as Some).0: u32);
         goto -> bb3;
     }
 
diff --git a/tests/mir-opt/pre-codegen/checked_ops.saturating_sub_at_home.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/checked_ops.saturating_sub_at_home.PreCodegen.after.panic-unwind.mir
index 5b4fdeda857..dc7567b57e7 100644
--- a/tests/mir-opt/pre-codegen/checked_ops.saturating_sub_at_home.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/checked_ops.saturating_sub_at_home.PreCodegen.after.panic-unwind.mir
@@ -10,7 +10,6 @@ fn saturating_sub_at_home(_1: u32, _2: u32) -> u32 {
         let mut _4: u32;
     }
     scope 2 (inlined Option::<u32>::unwrap_or) {
-        let _6: u32;
         scope 3 {
         }
     }
@@ -28,10 +27,7 @@ fn saturating_sub_at_home(_1: u32, _2: u32) -> u32 {
         _5 = Option::<u32>::Some(move _4);
         StorageDead(_4);
         StorageDead(_3);
-        StorageLive(_6);
-        _6 = move ((_5 as Some).0: u32);
-        _0 = move _6;
-        StorageDead(_6);
+        _0 = move ((_5 as Some).0: u32);
         goto -> bb3;
     }
 
diff --git a/tests/mir-opt/pre-codegen/clone_as_copy.clone_as_copy.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/clone_as_copy.clone_as_copy.PreCodegen.after.mir
index 34747e5a928..1e6e2ee1b8b 100644
--- a/tests/mir-opt/pre-codegen/clone_as_copy.clone_as_copy.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/clone_as_copy.clone_as_copy.PreCodegen.after.mir
@@ -12,10 +12,8 @@ fn clone_as_copy(_1: &NestCopy) -> NestCopy {
     }
 
     bb0: {
-        StorageLive(_2);
-        _2 = &((*_1).1: AllCopy);
+        // DBG: _2 = &((*_1).1: AllCopy);
         _0 = copy (*_1);
-        StorageDead(_2);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/clone_as_copy.enum_clone_as_copy.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/clone_as_copy.enum_clone_as_copy.PreCodegen.after.mir
index e67f362ee04..76bb49bc9c1 100644
--- a/tests/mir-opt/pre-codegen/clone_as_copy.enum_clone_as_copy.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/clone_as_copy.enum_clone_as_copy.PreCodegen.after.mir
@@ -5,58 +5,28 @@ fn enum_clone_as_copy(_1: &Enum1) -> Enum1 {
     let mut _0: Enum1;
     scope 1 (inlined <Enum1 as Clone>::clone) {
         debug self => _1;
-        let mut _2: isize;
-        let _3: &AllCopy;
-        let _4: &NestCopy;
+        let _2: &AllCopy;
+        let _3: &NestCopy;
         scope 2 {
-            debug __self_0 => _3;
+            debug __self_0 => _2;
             scope 6 (inlined <AllCopy as Clone>::clone) {
-                debug self => _3;
+                debug self => _2;
             }
         }
         scope 3 {
-            debug __self_0 => _4;
+            debug __self_0 => _3;
             scope 4 (inlined <NestCopy as Clone>::clone) {
-                debug self => _4;
-                let _5: &AllCopy;
+                debug self => _3;
+                let _4: &AllCopy;
                 scope 5 (inlined <AllCopy as Clone>::clone) {
-                    debug self => _5;
+                    debug self => _4;
                 }
             }
         }
     }
 
     bb0: {
-        StorageLive(_2);
-        StorageLive(_3);
-        StorageLive(_4);
-        _2 = discriminant((*_1));
-        switchInt(move _2) -> [0: bb1, 1: bb2, otherwise: bb4];
-    }
-
-    bb1: {
-        _3 = &(((*_1) as A).0: AllCopy);
         _0 = copy (*_1);
-        goto -> bb3;
-    }
-
-    bb2: {
-        _4 = &(((*_1) as B).0: NestCopy);
-        StorageLive(_5);
-        _5 = &((((*_1) as B).0: NestCopy).1: AllCopy);
-        StorageDead(_5);
-        _0 = copy (*_1);
-        goto -> bb3;
-    }
-
-    bb3: {
-        StorageDead(_4);
-        StorageDead(_3);
-        StorageDead(_2);
         return;
     }
-
-    bb4: {
-        unreachable;
-    }
 }
diff --git a/tests/mir-opt/pre-codegen/clone_as_copy.rs b/tests/mir-opt/pre-codegen/clone_as_copy.rs
index f5ff1854d38..00f24754d59 100644
--- a/tests/mir-opt/pre-codegen/clone_as_copy.rs
+++ b/tests/mir-opt/pre-codegen/clone_as_copy.rs
@@ -25,19 +25,19 @@ enum Enum1 {
 // EMIT_MIR clone_as_copy.clone_as_copy.PreCodegen.after.mir
 fn clone_as_copy(v: &NestCopy) -> NestCopy {
     // CHECK-LABEL: fn clone_as_copy(
-    // CHECK-NOT: = AllCopy { {{.*}} };
-    // CHECK-NOT: = NestCopy { {{.*}} };
-    // CHECK: _0 = copy (*_1);
-    // CHECK: return;
+    // CHECK: let [[DEAD_VAR:_.*]]: &AllCopy;
+    // CHECK: bb0: {
+    // CHECK-NEXT: DBG: [[DEAD_VAR]] = &((*_1).1: AllCopy)
+    // CHECK-NEXT: _0 = copy (*_1);
+    // CHECK-NEXT: return;
     v.clone()
 }
 
-// FIXME: We can merge into exactly one assignment statement.
 // EMIT_MIR clone_as_copy.enum_clone_as_copy.PreCodegen.after.mir
 fn enum_clone_as_copy(v: &Enum1) -> Enum1 {
     // CHECK-LABEL: fn enum_clone_as_copy(
-    // CHECK-NOT: = Enum1::
-    // CHECK: _0 = copy (*_1);
-    // CHECK: _0 = copy (*_1);
+    // CHECK: bb0: {
+    // CHECK-NEXT: _0 = copy (*_1);
+    // CHECK-NEXT: return;
     v.clone()
 }
diff --git a/tests/mir-opt/pre-codegen/dead_on_invalid_place.invalid_place.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/dead_on_invalid_place.invalid_place.PreCodegen.after.mir
new file mode 100644
index 00000000000..4a2127178fb
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/dead_on_invalid_place.invalid_place.PreCodegen.after.mir
@@ -0,0 +1,13 @@
+// MIR for `invalid_place` after PreCodegen
+
+fn invalid_place(_1: bool) -> bool {
+    debug c1_ref => _2;
+    let mut _0: bool;
+    let mut _2: &bool;
+
+    bb0: {
+        // DBG: _2 = &?;
+        _0 = copy _1;
+        return;
+    }
+}
diff --git a/tests/mir-opt/pre-codegen/dead_on_invalid_place.rs b/tests/mir-opt/pre-codegen/dead_on_invalid_place.rs
new file mode 100644
index 00000000000..5abe9fa43a5
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/dead_on_invalid_place.rs
@@ -0,0 +1,27 @@
+#![feature(core_intrinsics, custom_mir)]
+#![crate_type = "lib"]
+
+use std::intrinsics::mir::*;
+
+// EMIT_MIR dead_on_invalid_place.invalid_place.PreCodegen.after.mir
+#[custom_mir(dialect = "runtime")]
+pub fn invalid_place(c: bool) -> bool {
+    // CHECK-LABEL: fn invalid_place
+    // CHECK: debug c1_ref => [[c1_ref:_[0-9]+]];
+    // CHECK: bb0: {
+    // We cannot read the reference, since `c1` is dead.
+    // CHECK-NEXT: DBG: [[c1_ref]] = &?
+    // CHECK-NEXT: _0 = copy _1;
+    // CHECK-NEXT: return;
+    mir! {
+        let _c1_ref: &bool;
+        let c1: bool;
+        debug c1_ref => _c1_ref;
+        {
+            c1 = c;
+            _c1_ref = &c1;
+            RET = c;
+            Return()
+        }
+    }
+}
diff --git a/tests/mir-opt/pre-codegen/derived_ord.demo_le.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/derived_ord.demo_le.PreCodegen.after.mir
index 8746cb08991..e235fa35c02 100644
--- a/tests/mir-opt/pre-codegen/derived_ord.demo_le.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/derived_ord.demo_le.PreCodegen.after.mir
@@ -5,8 +5,9 @@ fn demo_le(_1: &MultiField, _2: &MultiField) -> bool {
     debug b => _2;
     let mut _0: bool;
     scope 1 (inlined <MultiField as PartialOrd>::le) {
-        let mut _11: std::option::Option<std::cmp::Ordering>;
+        let mut _6: std::option::Option<std::cmp::Ordering>;
         scope 2 (inlined Option::<std::cmp::Ordering>::is_some_and::<fn(std::cmp::Ordering) -> bool {std::cmp::Ordering::is_le}>) {
+            let mut _11: isize;
             let _12: std::cmp::Ordering;
             scope 3 {
                 scope 4 (inlined <fn(std::cmp::Ordering) -> bool {std::cmp::Ordering::is_le} as FnOnce<(std::cmp::Ordering,)>>::call_once - shim(fn(std::cmp::Ordering) -> bool {std::cmp::Ordering::is_le})) {
@@ -19,7 +20,6 @@ fn demo_le(_1: &MultiField, _2: &MultiField) -> bool {
             }
         }
         scope 7 (inlined <MultiField as PartialOrd>::partial_cmp) {
-            let mut _6: std::option::Option<std::cmp::Ordering>;
             let mut _7: i8;
             scope 8 {
             }
@@ -38,9 +38,8 @@ fn demo_le(_1: &MultiField, _2: &MultiField) -> bool {
 
     bb0: {
         StorageLive(_12);
-        StorageLive(_11);
-        StorageLive(_5);
         StorageLive(_6);
+        StorageLive(_5);
         StorageLive(_7);
         StorageLive(_3);
         _3 = copy ((*_1).0: char);
@@ -63,30 +62,44 @@ fn demo_le(_1: &MultiField, _2: &MultiField) -> bool {
         _10 = Cmp(move _8, move _9);
         StorageDead(_9);
         StorageDead(_8);
-        _11 = Option::<std::cmp::Ordering>::Some(move _10);
+        _6 = Option::<std::cmp::Ordering>::Some(move _10);
         StorageDead(_10);
         StorageDead(_7);
-        StorageDead(_6);
         StorageDead(_5);
-        goto -> bb3;
+        StorageLive(_11);
+        goto -> bb4;
     }
 
     bb2: {
-        _11 = copy _6;
         StorageDead(_7);
-        StorageDead(_6);
         StorageDead(_5);
-        goto -> bb3;
+        StorageLive(_11);
+        _11 = discriminant(_6);
+        switchInt(move _11) -> [0: bb3, 1: bb4, otherwise: bb6];
     }
 
     bb3: {
-        _12 = move ((_11 as Some).0: std::cmp::Ordering);
+        _0 = const false;
+        goto -> bb5;
+    }
+
+    bb4: {
+        _12 = move ((_6 as Some).0: std::cmp::Ordering);
         StorageLive(_13);
         _13 = discriminant(_12);
         _0 = Le(move _13, const 0_i8);
         StorageDead(_13);
+        goto -> bb5;
+    }
+
+    bb5: {
         StorageDead(_11);
+        StorageDead(_6);
         StorageDead(_12);
         return;
     }
+
+    bb6: {
+        unreachable;
+    }
 }
diff --git a/tests/mir-opt/pre-codegen/derived_ord.rs b/tests/mir-opt/pre-codegen/derived_ord.rs
index 73ae923a6cb..823e0f6d09c 100644
--- a/tests/mir-opt/pre-codegen/derived_ord.rs
+++ b/tests/mir-opt/pre-codegen/derived_ord.rs
@@ -25,7 +25,10 @@ pub fn demo_le(a: &MultiField, b: &MultiField) -> bool {
     // CHECK: Cmp(move [[A1]], move [[B1]]);
 
     // CHECK: [[D1:_[0-9]+]] = discriminant({{.+}});
-    // CHECK: _0 = Le(move [[D1]], const 0_i8);
+    // CHECK: switchInt(move [[D1]]) -> [0: bb{{[0-9]+}}, 1: bb{{[0-9]+}}, otherwise: bb{{[0-9]+}}];
+
+    // CHECK: [[D2:_[0-9]+]] = discriminant({{.+}});
+    // CHECK: _0 = Le(move [[D2]], const 0_i8);
     *a <= *b
 }
 
diff --git a/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir
index de25eebee77..5993bd79d27 100644
--- a/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir
@@ -4,10 +4,9 @@ fn <impl at $DIR/derived_ord.rs:5:10: 5:20>::partial_cmp(_1: &MultiField, _2: &M
     debug self => _1;
     debug other => _2;
     let mut _0: std::option::Option<std::cmp::Ordering>;
-    let mut _6: std::option::Option<std::cmp::Ordering>;
-    let mut _7: i8;
+    let mut _6: i8;
     scope 1 {
-        debug cmp => _6;
+        debug cmp => _0;
     }
     scope 2 (inlined std::cmp::impls::<impl PartialOrd for char>::partial_cmp) {
         let mut _3: char;
@@ -15,9 +14,9 @@ fn <impl at $DIR/derived_ord.rs:5:10: 5:20>::partial_cmp(_1: &MultiField, _2: &M
         let mut _5: std::cmp::Ordering;
     }
     scope 3 (inlined std::cmp::impls::<impl PartialOrd for i16>::partial_cmp) {
+        let mut _7: i16;
         let mut _8: i16;
-        let mut _9: i16;
-        let mut _10: std::cmp::Ordering;
+        let mut _9: std::cmp::Ordering;
     }
 
     bb0: {
@@ -28,27 +27,26 @@ fn <impl at $DIR/derived_ord.rs:5:10: 5:20>::partial_cmp(_1: &MultiField, _2: &M
         _5 = Cmp(move _3, move _4);
         StorageDead(_4);
         StorageDead(_3);
-        _6 = Option::<std::cmp::Ordering>::Some(copy _5);
-        _7 = discriminant(_5);
-        switchInt(move _7) -> [0: bb1, otherwise: bb2];
+        _0 = Option::<std::cmp::Ordering>::Some(copy _5);
+        _6 = discriminant(_5);
+        switchInt(move _6) -> [0: bb1, otherwise: bb2];
     }
 
     bb1: {
-        StorageLive(_10);
-        StorageLive(_8);
-        _8 = copy ((*_1).1: i16);
         StorageLive(_9);
-        _9 = copy ((*_2).1: i16);
-        _10 = Cmp(move _8, move _9);
-        StorageDead(_9);
+        StorageLive(_7);
+        _7 = copy ((*_1).1: i16);
+        StorageLive(_8);
+        _8 = copy ((*_2).1: i16);
+        _9 = Cmp(move _7, move _8);
         StorageDead(_8);
-        _0 = Option::<std::cmp::Ordering>::Some(move _10);
-        StorageDead(_10);
+        StorageDead(_7);
+        _0 = Option::<std::cmp::Ordering>::Some(move _9);
+        StorageDead(_9);
         goto -> bb3;
     }
 
     bb2: {
-        _0 = copy _6;
         goto -> bb3;
     }
 
diff --git a/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir
index 75e8cb1d861..8f30ad30fcc 100644
--- a/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir
@@ -6,20 +6,20 @@ fn filter_mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> Option<U>) -> ()
     let mut _0: ();
     let mut _3: std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>;
     let mut _4: std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>;
-    let mut _5: &mut std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>;
-    let mut _8: std::option::Option<U>;
-    let mut _9: isize;
-    let _11: ();
+    let mut _7: std::option::Option<U>;
+    let mut _8: isize;
+    let _10: ();
+    let mut _11: &mut std::iter::FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>>;
     scope 1 {
         debug iter => _4;
-        let _10: U;
+        let _9: U;
         scope 2 {
-            debug x => _10;
+            debug x => _9;
         }
         scope 4 (inlined <FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> as Iterator>::next) {
-            debug self => _5;
-            let mut _6: &mut impl Iterator<Item = T>;
-            let mut _7: &mut impl Fn(T) -> Option<U>;
+            debug self => _11;
+            let mut _5: &mut impl Iterator<Item = T>;
+            let mut _6: &mut impl Fn(T) -> Option<U>;
         }
     }
     scope 3 (inlined <FilterMap<impl Iterator<Item = T>, impl Fn(T) -> Option<U>> as IntoIterator>::into_iter) {
@@ -37,24 +37,24 @@ fn filter_mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> Option<U>) -> ()
     }
 
     bb2: {
-        StorageLive(_8);
-        _5 = &mut _4;
-        StorageLive(_6);
-        _6 = &mut (_4.0: impl Iterator<Item = T>);
         StorageLive(_7);
-        _7 = &mut (_4.1: impl Fn(T) -> Option<U>);
-        _8 = <impl Iterator<Item = T> as Iterator>::find_map::<U, &mut impl Fn(T) -> Option<U>>(move _6, move _7) -> [return: bb3, unwind: bb9];
+        // DBG: _11 = &_4;
+        StorageLive(_5);
+        _5 = &mut (_4.0: impl Iterator<Item = T>);
+        StorageLive(_6);
+        _6 = &mut (_4.1: impl Fn(T) -> Option<U>);
+        _7 = <impl Iterator<Item = T> as Iterator>::find_map::<U, &mut impl Fn(T) -> Option<U>>(move _5, move _6) -> [return: bb3, unwind: bb9];
     }
 
     bb3: {
-        StorageDead(_7);
         StorageDead(_6);
-        _9 = discriminant(_8);
-        switchInt(move _9) -> [0: bb4, 1: bb6, otherwise: bb8];
+        StorageDead(_5);
+        _8 = discriminant(_7);
+        switchInt(move _8) -> [0: bb4, 1: bb6, otherwise: bb8];
     }
 
     bb4: {
-        StorageDead(_8);
+        StorageDead(_7);
         drop(_4) -> [return: bb5, unwind continue];
     }
 
@@ -64,12 +64,12 @@ fn filter_mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> Option<U>) -> ()
     }
 
     bb6: {
-        _10 = move ((_8 as Some).0: U);
-        _11 = opaque::<U>(move _10) -> [return: bb7, unwind: bb9];
+        _9 = move ((_7 as Some).0: U);
+        _10 = opaque::<U>(move _9) -> [return: bb7, unwind: bb9];
     }
 
     bb7: {
-        StorageDead(_8);
+        StorageDead(_7);
         goto -> bb2;
     }
 
diff --git a/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir
index 154cbd3791c..beb7b936ccf 100644
--- a/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/loops.int_range.PreCodegen.after.mir
@@ -5,32 +5,31 @@ fn int_range(_1: usize, _2: usize) -> () {
     debug end => _2;
     let mut _0: ();
     let mut _3: std::ops::Range<usize>;
-    let mut _4: std::ops::Range<usize>;
-    let mut _5: &mut std::ops::Range<usize>;
-    let mut _13: std::option::Option<usize>;
-    let _15: ();
+    let mut _9: std::option::Option<usize>;
+    let _11: ();
+    let mut _12: &mut std::ops::Range<usize>;
     scope 1 {
-        debug iter => _4;
-        let _14: usize;
+        debug iter => _3;
+        let _10: usize;
         scope 2 {
-            debug i => _14;
+            debug i => _10;
         }
         scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
-            debug self => _5;
+            debug self => _12;
             scope 5 (inlined <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next) {
-                debug self => _5;
-                let mut _6: &usize;
-                let mut _7: &usize;
-                let mut _10: bool;
-                let _11: usize;
-                let mut _12: usize;
+                debug self => _12;
+                let mut _6: bool;
+                let _7: usize;
+                let mut _8: usize;
+                let mut _13: &usize;
+                let mut _14: &usize;
                 scope 6 {
-                    debug old => _11;
+                    debug old => _7;
                     scope 8 (inlined <usize as Step>::forward_unchecked) {
-                        debug start => _11;
+                        debug start => _7;
                         debug n => const 1_usize;
                         scope 9 (inlined #[track_caller] core::num::<impl usize>::unchecked_add) {
-                            debug self => _11;
+                            debug self => _7;
                             debug rhs => const 1_usize;
                             scope 10 (inlined core::ub_checks::check_language_ub) {
                                 scope 11 (inlined core::ub_checks::check_language_ub::runtime) {
@@ -40,10 +39,10 @@ fn int_range(_1: usize, _2: usize) -> () {
                     }
                 }
                 scope 7 (inlined std::cmp::impls::<impl PartialOrd for usize>::lt) {
-                    debug self => _6;
-                    debug other => _7;
-                    let mut _8: usize;
-                    let mut _9: usize;
+                    debug self => _13;
+                    debug other => _14;
+                    let mut _4: usize;
+                    let mut _5: usize;
                 }
             }
         }
@@ -54,54 +53,45 @@ fn int_range(_1: usize, _2: usize) -> () {
 
     bb0: {
         _3 = std::ops::Range::<usize> { start: copy _1, end: copy _2 };
-        StorageLive(_4);
-        _4 = copy _3;
         goto -> bb1;
     }
 
     bb1: {
-        StorageLive(_13);
-        _5 = &mut _4;
-        StorageLive(_10);
-        StorageLive(_6);
-        _6 = &(_4.0: usize);
-        StorageLive(_7);
-        _7 = &(_4.1: usize);
-        StorageLive(_8);
-        _8 = copy (_4.0: usize);
         StorageLive(_9);
-        _9 = copy (_4.1: usize);
-        _10 = Lt(move _8, move _9);
-        StorageDead(_9);
-        StorageDead(_8);
-        switchInt(move _10) -> [0: bb2, otherwise: bb3];
+        // DBG: _12 = &_3;
+        StorageLive(_6);
+        // DBG: _13 = &(_3.0: usize);
+        // DBG: _14 = &(_3.1: usize);
+        StorageLive(_4);
+        _4 = copy (_3.0: usize);
+        StorageLive(_5);
+        _5 = copy (_3.1: usize);
+        _6 = Lt(move _4, move _5);
+        StorageDead(_5);
+        StorageDead(_4);
+        switchInt(move _6) -> [0: bb2, otherwise: bb3];
     }
 
     bb2: {
-        StorageDead(_7);
         StorageDead(_6);
-        StorageDead(_10);
-        StorageDead(_13);
-        StorageDead(_4);
+        StorageDead(_9);
         return;
     }
 
     bb3: {
-        StorageDead(_7);
+        _7 = copy (_3.0: usize);
+        StorageLive(_8);
+        _8 = AddUnchecked(copy _7, const 1_usize);
+        (_3.0: usize) = move _8;
+        StorageDead(_8);
+        _9 = Option::<usize>::Some(copy _7);
         StorageDead(_6);
-        _11 = copy (_4.0: usize);
-        StorageLive(_12);
-        _12 = AddUnchecked(copy _11, const 1_usize);
-        (_4.0: usize) = move _12;
-        StorageDead(_12);
-        _13 = Option::<usize>::Some(copy _11);
-        StorageDead(_10);
-        _14 = copy ((_13 as Some).0: usize);
-        _15 = opaque::<usize>(move _14) -> [return: bb4, unwind continue];
+        _10 = copy ((_9 as Some).0: usize);
+        _11 = opaque::<usize>(move _10) -> [return: bb4, unwind continue];
     }
 
     bb4: {
-        StorageDead(_13);
+        StorageDead(_9);
         goto -> bb1;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir
index d22ea54004c..406c96fc32f 100644
--- a/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/loops.mapped.PreCodegen.after.mir
@@ -6,32 +6,32 @@ fn mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> U) -> () {
     let mut _0: ();
     let mut _3: std::iter::Map<impl Iterator<Item = T>, impl Fn(T) -> U>;
     let mut _4: std::iter::Map<impl Iterator<Item = T>, impl Fn(T) -> U>;
-    let mut _5: &mut std::iter::Map<impl Iterator<Item = T>, impl Fn(T) -> U>;
-    let mut _13: std::option::Option<U>;
-    let _15: ();
+    let mut _12: std::option::Option<U>;
+    let _14: ();
+    let mut _15: &mut std::iter::Map<impl Iterator<Item = T>, impl Fn(T) -> U>;
     scope 1 {
         debug iter => _4;
-        let _14: U;
+        let _13: U;
         scope 2 {
-            debug x => _14;
+            debug x => _13;
         }
         scope 4 (inlined <Map<impl Iterator<Item = T>, impl Fn(T) -> U> as Iterator>::next) {
-            debug self => _5;
-            let mut _6: &mut impl Iterator<Item = T>;
-            let mut _7: std::option::Option<T>;
-            let mut _8: &mut impl Fn(T) -> U;
+            debug self => _15;
+            let mut _5: &mut impl Iterator<Item = T>;
+            let mut _6: std::option::Option<T>;
+            let mut _7: &mut impl Fn(T) -> U;
             scope 5 (inlined Option::<T>::map::<U, &mut impl Fn(T) -> U>) {
-                debug self => _7;
-                debug f => _8;
-                let mut _9: isize;
-                let _10: T;
-                let mut _11: (T,);
-                let mut _12: U;
+                debug self => _6;
+                debug f => _7;
+                let mut _8: isize;
+                let _9: T;
+                let mut _10: (T,);
+                let mut _11: U;
                 scope 6 {
-                    debug x => _10;
+                    debug x => _9;
                     scope 7 (inlined ops::function::impls::<impl FnOnce<(T,)> for &mut impl Fn(T) -> U>::call_once) {
-                        debug self => _8;
-                        debug args => _11;
+                        debug self => _7;
+                        debug args => _10;
                     }
                 }
             }
@@ -52,30 +52,30 @@ fn mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> U) -> () {
     }
 
     bb2: {
-        StorageLive(_13);
-        _5 = &mut _4;
-        StorageLive(_8);
+        StorageLive(_12);
+        // DBG: _15 = &_4;
         StorageLive(_7);
         StorageLive(_6);
-        _6 = &mut (_4.0: impl Iterator<Item = T>);
-        _7 = <impl Iterator<Item = T> as Iterator>::next(move _6) -> [return: bb3, unwind: bb10];
+        StorageLive(_5);
+        _5 = &mut (_4.0: impl Iterator<Item = T>);
+        _6 = <impl Iterator<Item = T> as Iterator>::next(move _5) -> [return: bb3, unwind: bb10];
     }
 
     bb3: {
-        StorageDead(_6);
-        _8 = &mut (_4.1: impl Fn(T) -> U);
+        StorageDead(_5);
+        _7 = &mut (_4.1: impl Fn(T) -> U);
+        StorageLive(_8);
         StorageLive(_9);
-        StorageLive(_10);
-        _9 = discriminant(_7);
-        switchInt(move _9) -> [0: bb4, 1: bb6, otherwise: bb9];
+        _8 = discriminant(_6);
+        switchInt(move _8) -> [0: bb4, 1: bb6, otherwise: bb9];
     }
 
     bb4: {
-        StorageDead(_10);
         StorageDead(_9);
-        StorageDead(_7);
         StorageDead(_8);
-        StorageDead(_13);
+        StorageDead(_6);
+        StorageDead(_7);
+        StorageDead(_12);
         drop(_4) -> [return: bb5, unwind continue];
     }
 
@@ -85,27 +85,27 @@ fn mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> U) -> () {
     }
 
     bb6: {
-        _10 = move ((_7 as Some).0: T);
-        StorageLive(_12);
+        _9 = move ((_6 as Some).0: T);
         StorageLive(_11);
-        _11 = (copy _10,);
-        _12 = <impl Fn(T) -> U as FnMut<(T,)>>::call_mut(move _8, move _11) -> [return: bb7, unwind: bb10];
+        StorageLive(_10);
+        _10 = (copy _9,);
+        _11 = <impl Fn(T) -> U as FnMut<(T,)>>::call_mut(move _7, move _10) -> [return: bb7, unwind: bb10];
     }
 
     bb7: {
-        StorageDead(_11);
-        _13 = Option::<U>::Some(move _12);
-        StorageDead(_12);
         StorageDead(_10);
+        _12 = Option::<U>::Some(move _11);
+        StorageDead(_11);
         StorageDead(_9);
-        StorageDead(_7);
         StorageDead(_8);
-        _14 = move ((_13 as Some).0: U);
-        _15 = opaque::<U>(move _14) -> [return: bb8, unwind: bb10];
+        StorageDead(_6);
+        StorageDead(_7);
+        _13 = move ((_12 as Some).0: U);
+        _14 = opaque::<U>(move _13) -> [return: bb8, unwind: bb10];
     }
 
     bb8: {
-        StorageDead(_13);
+        StorageDead(_12);
         goto -> bb2;
     }
 
diff --git a/tests/mir-opt/pre-codegen/loops.rs b/tests/mir-opt/pre-codegen/loops.rs
index d0b8cc8db7a..952dd8cac60 100644
--- a/tests/mir-opt/pre-codegen/loops.rs
+++ b/tests/mir-opt/pre-codegen/loops.rs
@@ -1,5 +1,6 @@
 // skip-filecheck
 //@ compile-flags: -O -Zmir-opt-level=2 -g
+//@ ignore-std-debug-assertions (debug assertions result in different inlines)
 //@ needs-unwind
 
 #![crate_type = "lib"]
diff --git a/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir
index e537dd6a28e..66eb1bcfaa6 100644
--- a/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir
@@ -3,72 +3,320 @@
 fn vec_move(_1: Vec<impl Sized>) -> () {
     debug v => _1;
     let mut _0: ();
-    let mut _2: std::vec::IntoIter<impl Sized>;
-    let mut _3: std::vec::IntoIter<impl Sized>;
-    let mut _4: &mut std::vec::IntoIter<impl Sized>;
-    let mut _5: std::option::Option<impl Sized>;
-    let mut _6: isize;
-    let _8: ();
+    let mut _22: std::vec::IntoIter<impl Sized>;
+    let mut _23: std::vec::IntoIter<impl Sized>;
+    let mut _24: &mut std::vec::IntoIter<impl Sized>;
+    let mut _25: std::option::Option<impl Sized>;
+    let mut _26: isize;
+    let _28: ();
     scope 1 {
-        debug iter => _3;
-        let _7: impl Sized;
+        debug iter => _23;
+        let _27: impl Sized;
         scope 2 {
-            debug x => _7;
+            debug x => _27;
+        }
+    }
+    scope 3 (inlined <Vec<impl Sized> as IntoIterator>::into_iter) {
+        debug self => _1;
+        let _2: std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
+        let mut _3: *const std::alloc::Global;
+        let mut _8: usize;
+        let mut _10: *mut impl Sized;
+        let mut _11: *const impl Sized;
+        let mut _12: usize;
+        let _29: &std::vec::Vec<impl Sized>;
+        let mut _30: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
+        let mut _31: &alloc::raw_vec::RawVec<impl Sized>;
+        let mut _32: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
+        let _33: &std::vec::Vec<impl Sized>;
+        let mut _34: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
+        let _35: &std::vec::Vec<impl Sized>;
+        let mut _36: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
+        let mut _37: &alloc::raw_vec::RawVec<impl Sized>;
+        let mut _38: &std::mem::ManuallyDrop<std::vec::Vec<impl Sized>>;
+        scope 4 {
+            debug me => _2;
+            scope 5 {
+                debug alloc => const ManuallyDrop::<std::alloc::Global> {{ value: std::alloc::Global }};
+                let _6: std::ptr::NonNull<impl Sized>;
+                scope 6 {
+                    debug buf => _6;
+                    let _7: *mut impl Sized;
+                    scope 7 {
+                        debug begin => _7;
+                        scope 8 {
+                            debug end => _11;
+                            let _20: usize;
+                            scope 9 {
+                                debug cap => _20;
+                            }
+                            scope 39 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
+                                debug self => _38;
+                            }
+                            scope 40 (inlined alloc::raw_vec::RawVec::<impl Sized>::capacity) {
+                                debug self => _37;
+                                let mut _19: usize;
+                                let mut _39: &alloc::raw_vec::RawVecInner;
+                                scope 41 (inlined std::mem::size_of::<impl Sized>) {
+                                }
+                                scope 42 (inlined alloc::raw_vec::RawVecInner::capacity) {
+                                    debug self => _39;
+                                    debug elem_size => _19;
+                                    let mut _21: core::num::niche_types::UsizeNoHighBit;
+                                    scope 43 (inlined core::num::niche_types::UsizeNoHighBit::as_inner) {
+                                        debug self => _21;
+                                    }
+                                }
+                            }
+                        }
+                        scope 25 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
+                            debug self => _34;
+                        }
+                        scope 26 (inlined Vec::<impl Sized>::len) {
+                            debug self => _33;
+                            let mut _13: bool;
+                            scope 27 {
+                            }
+                        }
+                        scope 28 (inlined std::ptr::mut_ptr::<impl *mut impl Sized>::wrapping_byte_add) {
+                            debug self => _7;
+                            debug count => _12;
+                            let mut _14: *mut u8;
+                            let mut _18: *mut u8;
+                            scope 29 (inlined std::ptr::mut_ptr::<impl *mut impl Sized>::cast::<u8>) {
+                                debug self => _7;
+                            }
+                            scope 30 (inlined std::ptr::mut_ptr::<impl *mut u8>::wrapping_add) {
+                                debug self => _14;
+                                debug count => _12;
+                                let mut _15: isize;
+                                scope 31 (inlined std::ptr::mut_ptr::<impl *mut u8>::wrapping_offset) {
+                                    debug self => _14;
+                                    debug count => _15;
+                                    let mut _16: *const u8;
+                                    let mut _17: *const u8;
+                                }
+                            }
+                            scope 32 (inlined std::ptr::mut_ptr::<impl *mut u8>::with_metadata_of::<impl Sized>) {
+                                debug self => _18;
+                                debug meta => _5;
+                                scope 33 (inlined std::ptr::metadata::<impl Sized>) {
+                                    debug ptr => _5;
+                                }
+                                scope 34 (inlined std::ptr::from_raw_parts_mut::<impl Sized, ()>) {
+                                }
+                            }
+                        }
+                        scope 35 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
+                            debug self => _36;
+                        }
+                        scope 36 (inlined Vec::<impl Sized>::len) {
+                            debug self => _35;
+                            let mut _9: bool;
+                            scope 37 {
+                            }
+                        }
+                        scope 38 (inlined #[track_caller] std::ptr::mut_ptr::<impl *mut impl Sized>::add) {
+                            debug self => _7;
+                            debug count => _8;
+                        }
+                    }
+                    scope 24 (inlined NonNull::<impl Sized>::as_ptr) {
+                        debug self => _6;
+                    }
+                }
+                scope 17 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
+                    debug self => _32;
+                }
+                scope 18 (inlined alloc::raw_vec::RawVec::<impl Sized>::non_null) {
+                    debug self => _31;
+                    scope 19 (inlined alloc::raw_vec::RawVecInner::non_null::<impl Sized>) {
+                        let mut _4: std::ptr::NonNull<u8>;
+                        scope 20 (inlined Unique::<u8>::cast::<impl Sized>) {
+                            scope 21 (inlined NonNull::<u8>::cast::<impl Sized>) {
+                                let mut _5: *const impl Sized;
+                                scope 22 (inlined NonNull::<u8>::as_ptr) {
+                                }
+                            }
+                        }
+                        scope 23 (inlined Unique::<impl Sized>::as_non_null_ptr) {
+                        }
+                    }
+                }
+            }
+            scope 11 (inlined <ManuallyDrop<Vec<impl Sized>> as Deref>::deref) {
+                debug self => _30;
+            }
+            scope 12 (inlined Vec::<impl Sized>::allocator) {
+                debug self => _29;
+                scope 13 (inlined alloc::raw_vec::RawVec::<impl Sized>::allocator) {
+                    scope 14 (inlined alloc::raw_vec::RawVecInner::allocator) {
+                    }
+                }
+            }
+            scope 15 (inlined #[track_caller] std::ptr::read::<std::alloc::Global>) {
+                debug src => _3;
+            }
+            scope 16 (inlined ManuallyDrop::<std::alloc::Global>::new) {
+                debug value => const std::alloc::Global;
+            }
+        }
+        scope 10 (inlined ManuallyDrop::<Vec<impl Sized>>::new) {
+            debug value => _1;
         }
     }
 
     bb0: {
+        StorageLive(_22);
+        StorageLive(_6);
+        StorageLive(_7);
+        StorageLive(_11);
+        StorageLive(_20);
+        StorageLive(_5);
+        StorageLive(_4);
+        StorageLive(_17);
         StorageLive(_2);
-        _2 = <Vec<impl Sized> as IntoIterator>::into_iter(move _1) -> [return: bb1, unwind continue];
+        _2 = ManuallyDrop::<Vec<impl Sized>> { value: copy _1 };
+        StorageLive(_3);
+        // DBG: _30 = &_2;
+        // DBG: _29 = &(_2.0: std::vec::Vec<impl Sized>);
+        _3 = &raw const ((((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner).2: std::alloc::Global);
+        StorageDead(_3);
+        // DBG: _32 = &_2;
+        // DBG: _31 = &((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>);
+        _4 = copy (((((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique<u8>).0: std::ptr::NonNull<u8>);
+        _5 = copy _4 as *const impl Sized (Transmute);
+        _6 = NonNull::<impl Sized> { pointer: copy _5 };
+        _7 = copy _4 as *mut impl Sized (Transmute);
+        switchInt(const <impl Sized as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2];
     }
 
     bb1: {
-        StorageLive(_3);
-        _3 = move _2;
-        goto -> bb2;
+        StorageLive(_10);
+        StorageLive(_8);
+        // DBG: _36 = &_2;
+        // DBG: _35 = &(_2.0: std::vec::Vec<impl Sized>);
+        _8 = copy ((_2.0: std::vec::Vec<impl Sized>).1: usize);
+        StorageLive(_9);
+        _9 = Le(copy _8, const <impl Sized as std::mem::SizedTypeProperties>::MAX_SLICE_LEN);
+        assume(move _9);
+        StorageDead(_9);
+        _10 = Offset(copy _7, copy _8);
+        _11 = copy _10 as *const impl Sized (PtrToPtr);
+        StorageDead(_8);
+        StorageDead(_10);
+        goto -> bb4;
     }
 
     bb2: {
-        StorageLive(_5);
-        _4 = &mut _3;
-        _5 = <std::vec::IntoIter<impl Sized> as Iterator>::next(move _4) -> [return: bb3, unwind: bb9];
+        StorageLive(_12);
+        // DBG: _34 = &_2;
+        // DBG: _33 = &(_2.0: std::vec::Vec<impl Sized>);
+        _12 = copy ((_2.0: std::vec::Vec<impl Sized>).1: usize);
+        StorageLive(_13);
+        _13 = Le(copy _12, const <impl Sized as std::mem::SizedTypeProperties>::MAX_SLICE_LEN);
+        assume(move _13);
+        StorageDead(_13);
+        StorageLive(_18);
+        StorageLive(_14);
+        _14 = copy _4 as *mut u8 (Transmute);
+        StorageLive(_15);
+        _15 = copy _12 as isize (IntToInt);
+        StorageLive(_16);
+        _16 = copy _4 as *const u8 (Transmute);
+        _17 = arith_offset::<u8>(move _16, move _15) -> [return: bb3, unwind unreachable];
     }
 
     bb3: {
-        _6 = discriminant(_5);
-        switchInt(move _6) -> [0: bb4, 1: bb6, otherwise: bb8];
+        StorageDead(_16);
+        _18 = copy _17 as *mut u8 (PtrToPtr);
+        StorageDead(_15);
+        StorageDead(_14);
+        StorageDead(_18);
+        StorageDead(_12);
+        _11 = copy _17 as *const impl Sized (PtrToPtr);
+        goto -> bb4;
     }
 
     bb4: {
-        StorageDead(_5);
-        drop(_3) -> [return: bb5, unwind continue];
+        // DBG: _38 = &_2;
+        // DBG: _37 = &((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>);
+        // DBG: _39 = &(((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner);
+        StorageLive(_19);
+        _19 = SizeOf(impl Sized);
+        switchInt(move _19) -> [0: bb5, otherwise: bb6];
     }
 
     bb5: {
-        StorageDead(_3);
-        StorageDead(_2);
-        return;
+        _20 = const usize::MAX;
+        goto -> bb7;
     }
 
     bb6: {
-        _7 = move ((_5 as Some).0: impl Sized);
-        _8 = opaque::<impl Sized>(move _7) -> [return: bb7, unwind: bb9];
+        StorageLive(_21);
+        _21 = copy ((((_2.0: std::vec::Vec<impl Sized>).0: alloc::raw_vec::RawVec<impl Sized>).0: alloc::raw_vec::RawVecInner).1: core::num::niche_types::UsizeNoHighBit);
+        _20 = copy _21 as usize (Transmute);
+        StorageDead(_21);
+        goto -> bb7;
     }
 
     bb7: {
+        StorageDead(_19);
+        _22 = std::vec::IntoIter::<impl Sized> { buf: copy _6, phantom: const ZeroSized: PhantomData<impl Sized>, cap: move _20, alloc: const ManuallyDrop::<std::alloc::Global> {{ value: std::alloc::Global }}, ptr: copy _6, end: copy _11 };
+        StorageDead(_2);
+        StorageDead(_17);
+        StorageDead(_4);
         StorageDead(_5);
-        goto -> bb2;
+        StorageDead(_20);
+        StorageDead(_11);
+        StorageDead(_7);
+        StorageDead(_6);
+        StorageLive(_23);
+        _23 = move _22;
+        goto -> bb8;
     }
 
     bb8: {
+        StorageLive(_25);
+        _24 = &mut _23;
+        _25 = <std::vec::IntoIter<impl Sized> as Iterator>::next(move _24) -> [return: bb9, unwind: bb15];
+    }
+
+    bb9: {
+        _26 = discriminant(_25);
+        switchInt(move _26) -> [0: bb10, 1: bb12, otherwise: bb14];
+    }
+
+    bb10: {
+        StorageDead(_25);
+        drop(_23) -> [return: bb11, unwind continue];
+    }
+
+    bb11: {
+        StorageDead(_23);
+        StorageDead(_22);
+        return;
+    }
+
+    bb12: {
+        _27 = move ((_25 as Some).0: impl Sized);
+        _28 = opaque::<impl Sized>(move _27) -> [return: bb13, unwind: bb15];
+    }
+
+    bb13: {
+        StorageDead(_25);
+        goto -> bb8;
+    }
+
+    bb14: {
         unreachable;
     }
 
-    bb9 (cleanup): {
-        drop(_3) -> [return: bb10, unwind terminate(cleanup)];
+    bb15 (cleanup): {
+        drop(_23) -> [return: bb16, unwind terminate(cleanup)];
     }
 
-    bb10 (cleanup): {
+    bb16 (cleanup): {
         resume;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir
index dfe618612ab..03a52b82b49 100644
--- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-abort.mir
@@ -5,23 +5,21 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
     debug end => _2;
     debug f => _3;
     let mut _0: ();
-    let mut _4: u32;
-    let mut _9: std::option::Option<u32>;
-    let mut _11: &impl Fn(u32);
-    let mut _12: (u32,);
-    let _13: ();
+    let mut _7: std::option::Option<u32>;
+    let mut _9: &impl Fn(u32);
+    let mut _10: (u32,);
+    let _11: ();
     scope 1 {
-        debug ((iter: std::ops::Range<u32>).0: u32) => _4;
+        debug ((iter: std::ops::Range<u32>).0: u32) => _1;
         debug ((iter: std::ops::Range<u32>).1: u32) => _2;
-        let _10: u32;
+        let _8: u32;
         scope 2 {
-            debug x => _10;
+            debug x => _8;
         }
         scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) {
             scope 5 (inlined <std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next) {
-                let mut _6: bool;
-                let _7: u32;
-                let mut _8: u32;
+                let mut _5: bool;
+                let _6: u32;
                 scope 6 {
                     scope 8 (inlined <u32 as Step>::forward_unchecked) {
                         scope 9 (inlined #[track_caller] core::num::<impl u32>::unchecked_add) {
@@ -33,7 +31,7 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
                     }
                 }
                 scope 7 (inlined std::cmp::impls::<impl PartialOrd for u32>::lt) {
-                    let mut _5: u32;
+                    let mut _4: u32;
                 }
             }
         }
@@ -42,25 +40,22 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
     }
 
     bb0: {
-        StorageLive(_4);
-        _4 = copy _1;
         goto -> bb1;
     }
 
     bb1: {
-        StorageLive(_9);
-        StorageLive(_6);
+        StorageLive(_7);
         StorageLive(_5);
-        _5 = copy _4;
-        _6 = Lt(move _5, copy _2);
-        StorageDead(_5);
-        switchInt(move _6) -> [0: bb2, otherwise: bb4];
+        StorageLive(_4);
+        _4 = copy _1;
+        _5 = Lt(move _4, copy _2);
+        StorageDead(_4);
+        switchInt(move _5) -> [0: bb2, otherwise: bb4];
     }
 
     bb2: {
-        StorageDead(_6);
-        StorageDead(_9);
-        StorageDead(_4);
+        StorageDead(_5);
+        StorageDead(_7);
         drop(_3) -> [return: bb3, unwind unreachable];
     }
 
@@ -69,25 +64,22 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
     }
 
     bb4: {
-        _7 = copy _4;
-        StorageLive(_8);
-        _8 = AddUnchecked(copy _7, const 1_u32);
-        _4 = move _8;
-        StorageDead(_8);
-        _9 = Option::<u32>::Some(copy _7);
-        StorageDead(_6);
-        _10 = copy ((_9 as Some).0: u32);
-        StorageLive(_11);
-        _11 = &_3;
-        StorageLive(_12);
-        _12 = (copy _10,);
-        _13 = <impl Fn(u32) as Fn<(u32,)>>::call(move _11, move _12) -> [return: bb5, unwind unreachable];
+        _6 = copy _1;
+        _1 = AddUnchecked(copy _6, const 1_u32);
+        _7 = Option::<u32>::Some(copy _6);
+        StorageDead(_5);
+        _8 = copy ((_7 as Some).0: u32);
+        StorageLive(_9);
+        _9 = &_3;
+        StorageLive(_10);
+        _10 = (copy _8,);
+        _11 = <impl Fn(u32) as Fn<(u32,)>>::call(move _9, move _10) -> [return: bb5, unwind unreachable];
     }
 
     bb5: {
-        StorageDead(_12);
-        StorageDead(_11);
+        StorageDead(_10);
         StorageDead(_9);
+        StorageDead(_7);
         goto -> bb1;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir
index e0fcfcaffc5..3b09f33e733 100644
--- a/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/range_iter.forward_loop.PreCodegen.after.panic-unwind.mir
@@ -5,23 +5,21 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
     debug end => _2;
     debug f => _3;
     let mut _0: ();
-    let mut _4: u32;
-    let mut _9: std::option::Option<u32>;
-    let mut _11: &impl Fn(u32);
-    let mut _12: (u32,);
-    let _13: ();
+    let mut _7: std::option::Option<u32>;
+    let mut _9: &impl Fn(u32);
+    let mut _10: (u32,);
+    let _11: ();
     scope 1 {
-        debug ((iter: std::ops::Range<u32>).0: u32) => _4;
+        debug ((iter: std::ops::Range<u32>).0: u32) => _1;
         debug ((iter: std::ops::Range<u32>).1: u32) => _2;
-        let _10: u32;
+        let _8: u32;
         scope 2 {
-            debug x => _10;
+            debug x => _8;
         }
         scope 4 (inlined iter::range::<impl Iterator for std::ops::Range<u32>>::next) {
             scope 5 (inlined <std::ops::Range<u32> as iter::range::RangeIteratorImpl>::spec_next) {
-                let mut _6: bool;
-                let _7: u32;
-                let mut _8: u32;
+                let mut _5: bool;
+                let _6: u32;
                 scope 6 {
                     scope 8 (inlined <u32 as Step>::forward_unchecked) {
                         scope 9 (inlined #[track_caller] core::num::<impl u32>::unchecked_add) {
@@ -33,7 +31,7 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
                     }
                 }
                 scope 7 (inlined std::cmp::impls::<impl PartialOrd for u32>::lt) {
-                    let mut _5: u32;
+                    let mut _4: u32;
                 }
             }
         }
@@ -42,25 +40,22 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
     }
 
     bb0: {
-        StorageLive(_4);
-        _4 = copy _1;
         goto -> bb1;
     }
 
     bb1: {
-        StorageLive(_9);
-        StorageLive(_6);
+        StorageLive(_7);
         StorageLive(_5);
-        _5 = copy _4;
-        _6 = Lt(move _5, copy _2);
-        StorageDead(_5);
-        switchInt(move _6) -> [0: bb2, otherwise: bb4];
+        StorageLive(_4);
+        _4 = copy _1;
+        _5 = Lt(move _4, copy _2);
+        StorageDead(_4);
+        switchInt(move _5) -> [0: bb2, otherwise: bb4];
     }
 
     bb2: {
-        StorageDead(_6);
-        StorageDead(_9);
-        StorageDead(_4);
+        StorageDead(_5);
+        StorageDead(_7);
         drop(_3) -> [return: bb3, unwind continue];
     }
 
@@ -69,25 +64,22 @@ fn forward_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
     }
 
     bb4: {
-        _7 = copy _4;
-        StorageLive(_8);
-        _8 = AddUnchecked(copy _7, const 1_u32);
-        _4 = move _8;
-        StorageDead(_8);
-        _9 = Option::<u32>::Some(copy _7);
-        StorageDead(_6);
-        _10 = copy ((_9 as Some).0: u32);
-        StorageLive(_11);
-        _11 = &_3;
-        StorageLive(_12);
-        _12 = (copy _10,);
-        _13 = <impl Fn(u32) as Fn<(u32,)>>::call(move _11, move _12) -> [return: bb5, unwind: bb6];
+        _6 = copy _1;
+        _1 = AddUnchecked(copy _6, const 1_u32);
+        _7 = Option::<u32>::Some(copy _6);
+        StorageDead(_5);
+        _8 = copy ((_7 as Some).0: u32);
+        StorageLive(_9);
+        _9 = &_3;
+        StorageLive(_10);
+        _10 = (copy _8,);
+        _11 = <impl Fn(u32) as Fn<(u32,)>>::call(move _9, move _10) -> [return: bb5, unwind: bb6];
     }
 
     bb5: {
-        StorageDead(_12);
-        StorageDead(_11);
+        StorageDead(_10);
         StorageDead(_9);
+        StorageDead(_7);
         goto -> bb1;
     }
 
diff --git a/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir
index cbdd194afd3..2cab8818296 100644
--- a/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir
@@ -3,183 +3,134 @@
 fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2: &&(usize, usize, usize, usize)) -> bool {
     let mut _0: bool;
     let mut _3: &(usize, usize, usize, usize);
-    let _4: &usize;
-    let _5: &usize;
-    let _6: &usize;
-    let _7: &usize;
-    let mut _8: &&usize;
-    let _9: &usize;
-    let mut _10: &&usize;
-    let mut _13: bool;
-    let mut _14: &&usize;
+    let mut _6: bool;
+    let mut _9: bool;
+    let mut _10: bool;
+    let _13: &usize;
+    let _14: &usize;
     let _15: &usize;
-    let mut _16: &&usize;
-    let mut _19: bool;
+    let _16: &usize;
+    let mut _17: &&usize;
+    let mut _18: &&usize;
+    let mut _19: &&usize;
     let mut _20: &&usize;
-    let _21: &usize;
+    let mut _21: &&usize;
     let mut _22: &&usize;
-    let mut _23: bool;
+    let mut _23: &&usize;
     let mut _24: &&usize;
-    let _25: &usize;
-    let mut _26: &&usize;
     scope 1 {
-        debug a => _4;
-        debug b => _5;
-        debug c => _6;
-        debug d => _7;
+        debug a => _13;
+        debug b => _14;
+        debug c => _15;
+        debug d => _16;
         scope 2 (inlined std::cmp::impls::<impl PartialOrd for &usize>::le) {
-            debug self => _8;
-            debug other => _10;
+            debug self => _17;
+            debug other => _18;
             scope 3 (inlined std::cmp::impls::<impl PartialOrd for usize>::le) {
-                debug self => _4;
-                debug other => _6;
-                let mut _11: usize;
-                let mut _12: usize;
+                debug self => _13;
+                debug other => _15;
+                let mut _4: usize;
+                let mut _5: usize;
             }
         }
         scope 4 (inlined std::cmp::impls::<impl PartialOrd for &usize>::le) {
-            debug self => _14;
-            debug other => _16;
+            debug self => _19;
+            debug other => _20;
             scope 5 (inlined std::cmp::impls::<impl PartialOrd for usize>::le) {
-                debug self => _7;
-                debug other => _5;
-                let mut _17: usize;
-                let mut _18: usize;
+                debug self => _16;
+                debug other => _14;
+                let mut _7: usize;
+                let mut _8: usize;
             }
         }
         scope 6 (inlined std::cmp::impls::<impl PartialOrd for &usize>::le) {
-            debug self => _20;
+            debug self => _21;
             debug other => _22;
             scope 7 (inlined std::cmp::impls::<impl PartialOrd for usize>::le) {
-                debug self => _6;
-                debug other => _4;
+                debug self => _15;
+                debug other => _13;
             }
         }
         scope 8 (inlined std::cmp::impls::<impl PartialOrd for &usize>::le) {
-            debug self => _24;
-            debug other => _26;
+            debug self => _23;
+            debug other => _24;
             scope 9 (inlined std::cmp::impls::<impl PartialOrd for usize>::le) {
-                debug self => _5;
-                debug other => _7;
-                let mut _27: usize;
-                let mut _28: usize;
+                debug self => _14;
+                debug other => _16;
+                let mut _11: usize;
+                let mut _12: usize;
             }
         }
     }
 
     bb0: {
         _3 = copy (*_2);
-        _4 = &((*_3).0: usize);
-        _5 = &((*_3).1: usize);
-        _6 = &((*_3).2: usize);
-        _7 = &((*_3).3: usize);
-        StorageLive(_13);
-        StorageLive(_8);
-        _8 = &_4;
-        StorageLive(_10);
-        StorageLive(_9);
-        _9 = copy _6;
-        _10 = &_9;
-        _11 = copy ((*_3).0: usize);
-        _12 = copy ((*_3).2: usize);
-        _13 = Le(copy _11, copy _12);
-        switchInt(move _13) -> [0: bb1, otherwise: bb2];
+        // DBG: _13 = &((*_3).0: usize);
+        // DBG: _14 = &((*_3).1: usize);
+        // DBG: _15 = &((*_3).2: usize);
+        // DBG: _16 = &((*_3).3: usize);
+        StorageLive(_6);
+        // DBG: _17 = &_13;
+        // DBG: _18 = &?;
+        _4 = copy ((*_3).0: usize);
+        _5 = copy ((*_3).2: usize);
+        _6 = Le(copy _4, copy _5);
+        switchInt(move _6) -> [0: bb2, otherwise: bb1];
     }
 
     bb1: {
-        StorageDead(_9);
-        StorageDead(_10);
+        StorageLive(_9);
+        // DBG: _19 = &_16;
+        // DBG: _20 = &?;
+        StorageLive(_7);
+        _7 = copy ((*_3).3: usize);
+        StorageLive(_8);
+        _8 = copy ((*_3).1: usize);
+        _9 = Le(move _7, move _8);
         StorageDead(_8);
-        goto -> bb4;
+        StorageDead(_7);
+        switchInt(move _9) -> [0: bb2, otherwise: bb6];
     }
 
     bb2: {
-        StorageDead(_9);
-        StorageDead(_10);
-        StorageDead(_8);
-        StorageLive(_19);
-        StorageLive(_14);
-        _14 = &_7;
-        StorageLive(_16);
-        StorageLive(_15);
-        _15 = copy _5;
-        _16 = &_15;
-        StorageLive(_17);
-        _17 = copy ((*_3).3: usize);
-        StorageLive(_18);
-        _18 = copy ((*_3).1: usize);
-        _19 = Le(move _17, move _18);
-        StorageDead(_18);
-        StorageDead(_17);
-        switchInt(move _19) -> [0: bb3, otherwise: bb8];
+        StorageLive(_10);
+        // DBG: _21 = &_15;
+        // DBG: _22 = &?;
+        _10 = Le(copy _5, copy _4);
+        switchInt(move _10) -> [0: bb3, otherwise: bb4];
     }
 
     bb3: {
-        StorageDead(_15);
-        StorageDead(_16);
-        StorageDead(_14);
-        goto -> bb4;
+        _0 = const false;
+        goto -> bb5;
     }
 
     bb4: {
-        StorageLive(_23);
-        StorageLive(_20);
-        _20 = &_6;
-        StorageLive(_22);
-        StorageLive(_21);
-        _21 = copy _4;
-        _22 = &_21;
-        _23 = Le(copy _12, copy _11);
-        switchInt(move _23) -> [0: bb5, otherwise: bb6];
+        // DBG: _23 = &_14;
+        // DBG: _24 = &?;
+        StorageLive(_11);
+        _11 = copy ((*_3).1: usize);
+        StorageLive(_12);
+        _12 = copy ((*_3).3: usize);
+        _0 = Le(move _11, move _12);
+        StorageDead(_12);
+        StorageDead(_11);
+        goto -> bb5;
     }
 
     bb5: {
-        StorageDead(_21);
-        StorageDead(_22);
-        StorageDead(_20);
-        _0 = const false;
+        StorageDead(_10);
         goto -> bb7;
     }
 
     bb6: {
-        StorageDead(_21);
-        StorageDead(_22);
-        StorageDead(_20);
-        StorageLive(_24);
-        _24 = &_5;
-        StorageLive(_26);
-        StorageLive(_25);
-        _25 = copy _7;
-        _26 = &_25;
-        StorageLive(_27);
-        _27 = copy ((*_3).1: usize);
-        StorageLive(_28);
-        _28 = copy ((*_3).3: usize);
-        _0 = Le(move _27, move _28);
-        StorageDead(_28);
-        StorageDead(_27);
-        StorageDead(_25);
-        StorageDead(_26);
-        StorageDead(_24);
+        _0 = const true;
         goto -> bb7;
     }
 
     bb7: {
-        StorageDead(_23);
-        goto -> bb9;
-    }
-
-    bb8: {
-        StorageDead(_15);
-        StorageDead(_16);
-        StorageDead(_14);
-        _0 = const true;
-        goto -> bb9;
-    }
-
-    bb9: {
-        StorageDead(_19);
-        StorageDead(_13);
+        StorageDead(_9);
+        StorageDead(_6);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir
index 72b39a7f6a8..104987b0fdd 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir
@@ -4,30 +4,28 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     debug slice => _1;
     debug f => _2;
     let mut _0: ();
-    let mut _11: std::ptr::NonNull<T>;
-    let mut _12: *const T;
-    let mut _13: usize;
-    let mut _32: std::option::Option<(usize, &T)>;
-    let mut _35: &impl Fn(usize, &T);
-    let mut _36: (usize, &T);
-    let _37: ();
+    let mut _10: usize;
+    let mut _28: std::option::Option<(usize, &T)>;
+    let mut _31: &impl Fn(usize, &T);
+    let mut _32: (usize, &T);
+    let _33: ();
     scope 1 {
-        debug (((iter: Enumerate<std::slice::Iter<'_, T>>).0: std::slice::Iter<'_, T>).0: std::ptr::NonNull<T>) => _11;
-        debug (((iter: Enumerate<std::slice::Iter<'_, T>>).0: std::slice::Iter<'_, T>).1: *const T) => _12;
+        debug (((iter: Enumerate<std::slice::Iter<'_, T>>).0: std::slice::Iter<'_, T>).0: std::ptr::NonNull<T>) => _6;
+        debug (((iter: Enumerate<std::slice::Iter<'_, T>>).0: std::slice::Iter<'_, T>).1: *const T) => _9;
         debug (((iter: Enumerate<std::slice::Iter<'_, T>>).0: std::slice::Iter<'_, T>).2: std::marker::PhantomData<&T>) => const ZeroSized: PhantomData<&T>;
-        debug ((iter: Enumerate<std::slice::Iter<'_, T>>).1: usize) => _13;
-        let _33: usize;
-        let _34: &T;
+        debug ((iter: Enumerate<std::slice::Iter<'_, T>>).1: usize) => _10;
+        let _29: usize;
+        let _30: &T;
         scope 2 {
-            debug i => _33;
-            debug x => _34;
+            debug i => _29;
+            debug x => _30;
         }
         scope 18 (inlined <Enumerate<std::slice::Iter<'_, T>> as Iterator>::next) {
-            let mut _27: std::option::Option<&T>;
-            let mut _30: (usize, bool);
-            let mut _31: (usize, &T);
+            let mut _23: std::option::Option<&T>;
+            let mut _26: (usize, bool);
+            let mut _27: (usize, &T);
             scope 19 {
-                let _29: usize;
+                let _25: usize;
                 scope 24 {
                 }
             }
@@ -42,21 +40,21 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
                 }
             }
             scope 25 (inlined <Option<&T> as Try>::branch) {
-                let _28: &T;
+                let _24: &T;
                 scope 26 {
                 }
             }
             scope 28 (inlined <std::slice::Iter<'_, T> as Iterator>::next) {
-                let _14: std::ptr::NonNull<T>;
-                let _16: std::ptr::NonNull<T>;
-                let mut _19: bool;
-                let mut _22: std::ptr::NonNull<T>;
-                let mut _24: usize;
-                let _26: &T;
+                let mut _6: std::ptr::NonNull<T>;
+                let _11: std::ptr::NonNull<T>;
+                let _13: std::ptr::NonNull<T>;
+                let mut _16: bool;
+                let mut _20: usize;
+                let _22: &T;
                 scope 29 {
-                    let _15: *const T;
+                    let _12: *const T;
                     scope 30 {
-                        let _23: usize;
+                        let _19: usize;
                         scope 31 {
                             scope 34 (inlined #[track_caller] core::num::<impl usize>::unchecked_sub) {
                                 scope 35 (inlined core::ub_checks::check_language_ub) {
@@ -72,21 +70,21 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
                             }
                         }
                         scope 38 (inlined <NonNull<T> as PartialEq>::eq) {
-                            let mut _17: *mut T;
-                            let mut _18: *mut T;
+                            let mut _14: *mut T;
+                            let mut _15: *mut T;
                             scope 39 (inlined NonNull::<T>::as_ptr) {
                             }
                             scope 40 (inlined NonNull::<T>::as_ptr) {
                             }
                         }
                         scope 41 (inlined NonNull::<T>::add) {
-                            let mut _20: *const T;
-                            let mut _21: *const T;
+                            let mut _17: *const T;
+                            let mut _18: *const T;
                             scope 42 (inlined NonNull::<T>::as_ptr) {
                             }
                         }
                         scope 43 (inlined NonNull::<T>::as_ref::<'_>) {
-                            let _25: *const T;
+                            let _21: *const T;
                             scope 44 (inlined NonNull::<T>::as_ptr) {
                             }
                             scope 45 (inlined std::ptr::mut_ptr::<impl *mut T>::cast_const) {
@@ -102,9 +100,7 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
             let _3: usize;
             let mut _7: *mut T;
             let mut _8: *mut T;
-            let mut _10: *const T;
             scope 5 {
-                let _6: std::ptr::NonNull<T>;
                 scope 6 {
                     let _9: *const T;
                     scope 7 {
@@ -145,7 +141,6 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
         _5 = copy _4 as *const T (PtrToPtr);
         _6 = NonNull::<T> { pointer: copy _5 };
         StorageDead(_5);
-        StorageLive(_9);
         switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2];
     }
 
@@ -166,97 +161,86 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     }
 
     bb3: {
-        _10 = copy _9;
-        StorageDead(_9);
         StorageDead(_4);
         StorageDead(_3);
-        StorageLive(_11);
-        StorageLive(_12);
-        StorageLive(_13);
-        _11 = copy _6;
-        _12 = copy _10;
-        _13 = const 0_usize;
+        StorageLive(_10);
+        _10 = const 0_usize;
         goto -> bb4;
     }
 
     bb4: {
-        StorageLive(_32);
-        StorageLive(_29);
-        StorageLive(_30);
-        StorageLive(_27);
-        StorageLive(_14);
-        StorageLive(_15);
-        StorageLive(_23);
-        StorageLive(_24);
-        StorageLive(_16);
+        StorageLive(_28);
+        StorageLive(_25);
         StorageLive(_26);
-        _14 = copy _11;
-        _15 = copy _12;
+        StorageLive(_23);
+        StorageLive(_11);
+        StorageLive(_12);
+        StorageLive(_19);
+        StorageLive(_20);
+        StorageLive(_13);
+        StorageLive(_22);
+        _11 = copy _6;
+        _12 = copy _9;
         switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb5, otherwise: bb8];
     }
 
     bb5: {
-        StorageLive(_19);
-        _16 = copy _15 as std::ptr::NonNull<T> (Transmute);
-        StorageLive(_17);
-        _17 = copy _14 as *mut T (Transmute);
-        StorageLive(_18);
-        _18 = copy _16 as *mut T (Transmute);
-        _19 = Eq(copy _17, copy _18);
-        StorageDead(_18);
-        StorageDead(_17);
-        switchInt(move _19) -> [0: bb6, otherwise: bb7];
+        StorageLive(_16);
+        _13 = copy _12 as std::ptr::NonNull<T> (Transmute);
+        StorageLive(_14);
+        _14 = copy _11 as *mut T (Transmute);
+        StorageLive(_15);
+        _15 = copy _13 as *mut T (Transmute);
+        _16 = Eq(copy _14, copy _15);
+        StorageDead(_15);
+        StorageDead(_14);
+        switchInt(move _16) -> [0: bb6, otherwise: bb7];
     }
 
     bb6: {
-        StorageDead(_19);
-        StorageLive(_22);
-        StorageLive(_21);
-        StorageLive(_20);
-        _20 = copy _14 as *const T (Transmute);
-        _21 = Offset(copy _20, const 1_usize);
-        StorageDead(_20);
-        _22 = NonNull::<T> { pointer: copy _21 };
-        StorageDead(_21);
-        _11 = move _22;
-        StorageDead(_22);
+        StorageDead(_16);
+        StorageLive(_18);
+        StorageLive(_17);
+        _17 = copy _11 as *const T (Transmute);
+        _18 = Offset(copy _17, const 1_usize);
+        StorageDead(_17);
+        _6 = NonNull::<T> { pointer: copy _18 };
+        StorageDead(_18);
         goto -> bb13;
     }
 
     bb7: {
-        StorageDead(_19);
-        StorageDead(_26);
         StorageDead(_16);
-        StorageDead(_24);
-        StorageDead(_23);
-        StorageDead(_15);
-        StorageDead(_14);
+        StorageDead(_22);
+        StorageDead(_13);
+        StorageDead(_20);
+        StorageDead(_19);
+        StorageDead(_12);
+        StorageDead(_11);
         goto -> bb10;
     }
 
     bb8: {
-        _23 = copy _15 as usize (Transmute);
-        switchInt(copy _23) -> [0: bb9, otherwise: bb12];
+        _19 = copy _12 as usize (Transmute);
+        switchInt(copy _19) -> [0: bb9, otherwise: bb12];
     }
 
     bb9: {
-        StorageDead(_26);
-        StorageDead(_16);
-        StorageDead(_24);
-        StorageDead(_23);
-        StorageDead(_15);
-        StorageDead(_14);
+        StorageDead(_22);
+        StorageDead(_13);
+        StorageDead(_20);
+        StorageDead(_19);
+        StorageDead(_12);
+        StorageDead(_11);
         goto -> bb10;
     }
 
     bb10: {
-        StorageDead(_27);
-        StorageDead(_30);
-        StorageDead(_29);
-        StorageDead(_32);
-        StorageDead(_11);
-        StorageDead(_12);
-        StorageDead(_13);
+        StorageDead(_23);
+        StorageDead(_26);
+        StorageDead(_25);
+        StorageDead(_28);
+        StorageDead(_10);
         drop(_2) -> [return: bb11, unwind unreachable];
     }
 
@@ -265,51 +249,51 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     }
 
     bb12: {
-        _24 = SubUnchecked(copy _23, const 1_usize);
-        _12 = copy _24 as *const T (Transmute);
+        _20 = SubUnchecked(copy _19, const 1_usize);
+        _9 = copy _20 as *const T (Transmute);
         goto -> bb13;
     }
 
     bb13: {
-        StorageLive(_25);
-        _25 = copy _14 as *const T (Transmute);
-        _26 = &(*_25);
-        StorageDead(_25);
-        _27 = Option::<&T>::Some(copy _26);
-        StorageDead(_26);
-        StorageDead(_16);
-        StorageDead(_24);
+        StorageLive(_21);
+        _21 = copy _11 as *const T (Transmute);
+        _22 = &(*_21);
+        StorageDead(_21);
+        _23 = Option::<&T>::Some(copy _22);
+        StorageDead(_22);
+        StorageDead(_13);
+        StorageDead(_20);
+        StorageDead(_19);
+        StorageDead(_12);
+        StorageDead(_11);
+        _24 = copy ((_23 as Some).0: &T);
         StorageDead(_23);
-        StorageDead(_15);
-        StorageDead(_14);
-        _28 = copy ((_27 as Some).0: &T);
-        StorageDead(_27);
-        _29 = copy _13;
-        _30 = AddWithOverflow(copy _13, const 1_usize);
-        assert(!move (_30.1: bool), "attempt to compute `{} + {}`, which would overflow", copy _13, const 1_usize) -> [success: bb14, unwind unreachable];
+        _25 = copy _10;
+        _26 = AddWithOverflow(copy _10, const 1_usize);
+        assert(!move (_26.1: bool), "attempt to compute `{} + {}`, which would overflow", copy _10, const 1_usize) -> [success: bb14, unwind unreachable];
     }
 
     bb14: {
-        _13 = move (_30.0: usize);
+        _10 = move (_26.0: usize);
+        StorageLive(_27);
+        _27 = (copy _25, copy _24);
+        _28 = Option::<(usize, &T)>::Some(move _27);
+        StorageDead(_27);
+        StorageDead(_26);
+        StorageDead(_25);
+        _29 = copy (((_28 as Some).0: (usize, &T)).0: usize);
+        _30 = copy (((_28 as Some).0: (usize, &T)).1: &T);
         StorageLive(_31);
-        _31 = (copy _29, copy _28);
-        _32 = Option::<(usize, &T)>::Some(move _31);
-        StorageDead(_31);
-        StorageDead(_30);
-        StorageDead(_29);
-        _33 = copy (((_32 as Some).0: (usize, &T)).0: usize);
-        _34 = copy (((_32 as Some).0: (usize, &T)).1: &T);
-        StorageLive(_35);
-        _35 = &_2;
-        StorageLive(_36);
-        _36 = (copy _33, copy _34);
-        _37 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _35, move _36) -> [return: bb15, unwind unreachable];
+        _31 = &_2;
+        StorageLive(_32);
+        _32 = (copy _29, copy _30);
+        _33 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _31, move _32) -> [return: bb15, unwind unreachable];
     }
 
     bb15: {
-        StorageDead(_36);
-        StorageDead(_35);
         StorageDead(_32);
+        StorageDead(_31);
+        StorageDead(_28);
         goto -> bb4;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir
index 42aa152ec99..28b12cdf367 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir
@@ -4,22 +4,22 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     debug slice => _1;
     debug f => _2;
     let mut _0: ();
-    let mut _11: std::slice::Iter<'_, T>;
+    let mut _10: std::slice::Iter<'_, T>;
+    let mut _11: std::iter::Enumerate<std::slice::Iter<'_, T>>;
     let mut _12: std::iter::Enumerate<std::slice::Iter<'_, T>>;
-    let mut _13: std::iter::Enumerate<std::slice::Iter<'_, T>>;
-    let mut _14: &mut std::iter::Enumerate<std::slice::Iter<'_, T>>;
-    let mut _15: std::option::Option<(usize, &T)>;
-    let mut _16: isize;
-    let mut _19: &impl Fn(usize, &T);
-    let mut _20: (usize, &T);
-    let _21: ();
+    let mut _13: &mut std::iter::Enumerate<std::slice::Iter<'_, T>>;
+    let mut _14: std::option::Option<(usize, &T)>;
+    let mut _15: isize;
+    let mut _18: &impl Fn(usize, &T);
+    let mut _19: (usize, &T);
+    let _20: ();
     scope 1 {
-        debug iter => _13;
-        let _17: usize;
-        let _18: &T;
+        debug iter => _12;
+        let _16: usize;
+        let _17: &T;
         scope 2 {
-            debug i => _17;
-            debug x => _18;
+            debug i => _16;
+            debug x => _17;
         }
     }
     scope 3 (inlined core::slice::<impl [T]>::iter) {
@@ -27,7 +27,6 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
             let _3: usize;
             let mut _7: *mut T;
             let mut _8: *mut T;
-            let mut _10: *const T;
             scope 5 {
                 let _6: std::ptr::NonNull<T>;
                 scope 6 {
@@ -62,9 +61,10 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     }
 
     bb0: {
-        StorageLive(_11);
+        StorageLive(_10);
         StorageLive(_3);
         StorageLive(_6);
+        StorageLive(_9);
         StorageLive(_4);
         _3 = PtrMetadata(copy _1);
         _4 = &raw const (*_1);
@@ -72,7 +72,6 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
         _5 = copy _4 as *const T (PtrToPtr);
         _6 = NonNull::<T> { pointer: copy _5 };
         StorageDead(_5);
-        StorageLive(_9);
         switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2];
     }
 
@@ -93,33 +92,30 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     }
 
     bb3: {
-        StorageLive(_10);
-        _10 = copy _9;
-        _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: copy _10, _marker: const ZeroSized: PhantomData<&T> };
-        StorageDead(_10);
-        StorageDead(_9);
+        _10 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: copy _9, _marker: const ZeroSized: PhantomData<&T> };
         StorageDead(_4);
+        StorageDead(_9);
         StorageDead(_6);
         StorageDead(_3);
-        _12 = Enumerate::<std::slice::Iter<'_, T>> { iter: copy _11, count: const 0_usize };
-        StorageDead(_11);
-        StorageLive(_13);
-        _13 = copy _12;
+        _11 = Enumerate::<std::slice::Iter<'_, T>> { iter: copy _10, count: const 0_usize };
+        StorageDead(_10);
+        StorageLive(_12);
+        _12 = copy _11;
         goto -> bb4;
     }
 
     bb4: {
-        _14 = &mut _13;
-        _15 = <Enumerate<std::slice::Iter<'_, T>> as Iterator>::next(move _14) -> [return: bb5, unwind: bb11];
+        _13 = &mut _12;
+        _14 = <Enumerate<std::slice::Iter<'_, T>> as Iterator>::next(move _13) -> [return: bb5, unwind: bb11];
     }
 
     bb5: {
-        _16 = discriminant(_15);
-        switchInt(move _16) -> [0: bb6, 1: bb8, otherwise: bb10];
+        _15 = discriminant(_14);
+        switchInt(move _15) -> [0: bb6, 1: bb8, otherwise: bb10];
     }
 
     bb6: {
-        StorageDead(_13);
+        StorageDead(_12);
         drop(_2) -> [return: bb7, unwind continue];
     }
 
@@ -128,18 +124,18 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     }
 
     bb8: {
-        _17 = copy (((_15 as Some).0: (usize, &T)).0: usize);
-        _18 = copy (((_15 as Some).0: (usize, &T)).1: &T);
+        _16 = copy (((_14 as Some).0: (usize, &T)).0: usize);
+        _17 = copy (((_14 as Some).0: (usize, &T)).1: &T);
+        StorageLive(_18);
+        _18 = &_2;
         StorageLive(_19);
-        _19 = &_2;
-        StorageLive(_20);
-        _20 = copy ((_15 as Some).0: (usize, &T));
-        _21 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _19, move _20) -> [return: bb9, unwind: bb11];
+        _19 = copy ((_14 as Some).0: (usize, &T));
+        _20 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _18, move _19) -> [return: bb9, unwind: bb11];
     }
 
     bb9: {
-        StorageDead(_20);
         StorageDead(_19);
+        StorageDead(_18);
         goto -> bb4;
     }
 
diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir
index 0d65640ec9b..4d0e3548e7d 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir
@@ -4,31 +4,29 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
     debug slice => _1;
     debug f => _2;
     let mut _0: ();
-    let mut _11: std::ptr::NonNull<T>;
-    let mut _12: *const T;
-    let mut _26: std::option::Option<&T>;
-    let mut _28: &impl Fn(&T);
-    let mut _29: (&T,);
-    let _30: ();
+    let mut _22: std::option::Option<&T>;
+    let mut _24: &impl Fn(&T);
+    let mut _25: (&T,);
+    let _26: ();
     scope 1 {
-        debug ((iter: std::slice::Iter<'_, T>).0: std::ptr::NonNull<T>) => _11;
-        debug ((iter: std::slice::Iter<'_, T>).1: *const T) => _12;
+        debug ((iter: std::slice::Iter<'_, T>).0: std::ptr::NonNull<T>) => _6;
+        debug ((iter: std::slice::Iter<'_, T>).1: *const T) => _9;
         debug ((iter: std::slice::Iter<'_, T>).2: std::marker::PhantomData<&T>) => const ZeroSized: PhantomData<&T>;
-        let _27: &T;
+        let _23: &T;
         scope 2 {
-            debug x => _27;
+            debug x => _23;
         }
         scope 16 (inlined <std::slice::Iter<'_, T> as Iterator>::next) {
-            let _13: std::ptr::NonNull<T>;
-            let _15: std::ptr::NonNull<T>;
-            let mut _18: bool;
-            let mut _21: std::ptr::NonNull<T>;
-            let mut _23: usize;
-            let _25: &T;
+            let mut _6: std::ptr::NonNull<T>;
+            let _10: std::ptr::NonNull<T>;
+            let _12: std::ptr::NonNull<T>;
+            let mut _15: bool;
+            let mut _19: usize;
+            let _21: &T;
             scope 17 {
-                let _14: *const T;
+                let _11: *const T;
                 scope 18 {
-                    let _22: usize;
+                    let _18: usize;
                     scope 19 {
                         scope 22 (inlined #[track_caller] core::num::<impl usize>::unchecked_sub) {
                             scope 23 (inlined core::ub_checks::check_language_ub) {
@@ -44,21 +42,21 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
                         }
                     }
                     scope 26 (inlined <NonNull<T> as PartialEq>::eq) {
-                        let mut _16: *mut T;
-                        let mut _17: *mut T;
+                        let mut _13: *mut T;
+                        let mut _14: *mut T;
                         scope 27 (inlined NonNull::<T>::as_ptr) {
                         }
                         scope 28 (inlined NonNull::<T>::as_ptr) {
                         }
                     }
                     scope 29 (inlined NonNull::<T>::add) {
-                        let mut _19: *const T;
-                        let mut _20: *const T;
+                        let mut _16: *const T;
+                        let mut _17: *const T;
                         scope 30 (inlined NonNull::<T>::as_ptr) {
                         }
                     }
                     scope 31 (inlined NonNull::<T>::as_ref::<'_>) {
-                        let _24: *const T;
+                        let _20: *const T;
                         scope 32 (inlined NonNull::<T>::as_ptr) {
                         }
                         scope 33 (inlined std::ptr::mut_ptr::<impl *mut T>::cast_const) {
@@ -73,9 +71,7 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
             let _3: usize;
             let mut _7: *mut T;
             let mut _8: *mut T;
-            let mut _10: *const T;
             scope 5 {
-                let _6: std::ptr::NonNull<T>;
                 scope 6 {
                     let _9: *const T;
                     scope 7 {
@@ -112,7 +108,6 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
         _5 = copy _4 as *const T (PtrToPtr);
         _6 = NonNull::<T> { pointer: copy _5 };
         StorageDead(_5);
-        StorageLive(_9);
         switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2];
     }
 
@@ -133,88 +128,77 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
     }
 
     bb3: {
-        _10 = copy _9;
-        StorageDead(_9);
         StorageDead(_4);
         StorageDead(_3);
-        StorageLive(_11);
-        StorageLive(_12);
-        _11 = copy _6;
-        _12 = copy _10;
         goto -> bb4;
     }
 
     bb4: {
-        StorageLive(_26);
-        StorageLive(_13);
-        StorageLive(_14);
         StorageLive(_22);
-        StorageLive(_23);
-        StorageLive(_15);
-        StorageLive(_25);
-        _13 = copy _11;
-        _14 = copy _12;
+        StorageLive(_10);
+        StorageLive(_11);
+        StorageLive(_18);
+        StorageLive(_19);
+        StorageLive(_12);
+        StorageLive(_21);
+        _10 = copy _6;
+        _11 = copy _9;
         switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb5, otherwise: bb8];
     }
 
     bb5: {
-        StorageLive(_18);
-        _15 = copy _14 as std::ptr::NonNull<T> (Transmute);
-        StorageLive(_16);
-        _16 = copy _13 as *mut T (Transmute);
-        StorageLive(_17);
-        _17 = copy _15 as *mut T (Transmute);
-        _18 = Eq(copy _16, copy _17);
-        StorageDead(_17);
-        StorageDead(_16);
-        switchInt(move _18) -> [0: bb6, otherwise: bb7];
+        StorageLive(_15);
+        _12 = copy _11 as std::ptr::NonNull<T> (Transmute);
+        StorageLive(_13);
+        _13 = copy _10 as *mut T (Transmute);
+        StorageLive(_14);
+        _14 = copy _12 as *mut T (Transmute);
+        _15 = Eq(copy _13, copy _14);
+        StorageDead(_14);
+        StorageDead(_13);
+        switchInt(move _15) -> [0: bb6, otherwise: bb7];
     }
 
     bb6: {
-        StorageDead(_18);
-        StorageLive(_21);
-        StorageLive(_20);
-        StorageLive(_19);
-        _19 = copy _13 as *const T (Transmute);
-        _20 = Offset(copy _19, const 1_usize);
-        StorageDead(_19);
-        _21 = NonNull::<T> { pointer: copy _20 };
-        StorageDead(_20);
-        _11 = move _21;
-        StorageDead(_21);
+        StorageDead(_15);
+        StorageLive(_17);
+        StorageLive(_16);
+        _16 = copy _10 as *const T (Transmute);
+        _17 = Offset(copy _16, const 1_usize);
+        StorageDead(_16);
+        _6 = NonNull::<T> { pointer: copy _17 };
+        StorageDead(_17);
         goto -> bb13;
     }
 
     bb7: {
-        StorageDead(_18);
-        StorageDead(_25);
         StorageDead(_15);
-        StorageDead(_23);
-        StorageDead(_22);
-        StorageDead(_14);
-        StorageDead(_13);
+        StorageDead(_21);
+        StorageDead(_12);
+        StorageDead(_19);
+        StorageDead(_18);
+        StorageDead(_11);
+        StorageDead(_10);
         goto -> bb10;
     }
 
     bb8: {
-        _22 = copy _14 as usize (Transmute);
-        switchInt(copy _22) -> [0: bb9, otherwise: bb12];
+        _18 = copy _11 as usize (Transmute);
+        switchInt(copy _18) -> [0: bb9, otherwise: bb12];
     }
 
     bb9: {
-        StorageDead(_25);
-        StorageDead(_15);
-        StorageDead(_23);
-        StorageDead(_22);
-        StorageDead(_14);
-        StorageDead(_13);
+        StorageDead(_21);
+        StorageDead(_12);
+        StorageDead(_19);
+        StorageDead(_18);
+        StorageDead(_11);
+        StorageDead(_10);
         goto -> bb10;
     }
 
     bb10: {
-        StorageDead(_26);
-        StorageDead(_11);
-        StorageDead(_12);
+        StorageDead(_22);
         drop(_2) -> [return: bb11, unwind unreachable];
     }
 
@@ -223,35 +207,35 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
     }
 
     bb12: {
-        _23 = SubUnchecked(copy _22, const 1_usize);
-        _12 = copy _23 as *const T (Transmute);
+        _19 = SubUnchecked(copy _18, const 1_usize);
+        _9 = copy _19 as *const T (Transmute);
         goto -> bb13;
     }
 
     bb13: {
+        StorageLive(_20);
+        _20 = copy _10 as *const T (Transmute);
+        _21 = &(*_20);
+        StorageDead(_20);
+        _22 = Option::<&T>::Some(copy _21);
+        StorageDead(_21);
+        StorageDead(_12);
+        StorageDead(_19);
+        StorageDead(_18);
+        StorageDead(_11);
+        StorageDead(_10);
+        _23 = copy ((_22 as Some).0: &T);
         StorageLive(_24);
-        _24 = copy _13 as *const T (Transmute);
-        _25 = &(*_24);
-        StorageDead(_24);
-        _26 = Option::<&T>::Some(copy _25);
-        StorageDead(_25);
-        StorageDead(_15);
-        StorageDead(_23);
-        StorageDead(_22);
-        StorageDead(_14);
-        StorageDead(_13);
-        _27 = copy ((_26 as Some).0: &T);
-        StorageLive(_28);
-        _28 = &_2;
-        StorageLive(_29);
-        _29 = (copy _27,);
-        _30 = <impl Fn(&T) as Fn<(&T,)>>::call(move _28, move _29) -> [return: bb14, unwind unreachable];
+        _24 = &_2;
+        StorageLive(_25);
+        _25 = (copy _23,);
+        _26 = <impl Fn(&T) as Fn<(&T,)>>::call(move _24, move _25) -> [return: bb14, unwind unreachable];
     }
 
     bb14: {
-        StorageDead(_29);
-        StorageDead(_28);
-        StorageDead(_26);
+        StorageDead(_25);
+        StorageDead(_24);
+        StorageDead(_22);
         goto -> bb4;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir
index 02efb193474..2b5d8c27d71 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir
@@ -4,31 +4,29 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
     debug slice => _1;
     debug f => _2;
     let mut _0: ();
-    let mut _11: std::ptr::NonNull<T>;
-    let mut _12: *const T;
-    let mut _26: std::option::Option<&T>;
-    let mut _28: &impl Fn(&T);
-    let mut _29: (&T,);
-    let _30: ();
+    let mut _22: std::option::Option<&T>;
+    let mut _24: &impl Fn(&T);
+    let mut _25: (&T,);
+    let _26: ();
     scope 1 {
-        debug ((iter: std::slice::Iter<'_, T>).0: std::ptr::NonNull<T>) => _11;
-        debug ((iter: std::slice::Iter<'_, T>).1: *const T) => _12;
+        debug ((iter: std::slice::Iter<'_, T>).0: std::ptr::NonNull<T>) => _6;
+        debug ((iter: std::slice::Iter<'_, T>).1: *const T) => _9;
         debug ((iter: std::slice::Iter<'_, T>).2: std::marker::PhantomData<&T>) => const ZeroSized: PhantomData<&T>;
-        let _27: &T;
+        let _23: &T;
         scope 2 {
-            debug x => _27;
+            debug x => _23;
         }
         scope 16 (inlined <std::slice::Iter<'_, T> as Iterator>::next) {
-            let _13: std::ptr::NonNull<T>;
-            let _15: std::ptr::NonNull<T>;
-            let mut _18: bool;
-            let mut _21: std::ptr::NonNull<T>;
-            let mut _23: usize;
-            let _25: &T;
+            let mut _6: std::ptr::NonNull<T>;
+            let _10: std::ptr::NonNull<T>;
+            let _12: std::ptr::NonNull<T>;
+            let mut _15: bool;
+            let mut _19: usize;
+            let _21: &T;
             scope 17 {
-                let _14: *const T;
+                let _11: *const T;
                 scope 18 {
-                    let _22: usize;
+                    let _18: usize;
                     scope 19 {
                         scope 22 (inlined #[track_caller] core::num::<impl usize>::unchecked_sub) {
                             scope 23 (inlined core::ub_checks::check_language_ub) {
@@ -44,21 +42,21 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
                         }
                     }
                     scope 26 (inlined <NonNull<T> as PartialEq>::eq) {
-                        let mut _16: *mut T;
-                        let mut _17: *mut T;
+                        let mut _13: *mut T;
+                        let mut _14: *mut T;
                         scope 27 (inlined NonNull::<T>::as_ptr) {
                         }
                         scope 28 (inlined NonNull::<T>::as_ptr) {
                         }
                     }
                     scope 29 (inlined NonNull::<T>::add) {
-                        let mut _19: *const T;
-                        let mut _20: *const T;
+                        let mut _16: *const T;
+                        let mut _17: *const T;
                         scope 30 (inlined NonNull::<T>::as_ptr) {
                         }
                     }
                     scope 31 (inlined NonNull::<T>::as_ref::<'_>) {
-                        let _24: *const T;
+                        let _20: *const T;
                         scope 32 (inlined NonNull::<T>::as_ptr) {
                         }
                         scope 33 (inlined std::ptr::mut_ptr::<impl *mut T>::cast_const) {
@@ -73,9 +71,7 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
             let _3: usize;
             let mut _7: *mut T;
             let mut _8: *mut T;
-            let mut _10: *const T;
             scope 5 {
-                let _6: std::ptr::NonNull<T>;
                 scope 6 {
                     let _9: *const T;
                     scope 7 {
@@ -112,7 +108,6 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
         _5 = copy _4 as *const T (PtrToPtr);
         _6 = NonNull::<T> { pointer: copy _5 };
         StorageDead(_5);
-        StorageLive(_9);
         switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2];
     }
 
@@ -133,88 +128,77 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
     }
 
     bb3: {
-        _10 = copy _9;
-        StorageDead(_9);
         StorageDead(_4);
         StorageDead(_3);
-        StorageLive(_11);
-        StorageLive(_12);
-        _11 = copy _6;
-        _12 = copy _10;
         goto -> bb4;
     }
 
     bb4: {
-        StorageLive(_26);
-        StorageLive(_13);
-        StorageLive(_14);
         StorageLive(_22);
-        StorageLive(_23);
-        StorageLive(_15);
-        StorageLive(_25);
-        _13 = copy _11;
-        _14 = copy _12;
+        StorageLive(_10);
+        StorageLive(_11);
+        StorageLive(_18);
+        StorageLive(_19);
+        StorageLive(_12);
+        StorageLive(_21);
+        _10 = copy _6;
+        _11 = copy _9;
         switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb5, otherwise: bb8];
     }
 
     bb5: {
-        StorageLive(_18);
-        _15 = copy _14 as std::ptr::NonNull<T> (Transmute);
-        StorageLive(_16);
-        _16 = copy _13 as *mut T (Transmute);
-        StorageLive(_17);
-        _17 = copy _15 as *mut T (Transmute);
-        _18 = Eq(copy _16, copy _17);
-        StorageDead(_17);
-        StorageDead(_16);
-        switchInt(move _18) -> [0: bb6, otherwise: bb7];
+        StorageLive(_15);
+        _12 = copy _11 as std::ptr::NonNull<T> (Transmute);
+        StorageLive(_13);
+        _13 = copy _10 as *mut T (Transmute);
+        StorageLive(_14);
+        _14 = copy _12 as *mut T (Transmute);
+        _15 = Eq(copy _13, copy _14);
+        StorageDead(_14);
+        StorageDead(_13);
+        switchInt(move _15) -> [0: bb6, otherwise: bb7];
     }
 
     bb6: {
-        StorageDead(_18);
-        StorageLive(_21);
-        StorageLive(_20);
-        StorageLive(_19);
-        _19 = copy _13 as *const T (Transmute);
-        _20 = Offset(copy _19, const 1_usize);
-        StorageDead(_19);
-        _21 = NonNull::<T> { pointer: copy _20 };
-        StorageDead(_20);
-        _11 = move _21;
-        StorageDead(_21);
+        StorageDead(_15);
+        StorageLive(_17);
+        StorageLive(_16);
+        _16 = copy _10 as *const T (Transmute);
+        _17 = Offset(copy _16, const 1_usize);
+        StorageDead(_16);
+        _6 = NonNull::<T> { pointer: copy _17 };
+        StorageDead(_17);
         goto -> bb13;
     }
 
     bb7: {
-        StorageDead(_18);
-        StorageDead(_25);
         StorageDead(_15);
-        StorageDead(_23);
-        StorageDead(_22);
-        StorageDead(_14);
-        StorageDead(_13);
+        StorageDead(_21);
+        StorageDead(_12);
+        StorageDead(_19);
+        StorageDead(_18);
+        StorageDead(_11);
+        StorageDead(_10);
         goto -> bb10;
     }
 
     bb8: {
-        _22 = copy _14 as usize (Transmute);
-        switchInt(copy _22) -> [0: bb9, otherwise: bb12];
+        _18 = copy _11 as usize (Transmute);
+        switchInt(copy _18) -> [0: bb9, otherwise: bb12];
     }
 
     bb9: {
-        StorageDead(_25);
-        StorageDead(_15);
-        StorageDead(_23);
-        StorageDead(_22);
-        StorageDead(_14);
-        StorageDead(_13);
+        StorageDead(_21);
+        StorageDead(_12);
+        StorageDead(_19);
+        StorageDead(_18);
+        StorageDead(_11);
+        StorageDead(_10);
         goto -> bb10;
     }
 
     bb10: {
-        StorageDead(_26);
-        StorageDead(_11);
-        StorageDead(_12);
+        StorageDead(_22);
         drop(_2) -> [return: bb11, unwind continue];
     }
 
@@ -223,35 +207,35 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
     }
 
     bb12: {
-        _23 = SubUnchecked(copy _22, const 1_usize);
-        _12 = copy _23 as *const T (Transmute);
+        _19 = SubUnchecked(copy _18, const 1_usize);
+        _9 = copy _19 as *const T (Transmute);
         goto -> bb13;
     }
 
     bb13: {
+        StorageLive(_20);
+        _20 = copy _10 as *const T (Transmute);
+        _21 = &(*_20);
+        StorageDead(_20);
+        _22 = Option::<&T>::Some(copy _21);
+        StorageDead(_21);
+        StorageDead(_12);
+        StorageDead(_19);
+        StorageDead(_18);
+        StorageDead(_11);
+        StorageDead(_10);
+        _23 = copy ((_22 as Some).0: &T);
         StorageLive(_24);
-        _24 = copy _13 as *const T (Transmute);
-        _25 = &(*_24);
-        StorageDead(_24);
-        _26 = Option::<&T>::Some(copy _25);
-        StorageDead(_25);
-        StorageDead(_15);
-        StorageDead(_23);
-        StorageDead(_22);
-        StorageDead(_14);
-        StorageDead(_13);
-        _27 = copy ((_26 as Some).0: &T);
-        StorageLive(_28);
-        _28 = &_2;
-        StorageLive(_29);
-        _29 = (copy _27,);
-        _30 = <impl Fn(&T) as Fn<(&T,)>>::call(move _28, move _29) -> [return: bb14, unwind: bb15];
+        _24 = &_2;
+        StorageLive(_25);
+        _25 = (copy _23,);
+        _26 = <impl Fn(&T) as Fn<(&T,)>>::call(move _24, move _25) -> [return: bb14, unwind: bb15];
     }
 
     bb14: {
-        StorageDead(_29);
-        StorageDead(_28);
-        StorageDead(_26);
+        StorageDead(_25);
+        StorageDead(_24);
+        StorageDead(_22);
         goto -> bb4;
     }
 
diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir
index 41e273151ec..14537599071 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-abort.mir
@@ -5,28 +5,27 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     debug f => _2;
     let mut _0: ();
     let mut _3: usize;
-    let mut _4: usize;
-    let mut _9: std::option::Option<usize>;
-    let mut _11: bool;
-    let mut _13: &impl Fn(usize, &T);
-    let mut _14: (usize, &T);
-    let _15: ();
+    let mut _8: std::option::Option<usize>;
+    let mut _10: bool;
+    let mut _12: &impl Fn(usize, &T);
+    let mut _13: (usize, &T);
+    let _14: ();
     scope 1 {
         debug ((iter: std::ops::Range<usize>).0: usize) => _4;
         debug ((iter: std::ops::Range<usize>).1: usize) => _3;
-        let _10: usize;
+        let _9: usize;
         scope 2 {
-            debug i => _10;
-            let _12: &T;
+            debug i => _9;
+            let _11: &T;
             scope 3 {
-                debug x => _12;
+                debug x => _11;
             }
         }
         scope 5 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
             scope 6 (inlined <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next) {
+                let mut _4: usize;
                 let mut _6: bool;
                 let _7: usize;
-                let mut _8: usize;
                 scope 7 {
                     scope 9 (inlined <usize as Step>::forward_unchecked) {
                         scope 10 (inlined #[track_caller] core::num::<impl usize>::unchecked_add) {
@@ -48,13 +47,12 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
 
     bb0: {
         _3 = PtrMetadata(copy _1);
-        StorageLive(_4);
         _4 = const 0_usize;
         goto -> bb1;
     }
 
     bb1: {
-        StorageLive(_9);
+        StorageLive(_8);
         StorageLive(_6);
         StorageLive(_5);
         _5 = copy _4;
@@ -65,8 +63,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
 
     bb2: {
         StorageDead(_6);
-        StorageDead(_9);
-        StorageDead(_4);
+        StorageDead(_8);
         drop(_2) -> [return: bb3, unwind unreachable];
     }
 
@@ -76,30 +73,27 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
 
     bb4: {
         _7 = copy _4;
-        StorageLive(_8);
-        _8 = AddUnchecked(copy _7, const 1_usize);
-        _4 = move _8;
-        StorageDead(_8);
-        _9 = Option::<usize>::Some(copy _7);
+        _4 = AddUnchecked(copy _7, const 1_usize);
+        _8 = Option::<usize>::Some(copy _7);
         StorageDead(_6);
-        _10 = copy ((_9 as Some).0: usize);
-        _11 = Lt(copy _10, copy _3);
-        assert(move _11, "index out of bounds: the length is {} but the index is {}", copy _3, copy _10) -> [success: bb5, unwind unreachable];
+        _9 = copy ((_8 as Some).0: usize);
+        _10 = Lt(copy _9, copy _3);
+        assert(move _10, "index out of bounds: the length is {} but the index is {}", copy _3, copy _9) -> [success: bb5, unwind unreachable];
     }
 
     bb5: {
-        _12 = &(*_1)[_10];
+        _11 = &(*_1)[_9];
+        StorageLive(_12);
+        _12 = &_2;
         StorageLive(_13);
-        _13 = &_2;
-        StorageLive(_14);
-        _14 = (copy _10, copy _12);
-        _15 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _13, move _14) -> [return: bb6, unwind unreachable];
+        _13 = (copy _9, copy _11);
+        _14 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _12, move _13) -> [return: bb6, unwind unreachable];
     }
 
     bb6: {
-        StorageDead(_14);
         StorageDead(_13);
-        StorageDead(_9);
+        StorageDead(_12);
+        StorageDead(_8);
         goto -> bb1;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
index ec781c1480c..8e573ef488f 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.range_loop.PreCodegen.after.panic-unwind.mir
@@ -5,28 +5,27 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
     debug f => _2;
     let mut _0: ();
     let mut _3: usize;
-    let mut _4: usize;
-    let mut _9: std::option::Option<usize>;
-    let mut _11: bool;
-    let mut _13: &impl Fn(usize, &T);
-    let mut _14: (usize, &T);
-    let _15: ();
+    let mut _8: std::option::Option<usize>;
+    let mut _10: bool;
+    let mut _12: &impl Fn(usize, &T);
+    let mut _13: (usize, &T);
+    let _14: ();
     scope 1 {
         debug ((iter: std::ops::Range<usize>).0: usize) => _4;
         debug ((iter: std::ops::Range<usize>).1: usize) => _3;
-        let _10: usize;
+        let _9: usize;
         scope 2 {
-            debug i => _10;
-            let _12: &T;
+            debug i => _9;
+            let _11: &T;
             scope 3 {
-                debug x => _12;
+                debug x => _11;
             }
         }
         scope 5 (inlined iter::range::<impl Iterator for std::ops::Range<usize>>::next) {
             scope 6 (inlined <std::ops::Range<usize> as iter::range::RangeIteratorImpl>::spec_next) {
+                let mut _4: usize;
                 let mut _6: bool;
                 let _7: usize;
-                let mut _8: usize;
                 scope 7 {
                     scope 9 (inlined <usize as Step>::forward_unchecked) {
                         scope 10 (inlined #[track_caller] core::num::<impl usize>::unchecked_add) {
@@ -48,13 +47,12 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
 
     bb0: {
         _3 = PtrMetadata(copy _1);
-        StorageLive(_4);
         _4 = const 0_usize;
         goto -> bb1;
     }
 
     bb1: {
-        StorageLive(_9);
+        StorageLive(_8);
         StorageLive(_6);
         StorageLive(_5);
         _5 = copy _4;
@@ -65,8 +63,7 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
 
     bb2: {
         StorageDead(_6);
-        StorageDead(_9);
-        StorageDead(_4);
+        StorageDead(_8);
         drop(_2) -> [return: bb3, unwind continue];
     }
 
@@ -76,30 +73,27 @@ fn range_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
 
     bb4: {
         _7 = copy _4;
-        StorageLive(_8);
-        _8 = AddUnchecked(copy _7, const 1_usize);
-        _4 = move _8;
-        StorageDead(_8);
-        _9 = Option::<usize>::Some(copy _7);
+        _4 = AddUnchecked(copy _7, const 1_usize);
+        _8 = Option::<usize>::Some(copy _7);
         StorageDead(_6);
-        _10 = copy ((_9 as Some).0: usize);
-        _11 = Lt(copy _10, copy _3);
-        assert(move _11, "index out of bounds: the length is {} but the index is {}", copy _3, copy _10) -> [success: bb5, unwind: bb7];
+        _9 = copy ((_8 as Some).0: usize);
+        _10 = Lt(copy _9, copy _3);
+        assert(move _10, "index out of bounds: the length is {} but the index is {}", copy _3, copy _9) -> [success: bb5, unwind: bb7];
     }
 
     bb5: {
-        _12 = &(*_1)[_10];
+        _11 = &(*_1)[_9];
+        StorageLive(_12);
+        _12 = &_2;
         StorageLive(_13);
-        _13 = &_2;
-        StorageLive(_14);
-        _14 = (copy _10, copy _12);
-        _15 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _13, move _14) -> [return: bb6, unwind: bb7];
+        _13 = (copy _9, copy _11);
+        _14 = <impl Fn(usize, &T) as Fn<(usize, &T)>>::call(move _12, move _13) -> [return: bb6, unwind: bb7];
     }
 
     bb6: {
-        StorageDead(_14);
         StorageDead(_13);
-        StorageDead(_9);
+        StorageDead(_12);
+        StorageDead(_8);
         goto -> bb1;
     }
 
diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir
index ee638be7d7a..3009be3f9dc 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-abort.mir
@@ -4,22 +4,90 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
     debug slice => _1;
     debug f => _2;
     let mut _0: ();
-    let mut _11: std::slice::Iter<'_, T>;
+    let mut _10: std::slice::Iter<'_, T>;
+    let mut _11: std::iter::Rev<std::slice::Iter<'_, T>>;
     let mut _12: std::iter::Rev<std::slice::Iter<'_, T>>;
-    let mut _13: std::iter::Rev<std::slice::Iter<'_, T>>;
-    let mut _15: std::option::Option<&T>;
-    let mut _16: isize;
-    let mut _18: &impl Fn(&T);
-    let mut _19: (&T,);
-    let _20: ();
+    let mut _33: std::option::Option<&T>;
+    let mut _35: &impl Fn(&T);
+    let mut _36: (&T,);
+    let _37: ();
     scope 1 {
-        debug iter => _13;
-        let _17: &T;
+        debug iter => _12;
+        let _34: &T;
         scope 2 {
-            debug x => _17;
+            debug x => _34;
         }
         scope 18 (inlined <Rev<std::slice::Iter<'_, T>> as Iterator>::next) {
-            let mut _14: &mut std::slice::Iter<'_, T>;
+            scope 19 (inlined <std::slice::Iter<'_, T> as DoubleEndedIterator>::next_back) {
+                let mut _13: *const T;
+                let mut _18: bool;
+                let mut _19: *const T;
+                let _32: &T;
+                scope 20 {
+                    let _14: std::ptr::NonNull<T>;
+                    let _20: usize;
+                    scope 21 {
+                    }
+                    scope 22 {
+                        scope 25 (inlined <NonNull<T> as PartialEq>::eq) {
+                            let mut _15: std::ptr::NonNull<T>;
+                            let mut _16: *mut T;
+                            let mut _17: *mut T;
+                            scope 26 (inlined NonNull::<T>::as_ptr) {
+                            }
+                            scope 27 (inlined NonNull::<T>::as_ptr) {
+                            }
+                        }
+                    }
+                    scope 23 (inlined std::ptr::const_ptr::<impl *const T>::addr) {
+                        scope 24 (inlined std::ptr::const_ptr::<impl *const T>::cast::<()>) {
+                        }
+                    }
+                }
+                scope 28 (inlined std::slice::Iter::<'_, T>::next_back_unchecked) {
+                    let _26: std::ptr::NonNull<T>;
+                    scope 29 (inlined std::slice::Iter::<'_, T>::pre_dec_end) {
+                        let mut _21: *mut *const T;
+                        let mut _22: *mut std::ptr::NonNull<T>;
+                        let mut _23: std::ptr::NonNull<T>;
+                        let mut _27: *mut *const T;
+                        let mut _28: *mut usize;
+                        let mut _29: usize;
+                        let mut _30: usize;
+                        scope 30 {
+                            scope 31 {
+                            }
+                            scope 32 {
+                                scope 35 (inlined NonNull::<T>::sub) {
+                                    scope 36 (inlined #[track_caller] core::num::<impl isize>::unchecked_neg) {
+                                        scope 37 (inlined core::ub_checks::check_language_ub) {
+                                            scope 38 (inlined core::ub_checks::check_language_ub::runtime) {
+                                            }
+                                        }
+                                    }
+                                    scope 39 (inlined NonNull::<T>::offset) {
+                                        let mut _24: *const T;
+                                        let mut _25: *const T;
+                                        scope 40 (inlined NonNull::<T>::as_ptr) {
+                                        }
+                                    }
+                                }
+                            }
+                            scope 33 (inlined std::ptr::mut_ptr::<impl *mut *const T>::cast::<usize>) {
+                            }
+                            scope 34 (inlined std::ptr::mut_ptr::<impl *mut *const T>::cast::<NonNull<T>>) {
+                            }
+                        }
+                    }
+                    scope 41 (inlined NonNull::<T>::as_ref::<'_>) {
+                        let _31: *const T;
+                        scope 42 (inlined NonNull::<T>::as_ptr) {
+                        }
+                        scope 43 (inlined std::ptr::mut_ptr::<impl *mut T>::cast_const) {
+                        }
+                    }
+                }
+            }
         }
     }
     scope 3 (inlined core::slice::<impl [T]>::iter) {
@@ -27,7 +95,6 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
             let _3: usize;
             let mut _7: *mut T;
             let mut _8: *mut T;
-            let mut _10: *const T;
             scope 5 {
                 let _6: std::ptr::NonNull<T>;
                 scope 6 {
@@ -62,9 +129,10 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
     }
 
     bb0: {
-        StorageLive(_11);
+        StorageLive(_10);
         StorageLive(_3);
         StorageLive(_6);
+        StorageLive(_9);
         StorageLive(_4);
         _3 = PtrMetadata(copy _1);
         _4 = &raw const (*_1);
@@ -72,7 +140,6 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
         _5 = copy _4 as *const T (PtrToPtr);
         _6 = NonNull::<T> { pointer: copy _5 };
         StorageDead(_5);
-        StorageLive(_9);
         switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2];
     }
 
@@ -93,61 +160,149 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
     }
 
     bb3: {
-        StorageLive(_10);
-        _10 = copy _9;
-        _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: copy _10, _marker: const ZeroSized: PhantomData<&T> };
-        StorageDead(_10);
-        StorageDead(_9);
+        _10 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: copy _9, _marker: const ZeroSized: PhantomData<&T> };
         StorageDead(_4);
+        StorageDead(_9);
         StorageDead(_6);
         StorageDead(_3);
-        _12 = Rev::<std::slice::Iter<'_, T>> { iter: copy _11 };
-        StorageDead(_11);
-        StorageLive(_13);
-        _13 = copy _12;
+        _11 = Rev::<std::slice::Iter<'_, T>> { iter: copy _10 };
+        StorageDead(_10);
+        StorageLive(_12);
+        _12 = copy _11;
         goto -> bb4;
     }
 
     bb4: {
-        StorageLive(_15);
+        StorageLive(_33);
+        StorageLive(_20);
+        StorageLive(_19);
         StorageLive(_14);
-        _14 = &mut (_13.0: std::slice::Iter<'_, T>);
-        _15 = <std::slice::Iter<'_, T> as DoubleEndedIterator>::next_back(move _14) -> [return: bb5, unwind unreachable];
+        StorageLive(_32);
+        StorageLive(_18);
+        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb5, otherwise: bb6];
     }
 
     bb5: {
-        StorageDead(_14);
-        _16 = discriminant(_15);
-        switchInt(move _16) -> [0: bb6, 1: bb8, otherwise: bb10];
+        StorageLive(_13);
+        _13 = copy ((_12.0: std::slice::Iter<'_, T>).1: *const T);
+        _14 = copy _13 as std::ptr::NonNull<T> (Transmute);
+        StorageDead(_13);
+        StorageLive(_16);
+        StorageLive(_15);
+        _15 = copy ((_12.0: std::slice::Iter<'_, T>).0: std::ptr::NonNull<T>);
+        _16 = copy _15 as *mut T (Transmute);
+        StorageDead(_15);
+        StorageLive(_17);
+        _17 = copy _14 as *mut T (Transmute);
+        _18 = Eq(copy _16, copy _17);
+        StorageDead(_17);
+        StorageDead(_16);
+        goto -> bb7;
     }
 
     bb6: {
-        StorageDead(_15);
-        StorageDead(_13);
-        drop(_2) -> [return: bb7, unwind unreachable];
+        _19 = copy ((_12.0: std::slice::Iter<'_, T>).1: *const T);
+        _20 = copy _19 as usize (Transmute);
+        _18 = Eq(copy _20, const 0_usize);
+        goto -> bb7;
     }
 
     bb7: {
-        return;
+        switchInt(move _18) -> [0: bb8, otherwise: bb15];
     }
 
     bb8: {
-        _17 = copy ((_15 as Some).0: &T);
-        StorageLive(_18);
-        _18 = &_2;
-        StorageLive(_19);
-        _19 = (copy _17,);
-        _20 = <impl Fn(&T) as Fn<(&T,)>>::call(move _18, move _19) -> [return: bb9, unwind unreachable];
+        StorageLive(_26);
+        StorageLive(_28);
+        StorageLive(_22);
+        StorageLive(_23);
+        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb9, otherwise: bb12];
     }
 
     bb9: {
-        StorageDead(_19);
+        StorageLive(_21);
+        _21 = &raw mut ((_12.0: std::slice::Iter<'_, T>).1: *const T);
+        _22 = copy _21 as *mut std::ptr::NonNull<T> (PtrToPtr);
+        StorageDead(_21);
+        _23 = copy (*_22);
+        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb10, otherwise: bb11];
+    }
+
+    bb10: {
+        StorageLive(_25);
+        StorageLive(_24);
+        _24 = copy _23 as *const T (Transmute);
+        _25 = Offset(copy _24, const -1_isize);
+        StorageDead(_24);
+        _23 = NonNull::<T> { pointer: copy _25 };
+        StorageDead(_25);
+        goto -> bb11;
+    }
+
+    bb11: {
+        (*_22) = move _23;
+        _26 = copy (*_22);
+        goto -> bb13;
+    }
+
+    bb12: {
+        StorageLive(_27);
+        _27 = &raw mut ((_12.0: std::slice::Iter<'_, T>).1: *const T);
+        _28 = copy _27 as *mut usize (PtrToPtr);
+        StorageDead(_27);
+        StorageLive(_30);
+        StorageLive(_29);
+        _29 = copy (*_28);
+        _30 = SubUnchecked(move _29, const 1_usize);
+        StorageDead(_29);
+        (*_28) = move _30;
+        StorageDead(_30);
+        _26 = copy ((_12.0: std::slice::Iter<'_, T>).0: std::ptr::NonNull<T>);
+        goto -> bb13;
+    }
+
+    bb13: {
+        StorageDead(_23);
+        StorageDead(_22);
+        StorageDead(_28);
+        StorageLive(_31);
+        _31 = copy _26 as *const T (Transmute);
+        _32 = &(*_31);
+        StorageDead(_31);
+        StorageDead(_26);
+        _33 = Option::<&T>::Some(copy _32);
         StorageDead(_18);
-        StorageDead(_15);
+        StorageDead(_32);
+        StorageDead(_14);
+        StorageDead(_19);
+        StorageDead(_20);
+        _34 = copy ((_33 as Some).0: &T);
+        StorageLive(_35);
+        _35 = &_2;
+        StorageLive(_36);
+        _36 = (copy _34,);
+        _37 = <impl Fn(&T) as Fn<(&T,)>>::call(move _35, move _36) -> [return: bb14, unwind unreachable];
+    }
+
+    bb14: {
+        StorageDead(_36);
+        StorageDead(_35);
+        StorageDead(_33);
         goto -> bb4;
     }
 
-    bb10: {
-        unreachable;
+    bb15: {
+        StorageDead(_18);
+        StorageDead(_32);
+        StorageDead(_14);
+        StorageDead(_19);
+        StorageDead(_20);
+        StorageDead(_33);
+        StorageDead(_12);
+        drop(_2) -> [return: bb16, unwind unreachable];
+    }
+
+    bb16: {
+        return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir
index aee29d4d4fe..e40bff5ea35 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.reverse_loop.PreCodegen.after.panic-unwind.mir
@@ -4,22 +4,90 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
     debug slice => _1;
     debug f => _2;
     let mut _0: ();
-    let mut _11: std::slice::Iter<'_, T>;
+    let mut _10: std::slice::Iter<'_, T>;
+    let mut _11: std::iter::Rev<std::slice::Iter<'_, T>>;
     let mut _12: std::iter::Rev<std::slice::Iter<'_, T>>;
-    let mut _13: std::iter::Rev<std::slice::Iter<'_, T>>;
-    let mut _15: std::option::Option<&T>;
-    let mut _16: isize;
-    let mut _18: &impl Fn(&T);
-    let mut _19: (&T,);
-    let _20: ();
+    let mut _33: std::option::Option<&T>;
+    let mut _35: &impl Fn(&T);
+    let mut _36: (&T,);
+    let _37: ();
     scope 1 {
-        debug iter => _13;
-        let _17: &T;
+        debug iter => _12;
+        let _34: &T;
         scope 2 {
-            debug x => _17;
+            debug x => _34;
         }
         scope 18 (inlined <Rev<std::slice::Iter<'_, T>> as Iterator>::next) {
-            let mut _14: &mut std::slice::Iter<'_, T>;
+            scope 19 (inlined <std::slice::Iter<'_, T> as DoubleEndedIterator>::next_back) {
+                let mut _13: *const T;
+                let mut _18: bool;
+                let mut _19: *const T;
+                let _32: &T;
+                scope 20 {
+                    let _14: std::ptr::NonNull<T>;
+                    let _20: usize;
+                    scope 21 {
+                    }
+                    scope 22 {
+                        scope 25 (inlined <NonNull<T> as PartialEq>::eq) {
+                            let mut _15: std::ptr::NonNull<T>;
+                            let mut _16: *mut T;
+                            let mut _17: *mut T;
+                            scope 26 (inlined NonNull::<T>::as_ptr) {
+                            }
+                            scope 27 (inlined NonNull::<T>::as_ptr) {
+                            }
+                        }
+                    }
+                    scope 23 (inlined std::ptr::const_ptr::<impl *const T>::addr) {
+                        scope 24 (inlined std::ptr::const_ptr::<impl *const T>::cast::<()>) {
+                        }
+                    }
+                }
+                scope 28 (inlined std::slice::Iter::<'_, T>::next_back_unchecked) {
+                    let _26: std::ptr::NonNull<T>;
+                    scope 29 (inlined std::slice::Iter::<'_, T>::pre_dec_end) {
+                        let mut _21: *mut *const T;
+                        let mut _22: *mut std::ptr::NonNull<T>;
+                        let mut _23: std::ptr::NonNull<T>;
+                        let mut _27: *mut *const T;
+                        let mut _28: *mut usize;
+                        let mut _29: usize;
+                        let mut _30: usize;
+                        scope 30 {
+                            scope 31 {
+                            }
+                            scope 32 {
+                                scope 35 (inlined NonNull::<T>::sub) {
+                                    scope 36 (inlined #[track_caller] core::num::<impl isize>::unchecked_neg) {
+                                        scope 37 (inlined core::ub_checks::check_language_ub) {
+                                            scope 38 (inlined core::ub_checks::check_language_ub::runtime) {
+                                            }
+                                        }
+                                    }
+                                    scope 39 (inlined NonNull::<T>::offset) {
+                                        let mut _24: *const T;
+                                        let mut _25: *const T;
+                                        scope 40 (inlined NonNull::<T>::as_ptr) {
+                                        }
+                                    }
+                                }
+                            }
+                            scope 33 (inlined std::ptr::mut_ptr::<impl *mut *const T>::cast::<usize>) {
+                            }
+                            scope 34 (inlined std::ptr::mut_ptr::<impl *mut *const T>::cast::<NonNull<T>>) {
+                            }
+                        }
+                    }
+                    scope 41 (inlined NonNull::<T>::as_ref::<'_>) {
+                        let _31: *const T;
+                        scope 42 (inlined NonNull::<T>::as_ptr) {
+                        }
+                        scope 43 (inlined std::ptr::mut_ptr::<impl *mut T>::cast_const) {
+                        }
+                    }
+                }
+            }
         }
     }
     scope 3 (inlined core::slice::<impl [T]>::iter) {
@@ -27,7 +95,6 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
             let _3: usize;
             let mut _7: *mut T;
             let mut _8: *mut T;
-            let mut _10: *const T;
             scope 5 {
                 let _6: std::ptr::NonNull<T>;
                 scope 6 {
@@ -62,9 +129,10 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
     }
 
     bb0: {
-        StorageLive(_11);
+        StorageLive(_10);
         StorageLive(_3);
         StorageLive(_6);
+        StorageLive(_9);
         StorageLive(_4);
         _3 = PtrMetadata(copy _1);
         _4 = &raw const (*_1);
@@ -72,7 +140,6 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
         _5 = copy _4 as *const T (PtrToPtr);
         _6 = NonNull::<T> { pointer: copy _5 };
         StorageDead(_5);
-        StorageLive(_9);
         switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2];
     }
 
@@ -93,69 +160,157 @@ fn reverse_loop(_1: &[T], _2: impl Fn(&T)) -> () {
     }
 
     bb3: {
-        StorageLive(_10);
-        _10 = copy _9;
-        _11 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: copy _10, _marker: const ZeroSized: PhantomData<&T> };
-        StorageDead(_10);
-        StorageDead(_9);
+        _10 = std::slice::Iter::<'_, T> { ptr: copy _6, end_or_len: copy _9, _marker: const ZeroSized: PhantomData<&T> };
         StorageDead(_4);
+        StorageDead(_9);
         StorageDead(_6);
         StorageDead(_3);
-        _12 = Rev::<std::slice::Iter<'_, T>> { iter: copy _11 };
-        StorageDead(_11);
-        StorageLive(_13);
-        _13 = copy _12;
+        _11 = Rev::<std::slice::Iter<'_, T>> { iter: copy _10 };
+        StorageDead(_10);
+        StorageLive(_12);
+        _12 = copy _11;
         goto -> bb4;
     }
 
     bb4: {
-        StorageLive(_15);
+        StorageLive(_33);
+        StorageLive(_20);
+        StorageLive(_19);
         StorageLive(_14);
-        _14 = &mut (_13.0: std::slice::Iter<'_, T>);
-        _15 = <std::slice::Iter<'_, T> as DoubleEndedIterator>::next_back(move _14) -> [return: bb5, unwind: bb11];
+        StorageLive(_32);
+        StorageLive(_18);
+        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb5, otherwise: bb6];
     }
 
     bb5: {
-        StorageDead(_14);
-        _16 = discriminant(_15);
-        switchInt(move _16) -> [0: bb6, 1: bb8, otherwise: bb10];
+        StorageLive(_13);
+        _13 = copy ((_12.0: std::slice::Iter<'_, T>).1: *const T);
+        _14 = copy _13 as std::ptr::NonNull<T> (Transmute);
+        StorageDead(_13);
+        StorageLive(_16);
+        StorageLive(_15);
+        _15 = copy ((_12.0: std::slice::Iter<'_, T>).0: std::ptr::NonNull<T>);
+        _16 = copy _15 as *mut T (Transmute);
+        StorageDead(_15);
+        StorageLive(_17);
+        _17 = copy _14 as *mut T (Transmute);
+        _18 = Eq(copy _16, copy _17);
+        StorageDead(_17);
+        StorageDead(_16);
+        goto -> bb7;
     }
 
     bb6: {
-        StorageDead(_15);
-        StorageDead(_13);
-        drop(_2) -> [return: bb7, unwind continue];
+        _19 = copy ((_12.0: std::slice::Iter<'_, T>).1: *const T);
+        _20 = copy _19 as usize (Transmute);
+        _18 = Eq(copy _20, const 0_usize);
+        goto -> bb7;
     }
 
     bb7: {
-        return;
+        switchInt(move _18) -> [0: bb8, otherwise: bb17];
     }
 
     bb8: {
-        _17 = copy ((_15 as Some).0: &T);
-        StorageLive(_18);
-        _18 = &_2;
-        StorageLive(_19);
-        _19 = (copy _17,);
-        _20 = <impl Fn(&T) as Fn<(&T,)>>::call(move _18, move _19) -> [return: bb9, unwind: bb11];
+        StorageLive(_26);
+        StorageLive(_28);
+        StorageLive(_22);
+        StorageLive(_23);
+        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb9, otherwise: bb12];
     }
 
     bb9: {
-        StorageDead(_19);
-        StorageDead(_18);
-        StorageDead(_15);
-        goto -> bb4;
+        StorageLive(_21);
+        _21 = &raw mut ((_12.0: std::slice::Iter<'_, T>).1: *const T);
+        _22 = copy _21 as *mut std::ptr::NonNull<T> (PtrToPtr);
+        StorageDead(_21);
+        _23 = copy (*_22);
+        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb10, otherwise: bb11];
     }
 
     bb10: {
-        unreachable;
+        StorageLive(_25);
+        StorageLive(_24);
+        _24 = copy _23 as *const T (Transmute);
+        _25 = Offset(copy _24, const -1_isize);
+        StorageDead(_24);
+        _23 = NonNull::<T> { pointer: copy _25 };
+        StorageDead(_25);
+        goto -> bb11;
+    }
+
+    bb11: {
+        (*_22) = move _23;
+        _26 = copy (*_22);
+        goto -> bb13;
     }
 
-    bb11 (cleanup): {
-        drop(_2) -> [return: bb12, unwind terminate(cleanup)];
+    bb12: {
+        StorageLive(_27);
+        _27 = &raw mut ((_12.0: std::slice::Iter<'_, T>).1: *const T);
+        _28 = copy _27 as *mut usize (PtrToPtr);
+        StorageDead(_27);
+        StorageLive(_30);
+        StorageLive(_29);
+        _29 = copy (*_28);
+        _30 = SubUnchecked(move _29, const 1_usize);
+        StorageDead(_29);
+        (*_28) = move _30;
+        StorageDead(_30);
+        _26 = copy ((_12.0: std::slice::Iter<'_, T>).0: std::ptr::NonNull<T>);
+        goto -> bb13;
     }
 
-    bb12 (cleanup): {
+    bb13: {
+        StorageDead(_23);
+        StorageDead(_22);
+        StorageDead(_28);
+        StorageLive(_31);
+        _31 = copy _26 as *const T (Transmute);
+        _32 = &(*_31);
+        StorageDead(_31);
+        StorageDead(_26);
+        _33 = Option::<&T>::Some(copy _32);
+        StorageDead(_18);
+        StorageDead(_32);
+        StorageDead(_14);
+        StorageDead(_19);
+        StorageDead(_20);
+        _34 = copy ((_33 as Some).0: &T);
+        StorageLive(_35);
+        _35 = &_2;
+        StorageLive(_36);
+        _36 = (copy _34,);
+        _37 = <impl Fn(&T) as Fn<(&T,)>>::call(move _35, move _36) -> [return: bb14, unwind: bb15];
+    }
+
+    bb14: {
+        StorageDead(_36);
+        StorageDead(_35);
+        StorageDead(_33);
+        goto -> bb4;
+    }
+
+    bb15 (cleanup): {
+        drop(_2) -> [return: bb16, unwind terminate(cleanup)];
+    }
+
+    bb16 (cleanup): {
         resume;
     }
+
+    bb17: {
+        StorageDead(_18);
+        StorageDead(_32);
+        StorageDead(_14);
+        StorageDead(_19);
+        StorageDead(_20);
+        StorageDead(_33);
+        StorageDead(_12);
+        drop(_2) -> [return: bb18, unwind continue];
+    }
+
+    bb18: {
+        return;
+    }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-abort.mir
index 78f96bf4195..62b738c36bf 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-abort.mir
@@ -3,12 +3,187 @@
 fn slice_iter_mut_next_back(_1: &mut std::slice::IterMut<'_, T>) -> Option<&mut T> {
     debug it => _1;
     let mut _0: std::option::Option<&mut T>;
+    scope 1 (inlined <std::slice::IterMut<'_, T> as DoubleEndedIterator>::next_back) {
+        let mut _2: *mut T;
+        let mut _7: bool;
+        let mut _8: *mut T;
+        let mut _21: &mut T;
+        scope 2 {
+            let _3: std::ptr::NonNull<T>;
+            let _9: usize;
+            scope 3 {
+            }
+            scope 4 {
+                scope 7 (inlined <NonNull<T> as PartialEq>::eq) {
+                    let mut _4: std::ptr::NonNull<T>;
+                    let mut _5: *mut T;
+                    let mut _6: *mut T;
+                    scope 8 (inlined NonNull::<T>::as_ptr) {
+                    }
+                    scope 9 (inlined NonNull::<T>::as_ptr) {
+                    }
+                }
+            }
+            scope 5 (inlined std::ptr::mut_ptr::<impl *mut T>::addr) {
+                scope 6 (inlined std::ptr::mut_ptr::<impl *mut T>::cast::<()>) {
+                }
+            }
+        }
+        scope 10 (inlined std::slice::IterMut::<'_, T>::next_back_unchecked) {
+            let mut _15: std::ptr::NonNull<T>;
+            scope 11 (inlined std::slice::IterMut::<'_, T>::pre_dec_end) {
+                let mut _10: *mut *mut T;
+                let mut _11: *mut std::ptr::NonNull<T>;
+                let mut _12: std::ptr::NonNull<T>;
+                let mut _16: *mut *mut T;
+                let mut _17: *mut usize;
+                let mut _18: usize;
+                let mut _19: usize;
+                scope 12 {
+                    scope 13 {
+                    }
+                    scope 14 {
+                        scope 17 (inlined NonNull::<T>::sub) {
+                            scope 18 (inlined #[track_caller] core::num::<impl isize>::unchecked_neg) {
+                                scope 19 (inlined core::ub_checks::check_language_ub) {
+                                    scope 20 (inlined core::ub_checks::check_language_ub::runtime) {
+                                    }
+                                }
+                            }
+                            scope 21 (inlined NonNull::<T>::offset) {
+                                let mut _13: *const T;
+                                let mut _14: *const T;
+                                scope 22 (inlined NonNull::<T>::as_ptr) {
+                                }
+                            }
+                        }
+                    }
+                    scope 15 (inlined std::ptr::mut_ptr::<impl *mut *mut T>::cast::<usize>) {
+                    }
+                    scope 16 (inlined std::ptr::mut_ptr::<impl *mut *mut T>::cast::<NonNull<T>>) {
+                    }
+                }
+            }
+            scope 23 (inlined NonNull::<T>::as_mut::<'_>) {
+                let mut _20: *mut T;
+                scope 24 (inlined NonNull::<T>::as_ptr) {
+                }
+            }
+        }
+    }
 
     bb0: {
-        _0 = <std::slice::IterMut<'_, T> as DoubleEndedIterator>::next_back(move _1) -> [return: bb1, unwind unreachable];
+        StorageLive(_9);
+        StorageLive(_8);
+        StorageLive(_3);
+        StorageLive(_2);
+        StorageLive(_21);
+        StorageLive(_7);
+        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2];
     }
 
     bb1: {
+        _2 = copy ((*_1).1: *mut T);
+        _3 = copy _2 as std::ptr::NonNull<T> (Transmute);
+        StorageLive(_5);
+        StorageLive(_4);
+        _4 = copy ((*_1).0: std::ptr::NonNull<T>);
+        _5 = copy _4 as *mut T (Transmute);
+        StorageDead(_4);
+        StorageLive(_6);
+        _6 = copy _3 as *mut T (Transmute);
+        _7 = Eq(copy _5, copy _6);
+        StorageDead(_6);
+        StorageDead(_5);
+        goto -> bb3;
+    }
+
+    bb2: {
+        _8 = copy ((*_1).1: *mut T);
+        _9 = copy _8 as usize (Transmute);
+        _7 = Eq(copy _9, const 0_usize);
+        goto -> bb3;
+    }
+
+    bb3: {
+        switchInt(move _7) -> [0: bb4, otherwise: bb10];
+    }
+
+    bb4: {
+        StorageLive(_15);
+        StorageLive(_17);
+        StorageLive(_11);
+        StorageLive(_12);
+        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb5, otherwise: bb8];
+    }
+
+    bb5: {
+        StorageLive(_10);
+        _10 = &raw mut ((*_1).1: *mut T);
+        _11 = copy _10 as *mut std::ptr::NonNull<T> (PtrToPtr);
+        StorageDead(_10);
+        _12 = copy (*_11);
+        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb6, otherwise: bb7];
+    }
+
+    bb6: {
+        StorageLive(_14);
+        StorageLive(_13);
+        _13 = copy _12 as *const T (Transmute);
+        _14 = Offset(copy _13, const -1_isize);
+        StorageDead(_13);
+        _12 = NonNull::<T> { pointer: copy _14 };
+        StorageDead(_14);
+        goto -> bb7;
+    }
+
+    bb7: {
+        (*_11) = move _12;
+        _15 = copy (*_11);
+        goto -> bb9;
+    }
+
+    bb8: {
+        StorageLive(_16);
+        _16 = &raw mut ((*_1).1: *mut T);
+        _17 = copy _16 as *mut usize (PtrToPtr);
+        StorageDead(_16);
+        StorageLive(_19);
+        StorageLive(_18);
+        _18 = copy (*_17);
+        _19 = SubUnchecked(move _18, const 1_usize);
+        StorageDead(_18);
+        (*_17) = move _19;
+        StorageDead(_19);
+        _15 = copy ((*_1).0: std::ptr::NonNull<T>);
+        goto -> bb9;
+    }
+
+    bb9: {
+        StorageDead(_12);
+        StorageDead(_11);
+        StorageDead(_17);
+        StorageLive(_20);
+        _20 = copy _15 as *mut T (Transmute);
+        _21 = &mut (*_20);
+        StorageDead(_20);
+        StorageDead(_15);
+        _0 = Option::<&mut T>::Some(copy _21);
+        goto -> bb11;
+    }
+
+    bb10: {
+        _0 = const {transmute(0x0000000000000000): Option<&mut T>};
+        goto -> bb11;
+    }
+
+    bb11: {
+        StorageDead(_7);
+        StorageDead(_21);
+        StorageDead(_2);
+        StorageDead(_3);
+        StorageDead(_8);
+        StorageDead(_9);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-unwind.mir
index dfe5e206fad..62b738c36bf 100644
--- a/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-unwind.mir
@@ -3,12 +3,187 @@
 fn slice_iter_mut_next_back(_1: &mut std::slice::IterMut<'_, T>) -> Option<&mut T> {
     debug it => _1;
     let mut _0: std::option::Option<&mut T>;
+    scope 1 (inlined <std::slice::IterMut<'_, T> as DoubleEndedIterator>::next_back) {
+        let mut _2: *mut T;
+        let mut _7: bool;
+        let mut _8: *mut T;
+        let mut _21: &mut T;
+        scope 2 {
+            let _3: std::ptr::NonNull<T>;
+            let _9: usize;
+            scope 3 {
+            }
+            scope 4 {
+                scope 7 (inlined <NonNull<T> as PartialEq>::eq) {
+                    let mut _4: std::ptr::NonNull<T>;
+                    let mut _5: *mut T;
+                    let mut _6: *mut T;
+                    scope 8 (inlined NonNull::<T>::as_ptr) {
+                    }
+                    scope 9 (inlined NonNull::<T>::as_ptr) {
+                    }
+                }
+            }
+            scope 5 (inlined std::ptr::mut_ptr::<impl *mut T>::addr) {
+                scope 6 (inlined std::ptr::mut_ptr::<impl *mut T>::cast::<()>) {
+                }
+            }
+        }
+        scope 10 (inlined std::slice::IterMut::<'_, T>::next_back_unchecked) {
+            let mut _15: std::ptr::NonNull<T>;
+            scope 11 (inlined std::slice::IterMut::<'_, T>::pre_dec_end) {
+                let mut _10: *mut *mut T;
+                let mut _11: *mut std::ptr::NonNull<T>;
+                let mut _12: std::ptr::NonNull<T>;
+                let mut _16: *mut *mut T;
+                let mut _17: *mut usize;
+                let mut _18: usize;
+                let mut _19: usize;
+                scope 12 {
+                    scope 13 {
+                    }
+                    scope 14 {
+                        scope 17 (inlined NonNull::<T>::sub) {
+                            scope 18 (inlined #[track_caller] core::num::<impl isize>::unchecked_neg) {
+                                scope 19 (inlined core::ub_checks::check_language_ub) {
+                                    scope 20 (inlined core::ub_checks::check_language_ub::runtime) {
+                                    }
+                                }
+                            }
+                            scope 21 (inlined NonNull::<T>::offset) {
+                                let mut _13: *const T;
+                                let mut _14: *const T;
+                                scope 22 (inlined NonNull::<T>::as_ptr) {
+                                }
+                            }
+                        }
+                    }
+                    scope 15 (inlined std::ptr::mut_ptr::<impl *mut *mut T>::cast::<usize>) {
+                    }
+                    scope 16 (inlined std::ptr::mut_ptr::<impl *mut *mut T>::cast::<NonNull<T>>) {
+                    }
+                }
+            }
+            scope 23 (inlined NonNull::<T>::as_mut::<'_>) {
+                let mut _20: *mut T;
+                scope 24 (inlined NonNull::<T>::as_ptr) {
+                }
+            }
+        }
+    }
 
     bb0: {
-        _0 = <std::slice::IterMut<'_, T> as DoubleEndedIterator>::next_back(move _1) -> [return: bb1, unwind continue];
+        StorageLive(_9);
+        StorageLive(_8);
+        StorageLive(_3);
+        StorageLive(_2);
+        StorageLive(_21);
+        StorageLive(_7);
+        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2];
     }
 
     bb1: {
+        _2 = copy ((*_1).1: *mut T);
+        _3 = copy _2 as std::ptr::NonNull<T> (Transmute);
+        StorageLive(_5);
+        StorageLive(_4);
+        _4 = copy ((*_1).0: std::ptr::NonNull<T>);
+        _5 = copy _4 as *mut T (Transmute);
+        StorageDead(_4);
+        StorageLive(_6);
+        _6 = copy _3 as *mut T (Transmute);
+        _7 = Eq(copy _5, copy _6);
+        StorageDead(_6);
+        StorageDead(_5);
+        goto -> bb3;
+    }
+
+    bb2: {
+        _8 = copy ((*_1).1: *mut T);
+        _9 = copy _8 as usize (Transmute);
+        _7 = Eq(copy _9, const 0_usize);
+        goto -> bb3;
+    }
+
+    bb3: {
+        switchInt(move _7) -> [0: bb4, otherwise: bb10];
+    }
+
+    bb4: {
+        StorageLive(_15);
+        StorageLive(_17);
+        StorageLive(_11);
+        StorageLive(_12);
+        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb5, otherwise: bb8];
+    }
+
+    bb5: {
+        StorageLive(_10);
+        _10 = &raw mut ((*_1).1: *mut T);
+        _11 = copy _10 as *mut std::ptr::NonNull<T> (PtrToPtr);
+        StorageDead(_10);
+        _12 = copy (*_11);
+        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb6, otherwise: bb7];
+    }
+
+    bb6: {
+        StorageLive(_14);
+        StorageLive(_13);
+        _13 = copy _12 as *const T (Transmute);
+        _14 = Offset(copy _13, const -1_isize);
+        StorageDead(_13);
+        _12 = NonNull::<T> { pointer: copy _14 };
+        StorageDead(_14);
+        goto -> bb7;
+    }
+
+    bb7: {
+        (*_11) = move _12;
+        _15 = copy (*_11);
+        goto -> bb9;
+    }
+
+    bb8: {
+        StorageLive(_16);
+        _16 = &raw mut ((*_1).1: *mut T);
+        _17 = copy _16 as *mut usize (PtrToPtr);
+        StorageDead(_16);
+        StorageLive(_19);
+        StorageLive(_18);
+        _18 = copy (*_17);
+        _19 = SubUnchecked(move _18, const 1_usize);
+        StorageDead(_18);
+        (*_17) = move _19;
+        StorageDead(_19);
+        _15 = copy ((*_1).0: std::ptr::NonNull<T>);
+        goto -> bb9;
+    }
+
+    bb9: {
+        StorageDead(_12);
+        StorageDead(_11);
+        StorageDead(_17);
+        StorageLive(_20);
+        _20 = copy _15 as *mut T (Transmute);
+        _21 = &mut (*_20);
+        StorageDead(_20);
+        StorageDead(_15);
+        _0 = Option::<&mut T>::Some(copy _21);
+        goto -> bb11;
+    }
+
+    bb10: {
+        _0 = const {transmute(0x0000000000000000): Option<&mut T>};
+        goto -> bb11;
+    }
+
+    bb11: {
+        StorageDead(_7);
+        StorageDead(_21);
+        StorageDead(_2);
+        StorageDead(_3);
+        StorageDead(_8);
+        StorageDead(_9);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir
index fe4e2deab87..79aa9c5ae1e 100644
--- a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir
@@ -9,7 +9,7 @@ fn outer(_1: u8) -> u8 {
     }
 
     bb0: {
-        _2 = &_1;                        // scope 0 at $DIR/spans.rs:11:11: 11:13
+        // DBG: _2 = &_1;
         _0 = copy _1;                    // scope 1 at $DIR/spans.rs:15:5: 15:7
         return;                          // scope 0 at $DIR/spans.rs:12:2: 12:2
     }
diff --git a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir
index fe4e2deab87..79aa9c5ae1e 100644
--- a/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir
@@ -9,7 +9,7 @@ fn outer(_1: u8) -> u8 {
     }
 
     bb0: {
-        _2 = &_1;                        // scope 0 at $DIR/spans.rs:11:11: 11:13
+        // DBG: _2 = &_1;
         _0 = copy _1;                    // scope 1 at $DIR/spans.rs:15:5: 15:7
         return;                          // scope 0 at $DIR/spans.rs:12:2: 12:2
     }
diff --git a/tests/mir-opt/pre-codegen/tuple_ord.demo_ge_partial.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/tuple_ord.demo_ge_partial.PreCodegen.after.mir
index c4d0e318b58..29bfe962974 100644
--- a/tests/mir-opt/pre-codegen/tuple_ord.demo_ge_partial.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/tuple_ord.demo_ge_partial.PreCodegen.after.mir
@@ -7,7 +7,6 @@ fn demo_ge_partial(_1: &(f32, f32), _2: &(f32, f32)) -> bool {
     scope 1 (inlined std::cmp::impls::<impl PartialOrd for &(f32, f32)>::ge) {
         scope 2 (inlined core::tuple::<impl PartialOrd for (f32, f32)>::ge) {
             let mut _7: std::ops::ControlFlow<bool>;
-            let _8: bool;
             scope 3 {
             }
             scope 4 (inlined std::cmp::impls::<impl PartialOrd for f32>::__chaining_ge) {
@@ -19,8 +18,8 @@ fn demo_ge_partial(_1: &(f32, f32), _2: &(f32, f32)) -> bool {
                 }
             }
             scope 6 (inlined std::cmp::impls::<impl PartialOrd for f32>::ge) {
+                let mut _8: f32;
                 let mut _9: f32;
-                let mut _10: f32;
             }
         }
     }
@@ -44,10 +43,7 @@ fn demo_ge_partial(_1: &(f32, f32), _2: &(f32, f32)) -> bool {
         StorageDead(_5);
         StorageDead(_4);
         StorageDead(_3);
-        StorageLive(_8);
-        _8 = copy ((_7 as Break).0: bool);
-        _0 = copy _8;
-        StorageDead(_8);
+        _0 = copy ((_7 as Break).0: bool);
         goto -> bb3;
     }
 
@@ -55,13 +51,13 @@ fn demo_ge_partial(_1: &(f32, f32), _2: &(f32, f32)) -> bool {
         StorageDead(_5);
         StorageDead(_4);
         StorageDead(_3);
+        StorageLive(_8);
+        _8 = copy ((*_1).1: f32);
         StorageLive(_9);
-        _9 = copy ((*_1).1: f32);
-        StorageLive(_10);
-        _10 = copy ((*_2).1: f32);
-        _0 = Ge(move _9, move _10);
-        StorageDead(_10);
+        _9 = copy ((*_2).1: f32);
+        _0 = Ge(move _8, move _9);
         StorageDead(_9);
+        StorageDead(_8);
         goto -> bb3;
     }
 
diff --git a/tests/mir-opt/pre-codegen/tuple_ord.demo_le_total.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/tuple_ord.demo_le_total.PreCodegen.after.mir
index 44df8b27993..7678c92a1f0 100644
--- a/tests/mir-opt/pre-codegen/tuple_ord.demo_le_total.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/tuple_ord.demo_le_total.PreCodegen.after.mir
@@ -7,7 +7,6 @@ fn demo_le_total(_1: &(u16, i16), _2: &(u16, i16)) -> bool {
     scope 1 (inlined std::cmp::impls::<impl PartialOrd for &(u16, i16)>::le) {
         scope 2 (inlined core::tuple::<impl PartialOrd for (u16, i16)>::le) {
             let mut _7: std::ops::ControlFlow<bool>;
-            let _8: bool;
             scope 3 {
             }
             scope 4 (inlined std::cmp::impls::<impl PartialOrd for u16>::__chaining_le) {
@@ -19,8 +18,8 @@ fn demo_le_total(_1: &(u16, i16), _2: &(u16, i16)) -> bool {
                 }
             }
             scope 6 (inlined std::cmp::impls::<impl PartialOrd for i16>::le) {
+                let mut _8: i16;
                 let mut _9: i16;
-                let mut _10: i16;
             }
         }
     }
@@ -44,10 +43,7 @@ fn demo_le_total(_1: &(u16, i16), _2: &(u16, i16)) -> bool {
         StorageDead(_5);
         StorageDead(_4);
         StorageDead(_3);
-        StorageLive(_8);
-        _8 = copy ((_7 as Break).0: bool);
-        _0 = copy _8;
-        StorageDead(_8);
+        _0 = copy ((_7 as Break).0: bool);
         goto -> bb3;
     }
 
@@ -55,13 +51,13 @@ fn demo_le_total(_1: &(u16, i16), _2: &(u16, i16)) -> bool {
         StorageDead(_5);
         StorageDead(_4);
         StorageDead(_3);
+        StorageLive(_8);
+        _8 = copy ((*_1).1: i16);
         StorageLive(_9);
-        _9 = copy ((*_1).1: i16);
-        StorageLive(_10);
-        _10 = copy ((*_2).1: i16);
-        _0 = Le(move _9, move _10);
-        StorageDead(_10);
+        _9 = copy ((*_2).1: i16);
+        _0 = Le(move _8, move _9);
         StorageDead(_9);
+        StorageDead(_8);
         goto -> bb3;
     }
 
diff --git a/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff b/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff
index 3da795b61f9..375b6096d88 100644
--- a/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff
+++ b/tests/mir-opt/reference_prop.debuginfo.ReferencePropagation.diff
@@ -17,14 +17,15 @@
       let mut _15: std::ops::RangeFull;
       let mut _16: usize;
       let mut _17: usize;
-      let mut _18: bool;
-      let _23: &&mut u8;
-      let _24: &mut u8;
-      let mut _25: debuginfo::T;
+      let mut _18: usize;
+      let mut _19: bool;
+      let _24: &&mut u8;
+      let _25: &mut u8;
+      let mut _26: debuginfo::T;
       scope 1 {
           debug ref_mut_u8 => _1;
           let _3: &u8;
-          let mut _28: &debuginfo::T;
+          let mut _29: &debuginfo::T;
           scope 2 {
               debug field => _3;
               let _5: &u8;
@@ -32,22 +33,22 @@
 -                 debug reborrow => _5;
 +                 debug reborrow => _1;
                   let _9: &i32;
-                  let _22: &&&mut u8;
-                  let mut _27: &std::option::Option<i32>;
+                  let _23: &&&mut u8;
+                  let mut _28: &std::option::Option<i32>;
                   scope 4 {
                       debug variant_field => _9;
                   }
                   scope 5 {
-                      debug constant_index => _19;
-                      debug subslice => _20;
-                      debug constant_index_from_end => _21;
-                      let _19: &i32;
-                      let _20: &[i32];
-                      let _21: &i32;
-                      let mut _26: &[i32; 10];
+                      debug constant_index => _20;
+                      debug subslice => _21;
+                      debug constant_index_from_end => _22;
+                      let _20: &i32;
+                      let _21: &[i32];
+                      let _22: &i32;
+                      let mut _27: &[i32; 10];
                   }
                   scope 6 {
-                      debug multiple_borrow => _22;
+                      debug multiple_borrow => _23;
                   }
               }
           }
@@ -59,8 +60,8 @@
           _2 = const 5_u8;
           _1 = &mut _2;
           StorageLive(_3);
-          _28 = const debuginfo::promoted[2];
-          _3 = &((*_28).0: u8);
+          _29 = const debuginfo::promoted[2];
+          _3 = &((*_29).0: u8);
 -         StorageLive(_5);
 -         _5 = &(*_1);
 -         StorageLive(_6);
@@ -76,8 +77,8 @@
   
       bb2: {
           StorageLive(_9);
-          _27 = const debuginfo::promoted[1];
-          _9 = &(((*_27) as Some).0: i32);
+          _28 = const debuginfo::promoted[1];
+          _9 = &(((*_28) as Some).0: i32);
 -         _6 = const ();
           StorageDead(_9);
           goto -> bb4;
@@ -92,11 +93,11 @@
           StorageDead(_7);
 -         StorageDead(_6);
 -         StorageLive(_10);
--         StorageLive(_11);
+          StorageLive(_11);
 -         StorageLive(_12);
           StorageLive(_13);
-          _26 = const debuginfo::promoted[0];
-          _13 = &(*_26);
+          _27 = const debuginfo::promoted[0];
+          _13 = &(*_27);
           StorageLive(_15);
           _15 = RangeFull;
 -         _12 = <[i32; 10] as Index<RangeFull>>::index(move _13, move _15) -> [return: bb5, unwind continue];
@@ -106,28 +107,28 @@
       bb5: {
           StorageDead(_15);
           StorageDead(_13);
--         _11 = &(*_12);
--         _16 = Len((*_11));
-+         _16 = Len((*_12));
-          _17 = const 3_usize;
-          _18 = Ge(move _16, move _17);
-          switchInt(move _18) -> [0: bb7, otherwise: bb6];
+          _11 = &(*_12);
+          _17 = PtrMetadata(copy _11);
+          _16 = move _17;
+          _18 = const 3_usize;
+          _19 = Ge(move _16, move _18);
+          switchInt(move _19) -> [0: bb7, otherwise: bb6];
       }
   
       bb6: {
-          StorageLive(_19);
--         _19 = &(*_11)[1 of 3];
-+         _19 = &(*_12)[1 of 3];
           StorageLive(_20);
--         _20 = &(*_11)[2:-1];
-+         _20 = &(*_12)[2:-1];
+-         _20 = &(*_11)[1 of 3];
++         _20 = &(*_12)[1 of 3];
           StorageLive(_21);
--         _21 = &(*_11)[-1 of 3];
+-         _21 = &(*_11)[2:-1];
++         _21 = &(*_12)[2:-1];
+          StorageLive(_22);
+-         _22 = &(*_11)[-1 of 3];
 -         _10 = const ();
-+         _21 = &(*_12)[-1 of 3];
++         _22 = &(*_12)[-1 of 3];
+          StorageDead(_22);
           StorageDead(_21);
           StorageDead(_20);
-          StorageDead(_19);
           goto -> bb8;
       }
   
@@ -138,21 +139,21 @@
   
       bb8: {
 -         StorageDead(_12);
--         StorageDead(_11);
+          StorageDead(_11);
 -         StorageDead(_10);
-          StorageLive(_22);
           StorageLive(_23);
           StorageLive(_24);
           StorageLive(_25);
-          _25 = T(const 6_u8);
-          _24 = &mut (_25.0: u8);
+          StorageLive(_26);
+          _26 = T(const 6_u8);
+          _25 = &mut (_26.0: u8);
+          _24 = &_25;
           _23 = &_24;
-          _22 = &_23;
           _0 = const ();
+          StorageDead(_26);
           StorageDead(_25);
           StorageDead(_24);
           StorageDead(_23);
-          StorageDead(_22);
 -         StorageDead(_5);
           StorageDead(_3);
           StorageDead(_2);
diff --git a/tests/run-make-cargo/panic-immediate-abort-codegen/Cargo.toml b/tests/run-make-cargo/panic-immediate-abort-codegen/Cargo.toml
new file mode 100644
index 00000000000..3c61c12a84e
--- /dev/null
+++ b/tests/run-make-cargo/panic-immediate-abort-codegen/Cargo.toml
@@ -0,0 +1,12 @@
+cargo-features = ["profile-rustflags"]
+
+[package]
+name = "panic_scenarios"
+version = "0.1.0"
+edition = "2024"
+
+[lib]
+path = "lib.rs"
+
+[profile.release]
+rustflags = ["-Zmerge-functions=disabled", "-Zcodegen-source-order", "--emit=llvm-ir"]
diff --git a/tests/run-make-cargo/panic-immediate-abort-codegen/lib.rs b/tests/run-make-cargo/panic-immediate-abort-codegen/lib.rs
new file mode 100644
index 00000000000..1e20da93ba8
--- /dev/null
+++ b/tests/run-make-cargo/panic-immediate-abort-codegen/lib.rs
@@ -0,0 +1,65 @@
+#![no_std]
+
+#[unsafe(no_mangle)]
+pub fn panic_noarg() {
+    // CHECK-LABEL: @panic_noarg(
+    // CHECK-NEXT: start:
+    // CHECK-NEXT: tail call void @llvm.trap()
+    panic!();
+}
+
+#[unsafe(no_mangle)]
+pub fn panic_str() {
+    // CHECK-LABEL: @panic_str(
+    // CHECK-NEXT: start:
+    // CHECK-NEXT: tail call void @llvm.trap()
+    panic!("ouch");
+}
+
+#[unsafe(no_mangle)]
+pub fn bounds_check(x: &[u8], idx: usize) -> &u8 {
+    // CHECK-LABEL: @bounds_check(
+    // CHECK-NEXT: start:
+    // CHECK-NEXT: icmp ult
+    // CHECK-NEXT: br i1
+    // CHECK: bb1:
+    // CHECK-NEXT: getelementptr inbounds nuw i8
+    // CHECK-NEXT: ret ptr
+    // CHECK: panic:
+    // CHECK-NEXT: tail call void @llvm.trap()
+    &x[idx]
+}
+
+#[unsafe(no_mangle)]
+pub fn str_bounds_check(x: &str, idx: usize) -> &str {
+    // CHECK-LABEL: @str_bounds_check(
+    // CHECK-NOT: call
+    // CHECK: tail call void @llvm.trap()
+    // CHECK-NOT: call
+    &x[idx..]
+}
+
+#[unsafe(no_mangle)]
+pub fn unsigned_integer_div(x: u16, y: u16) -> u16 {
+    // CHECK-LABEL: @unsigned_integer_div(
+    // CHECK-NEXT: start:
+    // CHECK-NEXT: icmp eq i16
+    // CHECK-NEXT: br i1
+    // CHECK: bb1:
+    // CHECK-NEXT: udiv i16
+    // CHECK-NEXT: ret i16
+    // CHECK: panic:
+    // CHECK-NEXT: tail call void @llvm.trap()
+    x / y
+}
+
+#[unsafe(no_mangle)]
+pub fn refcell_already_borrowed() {
+    // CHECK-LABEL: @refcell_already_borrowed(
+    // CHECK-NOT: call
+    // CHECK: tail call void @llvm.trap()
+    // CHECK-NOT: call
+    let r = core::cell::RefCell::new(0u8);
+    let _guard = r.borrow_mut();
+    r.borrow_mut();
+}
diff --git a/tests/run-make-cargo/panic-immediate-abort-codegen/rmake.rs b/tests/run-make-cargo/panic-immediate-abort-codegen/rmake.rs
new file mode 100644
index 00000000000..d7a7a8bfd8c
--- /dev/null
+++ b/tests/run-make-cargo/panic-immediate-abort-codegen/rmake.rs
@@ -0,0 +1,46 @@
+// This is a codegen test which checks that when code is compiled with panic=immediate-abort,
+// we get a `tail call void @llvm.trap()` in user code instead of a call into the standard
+// library's panic formatting code (such as panic_fmt) or one of the numerous panic outlining shims
+// (such as slice_index_fail).
+
+#![deny(warnings)]
+
+use run_make_support::{cargo, llvm_filecheck, path, rfs, target};
+
+fn main() {
+    let target_dir = path("target");
+
+    cargo()
+        .args(&[
+            "build",
+            "--release",
+            "--lib",
+            "--manifest-path",
+            "Cargo.toml",
+            "-Zbuild-std=core",
+            "--target",
+            &target(),
+        ])
+        .env("RUSTFLAGS", "-Zunstable-options -Cpanic=immediate-abort")
+        .env("CARGO_TARGET_DIR", &target_dir)
+        .env("RUSTC_BOOTSTRAP", "1")
+        // Visual Studio 2022 requires that the LIB env var be set so it can
+        // find the Windows SDK.
+        .env("LIB", std::env::var("LIB").unwrap_or_default())
+        .run();
+
+    let out_dir = target_dir.join(target()).join("release").join("deps");
+    let ir_file = rfs::read_dir(out_dir)
+        .find_map(|e| {
+            let path = e.unwrap().path();
+            let file_name = path.file_name().unwrap().to_str().unwrap();
+            if file_name.starts_with("panic_scenarios") && file_name.ends_with(".ll") {
+                Some(path)
+            } else {
+                None
+            }
+        })
+        .unwrap();
+
+    llvm_filecheck().patterns("lib.rs").input_file(ir_file).run();
+}
diff --git a/tests/run-make-cargo/panic-immediate-abort-works/hello/Cargo.toml b/tests/run-make-cargo/panic-immediate-abort-works/hello/Cargo.toml
new file mode 100644
index 00000000000..1e278d557c0
--- /dev/null
+++ b/tests/run-make-cargo/panic-immediate-abort-works/hello/Cargo.toml
@@ -0,0 +1,4 @@
+[package]
+name = "hello"
+version = "0.1.0"
+edition = "2024"
diff --git a/tests/run-make-cargo/panic-immediate-abort-works/hello/src/main.rs b/tests/run-make-cargo/panic-immediate-abort-works/hello/src/main.rs
new file mode 100644
index 00000000000..f328e4d9d04
--- /dev/null
+++ b/tests/run-make-cargo/panic-immediate-abort-works/hello/src/main.rs
@@ -0,0 +1 @@
+fn main() {}
diff --git a/tests/run-make-cargo/panic-immediate-abort-works/rmake.rs b/tests/run-make-cargo/panic-immediate-abort-works/rmake.rs
new file mode 100644
index 00000000000..3eeef38c962
--- /dev/null
+++ b/tests/run-make-cargo/panic-immediate-abort-works/rmake.rs
@@ -0,0 +1,39 @@
+// This test ensures we are able to compile and link a simple binary with panic=immediate-abort.
+// The test panic-immediate-abort-codegen checks that panic strategy produces the desired codegen,
+// but is based on compiling a library crate (which is the norm for codegen tests because it is
+// cleaner and more portable). So this test ensures that we didn't mix up a cfg or a compiler
+// implementation detail in a way that makes panic=immediate-abort encounter errors at link time.
+
+// Ideally this test would be run for most targets, but unfortunately:
+// This test is currently written using `fn main() {}` which requires std.
+// And since the default linker is only a linker for the host, we can't handle cross-compilation.
+// Both of these shortcomings could be addressed at the cost of making the test more complicated.
+//@ needs-target-std
+//@ ignore-cross-compile
+
+#![deny(warnings)]
+
+use run_make_support::{cargo, path, target};
+
+fn main() {
+    let target_dir = path("target");
+
+    cargo()
+        .current_dir("hello")
+        .args(&[
+            "build",
+            "--release",
+            "--manifest-path",
+            "Cargo.toml",
+            "-Zbuild-std",
+            "--target",
+            &target(),
+        ])
+        .env("RUSTFLAGS", "-Zunstable-options -Cpanic=immediate-abort")
+        .env("CARGO_TARGET_DIR", &target_dir)
+        .env("RUSTC_BOOTSTRAP", "1")
+        // Visual Studio 2022 requires that the LIB env var be set so it can
+        // find the Windows SDK.
+        .env("LIB", std::env::var("LIB").unwrap_or_default())
+        .run();
+}
diff --git a/tests/run-make/autodiff/type-trees/array-typetree/array.check b/tests/run-make/autodiff/type-trees/array-typetree/array.check
new file mode 100644
index 00000000000..0d38bdec17e
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/array-typetree/array.check
@@ -0,0 +1,4 @@
+; Check that array TypeTree metadata is correctly generated  
+; Should show Float@double at each array element offset (0, 8, 16, 24, 32 bytes)
+
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@double}"{{.*}}@test_array{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,-1]:Float@double}"
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/array-typetree/rmake.rs b/tests/run-make/autodiff/type-trees/array-typetree/rmake.rs
new file mode 100644
index 00000000000..20b6a066906
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/array-typetree/rmake.rs
@@ -0,0 +1,9 @@
+//@ needs-enzyme
+//@ ignore-cross-compile
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    rustc().input("test.rs").arg("-Zautodiff=Enable").emit("llvm-ir").run();
+    llvm_filecheck().patterns("array.check").stdin_buf(rfs::read("test.ll")).run();
+}
diff --git a/tests/run-make/autodiff/type-trees/array-typetree/test.rs b/tests/run-make/autodiff/type-trees/array-typetree/test.rs
new file mode 100644
index 00000000000..f54ebf5a4c7
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/array-typetree/test.rs
@@ -0,0 +1,15 @@
+#![feature(autodiff)]
+
+use std::autodiff::autodiff_reverse;
+
+#[autodiff_reverse(d_test, Duplicated, Active)]
+#[no_mangle]
+fn test_array(arr: &[f64; 5]) -> f64 {
+    arr[0] + arr[1] + arr[2] + arr[3] + arr[4]
+}
+
+fn main() {
+    let arr = [1.0, 2.0, 3.0, 4.0, 5.0];
+    let mut d_arr = [0.0; 5];
+    let _result = d_test(&arr, &mut d_arr, 1.0);
+}
diff --git a/tests/run-make/autodiff/type-trees/memcpy-typetree/memcpy-ir.check b/tests/run-make/autodiff/type-trees/memcpy-typetree/memcpy-ir.check
new file mode 100644
index 00000000000..0e6351ac4d3
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/memcpy-typetree/memcpy-ir.check
@@ -0,0 +1,8 @@
+; Check that enzyme_type attributes are present in the LLVM IR function definition
+; This verifies our TypeTree system correctly attaches metadata for Enzyme
+
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@double}"{{.*}}@test_memcpy({{.*}}"enzyme_type"="{[-1]:Pointer, [-1,-1]:Float@double}"
+
+; Check that llvm.memcpy exists (either call or declare)
+CHECK: {{(call|declare).*}}@llvm.memcpy
+
diff --git a/tests/run-make/autodiff/type-trees/memcpy-typetree/memcpy.check b/tests/run-make/autodiff/type-trees/memcpy-typetree/memcpy.check
new file mode 100644
index 00000000000..ae70830297a
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/memcpy-typetree/memcpy.check
@@ -0,0 +1,13 @@
+CHECK: force_memcpy
+
+CHECK: @llvm.memcpy.p0.p0.i64
+
+CHECK: test_memcpy - {[-1]:Float@double} |{[-1]:Pointer}:{}
+
+CHECK-DAG: ptr %{{[0-9]+}}: {[-1]:Pointer, [-1,0]:Float@double, [-1,8]:Float@double, [-1,16]:Float@double, [-1,24]:Float@double}
+
+CHECK-DAG: load double{{.*}}: {[-1]:Float@double}
+
+CHECK-DAG: fmul double{{.*}}: {[-1]:Float@double}
+
+CHECK-DAG: fadd double{{.*}}: {[-1]:Float@double}
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/memcpy-typetree/memcpy.rs b/tests/run-make/autodiff/type-trees/memcpy-typetree/memcpy.rs
new file mode 100644
index 00000000000..3c1029190c8
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/memcpy-typetree/memcpy.rs
@@ -0,0 +1,36 @@
+#![feature(autodiff)]
+
+use std::autodiff::autodiff_reverse;
+use std::ptr;
+
+#[inline(never)]
+fn force_memcpy(src: *const f64, dst: *mut f64, count: usize) {
+    unsafe {
+        ptr::copy_nonoverlapping(src, dst, count);
+    }
+}
+
+#[autodiff_reverse(d_test_memcpy, Duplicated, Active)]
+#[no_mangle]
+fn test_memcpy(input: &[f64; 128]) -> f64 {
+    let mut local_data = [0.0f64; 128];
+
+    // Use a separate function to prevent inlining and optimization
+    force_memcpy(input.as_ptr(), local_data.as_mut_ptr(), 128);
+
+    // Sum only first few elements to keep the computation simple
+    local_data[0] * local_data[0]
+        + local_data[1] * local_data[1]
+        + local_data[2] * local_data[2]
+        + local_data[3] * local_data[3]
+}
+
+fn main() {
+    let input = [1.0; 128];
+    let mut d_input = [0.0; 128];
+    let result = test_memcpy(&input);
+    let result_d = d_test_memcpy(&input, &mut d_input, 1.0);
+
+    assert_eq!(result, result_d);
+    println!("Memcpy test passed: result = {}", result);
+}
diff --git a/tests/run-make/autodiff/type-trees/memcpy-typetree/rmake.rs b/tests/run-make/autodiff/type-trees/memcpy-typetree/rmake.rs
new file mode 100644
index 00000000000..b4c650330fe
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/memcpy-typetree/rmake.rs
@@ -0,0 +1,39 @@
+//@ needs-enzyme
+//@ ignore-cross-compile
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    // First, compile to LLVM IR to check for enzyme_type attributes
+    let _ir_output = rustc()
+        .input("memcpy.rs")
+        .arg("-Zautodiff=Enable")
+        .arg("-Zautodiff=NoPostopt")
+        .opt_level("0")
+        .arg("--emit=llvm-ir")
+        .arg("-o")
+        .arg("main.ll")
+        .run();
+
+    // Then compile with TypeTree analysis output for the existing checks
+    let output = rustc()
+        .input("memcpy.rs")
+        .arg("-Zautodiff=Enable,PrintTAFn=test_memcpy")
+        .arg("-Zautodiff=NoPostopt")
+        .opt_level("3")
+        .arg("-Clto=fat")
+        .arg("-g")
+        .run();
+
+    let stdout = output.stdout_utf8();
+    let stderr = output.stderr_utf8();
+    let ir_content = rfs::read_to_string("main.ll");
+
+    rfs::write("memcpy.stdout", &stdout);
+    rfs::write("memcpy.stderr", &stderr);
+    rfs::write("main.ir", &ir_content);
+
+    llvm_filecheck().patterns("memcpy.check").stdin_buf(stdout).run();
+
+    llvm_filecheck().patterns("memcpy-ir.check").stdin_buf(ir_content).run();
+}
diff --git a/tests/run-make/autodiff/type-trees/mixed-struct-typetree/mixed.check b/tests/run-make/autodiff/type-trees/mixed-struct-typetree/mixed.check
new file mode 100644
index 00000000000..584f5840843
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/mixed-struct-typetree/mixed.check
@@ -0,0 +1,2 @@
+; Check that mixed struct with large array generates correct detailed type tree
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@float}"{{.*}}@test_mixed_struct{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,0]:Integer, [-1,8]:Float@float}"
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/mixed-struct-typetree/rmake.rs b/tests/run-make/autodiff/type-trees/mixed-struct-typetree/rmake.rs
new file mode 100644
index 00000000000..1c19963bc36
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/mixed-struct-typetree/rmake.rs
@@ -0,0 +1,16 @@
+//@ needs-enzyme
+//@ ignore-cross-compile
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    rustc()
+        .input("test.rs")
+        .arg("-Zautodiff=Enable")
+        .arg("-Zautodiff=NoPostopt")
+        .opt_level("0")
+        .emit("llvm-ir")
+        .run();
+
+    llvm_filecheck().patterns("mixed.check").stdin_buf(rfs::read("test.ll")).run();
+}
diff --git a/tests/run-make/autodiff/type-trees/mixed-struct-typetree/test.rs b/tests/run-make/autodiff/type-trees/mixed-struct-typetree/test.rs
new file mode 100644
index 00000000000..7a734980e61
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/mixed-struct-typetree/test.rs
@@ -0,0 +1,23 @@
+#![feature(autodiff)]
+
+use std::autodiff::autodiff_reverse;
+
+#[repr(C)]
+struct Container {
+    header: i64,
+    data: [f32; 1000],
+}
+
+#[autodiff_reverse(d_test, Duplicated, Active)]
+#[no_mangle]
+#[inline(never)]
+fn test_mixed_struct(container: &Container) -> f32 {
+    container.data[0] + container.data[999]
+}
+
+fn main() {
+    let container = Container { header: 42, data: [1.0; 1000] };
+    let mut d_container = Container { header: 0, data: [0.0; 1000] };
+    let result = d_test(&container, &mut d_container, 1.0);
+    std::hint::black_box(result);
+}
diff --git a/tests/run-make/autodiff/type-trees/nott-flag/nott.check b/tests/run-make/autodiff/type-trees/nott-flag/nott.check
new file mode 100644
index 00000000000..8d23e2ee319
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/nott-flag/nott.check
@@ -0,0 +1,5 @@
+// Check that enzyme_type attributes are NOT present when NoTT flag is used
+// This verifies the NoTT flag correctly disables TypeTree metadata
+
+CHECK: define{{.*}}@square
+CHECK-NOT: "enzyme_type"
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/nott-flag/rmake.rs b/tests/run-make/autodiff/type-trees/nott-flag/rmake.rs
new file mode 100644
index 00000000000..de540b990ca
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/nott-flag/rmake.rs
@@ -0,0 +1,30 @@
+//@ needs-enzyme
+//@ ignore-cross-compile
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    // Test with NoTT flag - should not generate TypeTree metadata
+    rustc()
+        .input("test.rs")
+        .arg("-Zautodiff=Enable,NoTT")
+        .emit("llvm-ir")
+        .arg("-o")
+        .arg("nott.ll")
+        .run();
+
+    // Test without NoTT flag - should generate TypeTree metadata
+    rustc()
+        .input("test.rs")
+        .arg("-Zautodiff=Enable")
+        .emit("llvm-ir")
+        .arg("-o")
+        .arg("with_tt.ll")
+        .run();
+
+    // Verify NoTT version does NOT have enzyme_type attributes
+    llvm_filecheck().patterns("nott.check").stdin_buf(rfs::read("nott.ll")).run();
+
+    // Verify TypeTree version DOES have enzyme_type attributes
+    llvm_filecheck().patterns("with_tt.check").stdin_buf(rfs::read("with_tt.ll")).run();
+}
diff --git a/tests/run-make/autodiff/type-trees/nott-flag/test.rs b/tests/run-make/autodiff/type-trees/nott-flag/test.rs
new file mode 100644
index 00000000000..de3549c37c6
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/nott-flag/test.rs
@@ -0,0 +1,15 @@
+#![feature(autodiff)]
+
+use std::autodiff::autodiff_reverse;
+
+#[autodiff_reverse(d_square, Duplicated, Active)]
+#[no_mangle]
+fn square(x: &f64) -> f64 {
+    x * x
+}
+
+fn main() {
+    let x = 2.0;
+    let mut dx = 0.0;
+    let _result = d_square(&x, &mut dx, 1.0);
+}
diff --git a/tests/run-make/autodiff/type-trees/nott-flag/with_tt.check b/tests/run-make/autodiff/type-trees/nott-flag/with_tt.check
new file mode 100644
index 00000000000..0b4c9119179
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/nott-flag/with_tt.check
@@ -0,0 +1,4 @@
+// Check that enzyme_type attributes are present when TypeTree is enabled
+// This verifies our TypeTree metadata attachment is working
+
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@double}"{{.*}}@square{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,0]:Float@double}"
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/recursion-typetree/recursion.check b/tests/run-make/autodiff/type-trees/recursion-typetree/recursion.check
new file mode 100644
index 00000000000..1960e7b816c
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/recursion-typetree/recursion.check
@@ -0,0 +1,3 @@
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@double}"{{.*}}@test_deep{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,0]:Float@double}"
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@double}"{{.*}}@test_graph{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,0]:Integer, [-1,8]:Integer, [-1,16]:Integer, [-1,24]:Float@double}"
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@double}"{{.*}}@test_node{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,0]:Float@double}"
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/recursion-typetree/rmake.rs b/tests/run-make/autodiff/type-trees/recursion-typetree/rmake.rs
new file mode 100644
index 00000000000..78718f3a215
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/recursion-typetree/rmake.rs
@@ -0,0 +1,9 @@
+//@ needs-enzyme
+//@ ignore-cross-compile
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    rustc().input("test.rs").arg("-Zautodiff=Enable").emit("llvm-ir").run();
+    llvm_filecheck().patterns("recursion.check").stdin_buf(rfs::read("test.ll")).run();
+}
diff --git a/tests/run-make/autodiff/type-trees/recursion-typetree/test.rs b/tests/run-make/autodiff/type-trees/recursion-typetree/test.rs
new file mode 100644
index 00000000000..9d40bec1bf1
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/recursion-typetree/test.rs
@@ -0,0 +1,100 @@
+#![feature(autodiff)]
+
+use std::autodiff::autodiff_reverse;
+
+// Self-referential struct to test recursion detection
+#[derive(Clone)]
+struct Node {
+    value: f64,
+    next: Option<Box<Node>>,
+}
+
+// Mutually recursive structs to test cycle detection
+#[derive(Clone)]
+struct GraphNodeA {
+    value: f64,
+    connections: Vec<GraphNodeB>,
+}
+
+#[derive(Clone)]
+struct GraphNodeB {
+    weight: f64,
+    target: Option<Box<GraphNodeA>>,
+}
+
+#[autodiff_reverse(d_test_node, Duplicated, Active)]
+#[no_mangle]
+fn test_node(node: &Node) -> f64 {
+    node.value * 2.0
+}
+
+#[autodiff_reverse(d_test_graph, Duplicated, Active)]
+#[no_mangle]
+fn test_graph(a: &GraphNodeA) -> f64 {
+    a.value * 3.0
+}
+
+// Simple depth test - deeply nested but not circular
+#[derive(Clone)]
+struct Level1 {
+    val: f64,
+    next: Option<Box<Level2>>,
+}
+#[derive(Clone)]
+struct Level2 {
+    val: f64,
+    next: Option<Box<Level3>>,
+}
+#[derive(Clone)]
+struct Level3 {
+    val: f64,
+    next: Option<Box<Level4>>,
+}
+#[derive(Clone)]
+struct Level4 {
+    val: f64,
+    next: Option<Box<Level5>>,
+}
+#[derive(Clone)]
+struct Level5 {
+    val: f64,
+    next: Option<Box<Level6>>,
+}
+#[derive(Clone)]
+struct Level6 {
+    val: f64,
+    next: Option<Box<Level7>>,
+}
+#[derive(Clone)]
+struct Level7 {
+    val: f64,
+    next: Option<Box<Level8>>,
+}
+#[derive(Clone)]
+struct Level8 {
+    val: f64,
+}
+
+#[autodiff_reverse(d_test_deep, Duplicated, Active)]
+#[no_mangle]
+fn test_deep(deep: &Level1) -> f64 {
+    deep.val * 4.0
+}
+
+fn main() {
+    let node = Node { value: 1.0, next: None };
+
+    let graph = GraphNodeA { value: 2.0, connections: vec![] };
+
+    let deep = Level1 { val: 5.0, next: None };
+
+    let mut d_node = Node { value: 0.0, next: None };
+
+    let mut d_graph = GraphNodeA { value: 0.0, connections: vec![] };
+
+    let mut d_deep = Level1 { val: 0.0, next: None };
+
+    let _result1 = d_test_node(&node, &mut d_node, 1.0);
+    let _result2 = d_test_graph(&graph, &mut d_graph, 1.0);
+    let _result3 = d_test_deep(&deep, &mut d_deep, 1.0);
+}
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/f128-typetree/f128.check b/tests/run-make/autodiff/type-trees/scalar-types/f128-typetree/f128.check
new file mode 100644
index 00000000000..23db64eea52
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/f128-typetree/f128.check
@@ -0,0 +1,4 @@
+; Check that f128 TypeTree metadata is correctly generated
+; Should show Float@fp128 for f128 values and Pointer for references
+
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@fp128}"{{.*}}@test_f128{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,0]:Float@fp128}"
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/f128-typetree/rmake.rs b/tests/run-make/autodiff/type-trees/scalar-types/f128-typetree/rmake.rs
new file mode 100644
index 00000000000..44320ecdd57
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/f128-typetree/rmake.rs
@@ -0,0 +1,12 @@
+//@ needs-enzyme
+//@ ignore-cross-compile
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    // Compile with TypeTree enabled and emit LLVM IR
+    rustc().input("test.rs").arg("-Zautodiff=Enable").emit("llvm-ir").run();
+
+    // Check that f128 TypeTree metadata is correctly generated
+    llvm_filecheck().patterns("f128.check").stdin_buf(rfs::read("test.ll")).run();
+}
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/f128-typetree/test.rs b/tests/run-make/autodiff/type-trees/scalar-types/f128-typetree/test.rs
new file mode 100644
index 00000000000..5c71baa3e69
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/f128-typetree/test.rs
@@ -0,0 +1,15 @@
+#![feature(autodiff, f128)]
+
+use std::autodiff::autodiff_reverse;
+
+#[autodiff_reverse(d_test, Duplicated, Active)]
+#[no_mangle]
+fn test_f128(x: &f128) -> f128 {
+    *x * *x
+}
+
+fn main() {
+    let x = 2.0_f128;
+    let mut dx = 0.0_f128;
+    let _result = d_test(&x, &mut dx, 1.0);
+}
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/f16-typetree/f16.check b/tests/run-make/autodiff/type-trees/scalar-types/f16-typetree/f16.check
new file mode 100644
index 00000000000..9adff68d36f
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/f16-typetree/f16.check
@@ -0,0 +1,4 @@
+; Check that f16 TypeTree metadata is correctly generated
+; Should show Float@half for f16 values and Pointer for references
+
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@half}"{{.*}}@test_f16{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,0]:Float@half}"
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/f16-typetree/rmake.rs b/tests/run-make/autodiff/type-trees/scalar-types/f16-typetree/rmake.rs
new file mode 100644
index 00000000000..0aebdbf5520
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/f16-typetree/rmake.rs
@@ -0,0 +1,12 @@
+//@ needs-enzyme
+//@ ignore-cross-compile
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    // Compile with TypeTree enabled and emit LLVM IR
+    rustc().input("test.rs").arg("-Zautodiff=Enable").emit("llvm-ir").run();
+
+    // Check that f16 TypeTree metadata is correctly generated
+    llvm_filecheck().patterns("f16.check").stdin_buf(rfs::read("test.ll")).run();
+}
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/f16-typetree/test.rs b/tests/run-make/autodiff/type-trees/scalar-types/f16-typetree/test.rs
new file mode 100644
index 00000000000..6b68e8252f4
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/f16-typetree/test.rs
@@ -0,0 +1,15 @@
+#![feature(autodiff, f16)]
+
+use std::autodiff::autodiff_reverse;
+
+#[autodiff_reverse(d_test, Duplicated, Active)]
+#[no_mangle]
+fn test_f16(x: &f16) -> f16 {
+    *x * *x
+}
+
+fn main() {
+    let x = 2.0_f16;
+    let mut dx = 0.0_f16;
+    let _result = d_test(&x, &mut dx, 1.0);
+}
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/f32-typetree/f32.check b/tests/run-make/autodiff/type-trees/scalar-types/f32-typetree/f32.check
new file mode 100644
index 00000000000..176630f57e8
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/f32-typetree/f32.check
@@ -0,0 +1,4 @@
+; Check that f32 TypeTree metadata is correctly generated
+; Should show Float@float for f32 values and Pointer for references
+
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@float}"{{.*}}@test_f32{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,0]:Float@float}"
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/f32-typetree/rmake.rs b/tests/run-make/autodiff/type-trees/scalar-types/f32-typetree/rmake.rs
new file mode 100644
index 00000000000..ee3ab753bf5
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/f32-typetree/rmake.rs
@@ -0,0 +1,12 @@
+//@ needs-enzyme
+//@ ignore-cross-compile
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    // Compile with TypeTree enabled and emit LLVM IR
+    rustc().input("test.rs").arg("-Zautodiff=Enable").emit("llvm-ir").run();
+
+    // Check that f32 TypeTree metadata is correctly generated
+    llvm_filecheck().patterns("f32.check").stdin_buf(rfs::read("test.ll")).run();
+}
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/f32-typetree/test.rs b/tests/run-make/autodiff/type-trees/scalar-types/f32-typetree/test.rs
new file mode 100644
index 00000000000..56c118399ee
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/f32-typetree/test.rs
@@ -0,0 +1,15 @@
+#![feature(autodiff)]
+
+use std::autodiff::autodiff_reverse;
+
+#[autodiff_reverse(d_test, Duplicated, Active)]
+#[no_mangle]
+fn test_f32(x: &f32) -> f32 {
+    x * x
+}
+
+fn main() {
+    let x = 2.0_f32;
+    let mut dx = 0.0_f32;
+    let _result = d_test(&x, &mut dx, 1.0);
+}
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/f64-typetree/f64.check b/tests/run-make/autodiff/type-trees/scalar-types/f64-typetree/f64.check
new file mode 100644
index 00000000000..929cd379694
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/f64-typetree/f64.check
@@ -0,0 +1,4 @@
+; Check that f64 TypeTree metadata is correctly generated  
+; Should show Float@double for f64 values and Pointer for references
+
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@double}"{{.*}}@test_f64{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,0]:Float@double}"
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/f64-typetree/rmake.rs b/tests/run-make/autodiff/type-trees/scalar-types/f64-typetree/rmake.rs
new file mode 100644
index 00000000000..5fac9b23bc8
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/f64-typetree/rmake.rs
@@ -0,0 +1,12 @@
+//@ needs-enzyme
+//@ ignore-cross-compile
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    // Compile with TypeTree enabled and emit LLVM IR
+    rustc().input("test.rs").arg("-Zautodiff=Enable").emit("llvm-ir").run();
+
+    // Check that f64 TypeTree metadata is correctly generated
+    llvm_filecheck().patterns("f64.check").stdin_buf(rfs::read("test.ll")).run();
+}
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/f64-typetree/test.rs b/tests/run-make/autodiff/type-trees/scalar-types/f64-typetree/test.rs
new file mode 100644
index 00000000000..235360b76b2
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/f64-typetree/test.rs
@@ -0,0 +1,15 @@
+#![feature(autodiff)]
+
+use std::autodiff::autodiff_reverse;
+
+#[autodiff_reverse(d_test, Duplicated, Active)]
+#[no_mangle]
+fn test_f64(x: &f64) -> f64 {
+    x * x
+}
+
+fn main() {
+    let x = 2.0_f64;
+    let mut dx = 0.0_f64;
+    let _result = d_test(&x, &mut dx, 1.0);
+}
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/i32-typetree/i32.check b/tests/run-make/autodiff/type-trees/scalar-types/i32-typetree/i32.check
new file mode 100644
index 00000000000..dee4aa5bbb6
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/i32-typetree/i32.check
@@ -0,0 +1,4 @@
+; Check that i32 TypeTree metadata is correctly generated
+; Should show Integer for i32 values and Pointer for references
+
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Integer}"{{.*}}@test_i32{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,0]:Integer}"
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/i32-typetree/rmake.rs b/tests/run-make/autodiff/type-trees/scalar-types/i32-typetree/rmake.rs
new file mode 100644
index 00000000000..a40fd55d88a
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/i32-typetree/rmake.rs
@@ -0,0 +1,12 @@
+//@ needs-enzyme
+//@ ignore-cross-compile
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    // Compile with TypeTree enabled and emit LLVM IR
+    rustc().input("test.rs").arg("-Zautodiff=Enable").emit("llvm-ir").run();
+
+    // Check that i32 TypeTree metadata is correctly generated
+    llvm_filecheck().patterns("i32.check").stdin_buf(rfs::read("test.ll")).run();
+}
diff --git a/tests/run-make/autodiff/type-trees/scalar-types/i32-typetree/test.rs b/tests/run-make/autodiff/type-trees/scalar-types/i32-typetree/test.rs
new file mode 100644
index 00000000000..249803c5d9f
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/scalar-types/i32-typetree/test.rs
@@ -0,0 +1,15 @@
+#![feature(autodiff)]
+
+use std::autodiff::autodiff_reverse;
+
+#[autodiff_reverse(d_test, Duplicated, Active)]
+#[no_mangle]
+fn test_i32(x: &i32) -> i32 {
+    x * x
+}
+
+fn main() {
+    let x = 5_i32;
+    let mut dx = 0_i32;
+    let _result = d_test(&x, &mut dx, 1);
+}
diff --git a/tests/run-make/autodiff/type-trees/slice-typetree/rmake.rs b/tests/run-make/autodiff/type-trees/slice-typetree/rmake.rs
new file mode 100644
index 00000000000..b81fb50bf1a
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/slice-typetree/rmake.rs
@@ -0,0 +1,9 @@
+//@ needs-enzyme
+//@ ignore-cross-compile
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    rustc().input("test.rs").arg("-Zautodiff=Enable").emit("llvm-ir").run();
+    llvm_filecheck().patterns("slice.check").stdin_buf(rfs::read("test.ll")).run();
+}
diff --git a/tests/run-make/autodiff/type-trees/slice-typetree/slice.check b/tests/run-make/autodiff/type-trees/slice-typetree/slice.check
new file mode 100644
index 00000000000..6543b616115
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/slice-typetree/slice.check
@@ -0,0 +1,4 @@
+; Check that slice TypeTree metadata is correctly generated
+; Should show Float@double for slice elements
+
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@double}"{{.*}}@test_slice{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,-1]:Float@double}"
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/slice-typetree/test.rs b/tests/run-make/autodiff/type-trees/slice-typetree/test.rs
new file mode 100644
index 00000000000..7117fa3844f
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/slice-typetree/test.rs
@@ -0,0 +1,16 @@
+#![feature(autodiff)]
+
+use std::autodiff::autodiff_reverse;
+
+#[autodiff_reverse(d_test, Duplicated, Active)]
+#[no_mangle]
+fn test_slice(slice: &[f64]) -> f64 {
+    slice.iter().sum()
+}
+
+fn main() {
+    let arr = [1.0, 2.0, 3.0, 4.0, 5.0];
+    let slice = &arr[..];
+    let mut d_slice = [0.0; 5];
+    let _result = d_test(slice, &mut d_slice[..], 1.0);
+}
diff --git a/tests/run-make/autodiff/type-trees/struct-typetree/rmake.rs b/tests/run-make/autodiff/type-trees/struct-typetree/rmake.rs
new file mode 100644
index 00000000000..0af1b65ee18
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/struct-typetree/rmake.rs
@@ -0,0 +1,9 @@
+//@ needs-enzyme
+//@ ignore-cross-compile
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    rustc().input("test.rs").arg("-Zautodiff=Enable").emit("llvm-ir").run();
+    llvm_filecheck().patterns("struct.check").stdin_buf(rfs::read("test.ll")).run();
+}
diff --git a/tests/run-make/autodiff/type-trees/struct-typetree/struct.check b/tests/run-make/autodiff/type-trees/struct-typetree/struct.check
new file mode 100644
index 00000000000..54956317e1e
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/struct-typetree/struct.check
@@ -0,0 +1,4 @@
+; Check that struct TypeTree metadata is correctly generated
+; Should show Float@double at offsets 0, 8, 16 for Point struct fields
+
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@double}"{{.*}}@test_struct{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,0]:Float@double, [-1,8]:Float@double, [-1,16]:Float@double}"
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/struct-typetree/test.rs b/tests/run-make/autodiff/type-trees/struct-typetree/test.rs
new file mode 100644
index 00000000000..cbe7b10e409
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/struct-typetree/test.rs
@@ -0,0 +1,22 @@
+#![feature(autodiff)]
+
+use std::autodiff::autodiff_reverse;
+
+#[repr(C)]
+struct Point {
+    x: f64,
+    y: f64,
+    z: f64,
+}
+
+#[autodiff_reverse(d_test, Duplicated, Active)]
+#[no_mangle]
+fn test_struct(point: &Point) -> f64 {
+    point.x + point.y * 2.0 + point.z * 3.0
+}
+
+fn main() {
+    let point = Point { x: 1.0, y: 2.0, z: 3.0 };
+    let mut d_point = Point { x: 0.0, y: 0.0, z: 0.0 };
+    let _result = d_test(&point, &mut d_point, 1.0);
+}
diff --git a/tests/run-make/autodiff/type-trees/tuple-typetree/rmake.rs b/tests/run-make/autodiff/type-trees/tuple-typetree/rmake.rs
new file mode 100644
index 00000000000..76913828901
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/tuple-typetree/rmake.rs
@@ -0,0 +1,9 @@
+//@ needs-enzyme
+//@ ignore-cross-compile
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    rustc().input("test.rs").arg("-Zautodiff=Enable").emit("llvm-ir").run();
+    llvm_filecheck().patterns("tuple.check").stdin_buf(rfs::read("test.ll")).run();
+}
diff --git a/tests/run-make/autodiff/type-trees/tuple-typetree/test.rs b/tests/run-make/autodiff/type-trees/tuple-typetree/test.rs
new file mode 100644
index 00000000000..32187b587a3
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/tuple-typetree/test.rs
@@ -0,0 +1,15 @@
+#![feature(autodiff)]
+
+use std::autodiff::autodiff_reverse;
+
+#[autodiff_reverse(d_test, Duplicated, Active)]
+#[no_mangle]
+fn test_tuple(tuple: &(f64, f64, f64)) -> f64 {
+    tuple.0 + tuple.1 * 2.0 + tuple.2 * 3.0
+}
+
+fn main() {
+    let tuple = (1.0, 2.0, 3.0);
+    let mut d_tuple = (0.0, 0.0, 0.0);
+    let _result = d_test(&tuple, &mut d_tuple, 1.0);
+}
diff --git a/tests/run-make/autodiff/type-trees/tuple-typetree/tuple.check b/tests/run-make/autodiff/type-trees/tuple-typetree/tuple.check
new file mode 100644
index 00000000000..47647e78cc3
--- /dev/null
+++ b/tests/run-make/autodiff/type-trees/tuple-typetree/tuple.check
@@ -0,0 +1,4 @@
+; Check that tuple TypeTree metadata is correctly generated
+; Should show Float@double at offsets 0, 8, 16 for (f64, f64, f64)
+
+CHECK: define{{.*}}"enzyme_type"="{[-1]:Float@double}"{{.*}}@test_tuple{{.*}}"enzyme_type"="{[-1]:Pointer, [-1,0]:Float@double, [-1,8]:Float@double, [-1,16]:Float@double}"
\ No newline at end of file
diff --git a/tests/run-make/autodiff/type-trees/type-analysis/vec/vec.check b/tests/run-make/autodiff/type-trees/type-analysis/vec/vec.check
index dcf9508b69d..cdb70eb83fc 100644
--- a/tests/run-make/autodiff/type-trees/type-analysis/vec/vec.check
+++ b/tests/run-make/autodiff/type-trees/type-analysis/vec/vec.check
@@ -1,7 +1,7 @@
 // CHECK: callee - {[-1]:Float@float} |{[-1]:Pointer}:{}
 // CHECK: ptr %{{[0-9]+}}: {[-1]:Pointer}
 // CHECK-DAG: %{{[0-9]+}} = getelementptr inbounds nuw i8, ptr %{{[0-9]+}}, i64 8, !dbg !{{[0-9]+}}: {[-1]:Pointer}
-// CHECK-DAG: %{{[0-9]+}} = load ptr, ptr %{{[0-9]+}}, align 8, !dbg !{{[0-9]+}}, !nonnull !102, !noundef !{{[0-9]+}}: {}
+// CHECK-DAG: %{{[0-9]+}} = load ptr, ptr %{{[0-9]+}}, align 8, !dbg !{{[0-9]+}}, !nonnull !{{[0-9]+}}, !noundef !{{[0-9]+}}: {}
 // CHECK-DAG: %{{[0-9]+}} = getelementptr inbounds nuw i8, ptr %{{[0-9]+}}, i64 16, !dbg !{{[0-9]+}}: {[-1]:Pointer}
 // CHECK-DAG: %{{[0-9]+}} = load i64, ptr %{{[0-9]+}}, align 8, !dbg !{{[0-9]+}}, !noundef !{{[0-9]+}}: {}
 // CHECK-DAG: %{{[0-9]+}} = icmp eq i64 %{{[0-9]+}}, 0, !dbg !{{[0-9]+}}: {[-1]:Integer}
diff --git a/tests/run-make/crate-loading/multiple-dep-versions-3.rs b/tests/run-make/crate-loading/dep-2-reexport.rs
index 07444511472..07444511472 100644
--- a/tests/run-make/crate-loading/multiple-dep-versions-3.rs
+++ b/tests/run-make/crate-loading/dep-2-reexport.rs
diff --git a/tests/run-make/crate-loading/multiple-dep-versions-1.rs b/tests/run-make/crate-loading/dependency-1.rs
index bfeabccf5c1..bfeabccf5c1 100644
--- a/tests/run-make/crate-loading/multiple-dep-versions-1.rs
+++ b/tests/run-make/crate-loading/dependency-1.rs
diff --git a/tests/run-make/crate-loading/multiple-dep-versions-2.rs b/tests/run-make/crate-loading/dependency-2.rs
index 682d1ff64b8..682d1ff64b8 100644
--- a/tests/run-make/crate-loading/multiple-dep-versions-2.rs
+++ b/tests/run-make/crate-loading/dependency-2.rs
diff --git a/tests/run-make/crate-loading/rmake.rs b/tests/run-make/crate-loading/rmake.rs
index 6ad456e3e3e..8f257786123 100644
--- a/tests/run-make/crate-loading/rmake.rs
+++ b/tests/run-make/crate-loading/rmake.rs
@@ -6,12 +6,9 @@
 use run_make_support::{diff, rust_lib_name, rustc};
 
 fn main() {
-    rustc().input("multiple-dep-versions-1.rs").run();
-    rustc().input("multiple-dep-versions-2.rs").extra_filename("2").metadata("2").run();
-    rustc()
-        .input("multiple-dep-versions-3.rs")
-        .extern_("dependency", rust_lib_name("dependency2"))
-        .run();
+    rustc().input("dependency-1.rs").run();
+    rustc().input("dependency-2.rs").extra_filename("2").metadata("2").run();
+    rustc().input("dep-2-reexport.rs").extern_("dependency", rust_lib_name("dependency2")).run();
 
     let out = rustc()
         .input("multiple-dep-versions.rs")
diff --git a/tests/run-make/doctests-compilation-time-info/rmake.rs b/tests/run-make/doctests-compilation-time-info/rmake.rs
new file mode 100644
index 00000000000..2bcf664923f
--- /dev/null
+++ b/tests/run-make/doctests-compilation-time-info/rmake.rs
@@ -0,0 +1,119 @@
+//@ ignore-cross-compile (needs to run doctests)
+
+use run_make_support::rfs::write;
+use run_make_support::{cwd, rustdoc};
+
+fn assert_presence_of_compilation_time_report(
+    content: &str,
+    success: bool,
+    should_contain_compile_time: bool,
+) {
+    let mut cmd = rustdoc();
+    let file = cwd().join("foo.rs");
+
+    write(&file, content);
+    cmd.input(&file).arg("--test").edition("2024").env("RUST_BACKTRACE", "0");
+    let output = if success { cmd.run() } else { cmd.run_fail() };
+
+    assert_eq!(
+        output
+            .stdout_utf8()
+            .split("all doctests ran in ")
+            .last()
+            .is_some_and(|s| s.contains("; merged doctests compilation took")),
+        should_contain_compile_time,
+    );
+}
+
+fn main() {
+    // Checking with only successful merged doctests.
+    assert_presence_of_compilation_time_report(
+        "\
+//! ```
+//! let x = 12;
+//! ```",
+        true,
+        true,
+    );
+    // Checking with only failing merged doctests.
+    assert_presence_of_compilation_time_report(
+        "\
+//! ```
+//! panic!();
+//! ```",
+        false,
+        true,
+    );
+    // Checking with mix of successful doctests.
+    assert_presence_of_compilation_time_report(
+        "\
+//! ```
+//! let x = 12;
+//! ```
+//!
+//! ```compile_fail
+//! let x
+//! ```",
+        true,
+        true,
+    );
+    // Checking with mix of failing doctests.
+    assert_presence_of_compilation_time_report(
+        "\
+//! ```
+//! panic!();
+//! ```
+//!
+//! ```compile_fail
+//! let x
+//! ```",
+        false,
+        true,
+    );
+    // Checking with mix of failing doctests (v2).
+    assert_presence_of_compilation_time_report(
+        "\
+//! ```
+//! let x = 12;
+//! ```
+//!
+//! ```compile_fail
+//! let x = 12;
+//! ```",
+        false,
+        true,
+    );
+    // Checking with mix of failing doctests (v3).
+    assert_presence_of_compilation_time_report(
+        "\
+//! ```
+//! panic!();
+//! ```
+//!
+//! ```compile_fail
+//! let x = 12;
+//! ```",
+        false,
+        true,
+    );
+    // Checking with successful non-merged doctests.
+    assert_presence_of_compilation_time_report(
+        "\
+//! ```compile_fail
+//! let x
+//! ```",
+        true,
+        // If there is no merged doctests, then we should not display compilation time.
+        false,
+    );
+    // Checking with failing non-merged doctests.
+    assert_presence_of_compilation_time_report(
+        "\
+//! ```compile_fail
+//! let x = 12;
+//! ```",
+        false,
+        // If there is no merged doctests, then we should not display compilation time.
+        false,
+    );
+}
diff --git a/tests/run-make/doctests-merge/doctest-2024.stdout b/tests/run-make/doctests-merge/doctest-2024.stdout
index 7da08d68faa..a7e139bbd23 100644
--- a/tests/run-make/doctests-merge/doctest-2024.stdout
+++ b/tests/run-make/doctests-merge/doctest-2024.stdout
@@ -5,3 +5,4 @@ test doctest.rs - init (line 8) ... ok
 
 test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
 
+all doctests ran in $TIME; merged doctests compilation took $TIME
diff --git a/tests/run-make/doctests-merge/rmake.rs b/tests/run-make/doctests-merge/rmake.rs
index 7893d4988eb..f2a1e8e13dd 100644
--- a/tests/run-make/doctests-merge/rmake.rs
+++ b/tests/run-make/doctests-merge/rmake.rs
@@ -20,6 +20,8 @@ fn test_and_compare(input_file: &str, stdout_file: &str, edition: &str, dep: &Pa
         .expected_file(stdout_file)
         .actual_text("output", output.stdout_utf8())
         .normalize(r#"finished in \d+\.\d+s"#, "finished in $$TIME")
+        .normalize(r#"ran in \d+\.\d+s"#, "ran in $$TIME")
+        .normalize(r#"compilation took \d+\.\d+s"#, "compilation took $$TIME")
         .run();
 }
 
diff --git a/tests/run-make/linker-warning/rmake.rs b/tests/run-make/linker-warning/rmake.rs
index 9ea706af503..a31b08d6c69 100644
--- a/tests/run-make/linker-warning/rmake.rs
+++ b/tests/run-make/linker-warning/rmake.rs
@@ -61,14 +61,13 @@ fn main() {
         diff()
             .expected_file("short-error.txt")
             .actual_text("(linker error)", out.stderr())
-            .normalize(r#"/rustc[^/_-]*/"#, "/rustc/")
-            .normalize("libpanic_abort", "libpanic_unwind")
             .normalize(
                 regex::escape(
                     run_make_support::build_root().canonicalize().unwrap().to_str().unwrap(),
                 ),
                 "/build-root",
             )
+            .normalize("libpanic_abort", "libpanic_unwind")
             .normalize(r#""[^"]*\/symbols.o""#, "\"/symbols.o\"")
             .normalize(r#""[^"]*\/raw-dylibs""#, "\"/raw-dylibs\"")
             .run();
diff --git a/tests/run-make/musl-default-linking/rmake.rs b/tests/run-make/musl-default-linking/rmake.rs
index 7bb54e2739c..e9d09e359c6 100644
--- a/tests/run-make/musl-default-linking/rmake.rs
+++ b/tests/run-make/musl-default-linking/rmake.rs
@@ -4,7 +4,7 @@ use run_make_support::{rustc, serde_json};
 // Per https://github.com/rust-lang/compiler-team/issues/422,
 // we should be trying to move these targets to dynamically link
 // musl libc by default.
-//@ needs-llvm-components: aarch64 arm mips powerpc riscv systemz x86
+//@ needs-llvm-components: aarch64 arm powerpc x86
 static LEGACY_STATIC_LINKING_TARGETS: &[&'static str] = &[
     "aarch64-unknown-linux-musl",
     "arm-unknown-linux-musleabi",
@@ -14,16 +14,7 @@ static LEGACY_STATIC_LINKING_TARGETS: &[&'static str] = &[
     "armv7-unknown-linux-musleabihf",
     "i586-unknown-linux-musl",
     "i686-unknown-linux-musl",
-    "mips64-unknown-linux-musl",
-    "mips64-unknown-linux-muslabi64",
-    "mips64el-unknown-linux-muslabi64",
-    "powerpc-unknown-linux-musl",
-    "powerpc-unknown-linux-muslspe",
-    "powerpc64-unknown-linux-musl",
     "powerpc64le-unknown-linux-musl",
-    "riscv32gc-unknown-linux-musl",
-    "s390x-unknown-linux-musl",
-    "thumbv7neon-unknown-linux-musleabihf",
     "x86_64-unknown-linux-musl",
 ];
 
diff --git a/tests/run-make/panic-abort-eh_frame/rmake.rs b/tests/run-make/panic-abort-eh_frame/rmake.rs
index 23d95dc5774..2eccde62795 100644
--- a/tests/run-make/panic-abort-eh_frame/rmake.rs
+++ b/tests/run-make/panic-abort-eh_frame/rmake.rs
@@ -1,9 +1,11 @@
 // An `.eh_frame` section in an object file is a symptom of an UnwindAction::Terminate
 // being inserted, useful for determining whether or not unwinding is necessary.
-// This is useless when panics would NEVER unwind due to -C panic=abort. This section should
-// therefore never appear in the emit file of a -C panic=abort compilation, and this test
-// checks that this is respected.
-// See https://github.com/rust-lang/rust/pull/112403
+// This is useless when panics would NEVER unwind due to -C panic=abort and when we don't need
+// being able to generate backtraces (which depend on unwind tables on linux). This section should
+// therefore never appear in the emit file of a -C panic=abort compilation
+// with -C force-unwind-tables=no, and this test checks that this is respected.
+// See https://github.com/rust-lang/rust/pull/112403 and
+// https://github.com/rust-lang/rust/pull/143613.
 
 //@ only-linux
 // FIXME(Oneirical): the DW_CFA symbol appears on Windows-gnu, because uwtable
@@ -19,6 +21,7 @@ fn main() {
         .panic("abort")
         .edition("2021")
         .arg("-Zvalidate-mir")
+        .arg("-Cforce-unwind-tables=no")
         .run();
     llvm_objdump().arg("--dwarf=frames").input("foo.o").run().assert_stdout_not_contains("DW_CFA");
 }
diff --git a/tests/run-make/pointer-auth-link-with-c-lto-clang/rmake.rs b/tests/run-make/pointer-auth-link-with-c-lto-clang/rmake.rs
index 0a2186b0953..2ac5fdee063 100644
--- a/tests/run-make/pointer-auth-link-with-c-lto-clang/rmake.rs
+++ b/tests/run-make/pointer-auth-link-with-c-lto-clang/rmake.rs
@@ -1,12 +1,14 @@
 // `-Z branch protection` is an unstable compiler feature which adds pointer-authentication
 // code (PAC), a useful hashing measure for verifying that pointers have not been modified.
 // This test checks that compilation and execution is successful when this feature is activated,
-// with some of its possible extra arguments (bti, pac-ret, leaf) when doing LTO.
+// with some of its possible extra arguments (bti, gcs, pac-ret, leaf) when doing LTO.
 // See https://github.com/rust-lang/rust/pull/88354
 
 //@ needs-force-clang-based-tests
 //@ only-aarch64
 // Reason: branch protection is not supported on other architectures
+//@ ignore-apple
+// Reason: XCode needs updating to support gcs
 //@ ignore-cross-compile
 // Reason: the compiled binary is executed
 
@@ -19,7 +21,7 @@ fn main() {
     clang()
         .arg("-v")
         .lto("thin")
-        .arg("-mbranch-protection=bti+pac-ret+b-key+leaf")
+        .arg("-mbranch-protection=bti+gcs+pac-ret+b-key+leaf")
         .arg("-c")
         .out_exe("test.o")
         .input("test.c")
@@ -30,7 +32,7 @@ fn main() {
         .opt_level("2")
         .linker(&env_var("CLANG"))
         .link_arg("-fuse-ld=lld")
-        .arg("-Zbranch-protection=bti,pac-ret,leaf")
+        .arg("-Zbranch-protection=bti,gcs,pac-ret,leaf")
         .input("test.rs")
         .output("test.bin")
         .run();
diff --git a/tests/run-make/pointer-auth-link-with-c/rmake.rs b/tests/run-make/pointer-auth-link-with-c/rmake.rs
index a4d7454e575..1ddcb79d64f 100644
--- a/tests/run-make/pointer-auth-link-with-c/rmake.rs
+++ b/tests/run-make/pointer-auth-link-with-c/rmake.rs
@@ -1,11 +1,13 @@
 // `-Z branch protection` is an unstable compiler feature which adds pointer-authentication
 // code (PAC), a useful hashing measure for verifying that pointers have not been modified.
 // This test checks that compilation and execution is successful when this feature is activated,
-// with some of its possible extra arguments (bti, pac-ret, pc, leaf, b-key).
+// with some of its possible extra arguments (bti, gcs, pac-ret, pc, leaf, b-key).
 // See https://github.com/rust-lang/rust/pull/88354
 
 //@ only-aarch64
 // Reason: branch protection is not supported on other architectures
+//@ ignore-apple
+// Reason: XCode needs updating to support gcs
 //@ ignore-cross-compile
 // Reason: the compiled binary is executed
 
@@ -13,17 +15,17 @@ use run_make_support::{build_native_static_lib, cc, is_windows_msvc, llvm_ar, ru
 
 fn main() {
     build_native_static_lib("test");
-    rustc().arg("-Zbranch-protection=bti,pac-ret,leaf").input("test.rs").run();
+    rustc().arg("-Zbranch-protection=bti,gcs,pac-ret,leaf").input("test.rs").run();
     run("test");
     cc().arg("-v")
         .arg("-c")
         .out_exe("test")
         .input("test.c")
-        .arg("-mbranch-protection=bti+pac-ret+leaf")
+        .arg("-mbranch-protection=bti+gcs+pac-ret+leaf")
         .run();
     let obj_file = if is_windows_msvc() { "test.obj" } else { "test" };
     llvm_ar().obj_to_ar().output_input("libtest.a", &obj_file).run();
-    rustc().arg("-Zbranch-protection=bti,pac-ret,leaf").input("test.rs").run();
+    rustc().arg("-Zbranch-protection=bti,gcs,pac-ret,leaf").input("test.rs").run();
     run("test");
 
     // FIXME: +pc was only recently added to LLVM
diff --git a/tests/run-make/print-request-help-stable-unstable/help-diff.diff b/tests/run-make/print-request-help-stable-unstable/help-diff.diff
index 07eafca3271..044302a19a0 100644
--- a/tests/run-make/print-request-help-stable-unstable/help-diff.diff
+++ b/tests/run-make/print-request-help-stable-unstable/help-diff.diff
@@ -2,6 +2,6 @@
  error: unknown print request: `xxx`
    |
 -  = help: valid print requests are: `calling-conventions`, `cfg`, `code-models`, `crate-name`, `deployment-target`, `file-names`, `host-tuple`, `link-args`, `native-static-libs`, `relocation-models`, `split-debuginfo`, `stack-protector-strategies`, `sysroot`, `target-cpus`, `target-features`, `target-libdir`, `target-list`, `tls-models`
-+  = help: valid print requests are: `all-target-specs-json`, `calling-conventions`, `cfg`, `check-cfg`, `code-models`, `crate-name`, `crate-root-lint-levels`, `deployment-target`, `file-names`, `host-tuple`, `link-args`, `native-static-libs`, `relocation-models`, `split-debuginfo`, `stack-protector-strategies`, `supported-crate-types`, `sysroot`, `target-cpus`, `target-features`, `target-libdir`, `target-list`, `target-spec-json`, `tls-models`
++  = help: valid print requests are: `all-target-specs-json`, `calling-conventions`, `cfg`, `check-cfg`, `code-models`, `crate-name`, `crate-root-lint-levels`, `deployment-target`, `file-names`, `host-tuple`, `link-args`, `native-static-libs`, `relocation-models`, `split-debuginfo`, `stack-protector-strategies`, `supported-crate-types`, `sysroot`, `target-cpus`, `target-features`, `target-libdir`, `target-list`, `target-spec-json`, `target-spec-json-schema`, `tls-models`
    = help: for more information, see the rustc book: https://doc.rust-lang.org/rustc/command-line-arguments.html#--print-print-compiler-information
  
diff --git a/tests/run-make/print-request-help-stable-unstable/unstable-invalid-print-request-help.err b/tests/run-make/print-request-help-stable-unstable/unstable-invalid-print-request-help.err
index 50ef340e3dd..cc6c3c909b3 100644
--- a/tests/run-make/print-request-help-stable-unstable/unstable-invalid-print-request-help.err
+++ b/tests/run-make/print-request-help-stable-unstable/unstable-invalid-print-request-help.err
@@ -1,5 +1,5 @@
 error: unknown print request: `xxx`
   |
-  = help: valid print requests are: `all-target-specs-json`, `calling-conventions`, `cfg`, `check-cfg`, `code-models`, `crate-name`, `crate-root-lint-levels`, `deployment-target`, `file-names`, `host-tuple`, `link-args`, `native-static-libs`, `relocation-models`, `split-debuginfo`, `stack-protector-strategies`, `supported-crate-types`, `sysroot`, `target-cpus`, `target-features`, `target-libdir`, `target-list`, `target-spec-json`, `tls-models`
+  = help: valid print requests are: `all-target-specs-json`, `calling-conventions`, `cfg`, `check-cfg`, `code-models`, `crate-name`, `crate-root-lint-levels`, `deployment-target`, `file-names`, `host-tuple`, `link-args`, `native-static-libs`, `relocation-models`, `split-debuginfo`, `stack-protector-strategies`, `supported-crate-types`, `sysroot`, `target-cpus`, `target-features`, `target-libdir`, `target-list`, `target-spec-json`, `target-spec-json-schema`, `tls-models`
   = help: for more information, see the rustc book: https://doc.rust-lang.org/rustc/command-line-arguments.html#--print-print-compiler-information
 
diff --git a/tests/run-make/rustc-help/help-v.stdout b/tests/run-make/rustc-help/help-v.stdout
index 3fc297fb08e..cd161c51ee3 100644
--- a/tests/run-make/rustc-help/help-v.stdout
+++ b/tests/run-make/rustc-help/help-v.stdout
@@ -43,7 +43,7 @@ Options:
         --print <INFO>[=<FILE>]
                         Compiler information to print on stdout (or to a file)
                         INFO may be one of
-                        <all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|tls-models>.
+                        <all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|target-spec-json-schema|tls-models>.
     -g                  Equivalent to -C debuginfo=2
     -O                  Equivalent to -C opt-level=3
     -o <FILENAME>       Write output to FILENAME
diff --git a/tests/run-make/rustc-help/help.stdout b/tests/run-make/rustc-help/help.stdout
index caffe28f498..74ec083bdee 100644
--- a/tests/run-make/rustc-help/help.stdout
+++ b/tests/run-make/rustc-help/help.stdout
@@ -43,7 +43,7 @@ Options:
         --print <INFO>[=<FILE>]
                         Compiler information to print on stdout (or to a file)
                         INFO may be one of
-                        <all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|tls-models>.
+                        <all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|target-spec-json-schema|tls-models>.
     -g                  Equivalent to -C debuginfo=2
     -O                  Equivalent to -C opt-level=3
     -o <FILENAME>       Write output to FILENAME
diff --git a/tests/run-make/rustdoc-merge-no-input-finalize/rmake.rs b/tests/run-make/rustdoc-merge-no-input-finalize/rmake.rs
new file mode 100644
index 00000000000..0b1e1948d5f
--- /dev/null
+++ b/tests/run-make/rustdoc-merge-no-input-finalize/rmake.rs
@@ -0,0 +1,28 @@
+// Running --merge=finalize without an input crate root should not trigger ICE.
+// Issue: https://github.com/rust-lang/rust/issues/146646
+
+//@ needs-target-std
+
+use run_make_support::{path, rustdoc};
+
+fn main() {
+    let out_dir = path("out");
+    let merged_dir = path("merged");
+    let parts_out_dir = path("parts");
+    rustdoc()
+        .input("sierra.rs")
+        .out_dir(&out_dir)
+        .arg("-Zunstable-options")
+        .arg(format!("--parts-out-dir={}", parts_out_dir.display()))
+        .arg("--merge=none")
+        .run();
+    assert!(parts_out_dir.join("crate-info").exists());
+
+    let output = rustdoc()
+        .arg("-Zunstable-options")
+        .out_dir(&out_dir)
+        .arg(format!("--include-parts-dir={}", parts_out_dir.display()))
+        .arg("--merge=finalize")
+        .run();
+    output.assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug.");
+}
diff --git a/tests/run-make/rustdoc-merge-no-input-finalize/sierra.rs b/tests/run-make/rustdoc-merge-no-input-finalize/sierra.rs
new file mode 100644
index 00000000000..f8fc48341ed
--- /dev/null
+++ b/tests/run-make/rustdoc-merge-no-input-finalize/sierra.rs
@@ -0,0 +1 @@
+pub struct Sierra;
diff --git a/tests/run-make/split-debuginfo/rmake.rs b/tests/run-make/split-debuginfo/rmake.rs
index e8de5aed172..e53b7101078 100644
--- a/tests/run-make/split-debuginfo/rmake.rs
+++ b/tests/run-make/split-debuginfo/rmake.rs
@@ -188,6 +188,25 @@ enum UnstableOptions {
 }
 
 #[track_caller]
+fn dwo_out_filenames(dwo_out: Option<&str>) -> BTreeSet<String> {
+    let dwo_out = if let Some(d) = dwo_out {
+        d
+    } else {
+        return BTreeSet::new();
+    };
+    let files = shallow_find_files(dwo_out, |path| {
+        // Fiilter out source files
+        !has_extension(path, "rs")
+    });
+    files
+        .iter()
+        .map(|p| {
+            format!("{}/{}", dwo_out, p.file_name().unwrap().to_os_string().into_string().unwrap())
+        })
+        .collect()
+}
+
+#[track_caller]
 fn cwd_filenames() -> BTreeSet<String> {
     let files = shallow_find_files(cwd(), |path| {
         // Fiilter out source files
@@ -197,6 +216,17 @@ fn cwd_filenames() -> BTreeSet<String> {
 }
 
 #[track_caller]
+fn dwo_out_dwo_filenames(dwo_out: &str) -> BTreeSet<String> {
+    let files = shallow_find_files(dwo_out, |p| has_extension(p, "dwo"));
+    files
+        .iter()
+        .map(|p| {
+            format!("{}/{}", dwo_out, p.file_name().unwrap().to_os_string().into_string().unwrap())
+        })
+        .collect()
+}
+
+#[track_caller]
 fn cwd_dwo_filenames() -> BTreeSet<String> {
     let files = shallow_find_files(cwd(), |path| has_extension(path, "dwo"));
     files.iter().map(|p| p.file_name().unwrap().to_os_string().into_string().unwrap()).collect()
@@ -376,17 +406,19 @@ mod shared_linux_other_tests {
         lto: LinkerPluginLto,
         remap_path_prefix: RemapPathPrefix,
         remap_path_scope: RemapPathScope,
+        split_dwarf_output_directory: Option<&str>,
     ) {
         run_in_tmpdir(|| {
             println!(
-                "checking: unstable_options={:?} + split_kind={:?} + level={:?} + split_dwarf_kind={:?} + lto={:?} + remap_path_prefix={:?} + remap_path_scope={:?}",
+                "checking: unstable_options={:?} + split_kind={:?} + level={:?} + split_dwarf_kind={:?} + lto={:?} + remap_path_prefix={:?} + remap_path_scope={:?} + split_dwarf_out_dir={:?}",
                 unstable_options,
                 split_kind,
                 level,
                 split_dwarf_kind,
                 lto,
                 remap_path_prefix,
-                remap_path_scope
+                remap_path_scope,
+                split_dwarf_output_directory,
             );
 
             match cross_crate_test {
@@ -398,6 +430,7 @@ mod shared_linux_other_tests {
                     lto,
                     remap_path_prefix,
                     remap_path_scope,
+                    split_dwarf_output_directory,
                 ),
                 CrossCrateTest::No => simple_split_debuginfo(
                     unstable_options,
@@ -407,6 +440,7 @@ mod shared_linux_other_tests {
                     lto,
                     remap_path_prefix,
                     remap_path_scope,
+                    split_dwarf_output_directory,
                 ),
             }
         });
@@ -420,7 +454,11 @@ mod shared_linux_other_tests {
         lto: LinkerPluginLto,
         remap_path_prefix: RemapPathPrefix,
         remap_path_scope: RemapPathScope,
+        split_dwarf_output_directory: Option<&str>,
     ) {
+        if let Some(dwo_out) = split_dwarf_output_directory {
+            run_make_support::rfs::create_dir(dwo_out);
+        }
         match (split_kind, level, split_dwarf_kind, lto, remap_path_prefix, remap_path_scope) {
             // packed-crosscrate-split
             // - Debuginfo in `.dwo` files
@@ -531,13 +569,19 @@ mod shared_linux_other_tests {
                     .input("bar.rs")
                     .crate_type("lib")
                     .split_debuginfo(split_kind.cli_value())
+                    .split_dwarf_out_dir(split_dwarf_output_directory)
                     .debuginfo(level.cli_value())
                     .arg(format!("-Zsplit-dwarf-kind={}", split_dwarf_kind.cli_value()))
                     .run();
 
-                let bar_found_files = cwd_filenames();
+                let mut bar_found_files = cwd_filenames();
+                bar_found_files.append(&mut dwo_out_filenames(split_dwarf_output_directory));
 
-                let bar_dwo_files = cwd_dwo_filenames();
+                let bar_dwo_files = if let Some(dwo_out) = split_dwarf_output_directory {
+                    dwo_out_dwo_filenames(dwo_out)
+                } else {
+                    cwd_dwo_filenames()
+                };
                 assert_eq!(bar_dwo_files.len(), 1);
 
                 let mut bar_expected_files = BTreeSet::new();
@@ -553,13 +597,19 @@ mod shared_linux_other_tests {
                     .extern_("bar", "libbar.rlib")
                     .input("main.rs")
                     .split_debuginfo(split_kind.cli_value())
+                    .split_dwarf_out_dir(split_dwarf_output_directory)
                     .debuginfo(level.cli_value())
                     .arg(format!("-Zsplit-dwarf-kind={}", split_dwarf_kind.cli_value()))
                     .run();
 
-                let overall_found_files = cwd_filenames();
+                let mut overall_found_files = cwd_filenames();
+                overall_found_files.append(&mut dwo_out_filenames(split_dwarf_output_directory));
 
-                let overall_dwo_files = cwd_dwo_filenames();
+                let overall_dwo_files = if let Some(dwo_out) = split_dwarf_output_directory {
+                    dwo_out_dwo_filenames(dwo_out)
+                } else {
+                    cwd_dwo_filenames()
+                };
                 assert_eq!(overall_dwo_files.len(), 2);
 
                 let mut overall_expected_files = BTreeSet::new();
@@ -648,7 +698,11 @@ mod shared_linux_other_tests {
         lto: LinkerPluginLto,
         remap_path_prefix: RemapPathPrefix,
         remap_path_scope: RemapPathScope,
+        split_dwarf_output_directory: Option<&str>,
     ) {
+        if let Some(dwo_out) = split_dwarf_output_directory {
+            run_make_support::rfs::create_dir(dwo_out);
+        }
         match (split_kind, level, split_dwarf_kind, lto, remap_path_prefix, remap_path_scope) {
             // off (unspecified):
             // - Debuginfo in `.o` files
@@ -921,14 +975,19 @@ mod shared_linux_other_tests {
                 rustc(unstable_options)
                     .input("foo.rs")
                     .split_debuginfo(split_kind.cli_value())
+                    .split_dwarf_out_dir(split_dwarf_output_directory)
                     .debuginfo(level.cli_value())
                     .arg(format!("-Zsplit-dwarf-kind={}", split_dwarf_kind.cli_value()))
                     .run();
-                let found_files = cwd_filenames();
-
-                let dwo_files = cwd_dwo_filenames();
+                let mut found_files = cwd_filenames();
+                found_files.append(&mut dwo_out_filenames(split_dwarf_output_directory));
+
+                let dwo_files = if let Some(dwo_dir) = split_dwarf_output_directory {
+                    dwo_out_dwo_filenames(dwo_dir)
+                } else {
+                    cwd_dwo_filenames()
+                };
                 assert_eq!(dwo_files.len(), 1);
-
                 let mut expected_files = BTreeSet::new();
                 expected_files.extend(dwo_files);
                 expected_files.insert("foo".to_string());
@@ -1056,14 +1115,20 @@ mod shared_linux_other_tests {
                 rustc(unstable_options)
                     .input("foo.rs")
                     .split_debuginfo(split_kind.cli_value())
+                    .split_dwarf_out_dir(split_dwarf_output_directory)
                     .debuginfo(level.cli_value())
                     .arg(format!("-Zsplit-dwarf-kind={}", split_dwarf_kind.cli_value()))
                     .remap_path_prefix(cwd(), remapped_prefix)
                     .run();
 
-                let found_files = cwd_filenames();
+                let mut found_files = cwd_filenames();
+                found_files.append(&mut dwo_out_filenames(split_dwarf_output_directory));
 
-                let dwo_files = cwd_dwo_filenames();
+                let dwo_files = if let Some(dwo_out) = split_dwarf_output_directory {
+                    dwo_out_dwo_filenames(dwo_out)
+                } else {
+                    cwd_dwo_filenames()
+                };
                 assert_eq!(dwo_files.len(), 1);
 
                 let mut expected_files = BTreeSet::new();
@@ -1358,6 +1423,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
         );
 
         // off
@@ -1370,6 +1436,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
         );
 
         // packed-split
@@ -1382,6 +1449,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
         );
 
         // packed-single
@@ -1394,6 +1462,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
         );
 
         // packed-lto-split
@@ -1406,6 +1475,7 @@ fn main() {
             LinkerPluginLto::Yes,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
         );
 
         // packed-lto-single
@@ -1418,6 +1488,7 @@ fn main() {
             LinkerPluginLto::Yes,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
         );
 
         // FIXME: the remapping tests probably need to be reworked, see
@@ -1433,6 +1504,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Yes { remapped_prefix: "/__MY_REMAPPED_PATH__" },
             RemapPathScope::Unspecified,
+            None,
         );
 
         // packed-remapped-single
@@ -1445,6 +1517,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Yes { remapped_prefix: "/__MY_REMAPPED_PATH__" },
             RemapPathScope::Unspecified,
+            None,
         );
 
         // packed-remapped-scope
@@ -1457,6 +1530,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Yes { remapped_prefix: "/__MY_REMAPPED_PATH__" },
             RemapPathScope::Yes("debuginfo"),
+            None,
         );
 
         // packed-remapped-wrong-scope
@@ -1469,6 +1543,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Yes { remapped_prefix: "/__MY_REMAPPED_PATH__" },
             RemapPathScope::Yes("macro"),
+            None,
         );
 
         // packed-crosscrate-split
@@ -1481,6 +1556,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
         );
 
         // packed-crosscrate-single
@@ -1493,6 +1569,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
         );
 
         // unpacked-split
@@ -1505,6 +1582,20 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
+        );
+
+        // unpacked-split with split-dwarf-out-dir
+        shared_linux_other_tests::split_debuginfo(
+            CrossCrateTest::No,
+            UnstableOptions::Yes,
+            SplitDebuginfo::Unpacked,
+            DebuginfoLevel::Full,
+            SplitDwarfKind::Split,
+            LinkerPluginLto::Unspecified,
+            RemapPathPrefix::Unspecified,
+            RemapPathScope::Unspecified,
+            Some("other-dir"),
         );
 
         // unpacked-single
@@ -1517,6 +1608,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
         );
 
         // unpacked-lto-split
@@ -1529,6 +1621,7 @@ fn main() {
             LinkerPluginLto::Yes,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
         );
 
         // unpacked-lto-single
@@ -1541,6 +1634,7 @@ fn main() {
             LinkerPluginLto::Yes,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
         );
 
         // unpacked-remapped-split
@@ -1553,6 +1647,20 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Yes { remapped_prefix: "/__MY_REMAPPED_PATH__" },
             RemapPathScope::Unspecified,
+            None,
+        );
+
+        // unpacked-remapped-split with split-dwarf-out-dir
+        shared_linux_other_tests::split_debuginfo(
+            CrossCrateTest::No,
+            UnstableOptions::Yes,
+            SplitDebuginfo::Unpacked,
+            DebuginfoLevel::Full,
+            SplitDwarfKind::Split,
+            LinkerPluginLto::Unspecified,
+            RemapPathPrefix::Yes { remapped_prefix: "/__MY_REMAPPED_PATH__" },
+            RemapPathScope::Unspecified,
+            Some("other-dir"),
         );
 
         // unpacked-remapped-single
@@ -1565,6 +1673,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Yes { remapped_prefix: "/__MY_REMAPPED_PATH__" },
             RemapPathScope::Unspecified,
+            None,
         );
 
         // unpacked-remapped-scope
@@ -1577,6 +1686,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Yes { remapped_prefix: "/__MY_REMAPPED_PATH__" },
             RemapPathScope::Yes("debuginfo"),
+            None,
         );
 
         // unpacked-remapped-wrong-scope
@@ -1589,6 +1699,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Yes { remapped_prefix: "/__MY_REMAPPED_PATH__" },
             RemapPathScope::Yes("macro"),
+            None,
         );
 
         // unpacked-crosscrate-split
@@ -1601,6 +1712,20 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
+        );
+
+        // unpacked-crosscrate-split with split-dwarf-out-dir
+        shared_linux_other_tests::split_debuginfo(
+            CrossCrateTest::Yes,
+            UnstableOptions::Yes,
+            SplitDebuginfo::Unpacked,
+            DebuginfoLevel::Full,
+            SplitDwarfKind::Split,
+            LinkerPluginLto::Unspecified,
+            RemapPathPrefix::Unspecified,
+            RemapPathScope::Unspecified,
+            Some("other-dir"),
         );
 
         // unpacked-crosscrate-single
@@ -1613,6 +1738,7 @@ fn main() {
             LinkerPluginLto::Unspecified,
             RemapPathPrefix::Unspecified,
             RemapPathScope::Unspecified,
+            None,
         );
     }
 }
diff --git a/tests/rustdoc-gui/search-result-color.goml b/tests/rustdoc-gui/search-result-color.goml
index fe0f6401089..e5c11651bd2 100644
--- a/tests/rustdoc-gui/search-result-color.goml
+++ b/tests/rustdoc-gui/search-result-color.goml
@@ -5,7 +5,7 @@ include: "utils.goml"
 define-function: (
     "check-search-color",
     [
-        theme, count_color, desc_color, path_color, bottom_border_color, keyword_color,
+        theme, count_color, path_color, bottom_border_color, keyword_color,
         struct_color, associatedtype_color, tymethod_color, method_color, structfield_color,
         structfield_hover_color, macro_color, fn_color, hover_path_color, hover_background,
         attribute_color, grey
@@ -22,10 +22,6 @@ define-function: (
             ALL,
         )
         assert-css: (
-            "//*[@class='desc'][normalize-space()='Just a normal struct.']",
-            {"color": |desc_color|},
-        )
-        assert-css: (
             "//*[@class='result-name']//*[normalize-space()='test_docs::']",
             {"color": |path_color|},
         )
@@ -97,16 +93,6 @@ define-function: (
             ALL,
         )
 
-        // Checking color and background on hover.
-        move-cursor-to: "//*[@class='desc'][normalize-space()='Just a normal struct.']"
-        assert-css: (
-            "//*[@class='result-name']//*[normalize-space()='test_docs::']",
-            {"color": |hover_path_color|},
-        )
-        assert-css: (
-            "//*[@class='result-name']//*[normalize-space()='test_docs::']/ancestor::a",
-            {"color": |hover_path_color|, "background-color": |hover_background|},
-        )
     }
 )
 
@@ -157,7 +143,6 @@ show-text: true
 call-function: ("check-search-color", {
     "theme": "ayu",
     "count_color": "#888",
-    "desc_color": "#c5c5c5",
     "path_color": "#0096cf",
     "bottom_border_color": "#aaa3",
     "keyword_color": "#39afd7",
@@ -179,7 +164,6 @@ call-function: ("check-search-color", {
 call-function: ("check-search-color", {
     "theme": "dark",
     "count_color": "#888",
-    "desc_color": "#ddd",
     "path_color": "#ddd",
     "bottom_border_color": "#aaa3",
     "keyword_color": "#d2991d",
@@ -201,7 +185,6 @@ call-function: ("check-search-color", {
 call-function: ("check-search-color", {
     "theme": "light",
     "count_color": "#888",
-    "desc_color": "#000",
     "path_color": "#000",
     "bottom_border_color": "#aaa3",
     "keyword_color": "#3873ad",
@@ -226,12 +209,27 @@ call-function: ("perform-search", {"query": "thisisanalias"})
 
 define-function: (
     "check-alias",
-    [theme, alias, grey],
+    [theme, alias, grey, desc_color, hover_path_color, hover_background],
     block {
         call-function: ("switch-theme", {"theme": |theme|})
         // Checking that the colors for the alias element are the ones expected.
         assert-css: (".result-name .path .alias", {"color": |alias|})
         assert-css: (".result-name .path .alias > .grey", {"color": |grey|})
+        assert-css: (
+            "//*[@class='desc'][normalize-space()='Just a normal enum.']",
+            {"color": |desc_color|},
+        )
+        // Checking color and background on hover.
+        move-cursor-to: "//*[@class='desc'][normalize-space()='Just a normal enum.']"
+        assert-css: (
+            "//*[@class='result-name']//*[normalize-space()='test_docs::']",
+            {"color": |hover_path_color|},
+        )
+        assert-css: (
+            "//*[@class='result-name']//*[normalize-space()='test_docs::']/ancestor::a",
+            {"color": |hover_path_color|, "background-color": |hover_background|},
+        )
+
     },
 )
 
@@ -239,14 +237,23 @@ call-function: ("check-alias", {
     "theme": "ayu",
     "alias": "#c5c5c5",
     "grey": "#999",
+    "desc_color": "#c5c5c5",
+    "hover_path_color": "#fff",
+    "hover_background": "#3c3c3c",
 })
 call-function: ("check-alias", {
     "theme": "dark",
     "alias": "#fff",
     "grey": "#ccc",
+    "desc_color": "#ddd",
+    "hover_path_color": "#ddd",
+    "hover_background": "#616161",
 })
 call-function: ("check-alias", {
     "theme": "light",
     "alias": "#000",
     "grey": "#999",
+    "desc_color": "#000",
+    "hover_path_color": "#000",
+    "hover_background": "#ccc",
 })
diff --git a/tests/rustdoc-gui/search-tab.goml b/tests/rustdoc-gui/search-tab.goml
index 00ca952033d..0a3cfc231e5 100644
--- a/tests/rustdoc-gui/search-tab.goml
+++ b/tests/rustdoc-gui/search-tab.goml
@@ -79,7 +79,7 @@ call-function: ("check-colors", {
 set-window-size: (851, 600)
 
 // Check the size and count in tabs
-assert-text: ("#search-tabs > button:nth-child(1) > .count", " (27) ")
+assert-text: ("#search-tabs > button:nth-child(1) > .count", " (25) ")
 assert-text: ("#search-tabs > button:nth-child(2) > .count", " (7)  ")
 assert-text: ("#search-tabs > button:nth-child(3) > .count", " (0)  ")
 store-property: ("#search-tabs > button:nth-child(1)", {"offsetWidth": buttonWidth})
diff --git a/tests/rustdoc-gui/search-title.goml b/tests/rustdoc-gui/search-title.goml
index 83321a05f2b..5808ed845a3 100644
--- a/tests/rustdoc-gui/search-title.goml
+++ b/tests/rustdoc-gui/search-title.goml
@@ -20,3 +20,15 @@ assert-document-property: {"title": '"another one" Search - Rust'}
 press-key: "Escape"
 
 assert-document-property: {"title": |title|}
+
+// check that all.html does it correctly, too.
+go-to: "file://" + |DOC_PATH| + "/test_docs/all.html"
+assert-document-property: {"title": "List of all items in this crate"}
+call-function: ("perform-search", {"query": "verify"})
+assert-document-property: {"title": '"verify" Search - Rust'}
+
+// check that index.html does it correctly, too.
+go-to: "file://" + |DOC_PATH| + "/index.html"
+assert-document-property: {"title": "Index of crates"}
+call-function: ("perform-search", {"query": "verify"})
+assert-document-property: {"title": '"verify" Search - Rust'}
diff --git a/tests/rustdoc-gui/sidebar.goml b/tests/rustdoc-gui/sidebar.goml
index 5ec0008ad8a..0d371c8c6a4 100644
--- a/tests/rustdoc-gui/sidebar.goml
+++ b/tests/rustdoc-gui/sidebar.goml
@@ -1,5 +1,7 @@
 // Checks multiple things on the sidebar display (width of its elements, colors, etc).
 include: "utils.goml"
+// Disable animations so they don't mess up color assertions later.
+emulate-media-features: { "prefers-reduced-motion": "reduce" }
 go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
 assert-property: (".sidebar", {"clientWidth": "199"})
 show-text: true
diff --git a/tests/rustdoc-gui/src/lib2/lib.rs b/tests/rustdoc-gui/src/lib2/lib.rs
index 8db754f91ce..400488cbe85 100644
--- a/tests/rustdoc-gui/src/lib2/lib.rs
+++ b/tests/rustdoc-gui/src/lib2/lib.rs
@@ -1,7 +1,6 @@
 // ignore-tidy-linelength
 
 #![feature(doc_cfg)]
-#![feature(doc_auto_cfg)]
 
 pub mod another_folder;
 pub mod another_mod;
diff --git a/tests/rustdoc-gui/src/test_docs/lib.rs b/tests/rustdoc-gui/src/test_docs/lib.rs
index 42f2fbd93b1..c0771583ab6 100644
--- a/tests/rustdoc-gui/src/test_docs/lib.rs
+++ b/tests/rustdoc-gui/src/test_docs/lib.rs
@@ -1,3 +1,4 @@
+//@ compile-flags: --enable-index-page -Z unstable-options
 //! The point of this crate is to be able to have enough different "kinds" of
 //! documentation generated so we can test each different features.
 #![doc(html_playground_url="https://play.rust-lang.org/")]
@@ -459,10 +460,10 @@ pub fn safe_fn() {}
 
 #[repr(C)]
 pub struct WithGenerics<T: TraitWithNoDocblocks, S = String, E = WhoLetTheDogOut, P = i8> {
-    s: S,
-    t: T,
-    e: E,
-    p: P,
+    pub s: S,
+    pub t: T,
+    pub e: E,
+    pub p: P,
 }
 
 pub struct StructWithPublicUndocumentedFields {
diff --git a/tests/rustdoc-js-std/asrawfd.js b/tests/rustdoc-js-std/asrawfd.js
index 5dbc4ba95d9..da08eeb8a53 100644
--- a/tests/rustdoc-js-std/asrawfd.js
+++ b/tests/rustdoc-js-std/asrawfd.js
@@ -1,12 +1,10 @@
 // ignore-order
 
 const EXPECTED = {
-    'query': 'RawFd::as_raw_fd',
+    'query': 'method:RawFd::as_raw_fd',
     'others': [
         // Reproduction test for https://github.com/rust-lang/rust/issues/78724
         // Validate that type alias methods get the correct path.
-        { 'path': 'std::os::fd::AsRawFd', 'name': 'as_raw_fd' },
-        { 'path': 'std::os::fd::AsRawFd', 'name': 'as_raw_fd' },
         { 'path': 'std::os::fd::RawFd', 'name': 'as_raw_fd' },
     ],
 };
diff --git a/tests/rustdoc-js-std/quoted.js b/tests/rustdoc-js-std/quoted.js
index 8a927501925..a8ca6521208 100644
--- a/tests/rustdoc-js-std/quoted.js
+++ b/tests/rustdoc-js-std/quoted.js
@@ -1,21 +1,21 @@
+// make sure quoted search works both for items and and without generics
 // ignore-order
 
 const FILTER_CRATE = 'std';
 
 const EXPECTED = {
-    'query': '"error"',
+    'query': '"result"',
     'others': [
-        { 'path': 'std', 'name': 'error' },
-        { 'path': 'std::fmt', 'name': 'Error' },
-        { 'path': 'std::io', 'name': 'Error' },
+        { 'path': 'std', 'name': 'result' },
+        { 'path': 'std::result', 'name': 'Result' },
+        { 'path': 'std::fmt', 'name': 'Result' },
     ],
     'in_args': [
-        { 'path': 'std::fmt::Error', 'name': 'eq' },
-        { 'path': 'std::fmt::Error', 'name': 'cmp' },
-        { 'path': 'std::fmt::Error', 'name': 'partial_cmp' },
-
+        { 'path': 'std::result::Result', 'name': 'branch' },
+        { 'path': 'std::result::Result', 'name': 'ok' },
+        { 'path': 'std::result::Result', 'name': 'unwrap' },
     ],
     'returned': [
-        { 'path': 'std::fmt::LowerExp', 'name': 'fmt' },
+        { 'path': 'std::bool', 'name': 'try_into' },
     ],
 };
diff --git a/tests/rustdoc-js-std/bufread-fill-buf.js b/tests/rustdoc-js-std/trait-unbox.js
index 6b9309f6864..44ddc0c1e75 100644
--- a/tests/rustdoc-js-std/bufread-fill-buf.js
+++ b/tests/rustdoc-js-std/trait-unbox.js
@@ -1,10 +1,10 @@
-// ignore-order
+// make sure type-based searches with traits get unboxed too
 
 const EXPECTED = [
     {
-        'query': 'bufread -> result<[u8]>',
+        'query': 'any -> result<box>',
         'others': [
-            { 'path': 'std::boxed::Box', 'name': 'fill_buf' },
+            { 'path': 'std::boxed::Box', 'name': 'downcast' },
         ],
     },
     {
diff --git a/tests/rustdoc-js/trait-methods.js b/tests/rustdoc-js/trait-methods.js
index dafad5e4378..083e52439f4 100644
--- a/tests/rustdoc-js/trait-methods.js
+++ b/tests/rustdoc-js/trait-methods.js
@@ -9,4 +9,24 @@ const EXPECTED = [
             { 'path': 'trait_methods::MyTrait', 'name': 'next' },
         ],
     },
+    // the traitParent deduplication pass should remove
+    // Empty::next, as it would be redundant
+    {
+        'query': 'next',
+        'correction': null,
+        'in_args': [],
+        'others': [
+            { 'path': 'trait_methods::MyTrait', 'name': 'next' },
+        ],
+    },
+    // if the trait does not match, no deduplication happens
+    {
+        'query': '-> option<()>',
+        'correction': null,
+        'in_args': [],
+        'others': [
+            { 'path': 'trait_methods::Empty', 'name': 'next' },
+                    { 'path': 'trait_methods::Void', 'name': 'next' },
+        ],
+    },
 ];
diff --git a/tests/rustdoc-js/trait-methods.rs b/tests/rustdoc-js/trait-methods.rs
index c88f5edfd55..a741b361a33 100644
--- a/tests/rustdoc-js/trait-methods.rs
+++ b/tests/rustdoc-js/trait-methods.rs
@@ -2,3 +2,21 @@ pub trait MyTrait {
     type Item;
     fn next(&mut self) -> Option<Self::Item>;
 }
+
+pub struct Empty;
+
+impl MyTrait for Empty {
+    type Item = ();
+    fn next(&mut self) -> Option<()> {
+        None
+    }
+}
+
+pub struct Void;
+
+impl MyTrait for Void {
+    type Item = ();
+    fn next(&mut self) -> Option<()> {
+        Some(())
+    }
+}
diff --git a/tests/rustdoc-ui/cfg-hide-show-conflict.rs b/tests/rustdoc-ui/cfg-hide-show-conflict.rs
new file mode 100644
index 00000000000..8e98b95c85b
--- /dev/null
+++ b/tests/rustdoc-ui/cfg-hide-show-conflict.rs
@@ -0,0 +1,3 @@
+#![feature(doc_cfg)]
+#![doc(auto_cfg(hide(target_os = "linux")))]
+#![doc(auto_cfg(show(windows, target_os = "linux")))] //~ ERROR
diff --git a/tests/rustdoc-ui/cfg-hide-show-conflict.stderr b/tests/rustdoc-ui/cfg-hide-show-conflict.stderr
new file mode 100644
index 00000000000..22231e82cd7
--- /dev/null
+++ b/tests/rustdoc-ui/cfg-hide-show-conflict.stderr
@@ -0,0 +1,14 @@
+error: same `cfg` was in `auto_cfg(hide(...))` and `auto_cfg(show(...))` on the same item
+  --> $DIR/cfg-hide-show-conflict.rs:3:31
+   |
+LL | #![doc(auto_cfg(show(windows, target_os = "linux")))]
+   |                               ^^^^^^^^^^^^^^^^^^^
+   |
+note: first change was here
+  --> $DIR/cfg-hide-show-conflict.rs:2:22
+   |
+LL | #![doc(auto_cfg(hide(target_os = "linux")))]
+   |                      ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/rustdoc-ui/doc-cfg.rs b/tests/rustdoc-ui/doc-cfg.rs
index 14943bbc341..d72643e2355 100644
--- a/tests/rustdoc-ui/doc-cfg.rs
+++ b/tests/rustdoc-ui/doc-cfg.rs
@@ -8,4 +8,15 @@
 //~^^ WARN unexpected `cfg` condition name: `bar`
 #[doc(cfg())] //~ ERROR
 #[doc(cfg(foo, bar))] //~ ERROR
+#[doc(auto_cfg(42))] //~ ERROR
+#[doc(auto_cfg(hide(true)))] //~ ERROR
+#[doc(auto_cfg(hide(42)))] //~ ERROR
+#[doc(auto_cfg(hide("a")))] //~ ERROR
+#[doc(auto_cfg(hide(foo::bar)))] //~ ERROR
+#[doc(auto_cfg = 42)] //~ ERROR
+#[doc(auto_cfg = "a")] //~ ERROR
+// Shouldn't lint
+#[doc(auto_cfg(hide(windows)))]
+#[doc(auto_cfg(hide(feature = "windows")))]
+#[doc(auto_cfg(hide(foo)))]
 pub fn foo() {}
diff --git a/tests/rustdoc-ui/doc-cfg.stderr b/tests/rustdoc-ui/doc-cfg.stderr
index 1233ee010de..49e8c324fac 100644
--- a/tests/rustdoc-ui/doc-cfg.stderr
+++ b/tests/rustdoc-ui/doc-cfg.stderr
@@ -1,26 +1,46 @@
-error: `cfg` predicate is not specified
-  --> $DIR/doc-cfg.rs:3:7
+error: only `hide` or `show` are allowed in `#[doc(auto_cfg(...))]`
+  --> $DIR/doc-cfg.rs:11:7
    |
-LL | #[doc(cfg(), cfg(foo, bar))]
-   |       ^^^^^ help: expected syntax is: `cfg(/* predicate */)`
+LL | #[doc(auto_cfg(42))]
+   |       ^^^^^^^^^^^^
+   |
+   = note: `#[deny(invalid_doc_attributes)]` on by default
 
-error: multiple `cfg` predicates are specified
-  --> $DIR/doc-cfg.rs:3:23
+error: `#![doc(auto_cfg(hide(...)))]` only accepts identifiers or key/value items
+  --> $DIR/doc-cfg.rs:12:21
    |
-LL | #[doc(cfg(), cfg(foo, bar))]
-   |                       ^^^
+LL | #[doc(auto_cfg(hide(true)))]
+   |                     ^^^^
 
-error: `cfg` predicate is not specified
-  --> $DIR/doc-cfg.rs:9:7
+error: `#![doc(auto_cfg(hide(...)))]` only accepts identifiers or key/value items
+  --> $DIR/doc-cfg.rs:13:21
    |
-LL | #[doc(cfg())]
-   |       ^^^^^ help: expected syntax is: `cfg(/* predicate */)`
+LL | #[doc(auto_cfg(hide(42)))]
+   |                     ^^
 
-error: multiple `cfg` predicates are specified
-  --> $DIR/doc-cfg.rs:10:16
+error: `#![doc(auto_cfg(hide(...)))]` only accepts identifiers or key/value items
+  --> $DIR/doc-cfg.rs:14:21
    |
-LL | #[doc(cfg(foo, bar))]
-   |                ^^^
+LL | #[doc(auto_cfg(hide("a")))]
+   |                     ^^^
+
+error: `#![doc(auto_cfg(hide(...)))]` only accepts identifiers or key/value items
+  --> $DIR/doc-cfg.rs:15:21
+   |
+LL | #[doc(auto_cfg(hide(foo::bar)))]
+   |                     ^^^^^^^^
+
+error: expected boolean for `#[doc(auto_cfg = ...)]`
+  --> $DIR/doc-cfg.rs:16:7
+   |
+LL | #[doc(auto_cfg = 42)]
+   |       ^^^^^^^^^^^^^
+
+error: expected boolean for `#[doc(auto_cfg = ...)]`
+  --> $DIR/doc-cfg.rs:17:7
+   |
+LL | #[doc(auto_cfg = "a")]
+   |       ^^^^^^^^^^^^^^
 
 warning: unexpected `cfg` condition name: `foo`
   --> $DIR/doc-cfg.rs:6:11
@@ -42,5 +62,29 @@ LL | #[doc(cfg(foo), cfg(bar))]
    = help: to expect this configuration use `--check-cfg=cfg(bar)`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
 
-error: aborting due to 4 previous errors; 2 warnings emitted
+error: `cfg` predicate is not specified
+  --> $DIR/doc-cfg.rs:3:7
+   |
+LL | #[doc(cfg(), cfg(foo, bar))]
+   |       ^^^^^ help: expected syntax is: `cfg(/* predicate */)`
+
+error: multiple `cfg` predicates are specified
+  --> $DIR/doc-cfg.rs:3:23
+   |
+LL | #[doc(cfg(), cfg(foo, bar))]
+   |                       ^^^
+
+error: `cfg` predicate is not specified
+  --> $DIR/doc-cfg.rs:9:7
+   |
+LL | #[doc(cfg())]
+   |       ^^^^^ help: expected syntax is: `cfg(/* predicate */)`
+
+error: multiple `cfg` predicates are specified
+  --> $DIR/doc-cfg.rs:10:16
+   |
+LL | #[doc(cfg(foo, bar))]
+   |                ^^^
+
+error: aborting due to 11 previous errors; 2 warnings emitted
 
diff --git a/tests/rustdoc-ui/doctest/doctest-output.edition2015.stdout b/tests/rustdoc-ui/doctest/doctest-output.edition2015.stdout
index 0e2e30390ad..2ff7174577e 100644
--- a/tests/rustdoc-ui/doctest/doctest-output.edition2015.stdout
+++ b/tests/rustdoc-ui/doctest/doctest-output.edition2015.stdout
@@ -1,8 +1,8 @@
 
 running 3 tests
-test $DIR/doctest-output.rs - (line 12) ... ok
-test $DIR/doctest-output.rs - ExpandedStruct (line 28) ... ok
-test $DIR/doctest-output.rs - foo::bar (line 22) ... ok
+test $DIR/doctest-output.rs - (line 14) ... ok
+test $DIR/doctest-output.rs - ExpandedStruct (line 30) ... ok
+test $DIR/doctest-output.rs - foo::bar (line 24) ... ok
 
 test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
 
diff --git a/tests/rustdoc-ui/doctest/doctest-output.edition2024.stdout b/tests/rustdoc-ui/doctest/doctest-output.edition2024.stdout
index 0e2e30390ad..20bfd7e7086 100644
--- a/tests/rustdoc-ui/doctest/doctest-output.edition2024.stdout
+++ b/tests/rustdoc-ui/doctest/doctest-output.edition2024.stdout
@@ -1,8 +1,9 @@
 
 running 3 tests
-test $DIR/doctest-output.rs - (line 12) ... ok
-test $DIR/doctest-output.rs - ExpandedStruct (line 28) ... ok
-test $DIR/doctest-output.rs - foo::bar (line 22) ... ok
+test $DIR/doctest-output.rs - (line 14) ... ok
+test $DIR/doctest-output.rs - ExpandedStruct (line 30) ... ok
+test $DIR/doctest-output.rs - foo::bar (line 24) ... ok
 
 test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
 
+all doctests ran in $TIME; merged doctests compilation took $TIME
diff --git a/tests/rustdoc-ui/doctest/doctest-output.rs b/tests/rustdoc-ui/doctest/doctest-output.rs
index 04bd1813b4c..943f59e8b15 100644
--- a/tests/rustdoc-ui/doctest/doctest-output.rs
+++ b/tests/rustdoc-ui/doctest/doctest-output.rs
@@ -7,6 +7,8 @@
 //@[edition2024]compile-flags:--test --test-args=--test-threads=1
 //@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
 //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
+//@ normalize-stdout: "ran in \d+\.\d+s" -> "ran in $$TIME"
+//@ normalize-stdout: "compilation took \d+\.\d+s" -> "compilation took $$TIME"
 //@ check-pass
 
 //! ```
diff --git a/tests/rustdoc-ui/doctest/merged-ignore-no_run.rs b/tests/rustdoc-ui/doctest/merged-ignore-no_run.rs
index 7dac64e6de4..f92bea74bfe 100644
--- a/tests/rustdoc-ui/doctest/merged-ignore-no_run.rs
+++ b/tests/rustdoc-ui/doctest/merged-ignore-no_run.rs
@@ -2,6 +2,8 @@
 //@ compile-flags:--test --test-args=--test-threads=1
 //@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR"
 //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
+//@ normalize-stdout: "ran in \d+\.\d+s" -> "ran in $$TIME"
+//@ normalize-stdout: "compilation took \d+\.\d+s" -> "compilation took $$TIME"
 //@ check-pass
 
 /// ```ignore (test)
diff --git a/tests/rustdoc-ui/doctest/merged-ignore-no_run.stdout b/tests/rustdoc-ui/doctest/merged-ignore-no_run.stdout
index a32da0aeb96..6714cdb0b80 100644
--- a/tests/rustdoc-ui/doctest/merged-ignore-no_run.stdout
+++ b/tests/rustdoc-ui/doctest/merged-ignore-no_run.stdout
@@ -1,7 +1,8 @@
 
 running 2 tests
-test $DIR/merged-ignore-no_run.rs - ignored (line 7) ... ignored
-test $DIR/merged-ignore-no_run.rs - no_run (line 12) - compile ... ok
+test $DIR/merged-ignore-no_run.rs - ignored (line 9) ... ignored
+test $DIR/merged-ignore-no_run.rs - no_run (line 14) - compile ... ok
 
 test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in $TIME
 
+all doctests ran in $TIME; merged doctests compilation took $TIME
diff --git a/tests/rustdoc-ui/feature-gate-doc_cfg.rs b/tests/rustdoc-ui/feature-gate-doc_cfg.rs
new file mode 100644
index 00000000000..b474a1524bc
--- /dev/null
+++ b/tests/rustdoc-ui/feature-gate-doc_cfg.rs
@@ -0,0 +1,6 @@
+#![doc(auto_cfg)] //~ ERROR
+#![doc(auto_cfg(false))] //~ ERROR
+#![doc(auto_cfg(true))] //~ ERROR
+#![doc(auto_cfg(hide(feature = "solecism")))] //~ ERROR
+#![doc(auto_cfg(show(feature = "bla")))] //~ ERROR
+#![doc(cfg(feature = "solecism"))] //~ ERROR
diff --git a/tests/rustdoc-ui/feature-gate-doc_cfg.stderr b/tests/rustdoc-ui/feature-gate-doc_cfg.stderr
new file mode 100644
index 00000000000..68a86c1abb7
--- /dev/null
+++ b/tests/rustdoc-ui/feature-gate-doc_cfg.stderr
@@ -0,0 +1,63 @@
+error[E0658]: `#[doc(auto_cfg)]` is experimental
+  --> $DIR/feature-gate-doc_cfg.rs:1:1
+   |
+LL | #![doc(auto_cfg)]
+   | ^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #43781 <https://github.com/rust-lang/rust/issues/43781> for more information
+   = help: add `#![feature(doc_cfg)]` 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]: `#[doc(auto_cfg)]` is experimental
+  --> $DIR/feature-gate-doc_cfg.rs:2:1
+   |
+LL | #![doc(auto_cfg(false))]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #43781 <https://github.com/rust-lang/rust/issues/43781> for more information
+   = help: add `#![feature(doc_cfg)]` 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]: `#[doc(auto_cfg)]` is experimental
+  --> $DIR/feature-gate-doc_cfg.rs:3:1
+   |
+LL | #![doc(auto_cfg(true))]
+   | ^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #43781 <https://github.com/rust-lang/rust/issues/43781> for more information
+   = help: add `#![feature(doc_cfg)]` 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]: `#[doc(auto_cfg)]` is experimental
+  --> $DIR/feature-gate-doc_cfg.rs:4:1
+   |
+LL | #![doc(auto_cfg(hide(feature = "solecism")))]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #43781 <https://github.com/rust-lang/rust/issues/43781> for more information
+   = help: add `#![feature(doc_cfg)]` 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]: `#[doc(auto_cfg)]` is experimental
+  --> $DIR/feature-gate-doc_cfg.rs:5:1
+   |
+LL | #![doc(auto_cfg(show(feature = "bla")))]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #43781 <https://github.com/rust-lang/rust/issues/43781> for more information
+   = help: add `#![feature(doc_cfg)]` 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]: `#[doc(cfg)]` is experimental
+  --> $DIR/feature-gate-doc_cfg.rs:6:1
+   |
+LL | #![doc(cfg(feature = "solecism"))]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #43781 <https://github.com/rust-lang/rust/issues/43781> for more information
+   = help: add `#![feature(doc_cfg)]` 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 6 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/rustdoc-ui/feature-gate-doc_cfg_hide.rs b/tests/rustdoc-ui/feature-gate-doc_cfg_hide.rs
deleted file mode 100644
index 17812018b9b..00000000000
--- a/tests/rustdoc-ui/feature-gate-doc_cfg_hide.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#![doc(cfg_hide(test))]
-//~^ ERROR `#[doc(cfg_hide)]` is experimental
-
-#[cfg(not(test))]
-pub fn public_fn() {}
-#[cfg(test)]
-pub fn internal_use_only() {}
diff --git a/tests/rustdoc-ui/feature-gate-doc_cfg_hide.stderr b/tests/rustdoc-ui/feature-gate-doc_cfg_hide.stderr
deleted file mode 100644
index 55135986ffe..00000000000
--- a/tests/rustdoc-ui/feature-gate-doc_cfg_hide.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0658]: `#[doc(cfg_hide)]` is experimental
-  --> $DIR/feature-gate-doc_cfg_hide.rs:1:1
-   |
-LL | #![doc(cfg_hide(test))]
-   | ^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #43781 <https://github.com/rust-lang/rust/issues/43781> for more information
-   = help: add `#![feature(doc_cfg_hide)]` 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 1 previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/rustdoc-ui/intra-doc/type-alias-primitive-suggestion.rs b/tests/rustdoc-ui/intra-doc/type-alias-primitive-suggestion.rs
new file mode 100644
index 00000000000..c4527c626d9
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/type-alias-primitive-suggestion.rs
@@ -0,0 +1,21 @@
+// Ensure that no warning is emitted if the disambiguator is used for type alias.
+// Regression test for <https://github.com/rust-lang/rust/issues/146855>.
+
+#![deny(rustdoc::broken_intra_doc_links)]
+
+pub struct Foo;
+
+#[allow(non_camel_case_types)]
+pub type f32 = Foo;
+
+/// This function returns [`f32`].
+//~^ ERROR: `f32` is both a type alias and a primitive type
+//~| HELP: to link to the type alias, prefix with `tyalias@`
+//~| HELP: to link to the primitive type, prefix with `prim@`
+pub fn my_fn() -> f32 {}
+
+/// This function returns [type@f32].
+//~^ ERROR: `f32` is both a type alias and a primitive type
+//~| HELP: to link to the type alias, prefix with `tyalias@`
+//~| HELP: to link to the primitive type, prefix with `prim@`
+pub fn my_fn2() -> f32 {}
diff --git a/tests/rustdoc-ui/intra-doc/type-alias-primitive-suggestion.stderr b/tests/rustdoc-ui/intra-doc/type-alias-primitive-suggestion.stderr
new file mode 100644
index 00000000000..c99e7d1d104
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/type-alias-primitive-suggestion.stderr
@@ -0,0 +1,39 @@
+error: `f32` is both a type alias and a primitive type
+  --> $DIR/type-alias-primitive-suggestion.rs:11:29
+   |
+LL | /// This function returns [`f32`].
+   |                             ^^^ ambiguous link
+   |
+note: the lint level is defined here
+  --> $DIR/type-alias-primitive-suggestion.rs:4:9
+   |
+LL | #![deny(rustdoc::broken_intra_doc_links)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: to link to the type alias, prefix with `tyalias@`
+   |
+LL | /// This function returns [`tyalias@f32`].
+   |                             ++++++++
+help: to link to the primitive type, prefix with `prim@`
+   |
+LL | /// This function returns [`prim@f32`].
+   |                             +++++
+
+error: `f32` is both a type alias and a primitive type
+  --> $DIR/type-alias-primitive-suggestion.rs:17:28
+   |
+LL | /// This function returns [type@f32].
+   |                            ^^^^^^^^ ambiguous link
+   |
+help: to link to the type alias, prefix with `tyalias@`
+   |
+LL - /// This function returns [type@f32].
+LL + /// This function returns [tyalias@f32].
+   |
+help: to link to the primitive type, prefix with `prim@`
+   |
+LL - /// This function returns [type@f32].
+LL + /// This function returns [prim@f32].
+   |
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/rustdoc-ui/intra-doc/type-alias-primitive.rs b/tests/rustdoc-ui/intra-doc/type-alias-primitive.rs
new file mode 100644
index 00000000000..62b2c83eeca
--- /dev/null
+++ b/tests/rustdoc-ui/intra-doc/type-alias-primitive.rs
@@ -0,0 +1,14 @@
+// Ensure that no warning is emitted if the disambiguator is used for type alias.
+// Regression test for <https://github.com/rust-lang/rust/issues/146855>.
+
+//@ check-pass
+
+#![deny(rustdoc::broken_intra_doc_links)]
+
+pub struct Foo;
+
+#[allow(non_camel_case_types)]
+pub type f32 = Foo;
+
+/// This function returns [`tyalias@f32`] and not [`prim@f32`].
+pub fn my_fn() -> f32 {}
diff --git a/tests/rustdoc-ui/invalid-cfg.rs b/tests/rustdoc-ui/invalid-cfg.rs
index d237b8605c0..aff36286c53 100644
--- a/tests/rustdoc-ui/invalid-cfg.rs
+++ b/tests/rustdoc-ui/invalid-cfg.rs
@@ -1,4 +1,4 @@
 #![feature(doc_cfg)]
 #[doc(cfg = "x")] //~ ERROR not followed by parentheses
 #[doc(cfg(x, y))] //~ ERROR multiple `cfg` predicates
-struct S {}
+pub struct S {}
diff --git a/tests/rustdoc-ui/issues/issue-91713.stdout b/tests/rustdoc-ui/issues/issue-91713.stdout
index 30aadfe89f4..d34714be6c9 100644
--- a/tests/rustdoc-ui/issues/issue-91713.stdout
+++ b/tests/rustdoc-ui/issues/issue-91713.stdout
@@ -1,11 +1,11 @@
 Available passes for running rustdoc:
        check-doc-cfg - checks `#[doc(cfg(...))]` for stability feature and unexpected cfgs
 check_doc_test_visibility - run various visibility-related lints on doctests
+   propagate-doc-cfg - propagates `#[doc(cfg(...))]` to child items
 strip-aliased-non-local - strips all non-local private aliased items from the output
         strip-hidden - strips all `#[doc(hidden)]` items from the output
        strip-private - strips all private items from a crate which cannot be seen externally, implies strip-priv-imports
   strip-priv-imports - strips all private import statements (`use`, `extern crate`) from a crate
-   propagate-doc-cfg - propagates `#[doc(cfg(...))]` to child items
  propagate-stability - propagates stability to child items
 collect-intra-doc-links - resolves intra-doc links
  collect-trait-impls - retrieves trait impls for items in the crate
@@ -16,11 +16,11 @@ Default passes for rustdoc:
  collect-trait-impls
 check_doc_test_visibility
        check-doc-cfg
+collect-intra-doc-links
 strip-aliased-non-local
         strip-hidden  (when not --document-hidden-items)
        strip-private  (when not --document-private-items)
   strip-priv-imports  (when --document-private-items)
-collect-intra-doc-links
    propagate-doc-cfg
  propagate-stability
            run-lints
diff --git a/tests/rustdoc-ui/lints/doc_cfg_hide.rs b/tests/rustdoc-ui/lints/doc_cfg_hide.rs
index 9a8bce2a92a..397b21393e5 100644
--- a/tests/rustdoc-ui/lints/doc_cfg_hide.rs
+++ b/tests/rustdoc-ui/lints/doc_cfg_hide.rs
@@ -1,7 +1,4 @@
-#![feature(doc_cfg_hide)]
-
-#![doc(cfg_hide = "test")] //~ ERROR
-#![doc(cfg_hide)] //~ ERROR
-
-#[doc(cfg_hide(doc))] //~ ERROR
-pub fn foo() {}
+#![feature(doc_cfg)]
+#![doc(auto_cfg(hide = "test"))] //~ ERROR
+#![doc(auto_cfg(hide))] //~ ERROR
+#![doc(auto_cfg(hide(not(windows))))] //~ ERROR
diff --git a/tests/rustdoc-ui/lints/doc_cfg_hide.stderr b/tests/rustdoc-ui/lints/doc_cfg_hide.stderr
index 0c9d0879b0a..c63c8d607fa 100644
--- a/tests/rustdoc-ui/lints/doc_cfg_hide.stderr
+++ b/tests/rustdoc-ui/lints/doc_cfg_hide.stderr
@@ -1,27 +1,22 @@
-error: this attribute can only be applied at the crate level
-  --> $DIR/doc_cfg_hide.rs:6:7
+error: `#![doc(auto_cfg(hide(...)))]` expects a list of items
+  --> $DIR/doc_cfg_hide.rs:2:8
    |
-LL | #[doc(cfg_hide(doc))]
-   |       ^^^^^^^^^^^^^
+LL | #![doc(auto_cfg(hide = "test"))]
+   |        ^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
    = note: `#[deny(invalid_doc_attributes)]` on by default
-help: to apply to the crate, use an inner attribute
-   |
-LL | #![doc(cfg_hide(doc))]
-   |  +
 
-error: `#[doc(cfg_hide(...))]` takes a list of attributes
+error: `#![doc(auto_cfg(hide(...)))]` expects a list of items
   --> $DIR/doc_cfg_hide.rs:3:8
    |
-LL | #![doc(cfg_hide = "test")]
-   |        ^^^^^^^^^^^^^^^^^
+LL | #![doc(auto_cfg(hide))]
+   |        ^^^^^^^^^^^^^^
 
-error: `#[doc(cfg_hide(...))]` takes a list of attributes
-  --> $DIR/doc_cfg_hide.rs:4:8
+error: `#![doc(auto_cfg(hide(...)))]` only accepts identifiers or key/value items
+  --> $DIR/doc_cfg_hide.rs:4:22
    |
-LL | #![doc(cfg_hide)]
-   |        ^^^^^^^^
+LL | #![doc(auto_cfg(hide(not(windows))))]
+   |                      ^^^^^^^^^^^^
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.rs b/tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.rs
new file mode 100644
index 00000000000..d7efc201e7e
--- /dev/null
+++ b/tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.rs
@@ -0,0 +1,25 @@
+// this test ensures that bad HTML with multiline tags doesn't cause an ICE
+// regression test for https://github.com/rust-lang/rust/issues/146890
+#[deny(rustdoc::invalid_html_tags)]
+
+/// <TABLE
+/// BORDER>
+/// <TR
+/// >
+/// <TH
+//~^ ERROR: unclosed HTML tag `TH`
+/// >key
+/// </TD
+//~^ ERROR: unopened HTML tag `TD`
+/// >
+/// <TH
+//~^ ERROR: unclosed HTML tag `TH`
+/// >value
+/// </TD
+//~^ ERROR: unopened HTML tag `TD`
+/// >
+/// </TR
+/// >
+/// </TABLE
+/// >
+pub fn foo() {}
diff --git a/tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.stderr b/tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.stderr
new file mode 100644
index 00000000000..64a82b3a952
--- /dev/null
+++ b/tests/rustdoc-ui/lints/invalid-html-tags-ice-146890.stderr
@@ -0,0 +1,38 @@
+error: unopened HTML tag `TD`
+  --> $DIR/invalid-html-tags-ice-146890.rs:12:5
+   |
+LL |   /// </TD
+   |  _____^
+LL | |
+LL | | /// >
+   | |_____^
+   |
+note: the lint level is defined here
+  --> $DIR/invalid-html-tags-ice-146890.rs:3:8
+   |
+LL | #[deny(rustdoc::invalid_html_tags)]
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: unopened HTML tag `TD`
+  --> $DIR/invalid-html-tags-ice-146890.rs:18:5
+   |
+LL |   /// </TD
+   |  _____^
+LL | |
+LL | | /// >
+   | |_____^
+
+error: unclosed HTML tag `TH`
+  --> $DIR/invalid-html-tags-ice-146890.rs:9:5
+   |
+LL | /// <TH
+   |     ^^^
+
+error: unclosed HTML tag `TH`
+  --> $DIR/invalid-html-tags-ice-146890.rs:15:5
+   |
+LL | /// <TH
+   |     ^^^
+
+error: aborting due to 4 previous errors
+
diff --git a/tests/rustdoc/attribute-rendering.rs b/tests/rustdoc/attribute-rendering.rs
deleted file mode 100644
index fb40d0a9887..00000000000
--- a/tests/rustdoc/attribute-rendering.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-#![crate_name = "foo"]
-
-//@ has 'foo/fn.f.html'
-//@ has - //*[@'class="code-attribute"]' '#[unsafe(export_name = "f")]'
-//@ has - //*[@'class="rust item-decl"]' 'pub fn f()'
-#[unsafe(export_name = "\
-f")]
-pub fn f() {}
diff --git a/tests/rustdoc/attributes.rs b/tests/rustdoc/attributes.rs
index 33e4e31bec6..429a42a7252 100644
--- a/tests/rustdoc/attributes.rs
+++ b/tests/rustdoc/attributes.rs
@@ -9,6 +9,18 @@ pub extern "C" fn f() {}
 #[unsafe(export_name = "bar")]
 pub extern "C" fn g() {}
 
+//@ has foo/fn.escape_special.html '//*[@class="code-attribute"]' \
+//                                 '#[unsafe(export_name = "\n\"\n")]'
+#[unsafe(export_name = "\n\"
+")]
+pub extern "C" fn escape_special() {}
+
+// issue: <https://github.com/rust-lang/rust/issues/142835>
+//@ has foo/fn.escape_html.html '//*[@class="code-attribute"]' \
+//                              '#[unsafe(export_name = "<script>alert()</script>")]'
+#[unsafe(export_name = "<script>alert()</script>")]
+pub extern "C" fn escape_html() {}
+
 //@ has foo/fn.example.html '//*[@class="code-attribute"]' '#[unsafe(link_section = ".text")]'
 #[unsafe(link_section = ".text")]
 pub extern "C" fn example() {}
diff --git a/tests/rustdoc/auxiliary/ext-repr.rs b/tests/rustdoc/auxiliary/ext-repr.rs
new file mode 100644
index 00000000000..25acaa49449
--- /dev/null
+++ b/tests/rustdoc/auxiliary/ext-repr.rs
@@ -0,0 +1,5 @@
+#[repr(i8)]
+pub enum ReprI8 {
+    Var0,
+    Var1,
+}
diff --git a/tests/rustdoc/doc-auto-cfg-public-in-private.rs b/tests/rustdoc/doc-auto-cfg-public-in-private.rs
new file mode 100644
index 00000000000..b78e3f1b932
--- /dev/null
+++ b/tests/rustdoc/doc-auto-cfg-public-in-private.rs
@@ -0,0 +1,16 @@
+// This test ensures that even though private items are removed from generated docs,
+// their `cfg`s will still impact their child items.
+
+#![feature(doc_cfg)]
+#![crate_name = "foo"]
+
+pub struct X;
+
+#[cfg(not(feature = "blob"))]
+fn foo() {
+    impl X {
+        //@ has 'foo/struct.X.html'
+        //@ has - '//*[@class="stab portability"]' 'Available on non-crate feature blob only.'
+        pub fn bar() {}
+    }
+}
diff --git a/tests/rustdoc/doc-auto-cfg.rs b/tests/rustdoc/doc-auto-cfg.rs
index b3fe8922fd7..e56cf18d08a 100644
--- a/tests/rustdoc/doc-auto-cfg.rs
+++ b/tests/rustdoc/doc-auto-cfg.rs
@@ -1,4 +1,4 @@
-#![feature(doc_auto_cfg)]
+#![feature(doc_cfg)]
 #![crate_name = "foo"]
 
 //@ has foo/fn.foo.html
diff --git a/tests/rustdoc/doc-cfg/doc-cfg-hide.rs b/tests/rustdoc/doc-cfg/doc-cfg-hide.rs
index ceb1f99fae0..e919206d3a4 100644
--- a/tests/rustdoc/doc-cfg/doc-cfg-hide.rs
+++ b/tests/rustdoc/doc-cfg/doc-cfg-hide.rs
@@ -1,7 +1,7 @@
 #![crate_name = "oud"]
-#![feature(doc_auto_cfg, doc_cfg, doc_cfg_hide)]
+#![feature(doc_cfg)]
 
-#![doc(cfg_hide(feature = "solecism"))]
+#![doc(auto_cfg(hide(feature = "solecism")))]
 
 //@ has 'oud/struct.Solecism.html'
 //@ count   - '//*[@class="stab portability"]' 0
@@ -18,7 +18,7 @@ pub struct Scribacious;
 
 //@ has 'oud/struct.Hyperdulia.html'
 //@ count   - '//*[@class="stab portability"]' 1
-//@ matches - '//*[@class="stab portability"]' 'crate feature hyperdulia'
+//@ matches - '//*[@class="stab portability"]' 'crate features hyperdulia only'
 //@ compile-flags:--cfg feature="hyperdulia"
 #[cfg(feature = "solecism")]
 #[cfg(feature = "hyperdulia")]
@@ -26,7 +26,7 @@ pub struct Hyperdulia;
 
 //@ has 'oud/struct.Oystercatcher.html'
 //@ count   - '//*[@class="stab portability"]' 1
-//@ matches - '//*[@class="stab portability"]' 'crate feature oystercatcher only'
+//@ matches - '//*[@class="stab portability"]' 'crate features oystercatcher only'
 //@ compile-flags:--cfg feature="oystercatcher"
 #[cfg(all(feature = "solecism", feature = "oystercatcher"))]
 pub struct Oystercatcher;
diff --git a/tests/rustdoc/doc-cfg/doc-cfg-implicit-gate.rs b/tests/rustdoc/doc-cfg/doc-cfg-implicit-gate.rs
index b5b8d0f427b..9ae8b8fca4f 100644
--- a/tests/rustdoc/doc-cfg/doc-cfg-implicit-gate.rs
+++ b/tests/rustdoc/doc-cfg/doc-cfg-implicit-gate.rs
@@ -1,7 +1,8 @@
 //@ compile-flags:--cfg feature="worricow"
+#![feature(doc_cfg)]
 #![crate_name = "xenogenous"]
 
 //@ has 'xenogenous/struct.Worricow.html'
-//@ count   - '//*[@class="stab portability"]' 0
+//@ count   - '//*[@class="stab portability"]' 1
 #[cfg(feature = "worricow")]
 pub struct Worricow;
diff --git a/tests/rustdoc/doc-cfg/doc-cfg-implicit.rs b/tests/rustdoc/doc-cfg/doc-cfg-implicit.rs
index 69b10867ee3..c092675ee5c 100644
--- a/tests/rustdoc/doc-cfg/doc-cfg-implicit.rs
+++ b/tests/rustdoc/doc-cfg/doc-cfg-implicit.rs
@@ -1,5 +1,5 @@
 #![crate_name = "funambulism"]
-#![feature(doc_auto_cfg, doc_cfg)]
+#![feature(doc_cfg)]
 
 //@ has 'funambulism/struct.Disorbed.html'
 //@ count   - '//*[@class="stab portability"]' 1
diff --git a/tests/rustdoc/doc_auto_cfg.rs b/tests/rustdoc/doc_auto_cfg.rs
new file mode 100644
index 00000000000..19ef174c177
--- /dev/null
+++ b/tests/rustdoc/doc_auto_cfg.rs
@@ -0,0 +1,77 @@
+// Test covering RFC 3631 features.
+
+#![crate_name = "foo"]
+#![feature(doc_cfg)]
+#![doc(auto_cfg(hide(feature = "hidden")))]
+
+//@ has 'foo/index.html'
+//@ !has - '//*[@class="stab portability"]' 'Non-moustache'
+//@ has - '//*[@class="stab portability"]' 'Non-pistache'
+//@ count - '//*[@class="stab portability"]' 1
+
+//@ has 'foo/m/index.html'
+//@ count - '//*[@title="Available on non-crate feature `hidden` only"]' 2
+#[cfg(not(feature = "hidden"))]
+pub mod m {
+    //@ count 'foo/m/struct.A.html' '//*[@class="stab portability"]' 0
+    pub struct A;
+
+    //@ has 'foo/m/inner/index.html' '//*[@class="stab portability"]' 'Available on non-crate feature hidden only.'
+    #[doc(auto_cfg(show(feature = "hidden")))]
+    pub mod inner {
+        //@ has 'foo/m/inner/struct.B.html' '//*[@class="stab portability"]' 'Available on non-crate feature hidden only.'
+        pub struct B;
+
+        //@ count 'foo/m/inner/struct.A.html' '//*[@class="stab portability"]' 0
+        #[doc(auto_cfg(hide(feature = "hidden")))]
+        pub struct A;
+    }
+
+    //@ has 'foo/m/struct.B.html' '//*[@class="stab portability"]' 'Available on non-crate feature hidden only.'
+    #[doc(auto_cfg(show(feature = "hidden")))]
+    pub struct B;
+}
+
+//@ count 'foo/n/index.html' '//*[@title="Available on non-crate feature `moustache` only"]' 3
+//@ count - '//dl/dt' 4
+#[cfg(not(feature = "moustache"))]
+#[doc(auto_cfg = false)]
+pub mod n {
+    // Should not have `moustache` listed.
+    //@ count 'foo/n/struct.X.html' '//*[@class="stab portability"]' 0
+    pub struct X;
+
+    // Should re-enable `auto_cfg` and make `moustache` listed.
+    //@ has 'foo/n/struct.Y.html' '//*[@class="stab portability"]' \
+    //  'Available on non-crate feature moustache only.'
+    #[doc(auto_cfg)]
+    pub struct Y;
+
+    // Should re-enable `auto_cfg` and make `moustache` listed for itself
+    // and for `Y`.
+    //@ has 'foo/n/inner/index.html' '//*[@class="stab portability"]' \
+    //  'Available on non-crate feature moustache only.'
+    #[doc(auto_cfg = true)]
+    pub mod inner {
+        //@ has 'foo/n/inner/struct.Y.html' '//*[@class="stab portability"]' \
+        //  'Available on non-crate feature moustache only.'
+        pub struct Y;
+    }
+
+    // Should re-enable `auto_cfg` and make `moustache` listed.
+    //@ has 'foo/n/struct.Z.html' '//*[@class="stab portability"]' \
+    //  'Available on non-crate feature moustache only.'
+    #[doc(auto_cfg(hide(feature = "hidden")))]
+    pub struct Z;
+}
+
+// Checking inheritance.
+//@ has 'foo/o/index.html' '//*[@class="stab portability"]' \
+//  'Available on non-crate feature pistache only.'
+#[doc(cfg(not(feature = "pistache")))]
+pub mod o {
+    //@ has 'foo/o/struct.A.html' '//*[@class="stab portability"]' \
+    //  'Available on non-crate feature pistache and non-crate feature tarte only.'
+    #[doc(cfg(not(feature = "tarte")))]
+    pub struct A;
+}
diff --git a/tests/rustdoc/doc_auto_cfg_reexports.rs b/tests/rustdoc/doc_auto_cfg_reexports.rs
new file mode 100644
index 00000000000..ecfe9aabcfe
--- /dev/null
+++ b/tests/rustdoc/doc_auto_cfg_reexports.rs
@@ -0,0 +1,35 @@
+// Checks that `cfg` are correctly applied on inlined reexports.
+
+#![crate_name = "foo"]
+#![feature(doc_cfg)]
+
+// Check with `std` item.
+//@ has 'foo/index.html' '//*[@class="stab portability"]' 'Non-moustache'
+//@ has 'foo/struct.C.html' '//*[@class="stab portability"]' \
+//      'Available on non-crate feature moustache only.'
+#[cfg(not(feature = "moustache"))]
+pub use std::cell::RefCell as C;
+
+// Check with local item.
+mod x {
+    pub struct B;
+}
+
+//@ has 'foo/index.html' '//*[@class="stab portability"]' 'Non-pistache'
+//@ has 'foo/struct.B.html' '//*[@class="stab portability"]' \
+//      'Available on non-crate feature pistache only.'
+#[cfg(not(feature = "pistache"))]
+pub use crate::x::B;
+
+// Now checking that `cfg`s are not applied on non-inlined reexports.
+pub mod pub_sub_mod {
+    //@ has 'foo/pub_sub_mod/index.html'
+    // There should be only only item with `cfg` note.
+    //@ count - '//*[@class="stab portability"]' 1
+    // And obviously the item should be "blabla".
+    //@ has - '//dt' 'blablaNon-pistache'
+    #[cfg(not(feature = "pistache"))]
+    pub fn blabla() {}
+
+    pub use self::blabla as another;
+}
diff --git a/tests/rustdoc/impl/doc_auto_cfg_nested_impl.rs b/tests/rustdoc/impl/doc_auto_cfg_nested_impl.rs
index f85d7b23637..f24ebcd52ac 100644
--- a/tests/rustdoc/impl/doc_auto_cfg_nested_impl.rs
+++ b/tests/rustdoc/impl/doc_auto_cfg_nested_impl.rs
@@ -1,6 +1,6 @@
 // Regression test for <https://github.com/rust-lang/rust/issues/101129>.
 
-#![feature(doc_auto_cfg)]
+#![feature(doc_cfg)]
 #![crate_type = "lib"]
 #![crate_name = "foo"]
 
diff --git a/tests/rustdoc/inline_cross/attributes.rs b/tests/rustdoc/inline_cross/attributes.rs
index 4747f8ad67c..1657b7bdc8f 100644
--- a/tests/rustdoc/inline_cross/attributes.rs
+++ b/tests/rustdoc/inline_cross/attributes.rs
@@ -1,7 +1,20 @@
+// Ensure that we render attributes on inlined cross-crate re-exported items.
+// issue: <https://github.com/rust-lang/rust/issues/144004>
+
 //@ aux-crate:attributes=attributes.rs
 //@ edition:2021
 #![crate_name = "user"]
 
-//@ has 'user/struct.NonExhaustive.html'
-//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[non_exhaustive]'
+//@ has 'user/fn.no_mangle.html' '//pre[@class="rust item-decl"]' '#[unsafe(no_mangle)]'
+pub use attributes::no_mangle;
+
+//@ has 'user/fn.link_section.html' '//pre[@class="rust item-decl"]' \
+//                                  '#[unsafe(link_section = ".here")]'
+pub use attributes::link_section;
+
+//@ has 'user/fn.export_name.html' '//pre[@class="rust item-decl"]' \
+//                                 '#[unsafe(export_name = "exonym")]'
+pub use attributes::export_name;
+
+//@ has 'user/struct.NonExhaustive.html' '//pre[@class="rust item-decl"]' '#[non_exhaustive]'
 pub use attributes::NonExhaustive;
diff --git a/tests/rustdoc/inline_cross/auxiliary/attributes.rs b/tests/rustdoc/inline_cross/auxiliary/attributes.rs
index c6f155d4ba5..6068d385585 100644
--- a/tests/rustdoc/inline_cross/auxiliary/attributes.rs
+++ b/tests/rustdoc/inline_cross/auxiliary/attributes.rs
@@ -1,2 +1,11 @@
+#[unsafe(no_mangle)]
+pub fn no_mangle() {}
+
+#[unsafe(link_section = ".here")]
+pub fn link_section() {}
+
+#[unsafe(export_name = "exonym")]
+pub fn export_name() {}
+
 #[non_exhaustive]
 pub struct NonExhaustive;
diff --git a/tests/rustdoc/inline_cross/auxiliary/repr.rs b/tests/rustdoc/inline_cross/auxiliary/repr.rs
deleted file mode 100644
index 0211e1a8658..00000000000
--- a/tests/rustdoc/inline_cross/auxiliary/repr.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-#![feature(repr_simd)]
-
-#[repr(C, align(8))]
-pub struct ReprC {
-    field: u8,
-}
-#[repr(simd, packed(2))]
-pub struct ReprSimd {
-    field: [u8; 1],
-}
-#[repr(transparent)]
-pub struct ReprTransparent {
-    pub field: u8,
-}
-#[repr(isize)]
-pub enum ReprIsize {
-    Bla,
-}
-#[repr(u8)]
-pub enum ReprU8 {
-    Bla,
-}
-
-#[repr(transparent)] // private
-pub struct ReprTransparentPrivField {
-    field: u32, // non-1-ZST field
-}
-
-#[repr(transparent)] // public
-pub struct ReprTransparentPriv1ZstFields {
-    marker0: Marker,
-    pub main: u64, // non-1-ZST field
-    marker1: Marker,
-}
-
-#[repr(transparent)] // private
-pub struct ReprTransparentPrivFieldPub1ZstFields {
-    main: [u16; 0], // non-1-ZST field
-    pub marker: Marker,
-}
-
-pub struct Marker; // 1-ZST
diff --git a/tests/rustdoc/inline_cross/repr.rs b/tests/rustdoc/inline_cross/repr.rs
deleted file mode 100644
index d13e560b8d7..00000000000
--- a/tests/rustdoc/inline_cross/repr.rs
+++ /dev/null
@@ -1,40 +0,0 @@
-// Regression test for <https://github.com/rust-lang/rust/issues/110698>.
-// This test ensures that the re-exported items still have the `#[repr(...)]` attribute.
-
-//@ aux-build:repr.rs
-
-#![crate_name = "foo"]
-
-extern crate repr;
-
-//@ has 'foo/struct.ReprC.html'
-//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(C, align(8))]'
-pub use repr::ReprC;
-//@ has 'foo/struct.ReprSimd.html'
-//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(simd, packed(2))]'
-pub use repr::ReprSimd;
-//@ has 'foo/struct.ReprTransparent.html'
-//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
-pub use repr::ReprTransparent;
-//@ has 'foo/enum.ReprIsize.html'
-//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(isize)]'
-pub use repr::ReprIsize;
-//@ has 'foo/enum.ReprU8.html'
-//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(u8)]'
-pub use repr::ReprU8;
-
-// Regression test for <https://github.com/rust-lang/rust/issues/90435>.
-// Check that we show `#[repr(transparent)]` iff the non-1-ZST field is public or at least one
-// field is public in case all fields are 1-ZST fields.
-
-//@ has 'foo/struct.ReprTransparentPrivField.html'
-//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
-pub use repr::ReprTransparentPrivField;
-
-//@ has 'foo/struct.ReprTransparentPriv1ZstFields.html'
-//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
-pub use repr::ReprTransparentPriv1ZstFields;
-
-//@ has 'foo/struct.ReprTransparentPrivFieldPub1ZstFields.html'
-//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
-pub use repr::ReprTransparentPrivFieldPub1ZstFields;
diff --git a/tests/rustdoc/intra-doc/type-alias-primitive.rs b/tests/rustdoc/intra-doc/type-alias-primitive.rs
new file mode 100644
index 00000000000..7504166cbcc
--- /dev/null
+++ b/tests/rustdoc/intra-doc/type-alias-primitive.rs
@@ -0,0 +1,21 @@
+// Ensure that no warning is emitted if the disambiguator is used for type alias.
+// Regression test for <https://github.com/rust-lang/rust/issues/146855>.
+
+#![crate_name = "foo"]
+#![deny(rustdoc::broken_intra_doc_links)]
+
+pub struct Foo;
+
+#[allow(non_camel_case_types)]
+pub type f32 = Foo;
+
+/// This function returns [`tyalias@f32`] and not [bla][`prim@f32`].
+//@ has 'foo/fn.my_fn.html'
+//@ has - '//a[@href="type.f32.html"]' "f32"
+//@ has - '//a[@href="{{channel}}/std/primitive.f32.html"]' "bla"
+pub fn my_fn() -> f32 { 0. }
+
+/// This function returns [`typealias@f32`].
+//@ has 'foo/fn.my_other_fn.html'
+//@ has - '//a[@href="type.f32.html"]' "f32"
+pub fn my_other_fn() -> f32 { 0. }
diff --git a/tests/rustdoc/jump-to-def-assoc-items.rs b/tests/rustdoc/jump-to-def-assoc-items.rs
new file mode 100644
index 00000000000..8cbf9906283
--- /dev/null
+++ b/tests/rustdoc/jump-to-def-assoc-items.rs
@@ -0,0 +1,54 @@
+// This test ensures that patterns also get a link generated.
+
+//@ compile-flags: -Zunstable-options --generate-link-to-definition
+
+#![crate_name = "foo"]
+
+//@ has 'src/foo/jump-to-def-assoc-items.rs.html'
+
+pub trait Trait {
+    type T;
+}
+pub trait Another {
+    type T;
+    const X: u32;
+}
+
+pub struct Foo;
+
+impl Foo {
+    pub fn new() -> Self { Foo }
+}
+
+pub struct C;
+
+impl C {
+    pub fn wat() {}
+}
+
+pub struct Bar;
+impl Trait for Bar {
+    type T = Foo;
+}
+impl Another for Bar {
+    type T = C;
+    const X: u32 = 12;
+}
+
+pub fn bar() {
+    //@ has - '//a[@href="#20"]' 'new'
+    <Bar as Trait>::T::new();
+    //@ has - '//a[@href="#26"]' 'wat'
+    <Bar as Another>::T::wat();
+
+    match 12u32 {
+        //@ has - '//a[@href="#14"]' 'X'
+        <Bar as Another>::X => {}
+        _ => {}
+    }
+}
+
+pub struct Far {
+        //@ has - '//a[@href="#10"]' 'T'
+    x: <Bar as Trait>::T,
+}
diff --git a/tests/rustdoc/jump-to-def-ice-assoc-types.rs b/tests/rustdoc/jump-to-def-ice-assoc-types.rs
new file mode 100644
index 00000000000..9915c53668f
--- /dev/null
+++ b/tests/rustdoc/jump-to-def-ice-assoc-types.rs
@@ -0,0 +1,20 @@
+// This test ensures that associated types don't crash rustdoc jump to def.
+
+//@ compile-flags: -Zunstable-options --generate-link-to-definition
+
+
+#![crate_name = "foo"]
+
+//@ has 'src/foo/jump-to-def-ice-assoc-types.rs.html'
+
+pub trait Trait {
+    type Node;
+}
+
+pub fn y<G: Trait>() {
+    struct X<G>(G);
+
+    impl<G: Trait> Trait for X<G> {
+        type Node = G::Node;
+    }
+}
diff --git a/tests/rustdoc/jump-to-def-ice.rs b/tests/rustdoc/jump-to-def-ice.rs
new file mode 100644
index 00000000000..5578b9af3d7
--- /dev/null
+++ b/tests/rustdoc/jump-to-def-ice.rs
@@ -0,0 +1,24 @@
+// This test ensures that items with no body don't panic when generating
+// jump to def links.
+
+//@ compile-flags: -Zunstable-options --generate-link-to-definition
+
+#![crate_name = "foo"]
+
+//@ has 'src/foo/jump-to-def-ice.rs.html'
+
+pub trait A {
+    type T;
+    type U;
+}
+
+impl A for () {
+    type T = Self::U;
+    type U = ();
+}
+
+pub trait C {
+    type X;
+}
+
+pub struct F<T: C>(pub T::X);
diff --git a/tests/rustdoc/jump-to-def/jump-to-def-doc-links-calls.rs b/tests/rustdoc/jump-to-def/jump-to-def-doc-links-calls.rs
index 61856978773..55e59f23b6f 100644
--- a/tests/rustdoc/jump-to-def/jump-to-def-doc-links-calls.rs
+++ b/tests/rustdoc/jump-to-def/jump-to-def-doc-links-calls.rs
@@ -8,7 +8,7 @@
 pub struct Bar;
 
 impl std::default::Default for Bar {
-    //@ has - '//a[@href="#20-22"]' 'Self::new'
+    //@ has - '//a[@href="#20-22"]' 'new'
     fn default() -> Self {
         Self::new()
     }
@@ -16,7 +16,7 @@ impl std::default::Default for Bar {
 
 //@ has - '//a[@href="#8"]' 'Bar'
 impl Bar {
-     //@ has - '//a[@href="#24-26"]' 'Self::bar'
+     //@ has - '//a[@href="#24-26"]' 'bar'
      pub fn new()-> Self {
          Self::bar()
      }
diff --git a/tests/rustdoc/jump-to-def/jump-to-def-pats.rs b/tests/rustdoc/jump-to-def/jump-to-def-pats.rs
index 147902b44cf..852eba208db 100644
--- a/tests/rustdoc/jump-to-def/jump-to-def-pats.rs
+++ b/tests/rustdoc/jump-to-def/jump-to-def-pats.rs
@@ -30,13 +30,13 @@ pub fn foo() -> Result<(), ()> {
 impl<T, E> fmt::Display for MyEnum<T, E> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self {
-            //@ has - '//a[@href="#12"]' 'Self::Ok'
+            //@ has - '//a[@href="#12"]' 'Ok'
             Self::Ok(_) => f.write_str("MyEnum::Ok"),
-            //@ has - '//a[@href="#13"]' 'MyEnum::Err'
+            //@ has - '//a[@href="#13"]' 'Err'
             MyEnum::Err(_) => f.write_str("MyEnum::Err"),
-            //@ has - '//a[@href="#14"]' 'Self::Some'
+            //@ has - '//a[@href="#14"]' 'Some'
             Self::Some(_) => f.write_str("MyEnum::Some"),
-            //@ has - '//a[@href="#15"]' 'Self::None'
+            //@ has - '//a[@href="#15"]' 'None'
             Self::None => f.write_str("MyEnum::None"),
         }
     }
@@ -45,7 +45,7 @@ impl<T, E> fmt::Display for MyEnum<T, E> {
 impl X {
     fn p(&self) -> &str {
         match self {
-            //@ has - '//a[@href="#19"]' 'Self::A'
+            //@ has - '//a[@href="#19"]' 'A'
             Self::A => "X::A",
         }
     }
diff --git a/tests/rustdoc/jump-to-def/jump-to-non-local-method.rs b/tests/rustdoc/jump-to-def/jump-to-non-local-method.rs
index e2f530425f0..1d6d6b8d18f 100644
--- a/tests/rustdoc/jump-to-def/jump-to-non-local-method.rs
+++ b/tests/rustdoc/jump-to-def/jump-to-non-local-method.rs
@@ -21,9 +21,10 @@ pub fn bar2<T: Read>(readable: T) {
 }
 
 pub fn bar() {
-    //@ has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html#method.new"]' 'AtomicIsize::new'
+    //@ has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html"]' 'AtomicIsize'
+    //@ has - '//a[@href="{{channel}}/core/sync/atomic/struct.AtomicIsize.html#method.new"]' 'new'
     let _ = AtomicIsize::new(0);
-    //@ has - '//a[@href="#48"]' 'local_private'
+    //@ has - '//a[@href="#49"]' 'local_private'
     local_private();
 }
 
@@ -39,7 +40,7 @@ pub fn macro_call() -> Result<(), ()> {
 }
 
 pub fn variant() {
-    //@ has - '//a[@href="{{channel}}/core/cmp/enum.Ordering.html#variant.Less"]' 'Ordering::Less'
+    //@ has - '//a[@href="{{channel}}/core/cmp/enum.Ordering.html#variant.Less"]' 'Less'
     let _ = Ordering::Less;
     //@ has - '//a[@href="{{channel}}/core/marker/struct.PhantomData.html"]' 'PhantomData'
     let _: PhantomData::<usize> = PhantomData;
diff --git a/tests/rustdoc/reexport/auxiliary/reexports-attrs.rs b/tests/rustdoc/reexport/auxiliary/reexports-attrs.rs
deleted file mode 100644
index 96fa8209cde..00000000000
--- a/tests/rustdoc/reexport/auxiliary/reexports-attrs.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-#[unsafe(no_mangle)]
-pub fn f0() {}
-
-#[unsafe(link_section = ".here")]
-pub fn f1() {}
-
-#[unsafe(export_name = "f2export")]
-pub fn f2() {}
-
-#[repr(u8)]
-pub enum T0 { V1 }
-
-#[non_exhaustive]
-pub enum T1 {}
diff --git a/tests/rustdoc/reexport/doc_auto_cfg-reexport-foreign-113982.rs b/tests/rustdoc/reexport/doc_auto_cfg-reexport-foreign-113982.rs
index 76b25127a9c..f8ec4afc031 100644
--- a/tests/rustdoc/reexport/doc_auto_cfg-reexport-foreign-113982.rs
+++ b/tests/rustdoc/reexport/doc_auto_cfg-reexport-foreign-113982.rs
@@ -1,7 +1,7 @@
 //@ aux-build: issue-113982-doc_auto_cfg-reexport-foreign.rs
 
 // https://github.com/rust-lang/rust/issues/113982
-#![feature(no_core, doc_auto_cfg)]
+#![feature(no_core, doc_cfg)]
 #![no_core]
 #![crate_name = "foo"]
 
diff --git a/tests/rustdoc/reexport/glob-reexport-attribute-merge-doc-auto-cfg.rs b/tests/rustdoc/reexport/glob-reexport-attribute-merge-doc-auto-cfg.rs
index d0a2165ec8a..0aed2b0c462 100644
--- a/tests/rustdoc/reexport/glob-reexport-attribute-merge-doc-auto-cfg.rs
+++ b/tests/rustdoc/reexport/glob-reexport-attribute-merge-doc-auto-cfg.rs
@@ -2,7 +2,7 @@
 // the reexported item whereas glob reexports do with the `doc_auto_cfg` feature.
 
 #![crate_name = "foo"]
-#![feature(doc_auto_cfg)]
+#![feature(doc_cfg)]
 
 //@ has 'foo/index.html'
 // There are two items.
diff --git a/tests/rustdoc/reexport/private-mod-override-reexport.rs b/tests/rustdoc/reexport/private-mod-override-reexport.rs
new file mode 100644
index 00000000000..849acc5fdae
--- /dev/null
+++ b/tests/rustdoc/reexport/private-mod-override-reexport.rs
@@ -0,0 +1,13 @@
+// https://github.com/rust-lang/rust/issues/60926
+#![crate_name = "foo"]
+
+mod m1 {
+    pub mod m2 {
+        pub struct Foo;
+    }
+}
+
+pub use m1::*;
+use crate::m1::m2;
+
+//@ count foo/index.html '//a[@class="mod"]' 0
diff --git a/tests/rustdoc/reexport/reexport-attrs.rs b/tests/rustdoc/reexport/reexport-attrs.rs
deleted file mode 100644
index aec0a11c0c6..00000000000
--- a/tests/rustdoc/reexport/reexport-attrs.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-//@ aux-build: reexports-attrs.rs
-
-#![crate_name = "foo"]
-
-extern crate reexports_attrs;
-
-//@ has 'foo/fn.f0.html' '//pre[@class="rust item-decl"]' '#[unsafe(no_mangle)]'
-pub use reexports_attrs::f0;
-
-//@ has 'foo/fn.f1.html' '//pre[@class="rust item-decl"]' '#[unsafe(link_section = ".here")]'
-pub use reexports_attrs::f1;
-
-//@ has 'foo/fn.f2.html' '//pre[@class="rust item-decl"]' '#[unsafe(export_name = "f2export")]'
-pub use reexports_attrs::f2;
-
-//@ has 'foo/enum.T0.html' '//pre[@class="rust item-decl"]' '#[repr(u8)]'
-pub use reexports_attrs::T0;
-
-//@ has 'foo/enum.T1.html' '//pre[@class="rust item-decl"]' '#[non_exhaustive]'
-pub use reexports_attrs::T1;
diff --git a/tests/rustdoc/reexport/reexport-cfg.rs b/tests/rustdoc/reexport/reexport-cfg.rs
index 73b66824316..b624e5acf50 100644
--- a/tests/rustdoc/reexport/reexport-cfg.rs
+++ b/tests/rustdoc/reexport/reexport-cfg.rs
@@ -2,7 +2,7 @@
 // include `cfg`s from the previous chained items.
 
 #![crate_name = "foo"]
-#![feature(doc_auto_cfg, doc_cfg)]
+#![feature(doc_cfg)]
 
 mod foo {
     #[cfg(not(feature = "foo"))]
diff --git a/tests/rustdoc/repr.rs b/tests/rustdoc/repr.rs
index f4f683b3d81..1e8fad6ec0a 100644
--- a/tests/rustdoc/repr.rs
+++ b/tests/rustdoc/repr.rs
@@ -1,29 +1,163 @@
-// Regression test for <https://github.com/rust-lang/rust/issues/90435>.
-// Check that we show `#[repr(transparent)]` iff the non-1-ZST field is public or at least one
-// field is public in case all fields are 1-ZST fields.
+// Test the rendering of `#[repr]` on ADTs.
+#![feature(repr_simd)] // only used for the `ReprSimd` test case
+
+// Check the "local case" (HIR cleaning) //
+
+// Don't render the default repr which is `Rust`.
+//@ has 'repr/struct.ReprDefault.html'
+//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(Rust)]'
+pub struct ReprDefault;
+
+// Don't render the `Rust` repr — even if given explicitly — since it's the default.
+//@ has 'repr/struct.ReprRust.html'
+//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(Rust)]'
+#[repr(Rust)] // omitted
+pub struct ReprRust;
+
+//@ has 'repr/struct.ReprCPubFields.html'
+//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(C)]'
+#[repr(C)] // public
+pub struct ReprCPubFields {
+    pub a: u32,
+    pub b: u32,
+}
+
+//@ has 'repr/struct.ReprCPrivField.html'
+//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(C)]'
+#[repr(C)] // private...
+pub struct ReprCPrivField {
+    a: u32, // ...since this is private
+    pub b: u32,
+}
+
+//@ has 'repr/enum.ReprIsize.html'
+//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(isize)]'
+#[repr(isize)] // public
+pub enum ReprIsize {
+    Bla,
+}
+
+//@ has 'repr/enum.ReprU32HiddenVariant.html'
+//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(u32)]'
+#[repr(u32)] // private...
+pub enum ReprU32HiddenVariant {
+    #[doc(hidden)]
+    Hidden, // ...since this is hidden
+    Public,
+}
+
+//@ has 'repr/struct.ReprAlignHiddenField.html'
+//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(align(4))]'
+#[repr(align(4))] // private...
+pub struct ReprAlignHiddenField {
+    #[doc(hidden)]
+    pub hidden: i16, // ...since this field is hidden
+}
+
+//@ has 'repr/struct.ReprSimd.html'
+//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(simd, packed(2))]'
+#[repr(simd, packed(2))] // public
+pub struct ReprSimd {
+    pub field: [u8; 1],
+}
+
+//@ has 'repr/enum.ReprU32Align.html'
+//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(u32, align(8))]'
+#[repr(u32, align(8))] // public
+pub enum ReprU32Align {
+    Variant(u16),
+}
+
+//@ has 'repr/enum.ReprCHiddenVariantField.html'
+//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(C)]'
+#[repr(C)] // private...
+pub enum ReprCHiddenVariantField {
+    Variant { #[doc(hidden)] field: () }, //...since this field is hidden
+}
 
 //@ has 'repr/struct.ReprTransparentPrivField.html'
 //@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
-#[repr(transparent)] // private
+#[repr(transparent)] // private...
 pub struct ReprTransparentPrivField {
-    field: u32, // non-1-ZST field
+    field: u32, // ...since the non-1-ZST field is private
 }
 
 //@ has 'repr/struct.ReprTransparentPriv1ZstFields.html'
 //@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
-#[repr(transparent)] // public
+#[repr(transparent)] // public...
 pub struct ReprTransparentPriv1ZstFields {
     marker0: Marker,
-    pub main: u64, // non-1-ZST field
+    pub main: u64, // ...since the non-1-ZST field is public and visible
     marker1: Marker,
+} // the two private 1-ZST fields don't matter
+
+//@ has 'repr/struct.ReprTransparentPrivFieldPub1ZstField.html'
+//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
+#[repr(transparent)] // private...
+pub struct ReprTransparentPrivFieldPub1ZstField {
+    main: [u16; 0], // ...since the non-1-ZST field is private
+    pub marker: Marker, // this public 1-ZST field doesn't matter
 }
 
 //@ has 'repr/struct.ReprTransparentPub1ZstField.html'
 //@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
-#[repr(transparent)] // public
+#[repr(transparent)] // public...
 pub struct ReprTransparentPub1ZstField {
-    marker0: Marker,
-    pub marker1: Marker,
+    marker0: Marker, // ...since we don't have a non-1-ZST field...
+    pub marker1: Marker, // ...and this field is public and visible
+}
+
+//@ has 'repr/struct.ReprTransparentUnitStruct.html'
+//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
+#[repr(transparent)] // public
+pub struct ReprTransparentUnitStruct;
+
+//@ has 'repr/enum.ReprTransparentEnumUnitVariant.html'
+//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
+#[repr(transparent)] // public
+pub enum ReprTransparentEnumUnitVariant {
+    Variant,
+}
+
+//@ has 'repr/enum.ReprTransparentEnumHiddenUnitVariant.html'
+//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
+#[repr(transparent)] // private
+pub enum ReprTransparentEnumHiddenUnitVariant {
+    #[doc(hidden)] Variant(u32),
+}
+
+//@ has 'repr/enum.ReprTransparentEnumPub1ZstField.html'
+//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
+#[repr(transparent)] // public...
+pub enum ReprTransparentEnumPub1ZstField {
+    Variant {
+        field: u64, // ...since the non-1-ZST field is public
+        #[doc(hidden)]
+        marker: Marker, // this hidden 1-ZST field doesn't matter
+    },
+}
+
+//@ has 'repr/enum.ReprTransparentEnumHidden1ZstField.html'
+//@ !has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
+#[repr(transparent)] // private...
+pub enum ReprTransparentEnumHidden1ZstField {
+    Variant {
+        #[doc(hidden)]
+        field: u64, // ...since the non-1-ZST field is public
+    },
 }
 
 struct Marker; // 1-ZST
+
+// Check the "extern case" (middle cleaning) //
+
+// Internally, HIR and middle cleaning share `#[repr]` rendering.
+// Thus we'll only test the very basics in this section.
+
+//@ aux-build: ext-repr.rs
+extern crate ext_repr as ext;
+
+// Regression test for <https://github.com/rust-lang/rust/issues/110698>.
+//@ has 'repr/enum.ReprI8.html'
+//@ has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(i8)]'
+pub use ext::ReprI8;
diff --git a/tests/rustdoc/source-code-pages/check-source-code-urls-to-def.rs b/tests/rustdoc/source-code-pages/check-source-code-urls-to-def.rs
index d701b88bf9f..a7b944fa2f6 100644
--- a/tests/rustdoc/source-code-pages/check-source-code-urls-to-def.rs
+++ b/tests/rustdoc/source-code-pages/check-source-code-urls-to-def.rs
@@ -34,7 +34,7 @@ fn babar() {}
 // The 5 links to line 23 and the line 23 itself.
 //@ count - '//pre[@class="rust"]//a[@href="#23"]' 6
 //@ has - '//pre[@class="rust"]//a[@href="../../source_code/struct.SourceCode.html"]' \
-//        'source_code::SourceCode'
+//        'SourceCode'
 pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::SourceCode) {
     let x = 12;
     let y: Foo = Foo;
diff --git a/tests/rustdoc/target-feature.rs b/tests/rustdoc/target-feature.rs
index 59a08a0ca94..f2686f81fbf 100644
--- a/tests/rustdoc/target-feature.rs
+++ b/tests/rustdoc/target-feature.rs
@@ -1,3 +1,5 @@
+#![feature(doc_cfg)]
+
 #![crate_name = "foo"]
 
 //@ has 'foo/index.html'
diff --git a/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs b/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs
index 8449479287f..48f328f4fad 100644
--- a/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs
+++ b/tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs
@@ -33,6 +33,10 @@ impl CodegenBackend for TheBackend {
         ""
     }
 
+    fn name(&self) -> &'static str {
+        "the-backend"
+    }
+
     fn codegen_crate(&self, tcx: TyCtxt<'_>) -> Box<dyn Any> {
         Box::new(CodegenResults {
             modules: vec![],
diff --git a/tests/ui-fulldeps/mod_dir_path_canonicalized.rs b/tests/ui-fulldeps/mod_dir_path_canonicalized.rs
index df5f29e35fe..86f2d5f5954 100644
--- a/tests/ui-fulldeps/mod_dir_path_canonicalized.rs
+++ b/tests/ui-fulldeps/mod_dir_path_canonicalized.rs
@@ -2,7 +2,6 @@
 // Testing that a librustc_ast can parse modules with canonicalized base path
 //@ ignore-cross-compile
 //@ ignore-remote
-// no-remap-src-base: Reading `file!()` (expectedly) fails when enabled.
 
 #![feature(rustc_private)]
 
diff --git a/tests/ui/README.md b/tests/ui/README.md
index 66c1bb905a7..3b28ef694dd 100644
--- a/tests/ui/README.md
+++ b/tests/ui/README.md
@@ -350,6 +350,12 @@ Tests for FFI with C varargs (`va_list`).
 
 Tests for detection and handling of cyclic trait dependencies.
 
+## `tests/ui/darwin-objc/`: Darwin Objective-C
+
+Tests exercising `#![feature(darwin_objc)]`.
+
+See [Tracking Issue for `darwin_objc` #145496](https://github.com/rust-lang/rust/issues/145496).
+
 ## `tests/ui/dataflow_const_prop/`
 
 Contains a single regression test for const prop in `SwitchInt` pass crashing when `ptr2int` transmute is involved.
diff --git a/tests/ui/abi/abi-sysv64-arg-passing.rs b/tests/ui/abi/abi-sysv64-arg-passing.rs
index c18752418a1..362a1862f9d 100644
--- a/tests/ui/abi/abi-sysv64-arg-passing.rs
+++ b/tests/ui/abi/abi-sysv64-arg-passing.rs
@@ -28,6 +28,7 @@
 //@ ignore-arm
 //@ ignore-aarch64
 //@ ignore-windows
+//@ ignore-backends: gcc
 
 // Windows is ignored because bootstrap doesn't yet know to compile rust_test_helpers with
 // the sysv64 ABI on Windows.
diff --git a/tests/ui/abi/abi-sysv64-register-usage.rs b/tests/ui/abi/abi-sysv64-register-usage.rs
index d2fb2ae53ac..cf1620db6f7 100644
--- a/tests/ui/abi/abi-sysv64-register-usage.rs
+++ b/tests/ui/abi/abi-sysv64-register-usage.rs
@@ -6,6 +6,7 @@
 //@ ignore-arm
 //@ ignore-aarch64
 //@ needs-asm-support
+//@ ignore-backends: gcc
 
 #[cfg(target_arch = "x86_64")]
 pub extern "sysv64" fn all_the_registers(
diff --git a/tests/ui/issues/issue-56806.rs b/tests/ui/abi/invalid-self-parameter-type-56806.rs
index b1dac26d65a..60229df3005 100644
--- a/tests/ui/issues/issue-56806.rs
+++ b/tests/ui/abi/invalid-self-parameter-type-56806.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/56806
 pub trait Trait {
     fn dyn_instead_of_self(self: Box<dyn Trait>);
     //~^ ERROR invalid `self` parameter type
diff --git a/tests/ui/issues/issue-56806.stderr b/tests/ui/abi/invalid-self-parameter-type-56806.stderr
index ec50d863758..ac249b8f108 100644
--- a/tests/ui/issues/issue-56806.stderr
+++ b/tests/ui/abi/invalid-self-parameter-type-56806.stderr
@@ -1,5 +1,5 @@
 error[E0307]: invalid `self` parameter type: `Box<(dyn Trait + 'static)>`
-  --> $DIR/issue-56806.rs:2:34
+  --> $DIR/invalid-self-parameter-type-56806.rs:3:34
    |
 LL |     fn dyn_instead_of_self(self: Box<dyn Trait>);
    |                                  ^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/issue-28676.rs b/tests/ui/abi/issue-28676.rs
index 8640f5aad21..2abb4ce52b3 100644
--- a/tests/ui/abi/issue-28676.rs
+++ b/tests/ui/abi/issue-28676.rs
@@ -1,4 +1,6 @@
 //@ run-pass
+//@ ignore-backends: gcc
+
 #![allow(dead_code)]
 #![allow(improper_ctypes)]
 
diff --git a/tests/ui/abi/large-byval-align.rs b/tests/ui/abi/large-byval-align.rs
index c1de841178f..69418e1cbc7 100644
--- a/tests/ui/abi/large-byval-align.rs
+++ b/tests/ui/abi/large-byval-align.rs
@@ -1,6 +1,7 @@
 //@ compile-flags: -Copt-level=0
 //@ only-x86_64
 //@ build-pass
+//@ ignore-backends: gcc
 
 #[repr(align(536870912))]
 pub struct A(i64);
diff --git a/tests/ui/abi/numbers-arithmetic/float-struct.rs b/tests/ui/abi/numbers-arithmetic/float-struct.rs
index a958dc27272..dc4c536a14e 100644
--- a/tests/ui/abi/numbers-arithmetic/float-struct.rs
+++ b/tests/ui/abi/numbers-arithmetic/float-struct.rs
@@ -1,4 +1,5 @@
 //@ run-pass
+//@ ignore-backends: gcc
 
 use std::fmt::Debug;
 use std::hint::black_box;
diff --git a/tests/ui/abi/sparcv8plus-llvm19.rs b/tests/ui/abi/sparcv8plus-llvm19.rs
deleted file mode 100644
index 3d6d8568b6e..00000000000
--- a/tests/ui/abi/sparcv8plus-llvm19.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-//@ add-core-stubs
-//@ revisions: sparc sparcv8plus sparc_cpu_v9 sparc_feature_v8plus sparc_cpu_v9_feature_v8plus
-//@[sparc] compile-flags: --target sparc-unknown-none-elf
-//@[sparc] needs-llvm-components: sparc
-//@[sparcv8plus] compile-flags: --target sparc-unknown-linux-gnu
-//@[sparcv8plus] needs-llvm-components: sparc
-//@[sparc_cpu_v9] compile-flags: --target sparc-unknown-none-elf -C target-cpu=v9
-//@[sparc_cpu_v9] needs-llvm-components: sparc
-//@[sparc_feature_v8plus] compile-flags: --target sparc-unknown-none-elf -C target-feature=+v8plus
-//@[sparc_feature_v8plus] needs-llvm-components: sparc
-//@[sparc_cpu_v9_feature_v8plus] compile-flags: --target sparc-unknown-none-elf -C target-cpu=v9 -C target-feature=+v8plus
-//@[sparc_cpu_v9_feature_v8plus] needs-llvm-components: sparc
-//@ exact-llvm-major-version: 19
-
-#![crate_type = "rlib"]
-#![feature(no_core, rustc_attrs, lang_items)]
-#![no_core]
-
-extern crate minicore;
-use minicore::*;
-
-#[rustc_builtin_macro]
-macro_rules! compile_error {
-    () => {};
-}
-
-#[cfg(all(not(target_feature = "v8plus"), not(target_feature = "v9")))]
-compile_error!("-v8plus,-v9");
-//[sparc]~^ ERROR -v8plus,-v9
-
-// FIXME: sparc_cpu_v9 should be in "-v8plus,+v9" group (fixed in LLVM 20)
-#[cfg(all(target_feature = "v8plus", target_feature = "v9"))]
-compile_error!("+v8plus,+v9");
-//[sparcv8plus,sparc_cpu_v9_feature_v8plus,sparc_cpu_v9]~^ ERROR +v8plus,+v9
-
-// FIXME: should be rejected
-#[cfg(all(target_feature = "v8plus", not(target_feature = "v9")))]
-compile_error!("+v8plus,-v9 (FIXME)");
-//[sparc_feature_v8plus]~^ ERROR +v8plus,-v9 (FIXME)
-
-#[cfg(all(not(target_feature = "v8plus"), target_feature = "v9"))]
-compile_error!("-v8plus,+v9");
diff --git a/tests/ui/abi/sparcv8plus-llvm19.sparc.stderr b/tests/ui/abi/sparcv8plus-llvm19.sparc.stderr
deleted file mode 100644
index d3462ae87d3..00000000000
--- a/tests/ui/abi/sparcv8plus-llvm19.sparc.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: -v8plus,-v9
-  --> $DIR/sparcv8plus-llvm19.rs:28:1
-   |
-LL | compile_error!("-v8plus,-v9");
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9.stderr b/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9.stderr
deleted file mode 100644
index 9891aec94b8..00000000000
--- a/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: +v8plus,+v9
-  --> $DIR/sparcv8plus-llvm19.rs:33:1
-   |
-LL | compile_error!("+v8plus,+v9");
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9_feature_v8plus.stderr b/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9_feature_v8plus.stderr
deleted file mode 100644
index 9891aec94b8..00000000000
--- a/tests/ui/abi/sparcv8plus-llvm19.sparc_cpu_v9_feature_v8plus.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: +v8plus,+v9
-  --> $DIR/sparcv8plus-llvm19.rs:33:1
-   |
-LL | compile_error!("+v8plus,+v9");
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/abi/sparcv8plus-llvm19.sparc_feature_v8plus.stderr b/tests/ui/abi/sparcv8plus-llvm19.sparc_feature_v8plus.stderr
deleted file mode 100644
index dbcdb8ed121..00000000000
--- a/tests/ui/abi/sparcv8plus-llvm19.sparc_feature_v8plus.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: +v8plus,-v9 (FIXME)
-  --> $DIR/sparcv8plus-llvm19.rs:38:1
-   |
-LL | compile_error!("+v8plus,-v9 (FIXME)");
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/abi/sparcv8plus-llvm19.sparcv8plus.stderr b/tests/ui/abi/sparcv8plus-llvm19.sparcv8plus.stderr
deleted file mode 100644
index 9891aec94b8..00000000000
--- a/tests/ui/abi/sparcv8plus-llvm19.sparcv8plus.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: +v8plus,+v9
-  --> $DIR/sparcv8plus-llvm19.rs:33:1
-   |
-LL | compile_error!("+v8plus,+v9");
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/abi/sparcv8plus.rs b/tests/ui/abi/sparcv8plus.rs
index 6c17f721838..ba4fb6f7108 100644
--- a/tests/ui/abi/sparcv8plus.rs
+++ b/tests/ui/abi/sparcv8plus.rs
@@ -10,7 +10,6 @@
 //@[sparc_feature_v8plus] needs-llvm-components: sparc
 //@[sparc_cpu_v9_feature_v8plus] compile-flags: --target sparc-unknown-none-elf -C target-cpu=v9 -C target-feature=+v8plus
 //@[sparc_cpu_v9_feature_v8plus] needs-llvm-components: sparc
-//@ min-llvm-version: 20
 
 #![crate_type = "rlib"]
 #![feature(no_core, rustc_attrs, lang_items)]
diff --git a/tests/ui/abi/sparcv8plus.sparc.stderr b/tests/ui/abi/sparcv8plus.sparc.stderr
index e2aa89a9273..e31dbd344d6 100644
--- a/tests/ui/abi/sparcv8plus.sparc.stderr
+++ b/tests/ui/abi/sparcv8plus.sparc.stderr
@@ -1,5 +1,5 @@
 error: -v8plus,-v9
-  --> $DIR/sparcv8plus.rs:28:1
+  --> $DIR/sparcv8plus.rs:27:1
    |
 LL | compile_error!("-v8plus,-v9");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr b/tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr
index 2c5699f2dec..a1a8383cbe7 100644
--- a/tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr
+++ b/tests/ui/abi/sparcv8plus.sparc_cpu_v9.stderr
@@ -1,5 +1,5 @@
 error: -v8plus,+v9
-  --> $DIR/sparcv8plus.rs:41:1
+  --> $DIR/sparcv8plus.rs:40:1
    |
 LL | compile_error!("-v8plus,+v9");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr b/tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr
index 4b96e4421f9..c633ee26c51 100644
--- a/tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr
+++ b/tests/ui/abi/sparcv8plus.sparc_cpu_v9_feature_v8plus.stderr
@@ -1,5 +1,5 @@
 error: +v8plus,+v9
-  --> $DIR/sparcv8plus.rs:32:1
+  --> $DIR/sparcv8plus.rs:31:1
    |
 LL | compile_error!("+v8plus,+v9");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr b/tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr
index dfdec88961b..bad8adc1599 100644
--- a/tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr
+++ b/tests/ui/abi/sparcv8plus.sparc_feature_v8plus.stderr
@@ -1,5 +1,5 @@
 error: +v8plus,-v9 (FIXME)
-  --> $DIR/sparcv8plus.rs:37:1
+  --> $DIR/sparcv8plus.rs:36:1
    |
 LL | compile_error!("+v8plus,-v9 (FIXME)");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/sparcv8plus.sparcv8plus.stderr b/tests/ui/abi/sparcv8plus.sparcv8plus.stderr
index 4b96e4421f9..c633ee26c51 100644
--- a/tests/ui/abi/sparcv8plus.sparcv8plus.stderr
+++ b/tests/ui/abi/sparcv8plus.sparcv8plus.stderr
@@ -1,5 +1,5 @@
 error: +v8plus,+v9
-  --> $DIR/sparcv8plus.rs:32:1
+  --> $DIR/sparcv8plus.rs:31:1
    |
 LL | compile_error!("+v8plus,+v9");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/abi/stack-probes-lto.rs b/tests/ui/abi/stack-probes-lto.rs
index c6e5bea5f42..6203be90590 100644
--- a/tests/ui/abi/stack-probes-lto.rs
+++ b/tests/ui/abi/stack-probes-lto.rs
@@ -13,5 +13,6 @@
 //@ ignore-tvos Stack probes are enabled, but the SIGSEGV handler isn't
 //@ ignore-watchos Stack probes are enabled, but the SIGSEGV handler isn't
 //@ ignore-visionos Stack probes are enabled, but the SIGSEGV handler isn't
+//@ ignore-backends: gcc
 
 include!("stack-probes.rs");
diff --git a/tests/ui/abi/stack-probes.rs b/tests/ui/abi/stack-probes.rs
index f0fbd80d2e7..4d0301411e0 100644
--- a/tests/ui/abi/stack-probes.rs
+++ b/tests/ui/abi/stack-probes.rs
@@ -10,6 +10,7 @@
 //@ ignore-tvos Stack probes are enabled, but the SIGSEGV handler isn't
 //@ ignore-watchos Stack probes are enabled, but the SIGSEGV handler isn't
 //@ ignore-visionos Stack probes are enabled, but the SIGSEGV handler isn't
+//@ ignore-backends: gcc
 
 use std::env;
 use std::mem::MaybeUninit;
diff --git a/tests/ui/abi/stack-protector.rs b/tests/ui/abi/stack-protector.rs
index 29332861977..928b49c0eea 100644
--- a/tests/ui/abi/stack-protector.rs
+++ b/tests/ui/abi/stack-protector.rs
@@ -4,6 +4,7 @@
 //@ [ssp] compile-flags: -Z stack-protector=all
 //@ compile-flags: -C opt-level=2
 //@ compile-flags: -g
+//@ ignore-backends: gcc
 
 use std::env;
 use std::process::{Command, ExitStatus};
diff --git a/tests/ui/abi/struct-enums/struct-return.rs b/tests/ui/abi/struct-enums/struct-return.rs
index 5b39c0de454..5fe80d5f670 100644
--- a/tests/ui/abi/struct-enums/struct-return.rs
+++ b/tests/ui/abi/struct-enums/struct-return.rs
@@ -1,4 +1,6 @@
 //@ run-pass
+//@ ignore-backends: gcc
+
 #![allow(dead_code)]
 
 #[repr(C)]
diff --git a/tests/ui/abi/variadic-ffi.rs b/tests/ui/abi/variadic-ffi.rs
index 6cfae0f2a32..dfdbff33264 100644
--- a/tests/ui/abi/variadic-ffi.rs
+++ b/tests/ui/abi/variadic-ffi.rs
@@ -1,4 +1,6 @@
 //@ run-pass
+//@ ignore-backends: gcc
+
 #![feature(c_variadic)]
 
 use std::ffi::VaList;
diff --git a/tests/ui/abi/x86stdcall.rs b/tests/ui/abi/x86stdcall.rs
index c1bd35b80d2..77866c30f0e 100644
--- a/tests/ui/abi/x86stdcall.rs
+++ b/tests/ui/abi/x86stdcall.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ only-windows
+//@ ignore-backends: gcc
 // GetLastError doesn't seem to work with stack switching
 
 #[cfg(windows)]
diff --git a/tests/ui/array-slice-vec/box-of-array-of-drop-1.rs b/tests/ui/array-slice-vec/box-of-array-of-drop-1.rs
index c7c05946c4c..5f4e381c983 100644
--- a/tests/ui/array-slice-vec/box-of-array-of-drop-1.rs
+++ b/tests/ui/array-slice-vec/box-of-array-of-drop-1.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 
 #![allow(overflowing_literals)]
 
diff --git a/tests/ui/array-slice-vec/box-of-array-of-drop-2.rs b/tests/ui/array-slice-vec/box-of-array-of-drop-2.rs
index 98175a26ec0..ea37d3e7212 100644
--- a/tests/ui/array-slice-vec/box-of-array-of-drop-2.rs
+++ b/tests/ui/array-slice-vec/box-of-array-of-drop-2.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 
 #![allow(overflowing_literals)]
 
diff --git a/tests/ui/array-slice-vec/nested-vec-3.rs b/tests/ui/array-slice-vec/nested-vec-3.rs
index 51975743742..e3c04ed6f6b 100644
--- a/tests/ui/array-slice-vec/nested-vec-3.rs
+++ b/tests/ui/array-slice-vec/nested-vec-3.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 
 #![allow(overflowing_literals)]
 
diff --git a/tests/ui/array-slice-vec/slice-panic-1.rs b/tests/ui/array-slice-vec/slice-panic-1.rs
index a745dff96af..d7c1098fa2b 100644
--- a/tests/ui/array-slice-vec/slice-panic-1.rs
+++ b/tests/ui/array-slice-vec/slice-panic-1.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 
 // Test that if a slicing expr[..] fails, the correct cleanups happen.
 
diff --git a/tests/ui/array-slice-vec/slice-panic-2.rs b/tests/ui/array-slice-vec/slice-panic-2.rs
index 483a4cbe245..157e716a95d 100644
--- a/tests/ui/array-slice-vec/slice-panic-2.rs
+++ b/tests/ui/array-slice-vec/slice-panic-2.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 
 // Test that if a slicing expr[..] fails, the correct cleanups happen.
 
diff --git a/tests/ui/asm/global-asm-isnt-really-a-mir-body.rs b/tests/ui/asm/global-asm-isnt-really-a-mir-body.rs
index aef25d057d4..94dab4235e0 100644
--- a/tests/ui/asm/global-asm-isnt-really-a-mir-body.rs
+++ b/tests/ui/asm/global-asm-isnt-really-a-mir-body.rs
@@ -18,6 +18,7 @@
 
 //@ build-pass
 //@ needs-asm-support
+//@ ignore-backends: gcc
 
 use std::arch::global_asm;
 
diff --git a/tests/ui/asm/loongarch/bad-reg.loongarch32_ilp32d.stderr b/tests/ui/asm/loongarch/bad-reg.loongarch32_ilp32d.stderr
index 8742d4bd82c..c67c913d2a6 100644
--- a/tests/ui/asm/loongarch/bad-reg.loongarch32_ilp32d.stderr
+++ b/tests/ui/asm/loongarch/bad-reg.loongarch32_ilp32d.stderr
@@ -1,35 +1,35 @@
 error: invalid register `$r0`: constant zero cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:27:18
+  --> $DIR/bad-reg.rs:26:18
    |
 LL |         asm!("", out("$r0") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$tp`: reserved for TLS
-  --> $DIR/bad-reg.rs:29:18
+  --> $DIR/bad-reg.rs:28:18
    |
 LL |         asm!("", out("$tp") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$sp`: the stack pointer cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:31:18
+  --> $DIR/bad-reg.rs:30:18
    |
 LL |         asm!("", out("$sp") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$r21`: reserved by the ABI
-  --> $DIR/bad-reg.rs:33:18
+  --> $DIR/bad-reg.rs:32:18
    |
 LL |         asm!("", out("$r21") _);
    |                  ^^^^^^^^^^^^^
 
 error: invalid register `$fp`: the frame pointer cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:35:18
+  --> $DIR/bad-reg.rs:34:18
    |
 LL |         asm!("", out("$fp") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$r31`: $r31 is used internally by LLVM and cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:37:18
+  --> $DIR/bad-reg.rs:36:18
    |
 LL |         asm!("", out("$r31") _);
    |                  ^^^^^^^^^^^^^
diff --git a/tests/ui/asm/loongarch/bad-reg.loongarch32_ilp32s.stderr b/tests/ui/asm/loongarch/bad-reg.loongarch32_ilp32s.stderr
index e6cb6e40c70..99c071919ac 100644
--- a/tests/ui/asm/loongarch/bad-reg.loongarch32_ilp32s.stderr
+++ b/tests/ui/asm/loongarch/bad-reg.loongarch32_ilp32s.stderr
@@ -1,59 +1,59 @@
 error: invalid register `$r0`: constant zero cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:27:18
+  --> $DIR/bad-reg.rs:26:18
    |
 LL |         asm!("", out("$r0") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$tp`: reserved for TLS
-  --> $DIR/bad-reg.rs:29:18
+  --> $DIR/bad-reg.rs:28:18
    |
 LL |         asm!("", out("$tp") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$sp`: the stack pointer cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:31:18
+  --> $DIR/bad-reg.rs:30:18
    |
 LL |         asm!("", out("$sp") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$r21`: reserved by the ABI
-  --> $DIR/bad-reg.rs:33:18
+  --> $DIR/bad-reg.rs:32:18
    |
 LL |         asm!("", out("$r21") _);
    |                  ^^^^^^^^^^^^^
 
 error: invalid register `$fp`: the frame pointer cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:35:18
+  --> $DIR/bad-reg.rs:34:18
    |
 LL |         asm!("", out("$fp") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$r31`: $r31 is used internally by LLVM and cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:37:18
+  --> $DIR/bad-reg.rs:36:18
    |
 LL |         asm!("", out("$r31") _);
    |                  ^^^^^^^^^^^^^
 
 error: register class `freg` requires at least one of the following target features: d, f
-  --> $DIR/bad-reg.rs:41:26
+  --> $DIR/bad-reg.rs:40:26
    |
 LL |         asm!("/* {} */", in(freg) f);
    |                          ^^^^^^^^^^
 
 error: register class `freg` requires at least one of the following target features: d, f
-  --> $DIR/bad-reg.rs:43:26
+  --> $DIR/bad-reg.rs:42:26
    |
 LL |         asm!("/* {} */", out(freg) _);
    |                          ^^^^^^^^^^^
 
 error: register class `freg` requires at least one of the following target features: d, f
-  --> $DIR/bad-reg.rs:45:26
+  --> $DIR/bad-reg.rs:44:26
    |
 LL |         asm!("/* {} */", in(freg) d);
    |                          ^^^^^^^^^^
 
 error: register class `freg` requires at least one of the following target features: d, f
-  --> $DIR/bad-reg.rs:47:26
+  --> $DIR/bad-reg.rs:46:26
    |
 LL |         asm!("/* {} */", out(freg) d);
    |                          ^^^^^^^^^^^
diff --git a/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64d.stderr b/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64d.stderr
index 8742d4bd82c..c67c913d2a6 100644
--- a/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64d.stderr
+++ b/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64d.stderr
@@ -1,35 +1,35 @@
 error: invalid register `$r0`: constant zero cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:27:18
+  --> $DIR/bad-reg.rs:26:18
    |
 LL |         asm!("", out("$r0") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$tp`: reserved for TLS
-  --> $DIR/bad-reg.rs:29:18
+  --> $DIR/bad-reg.rs:28:18
    |
 LL |         asm!("", out("$tp") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$sp`: the stack pointer cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:31:18
+  --> $DIR/bad-reg.rs:30:18
    |
 LL |         asm!("", out("$sp") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$r21`: reserved by the ABI
-  --> $DIR/bad-reg.rs:33:18
+  --> $DIR/bad-reg.rs:32:18
    |
 LL |         asm!("", out("$r21") _);
    |                  ^^^^^^^^^^^^^
 
 error: invalid register `$fp`: the frame pointer cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:35:18
+  --> $DIR/bad-reg.rs:34:18
    |
 LL |         asm!("", out("$fp") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$r31`: $r31 is used internally by LLVM and cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:37:18
+  --> $DIR/bad-reg.rs:36:18
    |
 LL |         asm!("", out("$r31") _);
    |                  ^^^^^^^^^^^^^
diff --git a/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64s.stderr b/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64s.stderr
index e6cb6e40c70..99c071919ac 100644
--- a/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64s.stderr
+++ b/tests/ui/asm/loongarch/bad-reg.loongarch64_lp64s.stderr
@@ -1,59 +1,59 @@
 error: invalid register `$r0`: constant zero cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:27:18
+  --> $DIR/bad-reg.rs:26:18
    |
 LL |         asm!("", out("$r0") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$tp`: reserved for TLS
-  --> $DIR/bad-reg.rs:29:18
+  --> $DIR/bad-reg.rs:28:18
    |
 LL |         asm!("", out("$tp") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$sp`: the stack pointer cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:31:18
+  --> $DIR/bad-reg.rs:30:18
    |
 LL |         asm!("", out("$sp") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$r21`: reserved by the ABI
-  --> $DIR/bad-reg.rs:33:18
+  --> $DIR/bad-reg.rs:32:18
    |
 LL |         asm!("", out("$r21") _);
    |                  ^^^^^^^^^^^^^
 
 error: invalid register `$fp`: the frame pointer cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:35:18
+  --> $DIR/bad-reg.rs:34:18
    |
 LL |         asm!("", out("$fp") _);
    |                  ^^^^^^^^^^^^
 
 error: invalid register `$r31`: $r31 is used internally by LLVM and cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:37:18
+  --> $DIR/bad-reg.rs:36:18
    |
 LL |         asm!("", out("$r31") _);
    |                  ^^^^^^^^^^^^^
 
 error: register class `freg` requires at least one of the following target features: d, f
-  --> $DIR/bad-reg.rs:41:26
+  --> $DIR/bad-reg.rs:40:26
    |
 LL |         asm!("/* {} */", in(freg) f);
    |                          ^^^^^^^^^^
 
 error: register class `freg` requires at least one of the following target features: d, f
-  --> $DIR/bad-reg.rs:43:26
+  --> $DIR/bad-reg.rs:42:26
    |
 LL |         asm!("/* {} */", out(freg) _);
    |                          ^^^^^^^^^^^
 
 error: register class `freg` requires at least one of the following target features: d, f
-  --> $DIR/bad-reg.rs:45:26
+  --> $DIR/bad-reg.rs:44:26
    |
 LL |         asm!("/* {} */", in(freg) d);
    |                          ^^^^^^^^^^
 
 error: register class `freg` requires at least one of the following target features: d, f
-  --> $DIR/bad-reg.rs:47:26
+  --> $DIR/bad-reg.rs:46:26
    |
 LL |         asm!("/* {} */", out(freg) d);
    |                          ^^^^^^^^^^^
diff --git a/tests/ui/asm/loongarch/bad-reg.rs b/tests/ui/asm/loongarch/bad-reg.rs
index 0d3eba07f14..cca37dd2e8e 100644
--- a/tests/ui/asm/loongarch/bad-reg.rs
+++ b/tests/ui/asm/loongarch/bad-reg.rs
@@ -1,7 +1,6 @@
 //@ add-core-stubs
 //@ needs-asm-support
 //@ revisions: loongarch32_ilp32d loongarch32_ilp32s loongarch64_lp64d loongarch64_lp64s
-//@ min-llvm-version: 20
 //@[loongarch32_ilp32d] compile-flags: --target loongarch32-unknown-none
 //@[loongarch32_ilp32d] needs-llvm-components: loongarch
 //@[loongarch32_ilp32s] compile-flags: --target loongarch32-unknown-none-softfloat
diff --git a/tests/ui/asm/powerpc/bad-reg.aix64.stderr b/tests/ui/asm/powerpc/bad-reg.aix64.stderr
index 124013f89af..82faba8d167 100644
--- a/tests/ui/asm/powerpc/bad-reg.aix64.stderr
+++ b/tests/ui/asm/powerpc/bad-reg.aix64.stderr
@@ -28,74 +28,110 @@ error: invalid register `fp`: the frame pointer cannot be used as an operand for
 LL |         asm!("", out("fp") _);
    |                  ^^^^^^^^^^^
 
-error: invalid register `lr`: the link register cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:48:18
-   |
-LL |         asm!("", out("lr") _);
-   |                  ^^^^^^^^^^^
-
-error: invalid register `ctr`: the counter register cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:50:18
-   |
-LL |         asm!("", out("ctr") _);
-   |                  ^^^^^^^^^^^^
-
 error: invalid register `vrsave`: the vrsave register cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:52:18
+  --> $DIR/bad-reg.rs:48:18
    |
 LL |         asm!("", out("vrsave") _);
    |                  ^^^^^^^^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:100:18
+  --> $DIR/bad-reg.rs:96:18
    |
 LL |         asm!("", in("cr") x);
    |                  ^^^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:103:18
+  --> $DIR/bad-reg.rs:99:18
    |
 LL |         asm!("", out("cr") x);
    |                  ^^^^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:106:26
+  --> $DIR/bad-reg.rs:102:26
    |
 LL |         asm!("/* {} */", in(cr) x);
    |                          ^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:109:26
+  --> $DIR/bad-reg.rs:105:26
    |
 LL |         asm!("/* {} */", out(cr) _);
    |                          ^^^^^^^^^
 
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:109:18
+   |
+LL |         asm!("", in("ctr") x);
+   |                  ^^^^^^^^^^^
+
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:112:18
+   |
+LL |         asm!("", out("ctr") x);
+   |                  ^^^^^^^^^^^^
+
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:115:26
+   |
+LL |         asm!("/* {} */", in(ctr) x);
+   |                          ^^^^^^^^^
+
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:118:26
+   |
+LL |         asm!("/* {} */", out(ctr) _);
+   |                          ^^^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:122:18
+   |
+LL |         asm!("", in("lr") x);
+   |                  ^^^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:125:18
+   |
+LL |         asm!("", out("lr") x);
+   |                  ^^^^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:128:26
+   |
+LL |         asm!("/* {} */", in(lr) x);
+   |                          ^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:131:26
+   |
+LL |         asm!("/* {} */", out(lr) _);
+   |                          ^^^^^^^^^
+
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:113:18
+  --> $DIR/bad-reg.rs:135:18
    |
 LL |         asm!("", in("xer") x);
    |                  ^^^^^^^^^^^
 
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:116:18
+  --> $DIR/bad-reg.rs:138:18
    |
 LL |         asm!("", out("xer") x);
    |                  ^^^^^^^^^^^^
 
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:119:26
+  --> $DIR/bad-reg.rs:141:26
    |
 LL |         asm!("/* {} */", in(xer) x);
    |                          ^^^^^^^^^
 
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:122:26
+  --> $DIR/bad-reg.rs:144:26
    |
 LL |         asm!("/* {} */", out(xer) _);
    |                          ^^^^^^^^^^
 
 error: register `cr0` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:126:31
+  --> $DIR/bad-reg.rs:148:31
    |
 LL |         asm!("", out("cr") _, out("cr0") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr0`
@@ -103,7 +139,7 @@ LL |         asm!("", out("cr") _, out("cr0") _);
    |                  register `cr`
 
 error: register `cr1` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:128:31
+  --> $DIR/bad-reg.rs:150:31
    |
 LL |         asm!("", out("cr") _, out("cr1") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr1`
@@ -111,7 +147,7 @@ LL |         asm!("", out("cr") _, out("cr1") _);
    |                  register `cr`
 
 error: register `cr2` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:130:31
+  --> $DIR/bad-reg.rs:152:31
    |
 LL |         asm!("", out("cr") _, out("cr2") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr2`
@@ -119,7 +155,7 @@ LL |         asm!("", out("cr") _, out("cr2") _);
    |                  register `cr`
 
 error: register `cr3` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:132:31
+  --> $DIR/bad-reg.rs:154:31
    |
 LL |         asm!("", out("cr") _, out("cr3") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr3`
@@ -127,7 +163,7 @@ LL |         asm!("", out("cr") _, out("cr3") _);
    |                  register `cr`
 
 error: register `cr4` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:134:31
+  --> $DIR/bad-reg.rs:156:31
    |
 LL |         asm!("", out("cr") _, out("cr4") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr4`
@@ -135,7 +171,7 @@ LL |         asm!("", out("cr") _, out("cr4") _);
    |                  register `cr`
 
 error: register `cr5` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:136:31
+  --> $DIR/bad-reg.rs:158:31
    |
 LL |         asm!("", out("cr") _, out("cr5") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr5`
@@ -143,7 +179,7 @@ LL |         asm!("", out("cr") _, out("cr5") _);
    |                  register `cr`
 
 error: register `cr6` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:138:31
+  --> $DIR/bad-reg.rs:160:31
    |
 LL |         asm!("", out("cr") _, out("cr6") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr6`
@@ -151,7 +187,7 @@ LL |         asm!("", out("cr") _, out("cr6") _);
    |                  register `cr`
 
 error: register `cr7` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:140:31
+  --> $DIR/bad-reg.rs:162:31
    |
 LL |         asm!("", out("cr") _, out("cr7") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr7`
@@ -165,7 +201,7 @@ LL |         asm!("", out("r13") _);
    |                  ^^^^^^^^^^^^
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:67:27
+  --> $DIR/bad-reg.rs:63:27
    |
 LL |         asm!("", in("v0") x); // FIXME: should be ok if vsx is available
    |                           ^
@@ -173,7 +209,7 @@ LL |         asm!("", in("v0") x); // FIXME: should be ok if vsx is available
    = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:70:28
+  --> $DIR/bad-reg.rs:66:28
    |
 LL |         asm!("", out("v0") x); // FIXME: should be ok if vsx is available
    |                            ^
@@ -181,7 +217,7 @@ LL |         asm!("", out("v0") x); // FIXME: should be ok if vsx is available
    = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:78:35
+  --> $DIR/bad-reg.rs:74:35
    |
 LL |         asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is available
    |                                   ^
@@ -189,7 +225,7 @@ LL |         asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is avai
    = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:100:27
+  --> $DIR/bad-reg.rs:96:27
    |
 LL |         asm!("", in("cr") x);
    |                           ^
@@ -197,7 +233,7 @@ LL |         asm!("", in("cr") x);
    = note: register class `cr` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:103:28
+  --> $DIR/bad-reg.rs:99:28
    |
 LL |         asm!("", out("cr") x);
    |                            ^
@@ -205,7 +241,7 @@ LL |         asm!("", out("cr") x);
    = note: register class `cr` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:106:33
+  --> $DIR/bad-reg.rs:102:33
    |
 LL |         asm!("/* {} */", in(cr) x);
    |                                 ^
@@ -213,7 +249,55 @@ LL |         asm!("/* {} */", in(cr) x);
    = note: register class `cr` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:113:28
+  --> $DIR/bad-reg.rs:109:28
+   |
+LL |         asm!("", in("ctr") x);
+   |                            ^
+   |
+   = note: register class `ctr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:112:29
+   |
+LL |         asm!("", out("ctr") x);
+   |                             ^
+   |
+   = note: register class `ctr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:115:34
+   |
+LL |         asm!("/* {} */", in(ctr) x);
+   |                                  ^
+   |
+   = note: register class `ctr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:122:27
+   |
+LL |         asm!("", in("lr") x);
+   |                           ^
+   |
+   = note: register class `lr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:125:28
+   |
+LL |         asm!("", out("lr") x);
+   |                            ^
+   |
+   = note: register class `lr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:128:33
+   |
+LL |         asm!("/* {} */", in(lr) x);
+   |                                 ^
+   |
+   = note: register class `lr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:135:28
    |
 LL |         asm!("", in("xer") x);
    |                            ^
@@ -221,7 +305,7 @@ LL |         asm!("", in("xer") x);
    = note: register class `xer` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:116:29
+  --> $DIR/bad-reg.rs:138:29
    |
 LL |         asm!("", out("xer") x);
    |                             ^
@@ -229,12 +313,12 @@ LL |         asm!("", out("xer") x);
    = note: register class `xer` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:119:34
+  --> $DIR/bad-reg.rs:141:34
    |
 LL |         asm!("/* {} */", in(xer) x);
    |                                  ^
    |
    = note: register class `xer` supports these types: 
 
-error: aborting due to 34 previous errors
+error: aborting due to 46 previous errors
 
diff --git a/tests/ui/asm/powerpc/bad-reg.powerpc.stderr b/tests/ui/asm/powerpc/bad-reg.powerpc.stderr
index b11c946f80d..fac70ea77cb 100644
--- a/tests/ui/asm/powerpc/bad-reg.powerpc.stderr
+++ b/tests/ui/asm/powerpc/bad-reg.powerpc.stderr
@@ -28,74 +28,110 @@ error: invalid register `fp`: the frame pointer cannot be used as an operand for
 LL |         asm!("", out("fp") _);
    |                  ^^^^^^^^^^^
 
-error: invalid register `lr`: the link register cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:48:18
-   |
-LL |         asm!("", out("lr") _);
-   |                  ^^^^^^^^^^^
-
-error: invalid register `ctr`: the counter register cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:50:18
-   |
-LL |         asm!("", out("ctr") _);
-   |                  ^^^^^^^^^^^^
-
 error: invalid register `vrsave`: the vrsave register cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:52:18
+  --> $DIR/bad-reg.rs:48:18
    |
 LL |         asm!("", out("vrsave") _);
    |                  ^^^^^^^^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:100:18
+  --> $DIR/bad-reg.rs:96:18
    |
 LL |         asm!("", in("cr") x);
    |                  ^^^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:103:18
+  --> $DIR/bad-reg.rs:99:18
    |
 LL |         asm!("", out("cr") x);
    |                  ^^^^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:106:26
+  --> $DIR/bad-reg.rs:102:26
    |
 LL |         asm!("/* {} */", in(cr) x);
    |                          ^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:109:26
+  --> $DIR/bad-reg.rs:105:26
    |
 LL |         asm!("/* {} */", out(cr) _);
    |                          ^^^^^^^^^
 
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:109:18
+   |
+LL |         asm!("", in("ctr") x);
+   |                  ^^^^^^^^^^^
+
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:112:18
+   |
+LL |         asm!("", out("ctr") x);
+   |                  ^^^^^^^^^^^^
+
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:115:26
+   |
+LL |         asm!("/* {} */", in(ctr) x);
+   |                          ^^^^^^^^^
+
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:118:26
+   |
+LL |         asm!("/* {} */", out(ctr) _);
+   |                          ^^^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:122:18
+   |
+LL |         asm!("", in("lr") x);
+   |                  ^^^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:125:18
+   |
+LL |         asm!("", out("lr") x);
+   |                  ^^^^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:128:26
+   |
+LL |         asm!("/* {} */", in(lr) x);
+   |                          ^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:131:26
+   |
+LL |         asm!("/* {} */", out(lr) _);
+   |                          ^^^^^^^^^
+
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:113:18
+  --> $DIR/bad-reg.rs:135:18
    |
 LL |         asm!("", in("xer") x);
    |                  ^^^^^^^^^^^
 
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:116:18
+  --> $DIR/bad-reg.rs:138:18
    |
 LL |         asm!("", out("xer") x);
    |                  ^^^^^^^^^^^^
 
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:119:26
+  --> $DIR/bad-reg.rs:141:26
    |
 LL |         asm!("/* {} */", in(xer) x);
    |                          ^^^^^^^^^
 
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:122:26
+  --> $DIR/bad-reg.rs:144:26
    |
 LL |         asm!("/* {} */", out(xer) _);
    |                          ^^^^^^^^^^
 
 error: register `cr0` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:126:31
+  --> $DIR/bad-reg.rs:148:31
    |
 LL |         asm!("", out("cr") _, out("cr0") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr0`
@@ -103,7 +139,7 @@ LL |         asm!("", out("cr") _, out("cr0") _);
    |                  register `cr`
 
 error: register `cr1` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:128:31
+  --> $DIR/bad-reg.rs:150:31
    |
 LL |         asm!("", out("cr") _, out("cr1") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr1`
@@ -111,7 +147,7 @@ LL |         asm!("", out("cr") _, out("cr1") _);
    |                  register `cr`
 
 error: register `cr2` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:130:31
+  --> $DIR/bad-reg.rs:152:31
    |
 LL |         asm!("", out("cr") _, out("cr2") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr2`
@@ -119,7 +155,7 @@ LL |         asm!("", out("cr") _, out("cr2") _);
    |                  register `cr`
 
 error: register `cr3` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:132:31
+  --> $DIR/bad-reg.rs:154:31
    |
 LL |         asm!("", out("cr") _, out("cr3") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr3`
@@ -127,7 +163,7 @@ LL |         asm!("", out("cr") _, out("cr3") _);
    |                  register `cr`
 
 error: register `cr4` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:134:31
+  --> $DIR/bad-reg.rs:156:31
    |
 LL |         asm!("", out("cr") _, out("cr4") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr4`
@@ -135,7 +171,7 @@ LL |         asm!("", out("cr") _, out("cr4") _);
    |                  register `cr`
 
 error: register `cr5` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:136:31
+  --> $DIR/bad-reg.rs:158:31
    |
 LL |         asm!("", out("cr") _, out("cr5") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr5`
@@ -143,7 +179,7 @@ LL |         asm!("", out("cr") _, out("cr5") _);
    |                  register `cr`
 
 error: register `cr6` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:138:31
+  --> $DIR/bad-reg.rs:160:31
    |
 LL |         asm!("", out("cr") _, out("cr6") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr6`
@@ -151,7 +187,7 @@ LL |         asm!("", out("cr") _, out("cr6") _);
    |                  register `cr`
 
 error: register `cr7` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:140:31
+  --> $DIR/bad-reg.rs:162:31
    |
 LL |         asm!("", out("cr") _, out("cr7") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr7`
@@ -165,67 +201,67 @@ LL |         asm!("", out("r13") _);
    |                  ^^^^^^^^^^^^
 
 error: register class `vreg` requires at least one of the following target features: altivec, vsx
-  --> $DIR/bad-reg.rs:57:18
+  --> $DIR/bad-reg.rs:53:18
    |
 LL |         asm!("", in("v0") v32x4); // requires altivec
    |                  ^^^^^^^^^^^^^^
 
 error: register class `vreg` requires at least one of the following target features: altivec, vsx
-  --> $DIR/bad-reg.rs:59:18
+  --> $DIR/bad-reg.rs:55:18
    |
 LL |         asm!("", out("v0") v32x4); // requires altivec
    |                  ^^^^^^^^^^^^^^^
 
 error: register class `vreg` requires at least one of the following target features: altivec, vsx
-  --> $DIR/bad-reg.rs:61:18
+  --> $DIR/bad-reg.rs:57:18
    |
 LL |         asm!("", in("v0") v64x2); // requires vsx
    |                  ^^^^^^^^^^^^^^
 
 error: register class `vreg` requires at least one of the following target features: altivec, vsx
-  --> $DIR/bad-reg.rs:64:18
+  --> $DIR/bad-reg.rs:60:18
    |
 LL |         asm!("", out("v0") v64x2); // requires vsx
    |                  ^^^^^^^^^^^^^^^
 
 error: register class `vreg` requires at least one of the following target features: altivec, vsx
-  --> $DIR/bad-reg.rs:67:18
+  --> $DIR/bad-reg.rs:63:18
    |
 LL |         asm!("", in("v0") x); // FIXME: should be ok if vsx is available
    |                  ^^^^^^^^^^
 
 error: register class `vreg` requires at least one of the following target features: altivec, vsx
-  --> $DIR/bad-reg.rs:70:18
+  --> $DIR/bad-reg.rs:66:18
    |
 LL |         asm!("", out("v0") x); // FIXME: should be ok if vsx is available
    |                  ^^^^^^^^^^^
 
 error: register class `vreg` requires at least one of the following target features: altivec, vsx
-  --> $DIR/bad-reg.rs:73:26
+  --> $DIR/bad-reg.rs:69:26
    |
 LL |         asm!("/* {} */", in(vreg) v32x4); // requires altivec
    |                          ^^^^^^^^^^^^^^
 
 error: register class `vreg` requires at least one of the following target features: altivec, vsx
-  --> $DIR/bad-reg.rs:75:26
+  --> $DIR/bad-reg.rs:71:26
    |
 LL |         asm!("/* {} */", in(vreg) v64x2); // requires vsx
    |                          ^^^^^^^^^^^^^^
 
 error: register class `vreg` requires at least one of the following target features: altivec, vsx
-  --> $DIR/bad-reg.rs:78:26
+  --> $DIR/bad-reg.rs:74:26
    |
 LL |         asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is available
    |                          ^^^^^^^^^^
 
 error: register class `vreg` requires at least one of the following target features: altivec, vsx
-  --> $DIR/bad-reg.rs:81:26
+  --> $DIR/bad-reg.rs:77:26
    |
 LL |         asm!("/* {} */", out(vreg) _); // requires altivec
    |                          ^^^^^^^^^^^
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:100:27
+  --> $DIR/bad-reg.rs:96:27
    |
 LL |         asm!("", in("cr") x);
    |                           ^
@@ -233,7 +269,7 @@ LL |         asm!("", in("cr") x);
    = note: register class `cr` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:103:28
+  --> $DIR/bad-reg.rs:99:28
    |
 LL |         asm!("", out("cr") x);
    |                            ^
@@ -241,7 +277,7 @@ LL |         asm!("", out("cr") x);
    = note: register class `cr` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:106:33
+  --> $DIR/bad-reg.rs:102:33
    |
 LL |         asm!("/* {} */", in(cr) x);
    |                                 ^
@@ -249,7 +285,55 @@ LL |         asm!("/* {} */", in(cr) x);
    = note: register class `cr` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:113:28
+  --> $DIR/bad-reg.rs:109:28
+   |
+LL |         asm!("", in("ctr") x);
+   |                            ^
+   |
+   = note: register class `ctr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:112:29
+   |
+LL |         asm!("", out("ctr") x);
+   |                             ^
+   |
+   = note: register class `ctr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:115:34
+   |
+LL |         asm!("/* {} */", in(ctr) x);
+   |                                  ^
+   |
+   = note: register class `ctr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:122:27
+   |
+LL |         asm!("", in("lr") x);
+   |                           ^
+   |
+   = note: register class `lr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:125:28
+   |
+LL |         asm!("", out("lr") x);
+   |                            ^
+   |
+   = note: register class `lr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:128:33
+   |
+LL |         asm!("/* {} */", in(lr) x);
+   |                                 ^
+   |
+   = note: register class `lr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:135:28
    |
 LL |         asm!("", in("xer") x);
    |                            ^
@@ -257,7 +341,7 @@ LL |         asm!("", in("xer") x);
    = note: register class `xer` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:116:29
+  --> $DIR/bad-reg.rs:138:29
    |
 LL |         asm!("", out("xer") x);
    |                             ^
@@ -265,12 +349,12 @@ LL |         asm!("", out("xer") x);
    = note: register class `xer` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:119:34
+  --> $DIR/bad-reg.rs:141:34
    |
 LL |         asm!("/* {} */", in(xer) x);
    |                                  ^
    |
    = note: register class `xer` supports these types: 
 
-error: aborting due to 41 previous errors
+error: aborting due to 53 previous errors
 
diff --git a/tests/ui/asm/powerpc/bad-reg.powerpc64.stderr b/tests/ui/asm/powerpc/bad-reg.powerpc64.stderr
index a93b2b018df..42a59448f42 100644
--- a/tests/ui/asm/powerpc/bad-reg.powerpc64.stderr
+++ b/tests/ui/asm/powerpc/bad-reg.powerpc64.stderr
@@ -28,74 +28,110 @@ error: invalid register `fp`: the frame pointer cannot be used as an operand for
 LL |         asm!("", out("fp") _);
    |                  ^^^^^^^^^^^
 
-error: invalid register `lr`: the link register cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:48:18
-   |
-LL |         asm!("", out("lr") _);
-   |                  ^^^^^^^^^^^
-
-error: invalid register `ctr`: the counter register cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:50:18
-   |
-LL |         asm!("", out("ctr") _);
-   |                  ^^^^^^^^^^^^
-
 error: invalid register `vrsave`: the vrsave register cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:52:18
+  --> $DIR/bad-reg.rs:48:18
    |
 LL |         asm!("", out("vrsave") _);
    |                  ^^^^^^^^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:100:18
+  --> $DIR/bad-reg.rs:96:18
    |
 LL |         asm!("", in("cr") x);
    |                  ^^^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:103:18
+  --> $DIR/bad-reg.rs:99:18
    |
 LL |         asm!("", out("cr") x);
    |                  ^^^^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:106:26
+  --> $DIR/bad-reg.rs:102:26
    |
 LL |         asm!("/* {} */", in(cr) x);
    |                          ^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:109:26
+  --> $DIR/bad-reg.rs:105:26
    |
 LL |         asm!("/* {} */", out(cr) _);
    |                          ^^^^^^^^^
 
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:109:18
+   |
+LL |         asm!("", in("ctr") x);
+   |                  ^^^^^^^^^^^
+
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:112:18
+   |
+LL |         asm!("", out("ctr") x);
+   |                  ^^^^^^^^^^^^
+
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:115:26
+   |
+LL |         asm!("/* {} */", in(ctr) x);
+   |                          ^^^^^^^^^
+
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:118:26
+   |
+LL |         asm!("/* {} */", out(ctr) _);
+   |                          ^^^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:122:18
+   |
+LL |         asm!("", in("lr") x);
+   |                  ^^^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:125:18
+   |
+LL |         asm!("", out("lr") x);
+   |                  ^^^^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:128:26
+   |
+LL |         asm!("/* {} */", in(lr) x);
+   |                          ^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:131:26
+   |
+LL |         asm!("/* {} */", out(lr) _);
+   |                          ^^^^^^^^^
+
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:113:18
+  --> $DIR/bad-reg.rs:135:18
    |
 LL |         asm!("", in("xer") x);
    |                  ^^^^^^^^^^^
 
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:116:18
+  --> $DIR/bad-reg.rs:138:18
    |
 LL |         asm!("", out("xer") x);
    |                  ^^^^^^^^^^^^
 
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:119:26
+  --> $DIR/bad-reg.rs:141:26
    |
 LL |         asm!("/* {} */", in(xer) x);
    |                          ^^^^^^^^^
 
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:122:26
+  --> $DIR/bad-reg.rs:144:26
    |
 LL |         asm!("/* {} */", out(xer) _);
    |                          ^^^^^^^^^^
 
 error: register `cr0` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:126:31
+  --> $DIR/bad-reg.rs:148:31
    |
 LL |         asm!("", out("cr") _, out("cr0") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr0`
@@ -103,7 +139,7 @@ LL |         asm!("", out("cr") _, out("cr0") _);
    |                  register `cr`
 
 error: register `cr1` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:128:31
+  --> $DIR/bad-reg.rs:150:31
    |
 LL |         asm!("", out("cr") _, out("cr1") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr1`
@@ -111,7 +147,7 @@ LL |         asm!("", out("cr") _, out("cr1") _);
    |                  register `cr`
 
 error: register `cr2` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:130:31
+  --> $DIR/bad-reg.rs:152:31
    |
 LL |         asm!("", out("cr") _, out("cr2") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr2`
@@ -119,7 +155,7 @@ LL |         asm!("", out("cr") _, out("cr2") _);
    |                  register `cr`
 
 error: register `cr3` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:132:31
+  --> $DIR/bad-reg.rs:154:31
    |
 LL |         asm!("", out("cr") _, out("cr3") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr3`
@@ -127,7 +163,7 @@ LL |         asm!("", out("cr") _, out("cr3") _);
    |                  register `cr`
 
 error: register `cr4` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:134:31
+  --> $DIR/bad-reg.rs:156:31
    |
 LL |         asm!("", out("cr") _, out("cr4") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr4`
@@ -135,7 +171,7 @@ LL |         asm!("", out("cr") _, out("cr4") _);
    |                  register `cr`
 
 error: register `cr5` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:136:31
+  --> $DIR/bad-reg.rs:158:31
    |
 LL |         asm!("", out("cr") _, out("cr5") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr5`
@@ -143,7 +179,7 @@ LL |         asm!("", out("cr") _, out("cr5") _);
    |                  register `cr`
 
 error: register `cr6` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:138:31
+  --> $DIR/bad-reg.rs:160:31
    |
 LL |         asm!("", out("cr") _, out("cr6") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr6`
@@ -151,7 +187,7 @@ LL |         asm!("", out("cr") _, out("cr6") _);
    |                  register `cr`
 
 error: register `cr7` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:140:31
+  --> $DIR/bad-reg.rs:162:31
    |
 LL |         asm!("", out("cr") _, out("cr7") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr7`
@@ -165,7 +201,7 @@ LL |         asm!("", out("r13") _);
    |                  ^^^^^^^^^^^^
 
 error: `vsx` target feature is not enabled
-  --> $DIR/bad-reg.rs:61:27
+  --> $DIR/bad-reg.rs:57:27
    |
 LL |         asm!("", in("v0") v64x2); // requires vsx
    |                           ^^^^^
@@ -173,7 +209,7 @@ LL |         asm!("", in("v0") v64x2); // requires vsx
    = note: this is required to use type `i64x2` with register class `vreg`
 
 error: `vsx` target feature is not enabled
-  --> $DIR/bad-reg.rs:64:28
+  --> $DIR/bad-reg.rs:60:28
    |
 LL |         asm!("", out("v0") v64x2); // requires vsx
    |                            ^^^^^
@@ -181,7 +217,7 @@ LL |         asm!("", out("v0") v64x2); // requires vsx
    = note: this is required to use type `i64x2` with register class `vreg`
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:67:27
+  --> $DIR/bad-reg.rs:63:27
    |
 LL |         asm!("", in("v0") x); // FIXME: should be ok if vsx is available
    |                           ^
@@ -189,7 +225,7 @@ LL |         asm!("", in("v0") x); // FIXME: should be ok if vsx is available
    = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:70:28
+  --> $DIR/bad-reg.rs:66:28
    |
 LL |         asm!("", out("v0") x); // FIXME: should be ok if vsx is available
    |                            ^
@@ -197,7 +233,7 @@ LL |         asm!("", out("v0") x); // FIXME: should be ok if vsx is available
    = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2
 
 error: `vsx` target feature is not enabled
-  --> $DIR/bad-reg.rs:75:35
+  --> $DIR/bad-reg.rs:71:35
    |
 LL |         asm!("/* {} */", in(vreg) v64x2); // requires vsx
    |                                   ^^^^^
@@ -205,7 +241,7 @@ LL |         asm!("/* {} */", in(vreg) v64x2); // requires vsx
    = note: this is required to use type `i64x2` with register class `vreg`
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:78:35
+  --> $DIR/bad-reg.rs:74:35
    |
 LL |         asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is available
    |                                   ^
@@ -213,7 +249,7 @@ LL |         asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is avai
    = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:100:27
+  --> $DIR/bad-reg.rs:96:27
    |
 LL |         asm!("", in("cr") x);
    |                           ^
@@ -221,7 +257,7 @@ LL |         asm!("", in("cr") x);
    = note: register class `cr` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:103:28
+  --> $DIR/bad-reg.rs:99:28
    |
 LL |         asm!("", out("cr") x);
    |                            ^
@@ -229,7 +265,7 @@ LL |         asm!("", out("cr") x);
    = note: register class `cr` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:106:33
+  --> $DIR/bad-reg.rs:102:33
    |
 LL |         asm!("/* {} */", in(cr) x);
    |                                 ^
@@ -237,7 +273,55 @@ LL |         asm!("/* {} */", in(cr) x);
    = note: register class `cr` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:113:28
+  --> $DIR/bad-reg.rs:109:28
+   |
+LL |         asm!("", in("ctr") x);
+   |                            ^
+   |
+   = note: register class `ctr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:112:29
+   |
+LL |         asm!("", out("ctr") x);
+   |                             ^
+   |
+   = note: register class `ctr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:115:34
+   |
+LL |         asm!("/* {} */", in(ctr) x);
+   |                                  ^
+   |
+   = note: register class `ctr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:122:27
+   |
+LL |         asm!("", in("lr") x);
+   |                           ^
+   |
+   = note: register class `lr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:125:28
+   |
+LL |         asm!("", out("lr") x);
+   |                            ^
+   |
+   = note: register class `lr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:128:33
+   |
+LL |         asm!("/* {} */", in(lr) x);
+   |                                 ^
+   |
+   = note: register class `lr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:135:28
    |
 LL |         asm!("", in("xer") x);
    |                            ^
@@ -245,7 +329,7 @@ LL |         asm!("", in("xer") x);
    = note: register class `xer` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:116:29
+  --> $DIR/bad-reg.rs:138:29
    |
 LL |         asm!("", out("xer") x);
    |                             ^
@@ -253,12 +337,12 @@ LL |         asm!("", out("xer") x);
    = note: register class `xer` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:119:34
+  --> $DIR/bad-reg.rs:141:34
    |
 LL |         asm!("/* {} */", in(xer) x);
    |                                  ^
    |
    = note: register class `xer` supports these types: 
 
-error: aborting due to 37 previous errors
+error: aborting due to 49 previous errors
 
diff --git a/tests/ui/asm/powerpc/bad-reg.powerpc64le.stderr b/tests/ui/asm/powerpc/bad-reg.powerpc64le.stderr
index 124013f89af..82faba8d167 100644
--- a/tests/ui/asm/powerpc/bad-reg.powerpc64le.stderr
+++ b/tests/ui/asm/powerpc/bad-reg.powerpc64le.stderr
@@ -28,74 +28,110 @@ error: invalid register `fp`: the frame pointer cannot be used as an operand for
 LL |         asm!("", out("fp") _);
    |                  ^^^^^^^^^^^
 
-error: invalid register `lr`: the link register cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:48:18
-   |
-LL |         asm!("", out("lr") _);
-   |                  ^^^^^^^^^^^
-
-error: invalid register `ctr`: the counter register cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:50:18
-   |
-LL |         asm!("", out("ctr") _);
-   |                  ^^^^^^^^^^^^
-
 error: invalid register `vrsave`: the vrsave register cannot be used as an operand for inline asm
-  --> $DIR/bad-reg.rs:52:18
+  --> $DIR/bad-reg.rs:48:18
    |
 LL |         asm!("", out("vrsave") _);
    |                  ^^^^^^^^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:100:18
+  --> $DIR/bad-reg.rs:96:18
    |
 LL |         asm!("", in("cr") x);
    |                  ^^^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:103:18
+  --> $DIR/bad-reg.rs:99:18
    |
 LL |         asm!("", out("cr") x);
    |                  ^^^^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:106:26
+  --> $DIR/bad-reg.rs:102:26
    |
 LL |         asm!("/* {} */", in(cr) x);
    |                          ^^^^^^^^
 
 error: register class `cr` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:109:26
+  --> $DIR/bad-reg.rs:105:26
    |
 LL |         asm!("/* {} */", out(cr) _);
    |                          ^^^^^^^^^
 
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:109:18
+   |
+LL |         asm!("", in("ctr") x);
+   |                  ^^^^^^^^^^^
+
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:112:18
+   |
+LL |         asm!("", out("ctr") x);
+   |                  ^^^^^^^^^^^^
+
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:115:26
+   |
+LL |         asm!("/* {} */", in(ctr) x);
+   |                          ^^^^^^^^^
+
+error: register class `ctr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:118:26
+   |
+LL |         asm!("/* {} */", out(ctr) _);
+   |                          ^^^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:122:18
+   |
+LL |         asm!("", in("lr") x);
+   |                  ^^^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:125:18
+   |
+LL |         asm!("", out("lr") x);
+   |                  ^^^^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:128:26
+   |
+LL |         asm!("/* {} */", in(lr) x);
+   |                          ^^^^^^^^
+
+error: register class `lr` can only be used as a clobber, not as an input or output
+  --> $DIR/bad-reg.rs:131:26
+   |
+LL |         asm!("/* {} */", out(lr) _);
+   |                          ^^^^^^^^^
+
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:113:18
+  --> $DIR/bad-reg.rs:135:18
    |
 LL |         asm!("", in("xer") x);
    |                  ^^^^^^^^^^^
 
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:116:18
+  --> $DIR/bad-reg.rs:138:18
    |
 LL |         asm!("", out("xer") x);
    |                  ^^^^^^^^^^^^
 
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:119:26
+  --> $DIR/bad-reg.rs:141:26
    |
 LL |         asm!("/* {} */", in(xer) x);
    |                          ^^^^^^^^^
 
 error: register class `xer` can only be used as a clobber, not as an input or output
-  --> $DIR/bad-reg.rs:122:26
+  --> $DIR/bad-reg.rs:144:26
    |
 LL |         asm!("/* {} */", out(xer) _);
    |                          ^^^^^^^^^^
 
 error: register `cr0` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:126:31
+  --> $DIR/bad-reg.rs:148:31
    |
 LL |         asm!("", out("cr") _, out("cr0") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr0`
@@ -103,7 +139,7 @@ LL |         asm!("", out("cr") _, out("cr0") _);
    |                  register `cr`
 
 error: register `cr1` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:128:31
+  --> $DIR/bad-reg.rs:150:31
    |
 LL |         asm!("", out("cr") _, out("cr1") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr1`
@@ -111,7 +147,7 @@ LL |         asm!("", out("cr") _, out("cr1") _);
    |                  register `cr`
 
 error: register `cr2` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:130:31
+  --> $DIR/bad-reg.rs:152:31
    |
 LL |         asm!("", out("cr") _, out("cr2") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr2`
@@ -119,7 +155,7 @@ LL |         asm!("", out("cr") _, out("cr2") _);
    |                  register `cr`
 
 error: register `cr3` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:132:31
+  --> $DIR/bad-reg.rs:154:31
    |
 LL |         asm!("", out("cr") _, out("cr3") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr3`
@@ -127,7 +163,7 @@ LL |         asm!("", out("cr") _, out("cr3") _);
    |                  register `cr`
 
 error: register `cr4` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:134:31
+  --> $DIR/bad-reg.rs:156:31
    |
 LL |         asm!("", out("cr") _, out("cr4") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr4`
@@ -135,7 +171,7 @@ LL |         asm!("", out("cr") _, out("cr4") _);
    |                  register `cr`
 
 error: register `cr5` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:136:31
+  --> $DIR/bad-reg.rs:158:31
    |
 LL |         asm!("", out("cr") _, out("cr5") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr5`
@@ -143,7 +179,7 @@ LL |         asm!("", out("cr") _, out("cr5") _);
    |                  register `cr`
 
 error: register `cr6` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:138:31
+  --> $DIR/bad-reg.rs:160:31
    |
 LL |         asm!("", out("cr") _, out("cr6") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr6`
@@ -151,7 +187,7 @@ LL |         asm!("", out("cr") _, out("cr6") _);
    |                  register `cr`
 
 error: register `cr7` conflicts with register `cr`
-  --> $DIR/bad-reg.rs:140:31
+  --> $DIR/bad-reg.rs:162:31
    |
 LL |         asm!("", out("cr") _, out("cr7") _);
    |                  -----------  ^^^^^^^^^^^^ register `cr7`
@@ -165,7 +201,7 @@ LL |         asm!("", out("r13") _);
    |                  ^^^^^^^^^^^^
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:67:27
+  --> $DIR/bad-reg.rs:63:27
    |
 LL |         asm!("", in("v0") x); // FIXME: should be ok if vsx is available
    |                           ^
@@ -173,7 +209,7 @@ LL |         asm!("", in("v0") x); // FIXME: should be ok if vsx is available
    = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:70:28
+  --> $DIR/bad-reg.rs:66:28
    |
 LL |         asm!("", out("v0") x); // FIXME: should be ok if vsx is available
    |                            ^
@@ -181,7 +217,7 @@ LL |         asm!("", out("v0") x); // FIXME: should be ok if vsx is available
    = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:78:35
+  --> $DIR/bad-reg.rs:74:35
    |
 LL |         asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is available
    |                                   ^
@@ -189,7 +225,7 @@ LL |         asm!("/* {} */", in(vreg) x); // FIXME: should be ok if vsx is avai
    = note: register class `vreg` supports these types: i8x16, i16x8, i32x4, f32x4, f32, f64, i64x2, f64x2
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:100:27
+  --> $DIR/bad-reg.rs:96:27
    |
 LL |         asm!("", in("cr") x);
    |                           ^
@@ -197,7 +233,7 @@ LL |         asm!("", in("cr") x);
    = note: register class `cr` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:103:28
+  --> $DIR/bad-reg.rs:99:28
    |
 LL |         asm!("", out("cr") x);
    |                            ^
@@ -205,7 +241,7 @@ LL |         asm!("", out("cr") x);
    = note: register class `cr` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:106:33
+  --> $DIR/bad-reg.rs:102:33
    |
 LL |         asm!("/* {} */", in(cr) x);
    |                                 ^
@@ -213,7 +249,55 @@ LL |         asm!("/* {} */", in(cr) x);
    = note: register class `cr` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:113:28
+  --> $DIR/bad-reg.rs:109:28
+   |
+LL |         asm!("", in("ctr") x);
+   |                            ^
+   |
+   = note: register class `ctr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:112:29
+   |
+LL |         asm!("", out("ctr") x);
+   |                             ^
+   |
+   = note: register class `ctr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:115:34
+   |
+LL |         asm!("/* {} */", in(ctr) x);
+   |                                  ^
+   |
+   = note: register class `ctr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:122:27
+   |
+LL |         asm!("", in("lr") x);
+   |                           ^
+   |
+   = note: register class `lr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:125:28
+   |
+LL |         asm!("", out("lr") x);
+   |                            ^
+   |
+   = note: register class `lr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:128:33
+   |
+LL |         asm!("/* {} */", in(lr) x);
+   |                                 ^
+   |
+   = note: register class `lr` supports these types: 
+
+error: type `i32` cannot be used with this register class
+  --> $DIR/bad-reg.rs:135:28
    |
 LL |         asm!("", in("xer") x);
    |                            ^
@@ -221,7 +305,7 @@ LL |         asm!("", in("xer") x);
    = note: register class `xer` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:116:29
+  --> $DIR/bad-reg.rs:138:29
    |
 LL |         asm!("", out("xer") x);
    |                             ^
@@ -229,12 +313,12 @@ LL |         asm!("", out("xer") x);
    = note: register class `xer` supports these types: 
 
 error: type `i32` cannot be used with this register class
-  --> $DIR/bad-reg.rs:119:34
+  --> $DIR/bad-reg.rs:141:34
    |
 LL |         asm!("/* {} */", in(xer) x);
    |                                  ^
    |
    = note: register class `xer` supports these types: 
 
-error: aborting due to 34 previous errors
+error: aborting due to 46 previous errors
 
diff --git a/tests/ui/asm/powerpc/bad-reg.rs b/tests/ui/asm/powerpc/bad-reg.rs
index 5598f837960..21ea451934e 100644
--- a/tests/ui/asm/powerpc/bad-reg.rs
+++ b/tests/ui/asm/powerpc/bad-reg.rs
@@ -45,10 +45,6 @@ fn f() {
         //~^ ERROR invalid register `r30`: r30 is used internally by LLVM and cannot be used as an operand for inline asm
         asm!("", out("fp") _);
         //~^ ERROR invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
-        asm!("", out("lr") _);
-        //~^ ERROR invalid register `lr`: the link register cannot be used as an operand for inline asm
-        asm!("", out("ctr") _);
-        //~^ ERROR invalid register `ctr`: the counter register cannot be used as an operand for inline asm
         asm!("", out("vrsave") _);
         //~^ ERROR invalid register `vrsave`: the vrsave register cannot be used as an operand for inline asm
 
@@ -108,6 +104,32 @@ fn f() {
         //~| ERROR type `i32` cannot be used with this register class
         asm!("/* {} */", out(cr) _);
         //~^ ERROR can only be used as a clobber
+        // ctr
+        asm!("", out("ctr") _); // ok
+        asm!("", in("ctr") x);
+        //~^ ERROR can only be used as a clobber
+        //~| ERROR type `i32` cannot be used with this register class
+        asm!("", out("ctr") x);
+        //~^ ERROR can only be used as a clobber
+        //~| ERROR type `i32` cannot be used with this register class
+        asm!("/* {} */", in(ctr) x);
+        //~^ ERROR can only be used as a clobber
+        //~| ERROR type `i32` cannot be used with this register class
+        asm!("/* {} */", out(ctr) _);
+        //~^ ERROR can only be used as a clobber
+        // lr
+        asm!("", out("lr") _); // ok
+        asm!("", in("lr") x);
+        //~^ ERROR can only be used as a clobber
+        //~| ERROR type `i32` cannot be used with this register class
+        asm!("", out("lr") x);
+        //~^ ERROR can only be used as a clobber
+        //~| ERROR type `i32` cannot be used with this register class
+        asm!("/* {} */", in(lr) x);
+        //~^ ERROR can only be used as a clobber
+        //~| ERROR type `i32` cannot be used with this register class
+        asm!("/* {} */", out(lr) _);
+        //~^ ERROR can only be used as a clobber
         // xer
         asm!("", out("xer") _); // ok
         asm!("", in("xer") x);
diff --git a/tests/ui/asm/x86_64/goto.rs b/tests/ui/asm/x86_64/goto.rs
index 00a8e588f96..c1dbce0d1c9 100644
--- a/tests/ui/asm/x86_64/goto.rs
+++ b/tests/ui/asm/x86_64/goto.rs
@@ -1,6 +1,7 @@
 //@ only-x86_64
 //@ run-pass
 //@ needs-asm-support
+//@ ignore-backends: gcc
 
 #![deny(unreachable_code)]
 #![feature(asm_goto_with_outputs)]
diff --git a/tests/ui/asm/x86_64/goto.stderr b/tests/ui/asm/x86_64/goto.stderr
index 78b726b3f3d..f8f09f32f6c 100644
--- a/tests/ui/asm/x86_64/goto.stderr
+++ b/tests/ui/asm/x86_64/goto.stderr
@@ -1,5 +1,5 @@
 warning: unreachable statement
-  --> $DIR/goto.rs:143:9
+  --> $DIR/goto.rs:144:9
    |
 LL | /         asm!(
 LL | |             "jmp {}",
@@ -13,7 +13,7 @@ LL |           unreachable!();
    |           ^^^^^^^^^^^^^^ unreachable statement
    |
 note: the lint level is defined here
-  --> $DIR/goto.rs:133:8
+  --> $DIR/goto.rs:134:8
    |
 LL | #[warn(unreachable_code)]
    |        ^^^^^^^^^^^^^^^^
diff --git a/tests/ui/asm/x86_64/srcloc.rs b/tests/ui/asm/x86_64/srcloc.rs
index 2938bafe5e7..f4ffa8c5c3b 100644
--- a/tests/ui/asm/x86_64/srcloc.rs
+++ b/tests/ui/asm/x86_64/srcloc.rs
@@ -1,6 +1,7 @@
 //@ only-x86_64
 //@ build-fail
 //@ compile-flags: -Ccodegen-units=1
+//@ ignore-backends: gcc
 
 use std::arch::asm;
 
diff --git a/tests/ui/asm/x86_64/srcloc.stderr b/tests/ui/asm/x86_64/srcloc.stderr
index bb4e855163d..b2079120ec0 100644
--- a/tests/ui/asm/x86_64/srcloc.stderr
+++ b/tests/ui/asm/x86_64/srcloc.stderr
@@ -1,5 +1,5 @@
 error: invalid instruction mnemonic 'invalid_instruction'
-  --> $DIR/srcloc.rs:11:15
+  --> $DIR/srcloc.rs:12:15
    |
 LL |         asm!("invalid_instruction");
    |               ^^^^^^^^^^^^^^^^^^^
@@ -11,7 +11,7 @@ LL |     invalid_instruction
    |     ^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction'
-  --> $DIR/srcloc.rs:15:13
+  --> $DIR/srcloc.rs:16:13
    |
 LL |             invalid_instruction
    |             ^^^^^^^^^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL |             invalid_instruction
    |             ^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction'
-  --> $DIR/srcloc.rs:20:13
+  --> $DIR/srcloc.rs:21:13
    |
 LL |             invalid_instruction
    |             ^^^^^^^^^^^^^^^^^^^
@@ -35,7 +35,7 @@ LL |             invalid_instruction
    |             ^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction'
-  --> $DIR/srcloc.rs:26:13
+  --> $DIR/srcloc.rs:27:13
    |
 LL |             invalid_instruction
    |             ^^^^^^^^^^^^^^^^^^^
@@ -47,7 +47,7 @@ LL |             invalid_instruction
    |             ^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction'
-  --> $DIR/srcloc.rs:33:13
+  --> $DIR/srcloc.rs:34:13
    |
 LL |             invalid_instruction
    |             ^^^^^^^^^^^^^^^^^^^
@@ -59,7 +59,7 @@ LL |             invalid_instruction
    |             ^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction'
-  --> $DIR/srcloc.rs:38:14
+  --> $DIR/srcloc.rs:39:14
    |
 LL |         asm!(concat!("invalid", "_", "instruction"));
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -71,7 +71,7 @@ LL |     invalid_instruction
    |     ^^^^^^^^^^^^^^^^^^^
 
 warning: scale factor without index register is ignored
-  --> $DIR/srcloc.rs:41:15
+  --> $DIR/srcloc.rs:42:15
    |
 LL |         asm!("movaps %xmm3, (%esi, 2)", options(att_syntax));
    |               ^^^^^^^^^^^^^^^^^^^^^^^
@@ -83,7 +83,7 @@ LL |     movaps %xmm3, (%esi, 2)
    |                          ^
 
 error: invalid instruction mnemonic 'invalid_instruction'
-  --> $DIR/srcloc.rs:45:14
+  --> $DIR/srcloc.rs:46:14
    |
 LL |             "invalid_instruction",
    |              ^^^^^^^^^^^^^^^^^^^
@@ -95,7 +95,7 @@ LL |     invalid_instruction
    |     ^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction'
-  --> $DIR/srcloc.rs:51:14
+  --> $DIR/srcloc.rs:52:14
    |
 LL |             "invalid_instruction",
    |              ^^^^^^^^^^^^^^^^^^^
@@ -107,7 +107,7 @@ LL | invalid_instruction
    | ^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction'
-  --> $DIR/srcloc.rs:58:14
+  --> $DIR/srcloc.rs:59:14
    |
 LL |             "invalid_instruction",
    |              ^^^^^^^^^^^^^^^^^^^
@@ -119,7 +119,7 @@ LL | invalid_instruction
    | ^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction'
-  --> $DIR/srcloc.rs:65:13
+  --> $DIR/srcloc.rs:66:13
    |
 LL |             concat!("invalid", "_", "instruction"),
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -131,7 +131,7 @@ LL | invalid_instruction
    | ^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction'
-  --> $DIR/srcloc.rs:72:13
+  --> $DIR/srcloc.rs:73:13
    |
 LL |             concat!("invalid", "_", "instruction"),
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -143,7 +143,7 @@ LL | invalid_instruction
    | ^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction1'
-  --> $DIR/srcloc.rs:79:14
+  --> $DIR/srcloc.rs:80:14
    |
 LL |             "invalid_instruction1",
    |              ^^^^^^^^^^^^^^^^^^^^
@@ -155,7 +155,7 @@ LL |     invalid_instruction1
    |     ^^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction2'
-  --> $DIR/srcloc.rs:80:14
+  --> $DIR/srcloc.rs:81:14
    |
 LL |             "invalid_instruction2",
    |              ^^^^^^^^^^^^^^^^^^^^
@@ -167,7 +167,7 @@ LL | invalid_instruction2
    | ^^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction1'
-  --> $DIR/srcloc.rs:86:13
+  --> $DIR/srcloc.rs:87:13
    |
 LL | /             concat!(
 LL | |                 "invalid", "_", "instruction1", "\n",
@@ -182,7 +182,7 @@ LL |     invalid_instruction1
    |     ^^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction2'
-  --> $DIR/srcloc.rs:86:13
+  --> $DIR/srcloc.rs:87:13
    |
 LL | /             concat!(
 LL | |                 "invalid", "_", "instruction1", "\n",
@@ -197,7 +197,7 @@ LL | invalid_instruction2
    | ^^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction1'
-  --> $DIR/srcloc.rs:95:13
+  --> $DIR/srcloc.rs:96:13
    |
 LL | /             concat!(
 LL | |                 "invalid", "_", "instruction1", "\n",
@@ -212,7 +212,7 @@ LL |     invalid_instruction1
    |     ^^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction2'
-  --> $DIR/srcloc.rs:95:13
+  --> $DIR/srcloc.rs:96:13
    |
 LL | /             concat!(
 LL | |                 "invalid", "_", "instruction1", "\n",
@@ -227,7 +227,7 @@ LL | invalid_instruction2
    | ^^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction3'
-  --> $DIR/srcloc.rs:99:13
+  --> $DIR/srcloc.rs:100:13
    |
 LL | /             concat!(
 LL | |                 "invalid", "_", "instruction3", "\n",
@@ -242,7 +242,7 @@ LL | invalid_instruction3
    | ^^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction4'
-  --> $DIR/srcloc.rs:99:13
+  --> $DIR/srcloc.rs:100:13
    |
 LL | /             concat!(
 LL | |                 "invalid", "_", "instruction3", "\n",
@@ -257,7 +257,7 @@ LL | invalid_instruction4
    | ^^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction1'
-  --> $DIR/srcloc.rs:110:13
+  --> $DIR/srcloc.rs:111:13
    |
 LL | /             concat!(
 LL | |                 "invalid", "_", "instruction1", "\n",
@@ -272,7 +272,7 @@ LL |     invalid_instruction1
    |     ^^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction2'
-  --> $DIR/srcloc.rs:110:13
+  --> $DIR/srcloc.rs:111:13
    |
 LL | /             concat!(
 LL | |                 "invalid", "_", "instruction1", "\n",
@@ -287,7 +287,7 @@ LL | invalid_instruction2
    | ^^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction3'
-  --> $DIR/srcloc.rs:114:13
+  --> $DIR/srcloc.rs:115:13
    |
 LL | /             concat!(
 LL | |                 "invalid", "_", "instruction3", "\n",
@@ -302,7 +302,7 @@ LL | invalid_instruction3
    | ^^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction4'
-  --> $DIR/srcloc.rs:114:13
+  --> $DIR/srcloc.rs:115:13
    |
 LL | /             concat!(
 LL | |                 "invalid", "_", "instruction3", "\n",
@@ -317,7 +317,7 @@ LL | invalid_instruction4
    | ^^^^^^^^^^^^^^^^^^^^
 
 error: invalid instruction mnemonic 'invalid_instruction'
-  --> $DIR/srcloc.rs:127:14
+  --> $DIR/srcloc.rs:128:14
    |
 LL |             "invalid_instruction"
    |              ^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/issues/issue-56870.rs b/tests/ui/associated-consts/traits-associated-consts-ice-56870.rs
index fc6deedd029..0c5a2b84773 100644
--- a/tests/ui/issues/issue-56870.rs
+++ b/tests/ui/associated-consts/traits-associated-consts-ice-56870.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/56870
 //@ build-pass
 // Regression test for #56870: Internal compiler error (traits & associated consts)
 
diff --git a/tests/ui/associated-inherent-types/hr-do-not-blame-outlives-static-ice.rs b/tests/ui/associated-inherent-types/hr-do-not-blame-outlives-static-ice.rs
new file mode 100644
index 00000000000..e5c1f47b9e0
--- /dev/null
+++ b/tests/ui/associated-inherent-types/hr-do-not-blame-outlives-static-ice.rs
@@ -0,0 +1,17 @@
+//@ compile-flags: -Zdeduplicate-diagnostics=yes
+
+// Regression test for #146467.
+#![feature(inherent_associated_types)]
+//~^ WARN the feature `inherent_associated_types` is incomplete
+
+struct Foo<T>(T);
+
+impl<'a> Foo<fn(&())> {
+    //~^ ERROR the lifetime parameter `'a` is not constrained by the impl trait
+    type Assoc = &'a ();
+}
+
+fn foo(_: for<'a> fn(Foo<fn(&'a ())>::Assoc)) {}
+//~^ ERROR mismatched types
+//~| ERROR higher-ranked subtype error
+fn main() {}
diff --git a/tests/ui/associated-inherent-types/hr-do-not-blame-outlives-static-ice.stderr b/tests/ui/associated-inherent-types/hr-do-not-blame-outlives-static-ice.stderr
new file mode 100644
index 00000000000..4c0726d4ddc
--- /dev/null
+++ b/tests/ui/associated-inherent-types/hr-do-not-blame-outlives-static-ice.stderr
@@ -0,0 +1,34 @@
+warning: the feature `inherent_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
+  --> $DIR/hr-do-not-blame-outlives-static-ice.rs:4:12
+   |
+LL | #![feature(inherent_associated_types)]
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
+   = note: `#[warn(incomplete_features)]` on by default
+
+error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
+  --> $DIR/hr-do-not-blame-outlives-static-ice.rs:9:6
+   |
+LL | impl<'a> Foo<fn(&())> {
+   |      ^^ unconstrained lifetime parameter
+
+error[E0308]: mismatched types
+  --> $DIR/hr-do-not-blame-outlives-static-ice.rs:14:11
+   |
+LL | fn foo(_: for<'a> fn(Foo<fn(&'a ())>::Assoc)) {}
+   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+   |
+   = note: expected struct `Foo<for<'a> fn(&'a ())>`
+              found struct `Foo<for<'a> fn(&'a ())>`
+
+error: higher-ranked subtype error
+  --> $DIR/hr-do-not-blame-outlives-static-ice.rs:14:1
+   |
+LL | fn foo(_: for<'a> fn(Foo<fn(&'a ())>::Assoc)) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors; 1 warning emitted
+
+Some errors have detailed explanations: E0207, E0308.
+For more information about an error, try `rustc --explain E0207`.
diff --git a/tests/ui/associated-type-bounds/duplicate-bound-err.rs b/tests/ui/associated-type-bounds/duplicate-bound-err.rs
new file mode 100644
index 00000000000..01cc05f2545
--- /dev/null
+++ b/tests/ui/associated-type-bounds/duplicate-bound-err.rs
@@ -0,0 +1,114 @@
+//@ edition: 2024
+
+#![feature(associated_const_equality, type_alias_impl_trait, return_type_notation)]
+#![allow(refining_impl_trait_internal)]
+
+use std::iter;
+
+fn rpit1() -> impl Iterator<Item: Copy, Item: Send> {
+    iter::empty()
+    //~^ ERROR type annotations needed
+}
+fn rpit2() -> impl Iterator<Item: Copy, Item: Copy> {
+    iter::empty()
+    //~^ ERROR type annotations needed
+}
+fn rpit3() -> impl Iterator<Item: 'static, Item: 'static> {
+    iter::empty()
+    //~^ ERROR type annotations needed
+}
+
+type Tait1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
+//~^ ERROR unconstrained opaque type
+type Tait2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
+//~^ ERROR unconstrained opaque type
+type Tait3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
+//~^ ERROR unconstrained opaque type
+
+type Tait4 = impl Iterator<Item: Copy, Item: Send>;
+//~^ ERROR unconstrained opaque type
+type Tait5 = impl Iterator<Item: Copy, Item: Copy>;
+//~^ ERROR unconstrained opaque type
+type Tait6 = impl Iterator<Item: 'static, Item: 'static>;
+//~^ ERROR unconstrained opaque type
+
+fn mismatch() -> impl Iterator<Item: Copy, Item: Send> {
+    //~^ ERROR [E0277]
+    iter::empty::<*const ()>()
+}
+
+fn mismatch_2() -> impl Iterator<Item: Copy, Item: Send> {
+    //~^ ERROR [E0277]
+    iter::empty::<String>()
+}
+
+trait Trait {
+    type Gat<T>;
+
+    const ASSOC: i32;
+
+    fn foo() -> impl Sized;
+}
+
+impl Trait for () {
+    type Gat<T> = ();
+
+    const ASSOC: i32 = 3;
+
+    fn foo() {}
+}
+
+impl Trait for u32 {
+    type Gat<T> = ();
+
+    const ASSOC: i32 = 4;
+
+    fn foo() -> u32 {
+        42
+    }
+}
+
+fn uncallable(_: impl Iterator<Item = i32, Item = u32>) {}
+
+fn uncallable_const(_: impl Trait<ASSOC = 3, ASSOC = 4>) {}
+
+fn uncallable_rtn(_: impl Trait<foo(..): Trait<ASSOC = 3>, foo(..): Trait<ASSOC = 4>>) {}
+
+type MustFail = dyn Iterator<Item = i32, Item = u32>;
+//~^ ERROR [E0719]
+//~| ERROR conflicting associated type bounds
+
+trait Trait2 {
+    const ASSOC: u32;
+}
+
+type MustFail2 = dyn Trait2<ASSOC = 3u32, ASSOC = 4u32>;
+//~^ ERROR [E0719]
+//~| ERROR conflicting associated type bounds
+
+type MustFail3 = dyn Iterator<Item = i32, Item = i32>;
+//~^ ERROR [E0719]
+
+type MustFail4 = dyn Trait2<ASSOC = 3u32, ASSOC = 3u32>;
+//~^ ERROR [E0719]
+
+trait Trait3 {
+    fn foo() -> impl Iterator<Item = i32, Item = u32>;
+}
+
+impl Trait3 for () {
+    fn foo() -> impl Iterator<Item = i32, Item = u32> {
+        //~^ ERROR[E0271]
+        //~| ERROR[E0271]
+        [2u32].into_iter()
+    }
+}
+
+fn main() {
+    uncallable(iter::empty::<u32>()); //~ ERROR [E0271]
+    uncallable(iter::empty::<i32>()); //~ ERROR [E0271]
+    uncallable_const(()); //~ ERROR [E0271]
+    uncallable_const(4u32); //~ ERROR [E0271]
+    uncallable_rtn(()); //~ ERROR [E0271]
+    uncallable_rtn(17u32); //~ ERROR [E0271]
+}
diff --git a/tests/ui/associated-type-bounds/duplicate-bound-err.stderr b/tests/ui/associated-type-bounds/duplicate-bound-err.stderr
new file mode 100644
index 00000000000..1737d0dc5a3
--- /dev/null
+++ b/tests/ui/associated-type-bounds/duplicate-bound-err.stderr
@@ -0,0 +1,268 @@
+error[E0282]: type annotations needed
+  --> $DIR/duplicate-bound-err.rs:9:5
+   |
+LL |     iter::empty()
+   |     ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
+   |
+help: consider specifying the generic argument
+   |
+LL |     iter::empty::<T>()
+   |                +++++
+
+error[E0282]: type annotations needed
+  --> $DIR/duplicate-bound-err.rs:13:5
+   |
+LL |     iter::empty()
+   |     ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
+   |
+help: consider specifying the generic argument
+   |
+LL |     iter::empty::<T>()
+   |                +++++
+
+error[E0282]: type annotations needed
+  --> $DIR/duplicate-bound-err.rs:17:5
+   |
+LL |     iter::empty()
+   |     ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
+   |
+help: consider specifying the generic argument
+   |
+LL |     iter::empty::<T>()
+   |                +++++
+
+error: unconstrained opaque type
+  --> $DIR/duplicate-bound-err.rs:21:51
+   |
+LL | type Tait1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
+   |                                                   ^^^^^^^^^
+   |
+   = note: `Tait1` must be used in combination with a concrete type within the same crate
+
+error: unconstrained opaque type
+  --> $DIR/duplicate-bound-err.rs:23:51
+   |
+LL | type Tait2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
+   |                                                   ^^^^^^^^^
+   |
+   = note: `Tait2` must be used in combination with a concrete type within the same crate
+
+error: unconstrained opaque type
+  --> $DIR/duplicate-bound-err.rs:25:57
+   |
+LL | type Tait3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
+   |                                                         ^^^^^^^^^
+   |
+   = note: `Tait3` must be used in combination with a concrete type within the same crate
+
+error: unconstrained opaque type
+  --> $DIR/duplicate-bound-err.rs:28:14
+   |
+LL | type Tait4 = impl Iterator<Item: Copy, Item: Send>;
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `Tait4` must be used in combination with a concrete type within the same crate
+
+error: unconstrained opaque type
+  --> $DIR/duplicate-bound-err.rs:30:14
+   |
+LL | type Tait5 = impl Iterator<Item: Copy, Item: Copy>;
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `Tait5` must be used in combination with a concrete type within the same crate
+
+error: unconstrained opaque type
+  --> $DIR/duplicate-bound-err.rs:32:14
+   |
+LL | type Tait6 = impl Iterator<Item: 'static, Item: 'static>;
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: `Tait6` must be used in combination with a concrete type within the same crate
+
+error[E0277]: `*const ()` cannot be sent between threads safely
+  --> $DIR/duplicate-bound-err.rs:35:18
+   |
+LL | fn mismatch() -> impl Iterator<Item: Copy, Item: Send> {
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely
+LL |
+LL |     iter::empty::<*const ()>()
+   |     -------------------------- return type was inferred to be `std::iter::Empty<*const ()>` here
+   |
+   = help: the trait `Send` is not implemented for `*const ()`
+
+error[E0277]: the trait bound `String: Copy` is not satisfied
+  --> $DIR/duplicate-bound-err.rs:40:20
+   |
+LL | fn mismatch_2() -> impl Iterator<Item: Copy, Item: Send> {
+   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
+LL |
+LL |     iter::empty::<String>()
+   |     ----------------------- return type was inferred to be `std::iter::Empty<String>` here
+
+error[E0271]: expected `IntoIter<u32, 1>` to be an iterator that yields `i32`, but it yields `u32`
+  --> $DIR/duplicate-bound-err.rs:100:17
+   |
+LL |     fn foo() -> impl Iterator<Item = i32, Item = u32> {
+   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
+...
+LL |         [2u32].into_iter()
+   |         ------------------ return type was inferred to be `std::array::IntoIter<u32, 1>` here
+
+error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
+  --> $DIR/duplicate-bound-err.rs:77:42
+   |
+LL | type MustFail = dyn Iterator<Item = i32, Item = u32>;
+   |                              ----------  ^^^^^^^^^^ re-bound here
+   |                              |
+   |                              `Item` bound here first
+
+error: conflicting associated type bounds for `Item`
+  --> $DIR/duplicate-bound-err.rs:77:17
+   |
+LL | type MustFail = dyn Iterator<Item = i32, Item = u32>;
+   |                 ^^^^^^^^^^^^^----------^^----------^
+   |                              |           |
+   |                              |           `Item` is specified to be `u32` here
+   |                              `Item` is specified to be `i32` here
+
+error[E0719]: the value of the associated type `ASSOC` in trait `Trait2` is already specified
+  --> $DIR/duplicate-bound-err.rs:85:43
+   |
+LL | type MustFail2 = dyn Trait2<ASSOC = 3u32, ASSOC = 4u32>;
+   |                             ------------  ^^^^^^^^^^^^ re-bound here
+   |                             |
+   |                             `ASSOC` bound here first
+
+error: conflicting associated type bounds for `ASSOC`
+  --> $DIR/duplicate-bound-err.rs:85:18
+   |
+LL | type MustFail2 = dyn Trait2<ASSOC = 3u32, ASSOC = 4u32>;
+   |                  ^^^^^^^^^^^------------^^------------^
+   |                             |             |
+   |                             |             `ASSOC` is specified to be `4` here
+   |                             `ASSOC` is specified to be `3` here
+
+error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
+  --> $DIR/duplicate-bound-err.rs:89:43
+   |
+LL | type MustFail3 = dyn Iterator<Item = i32, Item = i32>;
+   |                               ----------  ^^^^^^^^^^ re-bound here
+   |                               |
+   |                               `Item` bound here first
+
+error[E0719]: the value of the associated type `ASSOC` in trait `Trait2` is already specified
+  --> $DIR/duplicate-bound-err.rs:92:43
+   |
+LL | type MustFail4 = dyn Trait2<ASSOC = 3u32, ASSOC = 3u32>;
+   |                             ------------  ^^^^^^^^^^^^ re-bound here
+   |                             |
+   |                             `ASSOC` bound here first
+
+error[E0271]: expected `impl Iterator<Item = u32>` to be an iterator that yields `i32`, but it yields `u32`
+  --> $DIR/duplicate-bound-err.rs:100:17
+   |
+LL |     fn foo() -> impl Iterator<Item = i32, Item = u32> {
+   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
+   |
+note: required by a bound in `Trait3::foo::{anon_assoc#0}`
+  --> $DIR/duplicate-bound-err.rs:96:31
+   |
+LL |     fn foo() -> impl Iterator<Item = i32, Item = u32>;
+   |                               ^^^^^^^^^^ required by this bound in `Trait3::foo::{anon_assoc#0}`
+
+error[E0271]: expected `Empty<u32>` to be an iterator that yields `i32`, but it yields `u32`
+  --> $DIR/duplicate-bound-err.rs:108:16
+   |
+LL |     uncallable(iter::empty::<u32>());
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
+   |     |
+   |     required by a bound introduced by this call
+   |
+note: required by a bound in `uncallable`
+  --> $DIR/duplicate-bound-err.rs:71:32
+   |
+LL | fn uncallable(_: impl Iterator<Item = i32, Item = u32>) {}
+   |                                ^^^^^^^^^^ required by this bound in `uncallable`
+
+error[E0271]: expected `Empty<i32>` to be an iterator that yields `u32`, but it yields `i32`
+  --> $DIR/duplicate-bound-err.rs:109:16
+   |
+LL |     uncallable(iter::empty::<i32>());
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
+   |     |
+   |     required by a bound introduced by this call
+   |
+note: required by a bound in `uncallable`
+  --> $DIR/duplicate-bound-err.rs:71:44
+   |
+LL | fn uncallable(_: impl Iterator<Item = i32, Item = u32>) {}
+   |                                            ^^^^^^^^^^ required by this bound in `uncallable`
+
+error[E0271]: type mismatch resolving `<() as Trait>::ASSOC == 4`
+  --> $DIR/duplicate-bound-err.rs:110:22
+   |
+LL |     uncallable_const(());
+   |     ---------------- ^^ expected `4`, found `3`
+   |     |
+   |     required by a bound introduced by this call
+   |
+   = note: expected constant `4`
+              found constant `3`
+note: required by a bound in `uncallable_const`
+  --> $DIR/duplicate-bound-err.rs:73:46
+   |
+LL | fn uncallable_const(_: impl Trait<ASSOC = 3, ASSOC = 4>) {}
+   |                                              ^^^^^^^^^ required by this bound in `uncallable_const`
+
+error[E0271]: type mismatch resolving `<u32 as Trait>::ASSOC == 3`
+  --> $DIR/duplicate-bound-err.rs:111:22
+   |
+LL |     uncallable_const(4u32);
+   |     ---------------- ^^^^ expected `3`, found `4`
+   |     |
+   |     required by a bound introduced by this call
+   |
+   = note: expected constant `3`
+              found constant `4`
+note: required by a bound in `uncallable_const`
+  --> $DIR/duplicate-bound-err.rs:73:35
+   |
+LL | fn uncallable_const(_: impl Trait<ASSOC = 3, ASSOC = 4>) {}
+   |                                   ^^^^^^^^^ required by this bound in `uncallable_const`
+
+error[E0271]: type mismatch resolving `<() as Trait>::ASSOC == 4`
+  --> $DIR/duplicate-bound-err.rs:112:20
+   |
+LL |     uncallable_rtn(());
+   |     -------------- ^^ expected `4`, found `3`
+   |     |
+   |     required by a bound introduced by this call
+   |
+   = note: expected constant `4`
+              found constant `3`
+note: required by a bound in `uncallable_rtn`
+  --> $DIR/duplicate-bound-err.rs:75:75
+   |
+LL | fn uncallable_rtn(_: impl Trait<foo(..): Trait<ASSOC = 3>, foo(..): Trait<ASSOC = 4>>) {}
+   |                                                                           ^^^^^^^^^ required by this bound in `uncallable_rtn`
+
+error[E0271]: type mismatch resolving `<u32 as Trait>::ASSOC == 3`
+  --> $DIR/duplicate-bound-err.rs:113:20
+   |
+LL |     uncallable_rtn(17u32);
+   |     -------------- ^^^^^ expected `3`, found `4`
+   |     |
+   |     required by a bound introduced by this call
+   |
+   = note: expected constant `3`
+              found constant `4`
+note: required by a bound in `uncallable_rtn`
+  --> $DIR/duplicate-bound-err.rs:75:48
+   |
+LL | fn uncallable_rtn(_: impl Trait<foo(..): Trait<ASSOC = 3>, foo(..): Trait<ASSOC = 4>>) {}
+   |                                                ^^^^^^^^^ required by this bound in `uncallable_rtn`
+
+error: aborting due to 25 previous errors
+
+Some errors have detailed explanations: E0271, E0277, E0282, E0719.
+For more information about an error, try `rustc --explain E0271`.
diff --git a/tests/ui/associated-type-bounds/duplicate-bound.rs b/tests/ui/associated-type-bounds/duplicate-bound.rs
new file mode 100644
index 00000000000..696710d76f6
--- /dev/null
+++ b/tests/ui/associated-type-bounds/duplicate-bound.rs
@@ -0,0 +1,240 @@
+//@ edition: 2024
+//@ run-pass
+
+#![feature(associated_const_equality, return_type_notation)]
+#![allow(dead_code, refining_impl_trait_internal, type_alias_bounds)]
+
+use std::iter;
+use std::mem::ManuallyDrop;
+
+struct Si1<T: Iterator<Item: Copy, Item: Send>> {
+    f: T,
+}
+struct Si2<T: Iterator<Item: Copy, Item: Copy>> {
+    f: T,
+}
+struct Si3<T: Iterator<Item: 'static, Item: 'static>> {
+    f: T,
+}
+struct Sw1<T>
+where
+    T: Iterator<Item: Copy, Item: Send>,
+{
+    f: T,
+}
+struct Sw2<T>
+where
+    T: Iterator<Item: Copy, Item: Copy>,
+{
+    f: T,
+}
+struct Sw3<T>
+where
+    T: Iterator<Item: 'static, Item: 'static>,
+{
+    f: T,
+}
+
+enum Ei1<T: Iterator<Item: Copy, Item: Send>> {
+    V(T),
+}
+enum Ei2<T: Iterator<Item: Copy, Item: Copy>> {
+    V(T),
+}
+enum Ei3<T: Iterator<Item: 'static, Item: 'static>> {
+    V(T),
+}
+enum Ew1<T>
+where
+    T: Iterator<Item: Copy, Item: Send>,
+{
+    V(T),
+}
+enum Ew2<T>
+where
+    T: Iterator<Item: Copy, Item: Copy>,
+{
+    V(T),
+}
+enum Ew3<T>
+where
+    T: Iterator<Item: 'static, Item: 'static>,
+{
+    V(T),
+}
+
+union Ui1<T: Iterator<Item: Copy, Item: Send>> {
+    f: ManuallyDrop<T>,
+}
+union Ui2<T: Iterator<Item: Copy, Item: Copy>> {
+    f: ManuallyDrop<T>,
+}
+union Ui3<T: Iterator<Item: 'static, Item: 'static>> {
+    f: ManuallyDrop<T>,
+}
+union Uw1<T>
+where
+    T: Iterator<Item: Copy, Item: Send>,
+{
+    f: ManuallyDrop<T>,
+}
+union Uw2<T>
+where
+    T: Iterator<Item: Copy, Item: Copy>,
+{
+    f: ManuallyDrop<T>,
+}
+union Uw3<T>
+where
+    T: Iterator<Item: 'static, Item: 'static>,
+{
+    f: ManuallyDrop<T>,
+}
+
+fn fi1<T: Iterator<Item: Copy, Item: Send>>() {}
+fn fi2<T: Iterator<Item: Copy, Item: Copy>>() {}
+fn fi3<T: Iterator<Item: 'static, Item: 'static>>() {}
+fn fw1<T>()
+where
+    T: Iterator<Item: Copy, Item: Send>,
+{
+}
+fn fw2<T>()
+where
+    T: Iterator<Item: Copy, Item: Copy>,
+{
+}
+fn fw3<T>()
+where
+    T: Iterator<Item: 'static, Item: 'static>,
+{
+}
+
+fn rpit1() -> impl Iterator<Item: Copy, Item: Send> {
+    iter::empty::<u32>()
+}
+fn rpit2() -> impl Iterator<Item: Copy, Item: Copy> {
+    iter::empty::<u32>()
+}
+fn rpit3() -> impl Iterator<Item: 'static, Item: 'static> {
+    iter::empty::<u32>()
+}
+fn apit1(_: impl Iterator<Item: Copy, Item: Send>) {}
+fn apit2(_: impl Iterator<Item: Copy, Item: Copy>) {}
+fn apit3(_: impl Iterator<Item: 'static, Item: 'static>) {}
+
+type Tait1<T: Iterator<Item: Copy, Item: Send>> = T;
+type Tait2<T: Iterator<Item: Copy, Item: Copy>> = T;
+type Tait3<T: Iterator<Item: 'static, Item: 'static>> = T;
+type Taw1<T>
+where
+    T: Iterator<Item: Copy, Item: Send>,
+= T;
+type Taw2<T>
+where
+    T: Iterator<Item: Copy, Item: Copy>,
+= T;
+type Taw3<T>
+where
+    T: Iterator<Item: 'static, Item: 'static>,
+= T;
+
+trait Tri1<T: Iterator<Item: Copy, Item: Send>> {}
+trait Tri2<T: Iterator<Item: Copy, Item: Copy>> {}
+trait Tri3<T: Iterator<Item: 'static, Item: 'static>> {}
+trait Trs1: Iterator<Item: Copy, Item: Send> {}
+trait Trs2: Iterator<Item: Copy, Item: Copy> {}
+trait Trs3: Iterator<Item: 'static, Item: 'static> {}
+trait Trw1<T>
+where
+    T: Iterator<Item: Copy, Item: Send>,
+{
+}
+trait Trw2<T>
+where
+    T: Iterator<Item: Copy, Item: Copy>,
+{
+}
+trait Trw3<T>
+where
+    T: Iterator<Item: 'static, Item: 'static>,
+{
+}
+trait Trsw1
+where
+    Self: Iterator<Item: Copy, Item: Send>,
+{
+}
+trait Trsw2
+where
+    Self: Iterator<Item: Copy, Item: Copy>,
+{
+}
+trait Trsw3
+where
+    Self: Iterator<Item: 'static, Item: 'static>,
+{
+}
+trait Tra1 {
+    type A: Iterator<Item: Copy, Item: Send>;
+}
+trait Tra2 {
+    type A: Iterator<Item: Copy, Item: Copy>;
+}
+trait Tra3 {
+    type A: Iterator<Item: 'static, Item: 'static>;
+}
+
+trait Trait {
+    type Gat<T>;
+
+    const ASSOC: i32;
+
+    fn foo() -> impl Sized;
+}
+
+impl Trait for () {
+    type Gat<T> = ();
+
+    const ASSOC: i32 = 3;
+
+    fn foo() {}
+}
+
+trait Subtrait: Trait<Gat<u32> = u32, Gat<u64> = u64> {}
+
+fn f<T: Trait<Gat<i32> = (), Gat<i64> = ()>>() {
+    let _: T::Gat<i32> = ();
+    let _: T::Gat<i64> = ();
+}
+
+fn g<T: Trait<Gat<i32> = (), Gat<i64> = &'static str>>() {
+    let _: T::Gat<i32> = ();
+    let _: T::Gat<i64> = "";
+}
+
+fn uncallable(_: impl Iterator<Item = i32, Item = u32>) {}
+
+fn callable(_: impl Iterator<Item = i32, Item = i32>) {}
+
+fn uncallable_const(_: impl Trait<ASSOC = 3, ASSOC = 4>) {}
+
+fn callable_const(_: impl Trait<ASSOC = 3, ASSOC = 3>) {}
+
+fn uncallable_rtn(_: impl Trait<foo(..): Trait<ASSOC = 3>, foo(..): Trait<ASSOC = 4>>) {}
+
+fn callable_rtn(_: impl Trait<foo(..): Send, foo(..): Send, foo(..): Eq>) {}
+
+trait Trait2 {
+    const ASSOC: u32;
+}
+
+trait Trait3 {
+    fn foo() -> impl Iterator<Item = i32, Item = u32>;
+}
+
+fn main() {
+    callable(iter::empty::<i32>());
+    callable_const(());
+    callable_rtn(());
+}
diff --git a/tests/ui/associated-type-bounds/duplicate.rs b/tests/ui/associated-type-bounds/duplicate.rs
deleted file mode 100644
index e9d94787e98..00000000000
--- a/tests/ui/associated-type-bounds/duplicate.rs
+++ /dev/null
@@ -1,278 +0,0 @@
-#![feature(type_alias_impl_trait)]
-
-use std::iter;
-use std::mem::ManuallyDrop;
-
-struct SI1<T: Iterator<Item: Copy, Item: Send>> {
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    f: T,
-}
-struct SI2<T: Iterator<Item: Copy, Item: Copy>> {
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    f: T,
-}
-struct SI3<T: Iterator<Item: 'static, Item: 'static>> {
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    f: T,
-}
-struct SW1<T>
-where
-    T: Iterator<Item: Copy, Item: Send>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-    f: T,
-}
-struct SW2<T>
-where
-    T: Iterator<Item: Copy, Item: Copy>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-    f: T,
-}
-struct SW3<T>
-where
-    T: Iterator<Item: 'static, Item: 'static>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-    f: T,
-}
-
-enum EI1<T: Iterator<Item: Copy, Item: Send>> {
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    V(T),
-}
-enum EI2<T: Iterator<Item: Copy, Item: Copy>> {
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    V(T),
-}
-enum EI3<T: Iterator<Item: 'static, Item: 'static>> {
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    V(T),
-}
-enum EW1<T>
-where
-    T: Iterator<Item: Copy, Item: Send>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-    V(T),
-}
-enum EW2<T>
-where
-    T: Iterator<Item: Copy, Item: Copy>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-    V(T),
-}
-enum EW3<T>
-where
-    T: Iterator<Item: 'static, Item: 'static>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-    V(T),
-}
-
-union UI1<T: Iterator<Item: Copy, Item: Send>> {
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    f: ManuallyDrop<T>,
-}
-union UI2<T: Iterator<Item: Copy, Item: Copy>> {
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    f: ManuallyDrop<T>,
-}
-union UI3<T: Iterator<Item: 'static, Item: 'static>> {
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    f: ManuallyDrop<T>,
-}
-union UW1<T>
-where
-    T: Iterator<Item: Copy, Item: Send>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-    f: ManuallyDrop<T>,
-}
-union UW2<T>
-where
-    T: Iterator<Item: Copy, Item: Copy>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-    f: ManuallyDrop<T>,
-}
-union UW3<T>
-where
-    T: Iterator<Item: 'static, Item: 'static>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-    f: ManuallyDrop<T>,
-}
-
-fn FI1<T: Iterator<Item: Copy, Item: Send>>() {}
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-fn FI2<T: Iterator<Item: Copy, Item: Copy>>() {}
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-fn FI3<T: Iterator<Item: 'static, Item: 'static>>() {}
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-fn FW1<T>()
-where
-    T: Iterator<Item: Copy, Item: Send>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-}
-fn FW2<T>()
-where
-    T: Iterator<Item: Copy, Item: Copy>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-}
-fn FW3<T>()
-where
-    T: Iterator<Item: 'static, Item: 'static>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-}
-
-fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> {
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    iter::empty()
-    //~^ ERROR type annotations needed
-}
-fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> {
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    iter::empty()
-    //~^ ERROR type annotations needed
-}
-fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> {
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    iter::empty()
-    //~^ ERROR type annotations needed
-}
-fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {}
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {}
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {}
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-
-type TAI1<T: Iterator<Item: Copy, Item: Send>> = T;
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T;
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T;
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-type TAW1<T>
-where
-    T: Iterator<Item: Copy, Item: Send>,
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-= T;
-type TAW2<T>
-where
-    T: Iterator<Item: Copy, Item: Copy>,
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-= T;
-type TAW3<T>
-where
-    T: Iterator<Item: 'static, Item: 'static>,
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-= T;
-
-type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR unconstrained opaque type
-type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR unconstrained opaque type
-type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR unconstrained opaque type
-type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR unconstrained opaque type
-type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR unconstrained opaque type
-type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR unconstrained opaque type
-
-trait TRI1<T: Iterator<Item: Copy, Item: Send>> {}
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {}
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {}
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-trait TRS1: Iterator<Item: Copy, Item: Send> {}
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-trait TRS2: Iterator<Item: Copy, Item: Copy> {}
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-trait TRS3: Iterator<Item: 'static, Item: 'static> {}
-//~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-//~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-trait TRW1<T>
-where
-    T: Iterator<Item: Copy, Item: Send>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-}
-trait TRW2<T>
-where
-    T: Iterator<Item: Copy, Item: Copy>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-}
-trait TRW3<T>
-where
-    T: Iterator<Item: 'static, Item: 'static>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-}
-trait TRSW1
-where
-    Self: Iterator<Item: Copy, Item: Send>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-}
-trait TRSW2
-where
-    Self: Iterator<Item: Copy, Item: Copy>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-}
-trait TRSW3
-where
-    Self: Iterator<Item: 'static, Item: 'static>,
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-{
-}
-trait TRA1 {
-    type A: Iterator<Item: Copy, Item: Send>;
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-}
-trait TRA2 {
-    type A: Iterator<Item: Copy, Item: Copy>;
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-}
-trait TRA3 {
-    type A: Iterator<Item: 'static, Item: 'static>;
-    //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-    //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719]
-}
-
-fn main() {}
diff --git a/tests/ui/associated-type-bounds/duplicate.stderr b/tests/ui/associated-type-bounds/duplicate.stderr
deleted file mode 100644
index 68fbb345f6f..00000000000
--- a/tests/ui/associated-type-bounds/duplicate.stderr
+++ /dev/null
@@ -1,751 +0,0 @@
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:6:36
-   |
-LL | struct SI1<T: Iterator<Item: Copy, Item: Send>> {
-   |                        ----------  ^^^^^^^^^^ re-bound here
-   |                        |
-   |                        `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:10:36
-   |
-LL | struct SI2<T: Iterator<Item: Copy, Item: Copy>> {
-   |                        ----------  ^^^^^^^^^^ re-bound here
-   |                        |
-   |                        `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:14:39
-   |
-LL | struct SI3<T: Iterator<Item: 'static, Item: 'static>> {
-   |                        -------------  ^^^^^^^^^^^^^ re-bound here
-   |                        |
-   |                        `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:20:29
-   |
-LL |     T: Iterator<Item: Copy, Item: Send>,
-   |                 ----------  ^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:27:29
-   |
-LL |     T: Iterator<Item: Copy, Item: Copy>,
-   |                 ----------  ^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:34:32
-   |
-LL |     T: Iterator<Item: 'static, Item: 'static>,
-   |                 -------------  ^^^^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:40:34
-   |
-LL | enum EI1<T: Iterator<Item: Copy, Item: Send>> {
-   |                      ----------  ^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:44:34
-   |
-LL | enum EI2<T: Iterator<Item: Copy, Item: Copy>> {
-   |                      ----------  ^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:48:37
-   |
-LL | enum EI3<T: Iterator<Item: 'static, Item: 'static>> {
-   |                      -------------  ^^^^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:54:29
-   |
-LL |     T: Iterator<Item: Copy, Item: Send>,
-   |                 ----------  ^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:61:29
-   |
-LL |     T: Iterator<Item: Copy, Item: Copy>,
-   |                 ----------  ^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:68:32
-   |
-LL |     T: Iterator<Item: 'static, Item: 'static>,
-   |                 -------------  ^^^^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:74:35
-   |
-LL | union UI1<T: Iterator<Item: Copy, Item: Send>> {
-   |                       ----------  ^^^^^^^^^^ re-bound here
-   |                       |
-   |                       `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:78:35
-   |
-LL | union UI2<T: Iterator<Item: Copy, Item: Copy>> {
-   |                       ----------  ^^^^^^^^^^ re-bound here
-   |                       |
-   |                       `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:82:38
-   |
-LL | union UI3<T: Iterator<Item: 'static, Item: 'static>> {
-   |                       -------------  ^^^^^^^^^^^^^ re-bound here
-   |                       |
-   |                       `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:88:29
-   |
-LL |     T: Iterator<Item: Copy, Item: Send>,
-   |                 ----------  ^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:95:29
-   |
-LL |     T: Iterator<Item: Copy, Item: Copy>,
-   |                 ----------  ^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:102:32
-   |
-LL |     T: Iterator<Item: 'static, Item: 'static>,
-   |                 -------------  ^^^^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:108:32
-   |
-LL | fn FI1<T: Iterator<Item: Copy, Item: Send>>() {}
-   |                    ----------  ^^^^^^^^^^ re-bound here
-   |                    |
-   |                    `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:110:32
-   |
-LL | fn FI2<T: Iterator<Item: Copy, Item: Copy>>() {}
-   |                    ----------  ^^^^^^^^^^ re-bound here
-   |                    |
-   |                    `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:112:35
-   |
-LL | fn FI3<T: Iterator<Item: 'static, Item: 'static>>() {}
-   |                    -------------  ^^^^^^^^^^^^^ re-bound here
-   |                    |
-   |                    `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:116:29
-   |
-LL |     T: Iterator<Item: Copy, Item: Send>,
-   |                 ----------  ^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:122:29
-   |
-LL |     T: Iterator<Item: Copy, Item: Copy>,
-   |                 ----------  ^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:128:32
-   |
-LL |     T: Iterator<Item: 'static, Item: 'static>,
-   |                 -------------  ^^^^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:133:42
-   |
-LL | fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> {
-   |                              ----------  ^^^^^^^^^^ re-bound here
-   |                              |
-   |                              `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:139:42
-   |
-LL | fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> {
-   |                              ----------  ^^^^^^^^^^ re-bound here
-   |                              |
-   |                              `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:145:45
-   |
-LL | fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> {
-   |                              -------------  ^^^^^^^^^^^^^ re-bound here
-   |                              |
-   |                              `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:151:40
-   |
-LL | fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {}
-   |                            ----------  ^^^^^^^^^^ re-bound here
-   |                            |
-   |                            `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:153:40
-   |
-LL | fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {}
-   |                            ----------  ^^^^^^^^^^ re-bound here
-   |                            |
-   |                            `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:155:43
-   |
-LL | fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {}
-   |                            -------------  ^^^^^^^^^^^^^ re-bound here
-   |                            |
-   |                            `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:158:35
-   |
-LL | type TAI1<T: Iterator<Item: Copy, Item: Send>> = T;
-   |                       ----------  ^^^^^^^^^^ re-bound here
-   |                       |
-   |                       `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:160:35
-   |
-LL | type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T;
-   |                       ----------  ^^^^^^^^^^ re-bound here
-   |                       |
-   |                       `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:162:38
-   |
-LL | type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T;
-   |                       -------------  ^^^^^^^^^^^^^ re-bound here
-   |                       |
-   |                       `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:166:29
-   |
-LL |     T: Iterator<Item: Copy, Item: Send>,
-   |                 ----------  ^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:171:29
-   |
-LL |     T: Iterator<Item: Copy, Item: Copy>,
-   |                 ----------  ^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:176:32
-   |
-LL |     T: Iterator<Item: 'static, Item: 'static>,
-   |                 -------------  ^^^^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:180:36
-   |
-LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
-   |                        ----------  ^^^^^^^^^^ re-bound here
-   |                        |
-   |                        `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:183:36
-   |
-LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
-   |                        ----------  ^^^^^^^^^^ re-bound here
-   |                        |
-   |                        `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:186:39
-   |
-LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
-   |                        -------------  ^^^^^^^^^^^^^ re-bound here
-   |                        |
-   |                        `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:202:36
-   |
-LL | trait TRI1<T: Iterator<Item: Copy, Item: Send>> {}
-   |                        ----------  ^^^^^^^^^^ re-bound here
-   |                        |
-   |                        `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:204:36
-   |
-LL | trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {}
-   |                        ----------  ^^^^^^^^^^ re-bound here
-   |                        |
-   |                        `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:206:39
-   |
-LL | trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {}
-   |                        -------------  ^^^^^^^^^^^^^ re-bound here
-   |                        |
-   |                        `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:208:34
-   |
-LL | trait TRS1: Iterator<Item: Copy, Item: Send> {}
-   |                      ----------  ^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:208:34
-   |
-LL | trait TRS1: Iterator<Item: Copy, Item: Send> {}
-   |                      ----------  ^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:208:34
-   |
-LL | trait TRS1: Iterator<Item: Copy, Item: Send> {}
-   |                      ----------  ^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:212:34
-   |
-LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {}
-   |                      ----------  ^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:212:34
-   |
-LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {}
-   |                      ----------  ^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:212:34
-   |
-LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {}
-   |                      ----------  ^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:216:37
-   |
-LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {}
-   |                      -------------  ^^^^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:216:37
-   |
-LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {}
-   |                      -------------  ^^^^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:216:37
-   |
-LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {}
-   |                      -------------  ^^^^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:222:29
-   |
-LL |     T: Iterator<Item: Copy, Item: Send>,
-   |                 ----------  ^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:228:29
-   |
-LL |     T: Iterator<Item: Copy, Item: Copy>,
-   |                 ----------  ^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:234:32
-   |
-LL |     T: Iterator<Item: 'static, Item: 'static>,
-   |                 -------------  ^^^^^^^^^^^^^ re-bound here
-   |                 |
-   |                 `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:240:32
-   |
-LL |     Self: Iterator<Item: Copy, Item: Send>,
-   |                    ----------  ^^^^^^^^^^ re-bound here
-   |                    |
-   |                    `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:240:32
-   |
-LL |     Self: Iterator<Item: Copy, Item: Send>,
-   |                    ----------  ^^^^^^^^^^ re-bound here
-   |                    |
-   |                    `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:240:32
-   |
-LL |     Self: Iterator<Item: Copy, Item: Send>,
-   |                    ----------  ^^^^^^^^^^ re-bound here
-   |                    |
-   |                    `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:248:32
-   |
-LL |     Self: Iterator<Item: Copy, Item: Copy>,
-   |                    ----------  ^^^^^^^^^^ re-bound here
-   |                    |
-   |                    `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:248:32
-   |
-LL |     Self: Iterator<Item: Copy, Item: Copy>,
-   |                    ----------  ^^^^^^^^^^ re-bound here
-   |                    |
-   |                    `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:248:32
-   |
-LL |     Self: Iterator<Item: Copy, Item: Copy>,
-   |                    ----------  ^^^^^^^^^^ re-bound here
-   |                    |
-   |                    `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:256:35
-   |
-LL |     Self: Iterator<Item: 'static, Item: 'static>,
-   |                    -------------  ^^^^^^^^^^^^^ re-bound here
-   |                    |
-   |                    `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:256:35
-   |
-LL |     Self: Iterator<Item: 'static, Item: 'static>,
-   |                    -------------  ^^^^^^^^^^^^^ re-bound here
-   |                    |
-   |                    `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:256:35
-   |
-LL |     Self: Iterator<Item: 'static, Item: 'static>,
-   |                    -------------  ^^^^^^^^^^^^^ re-bound here
-   |                    |
-   |                    `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:263:34
-   |
-LL |     type A: Iterator<Item: Copy, Item: Send>;
-   |                      ----------  ^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:263:34
-   |
-LL |     type A: Iterator<Item: Copy, Item: Send>;
-   |                      ----------  ^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:268:34
-   |
-LL |     type A: Iterator<Item: Copy, Item: Copy>;
-   |                      ----------  ^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:268:34
-   |
-LL |     type A: Iterator<Item: Copy, Item: Copy>;
-   |                      ----------  ^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:273:37
-   |
-LL |     type A: Iterator<Item: 'static, Item: 'static>;
-   |                      -------------  ^^^^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:273:37
-   |
-LL |     type A: Iterator<Item: 'static, Item: 'static>;
-   |                      -------------  ^^^^^^^^^^^^^ re-bound here
-   |                      |
-   |                      `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:133:42
-   |
-LL | fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> {
-   |                              ----------  ^^^^^^^^^^ re-bound here
-   |                              |
-   |                              `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0282]: type annotations needed
-  --> $DIR/duplicate.rs:136:5
-   |
-LL |     iter::empty()
-   |     ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
-   |
-help: consider specifying the generic argument
-   |
-LL |     iter::empty::<T>()
-   |                +++++
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:139:42
-   |
-LL | fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> {
-   |                              ----------  ^^^^^^^^^^ re-bound here
-   |                              |
-   |                              `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0282]: type annotations needed
-  --> $DIR/duplicate.rs:142:5
-   |
-LL |     iter::empty()
-   |     ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
-   |
-help: consider specifying the generic argument
-   |
-LL |     iter::empty::<T>()
-   |                +++++
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:145:45
-   |
-LL | fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> {
-   |                              -------------  ^^^^^^^^^^^^^ re-bound here
-   |                              |
-   |                              `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0282]: type annotations needed
-  --> $DIR/duplicate.rs:148:5
-   |
-LL |     iter::empty()
-   |     ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
-   |
-help: consider specifying the generic argument
-   |
-LL |     iter::empty::<T>()
-   |                +++++
-
-error: unconstrained opaque type
-  --> $DIR/duplicate.rs:180:51
-   |
-LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
-   |                                                   ^^^^^^^^^
-   |
-   = note: `ETAI1` must be used in combination with a concrete type within the same crate
-
-error: unconstrained opaque type
-  --> $DIR/duplicate.rs:183:51
-   |
-LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
-   |                                                   ^^^^^^^^^
-   |
-   = note: `ETAI2` must be used in combination with a concrete type within the same crate
-
-error: unconstrained opaque type
-  --> $DIR/duplicate.rs:186:57
-   |
-LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
-   |                                                         ^^^^^^^^^
-   |
-   = note: `ETAI3` must be used in combination with a concrete type within the same crate
-
-error: unconstrained opaque type
-  --> $DIR/duplicate.rs:189:14
-   |
-LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: `ETAI4` must be used in combination with a concrete type within the same crate
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:189:40
-   |
-LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
-   |                            ----------  ^^^^^^^^^^ re-bound here
-   |                            |
-   |                            `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:189:40
-   |
-LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
-   |                            ----------  ^^^^^^^^^^ re-bound here
-   |                            |
-   |                            `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: unconstrained opaque type
-  --> $DIR/duplicate.rs:193:14
-   |
-LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: `ETAI5` must be used in combination with a concrete type within the same crate
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:193:40
-   |
-LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
-   |                            ----------  ^^^^^^^^^^ re-bound here
-   |                            |
-   |                            `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:193:40
-   |
-LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
-   |                            ----------  ^^^^^^^^^^ re-bound here
-   |                            |
-   |                            `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: unconstrained opaque type
-  --> $DIR/duplicate.rs:197:14
-   |
-LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: `ETAI6` must be used in combination with a concrete type within the same crate
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:197:43
-   |
-LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
-   |                            -------------  ^^^^^^^^^^^^^ re-bound here
-   |                            |
-   |                            `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/duplicate.rs:197:43
-   |
-LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
-   |                            -------------  ^^^^^^^^^^^^^ re-bound here
-   |                            |
-   |                            `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: aborting due to 87 previous errors
-
-Some errors have detailed explanations: E0282, E0719.
-For more information about an error, try `rustc --explain E0282`.
diff --git a/tests/ui/associated-types/associated-types-for-unimpl-trait.fixed b/tests/ui/associated-types/associated-types-for-unimpl-trait.fixed
index bce6148f9e1..ae4d0107aee 100644
--- a/tests/ui/associated-types/associated-types-for-unimpl-trait.fixed
+++ b/tests/ui/associated-types/associated-types-for-unimpl-trait.fixed
@@ -8,7 +8,7 @@ trait Get {
 }
 
 trait Other {
-    fn uhoh<U: Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Sized, Self: Get, Self: Get {}
+    fn uhoh<U: Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Sized, Self: Get {}
     //~^ ERROR the trait bound `Self: Get` is not satisfied
     //~| ERROR the trait bound `Self: Get` is not satisfied
 }
diff --git a/tests/ui/associated-types/associated-types-overridden-binding-2.stderr b/tests/ui/associated-types/associated-types-overridden-binding-2.stderr
index 71a4a2610aa..e96a2446b6c 100644
--- a/tests/ui/associated-types/associated-types-overridden-binding-2.stderr
+++ b/tests/ui/associated-types/associated-types-overridden-binding-2.stderr
@@ -1,4 +1,4 @@
-error: conflicting associated type bounds for `Item` when expanding trait alias
+error: conflicting associated type bounds for `Item`
   --> $DIR/associated-types-overridden-binding-2.rs:6:13
    |
 LL | trait I32Iterator = Iterator<Item = i32>;
diff --git a/tests/ui/associated-types/associated-types-overridden-binding.stderr b/tests/ui/associated-types/associated-types-overridden-binding.stderr
index 3b20015dfca..08ab9b63ee9 100644
--- a/tests/ui/associated-types/associated-types-overridden-binding.stderr
+++ b/tests/ui/associated-types/associated-types-overridden-binding.stderr
@@ -22,7 +22,7 @@ note: required by a bound in `I32Iterator`
 LL | trait I32Iterator = Iterator<Item = i32>;
    |                              ^^^^^^^^^^ required by this bound in `I32Iterator`
 
-error: conflicting associated type bounds for `Item` when expanding trait alias
+error: conflicting associated type bounds for `Item`
   --> $DIR/associated-types-overridden-binding.rs:10:13
    |
 LL | trait I32Iterator = Iterator<Item = i32>;
diff --git a/tests/ui/issues/issue-59326.rs b/tests/ui/associated-types/duplicate-associated-type-resolution-59326.rs
index e9634ad9fd8..0439e229e14 100644
--- a/tests/ui/issues/issue-59326.rs
+++ b/tests/ui/associated-types/duplicate-associated-type-resolution-59326.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/59326
 //@ check-pass
 trait Service {
     type S;
diff --git a/tests/ui/issues/issue-57399-self-return-impl-trait.rs b/tests/ui/associated-types/impl-trait-member-type-resolution-57399.rs
index bcf1b18a9ff..3342dd0631a 100644
--- a/tests/ui/issues/issue-57399-self-return-impl-trait.rs
+++ b/tests/ui/associated-types/impl-trait-member-type-resolution-57399.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/57399
 //@ check-pass
 
 trait T {
@@ -12,7 +13,6 @@ struct S<A> {
     a: A,
 }
 
-
 impl From<u32> for S<<i32 as T>::T> {
     fn from(a: u32) -> Self {
         Self { a }
diff --git a/tests/ui/associated-types/projection-dyn-associated-type.rs b/tests/ui/associated-types/projection-dyn-associated-type.rs
new file mode 100644
index 00000000000..3b981e7987e
--- /dev/null
+++ b/tests/ui/associated-types/projection-dyn-associated-type.rs
@@ -0,0 +1,28 @@
+// Regression test for the projection bug in <https://github.com/rust-lang/rust/issues/123953>
+//
+//@ compile-flags: -Zincremental-verify-ich=yes
+//@ incremental
+
+pub trait A {}
+pub trait B: A {}
+
+pub trait Mirror {
+    type Assoc: ?Sized;
+}
+
+impl<T: ?Sized> Mirror for A {
+    //~^ ERROR the type parameter `T` is not constrained by the impl trait, self type, or predicates [E0207]
+    //~| WARN trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
+    //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+    type Assoc = T;
+}
+
+pub fn foo<'a>(
+    x: &'a <dyn A + 'static as Mirror>::Assoc
+) -> &'a <dyn B + 'static as Mirror>::Assoc {
+    //~^ ERROR the trait bound `(dyn B + 'static): Mirror` is not satisfied [E0277]
+    //~| ERROR the trait bound `(dyn B + 'static): Mirror` is not satisfied [E0277]
+    static
+} //~ ERROR expected identifier, found `}`
+
+pub fn main() {}
diff --git a/tests/ui/associated-types/projection-dyn-associated-type.stderr b/tests/ui/associated-types/projection-dyn-associated-type.stderr
new file mode 100644
index 00000000000..1ac2beb0414
--- /dev/null
+++ b/tests/ui/associated-types/projection-dyn-associated-type.stderr
@@ -0,0 +1,52 @@
+error: expected identifier, found `}`
+  --> $DIR/projection-dyn-associated-type.rs:26:1
+   |
+LL | }
+   | ^ expected identifier
+
+warning: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/projection-dyn-associated-type.rs:13:28
+   |
+LL | impl<T: ?Sized> Mirror for A {
+   |                            ^
+   |
+   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html>
+   = note: `#[warn(bare_trait_objects)]` (part of `#[warn(rust_2021_compatibility)]`) on by default
+help: if this is a dyn-compatible trait, use `dyn`
+   |
+LL | impl<T: ?Sized> Mirror for dyn A {
+   |                            +++
+help: alternatively use a blanket implementation to implement `Mirror` for all types that also implement `A`
+   |
+LL - impl<T: ?Sized> Mirror for A {
+LL + impl<T: ?Sized, U: A> Mirror for U {
+   |
+
+error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
+  --> $DIR/projection-dyn-associated-type.rs:13:6
+   |
+LL | impl<T: ?Sized> Mirror for A {
+   |      ^ unconstrained type parameter
+
+error[E0277]: the trait bound `(dyn B + 'static): Mirror` is not satisfied
+  --> $DIR/projection-dyn-associated-type.rs:22:6
+   |
+LL | ) -> &'a <dyn B + 'static as Mirror>::Assoc {
+   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Mirror` is not implemented for `(dyn B + 'static)`
+   |
+   = help: the trait `Mirror` is implemented for `dyn A`
+
+error[E0277]: the trait bound `(dyn B + 'static): Mirror` is not satisfied
+  --> $DIR/projection-dyn-associated-type.rs:22:6
+   |
+LL | ) -> &'a <dyn B + 'static as Mirror>::Assoc {
+   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Mirror` is not implemented for `(dyn B + 'static)`
+   |
+   = help: the trait `Mirror` is implemented for `dyn A`
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+error: aborting due to 4 previous errors; 1 warning emitted
+
+Some errors have detailed explanations: E0207, E0277.
+For more information about an error, try `rustc --explain E0207`.
diff --git a/tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.stderr b/tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.current.stderr
index 486e5f94165..f3938ff606f 100644
--- a/tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.stderr
+++ b/tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.current.stderr
@@ -1,5 +1,5 @@
-error: reached the recursion limit while instantiating `ToChain::<'_, '_>::perm_pairs::<{async closure@$DIR/post-mono-higher-ranked-hang.rs:43:45: 43:67}>`
-  --> $DIR/post-mono-higher-ranked-hang.rs:43:21
+error: reached the recursion limit while instantiating `ToChain::<'_, '_>::perm_pairs::<{async closure@$DIR/post-mono-higher-ranked-hang.rs:47:45: 47:67}>`
+  --> $DIR/post-mono-higher-ranked-hang.rs:47:21
    |
 LL | /                     self.perm_pairs(l, &mut async move |left_pair| {
 LL | |
@@ -8,7 +8,7 @@ LL | |                     })
    | |______________________^
    |
 note: `ToChain::<'env, 'db>::perm_pairs` defined here
-  --> $DIR/post-mono-higher-ranked-hang.rs:34:5
+  --> $DIR/post-mono-higher-ranked-hang.rs:38:5
    |
 LL | /     fn perm_pairs<'l>(
 LL | |         &'l self,
diff --git a/tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.next.stderr b/tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.next.stderr
new file mode 100644
index 00000000000..f3938ff606f
--- /dev/null
+++ b/tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.next.stderr
@@ -0,0 +1,21 @@
+error: reached the recursion limit while instantiating `ToChain::<'_, '_>::perm_pairs::<{async closure@$DIR/post-mono-higher-ranked-hang.rs:47:45: 47:67}>`
+  --> $DIR/post-mono-higher-ranked-hang.rs:47:21
+   |
+LL | /                     self.perm_pairs(l, &mut async move |left_pair| {
+LL | |
+LL | |                         self.perm_pairs(r, yield_chain).await
+LL | |                     })
+   | |______________________^
+   |
+note: `ToChain::<'env, 'db>::perm_pairs` defined here
+  --> $DIR/post-mono-higher-ranked-hang.rs:38:5
+   |
+LL | /     fn perm_pairs<'l>(
+LL | |         &'l self,
+LL | |         perm: &'l SymPerm<'db>,
+LL | |         yield_chain: &'l mut impl AsyncFnMut(&SymPerm<'db>),
+LL | |     ) -> Pin<Box<dyn std::future::Future<Output = ()> + 'l>> {
+   | |____________________________________________________________^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.rs b/tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.rs
index f6ebf787f81..55d7cc30ec9 100644
--- a/tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.rs
+++ b/tests/ui/async-await/async-closures/post-mono-higher-ranked-hang.rs
@@ -2,6 +2,10 @@
 //@ aux-build:block-on.rs
 //@ edition:2021
 
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
+
 // Regression test for <https://github.com/rust-lang/rust/issues/135780>.
 
 extern crate block_on;
diff --git a/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.rs b/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.rs
index 19a31d1889b..f97ec779b32 100644
--- a/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.rs
+++ b/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.rs
@@ -44,4 +44,18 @@ fn through_field_and_ref_move<'a>(x: &S<'a>) {
     outlives::<'a>(call_once(c)); //~ ERROR explicit lifetime required in the type of `x`
 }
 
+struct T;
+impl T {
+    fn outlives<'a>(&'a self, _: impl Sized + 'a) {}
+}
+fn through_method<'a>(x: &'a i32) {
+    let c = async || { println!("{}", *x); }; //~ ERROR `x` does not live long enough
+    T.outlives::<'a>(c());
+    T.outlives::<'a>(call_once(c));
+
+    let c = async move || { println!("{}", *x); };
+    T.outlives::<'a>(c()); //~ ERROR `c` does not live long enough
+    T.outlives::<'a>(call_once(c));
+}
+
 fn main() {}
diff --git a/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.stderr b/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.stderr
index b7259074bf6..4aae9807dd2 100644
--- a/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.stderr
+++ b/tests/ui/async-await/async-closures/without-precise-captures-we-are-powerless.stderr
@@ -28,6 +28,12 @@ LL |     outlives::<'a>(c());
 LL |     outlives::<'a>(call_once(c));
 LL | }
    | - `c` dropped here while still borrowed
+   |
+note: requirement that the value outlives `'a` introduced here
+  --> $DIR/without-precise-captures-we-are-powerless.rs:7:33
+   |
+LL | fn outlives<'a>(_: impl Sized + 'a) {}
+   |                                 ^^
 
 error[E0597]: `x` does not live long enough
   --> $DIR/without-precise-captures-we-are-powerless.rs:26:13
@@ -73,6 +79,12 @@ LL |     outlives::<'a>(c());
 LL |     outlives::<'a>(call_once(c));
 LL | }
    | - `c` dropped here while still borrowed
+   |
+note: requirement that the value outlives `'a` introduced here
+  --> $DIR/without-precise-captures-we-are-powerless.rs:7:33
+   |
+LL | fn outlives<'a>(_: impl Sized + 'a) {}
+   |                                 ^^
 
 error[E0505]: cannot move out of `c` because it is borrowed
   --> $DIR/without-precise-captures-we-are-powerless.rs:32:30
@@ -89,6 +101,12 @@ LL |     outlives::<'a>(c());
    |     argument requires that `c` is borrowed for `'a`
 LL |     outlives::<'a>(call_once(c));
    |                              ^ move out of `c` occurs here
+   |
+note: requirement that the value outlives `'a` introduced here
+  --> $DIR/without-precise-captures-we-are-powerless.rs:7:33
+   |
+LL | fn outlives<'a>(_: impl Sized + 'a) {}
+   |                                 ^^
 
 error[E0597]: `x` does not live long enough
   --> $DIR/without-precise-captures-we-are-powerless.rs:36:13
@@ -129,6 +147,12 @@ LL |     outlives::<'a>(c());
 LL |     outlives::<'a>(call_once(c));
 LL | }
    | - `c` dropped here while still borrowed
+   |
+note: requirement that the value outlives `'a` introduced here
+  --> $DIR/without-precise-captures-we-are-powerless.rs:7:33
+   |
+LL | fn outlives<'a>(_: impl Sized + 'a) {}
+   |                                 ^^
 
 error[E0621]: explicit lifetime required in the type of `x`
   --> $DIR/without-precise-captures-we-are-powerless.rs:44:5
@@ -141,7 +165,44 @@ help: add explicit lifetime `'a` to the type of `x`
 LL | fn through_field_and_ref_move<'a>(x: &'a S<'a>) {
    |                                       ++
 
-error: aborting due to 10 previous errors
+error[E0597]: `x` does not live long enough
+  --> $DIR/without-precise-captures-we-are-powerless.rs:52:13
+   |
+LL | fn through_method<'a>(x: &'a i32) {
+   |                   -- lifetime `'a` defined here
+LL |     let c = async || { println!("{}", *x); };
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
+LL |     T.outlives::<'a>(c());
+LL |     T.outlives::<'a>(call_once(c));
+   |     ------------------------------ argument requires that `x` is borrowed for `'a`
+...
+LL | }
+   |  - `x` dropped here while still borrowed
+
+error[E0597]: `c` does not live long enough
+  --> $DIR/without-precise-captures-we-are-powerless.rs:57:22
+   |
+LL | fn through_method<'a>(x: &'a i32) {
+   |                   -- lifetime `'a` defined here
+...
+LL |     let c = async move || { println!("{}", *x); };
+   |         - binding `c` declared here
+LL |     T.outlives::<'a>(c());
+   |     -----------------^---
+   |     |                |
+   |     |                borrowed value does not live long enough
+   |     argument requires that `c` is borrowed for `'a`
+LL |     T.outlives::<'a>(call_once(c));
+LL | }
+   | - `c` dropped here while still borrowed
+   |
+note: requirement that the value outlives `'a` introduced here
+  --> $DIR/without-precise-captures-we-are-powerless.rs:49:47
+   |
+LL |     fn outlives<'a>(&'a self, _: impl Sized + 'a) {}
+   |                                               ^^
+
+error: aborting due to 12 previous errors
 
 Some errors have detailed explanations: E0505, E0597, E0621.
 For more information about an error, try `rustc --explain E0505`.
diff --git a/tests/ui/async-await/future-sizes/async-awaiting-fut.rs b/tests/ui/async-await/future-sizes/async-awaiting-fut.rs
index b5f59069f85..7113f591630 100644
--- a/tests/ui/async-await/future-sizes/async-awaiting-fut.rs
+++ b/tests/ui/async-await/future-sizes/async-awaiting-fut.rs
@@ -1,3 +1,5 @@
+// FIXME(#61117): Respect debuginfo-level-tests, do not force debuginfo=0
+//@ compile-flags: -C debuginfo=0
 //@ compile-flags: -C panic=abort -Z print-type-sizes --crate-type lib
 //@ needs-deterministic-layouts
 //@ edition:2021
diff --git a/tests/ui/async-await/future-sizes/large-arg.rs b/tests/ui/async-await/future-sizes/large-arg.rs
index 809f7cf1f93..b05a2b71915 100644
--- a/tests/ui/async-await/future-sizes/large-arg.rs
+++ b/tests/ui/async-await/future-sizes/large-arg.rs
@@ -1,3 +1,5 @@
+// FIXME(#61117): Respect debuginfo-level-tests, do not force debuginfo=0
+//@ compile-flags: -C debuginfo=0
 //@ compile-flags: -C panic=abort -Z print-type-sizes --crate-type=lib
 //@ needs-deterministic-layouts
 //@ edition: 2021
diff --git a/tests/ui/attributes/empty-repr.stderr b/tests/ui/attributes/empty-repr.stderr
index 92901fa170c..6dfa2df75b7 100644
--- a/tests/ui/attributes/empty-repr.stderr
+++ b/tests/ui/attributes/empty-repr.stderr
@@ -4,6 +4,7 @@ error: unused attribute
 LL | #[repr()]
    | ^^^^^^^^^ help: remove this attribute
    |
+   = note: using `repr` with an empty list has no effect
 note: the lint level is defined here
   --> $DIR/empty-repr.rs:4:9
    |
diff --git a/tests/ui/attributes/fn-align-dyn.rs b/tests/ui/attributes/fn-align-dyn.rs
index 3778c75a2ca..91e2dab65a3 100644
--- a/tests/ui/attributes/fn-align-dyn.rs
+++ b/tests/ui/attributes/fn-align-dyn.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368)
+//@ ignore-backends: gcc
 
 // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
 #![feature(rustc_attrs)]
diff --git a/tests/ui/attributes/invalid_macro_export_argument.allow.stderr b/tests/ui/attributes/invalid_macro_export_argument.allow.stderr
new file mode 100644
index 00000000000..162b315b072
--- /dev/null
+++ b/tests/ui/attributes/invalid_macro_export_argument.allow.stderr
@@ -0,0 +1,40 @@
+Future incompatibility report: Future breakage diagnostic:
+warning: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
+  --> $DIR/invalid_macro_export_argument.rs:7:1
+   |
+LL | #[macro_export(hello, world)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = 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 #57571 <https://github.com/rust-lang/rust/issues/57571>
+
+Future breakage diagnostic:
+warning: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
+  --> $DIR/invalid_macro_export_argument.rs:14:1
+   |
+LL | #[macro_export(not_local_inner_macros)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = 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 #57571 <https://github.com/rust-lang/rust/issues/57571>
+
+Future breakage diagnostic:
+warning: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
+  --> $DIR/invalid_macro_export_argument.rs:31:1
+   |
+LL | #[macro_export()]
+   | ^^^^^^^^^^^^^^^^^
+   |
+   = 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 #57571 <https://github.com/rust-lang/rust/issues/57571>
+
+Future breakage diagnostic:
+warning: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
+  --> $DIR/invalid_macro_export_argument.rs:38:1
+   |
+LL | #[macro_export("blah")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = 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 #57571 <https://github.com/rust-lang/rust/issues/57571>
+
diff --git a/tests/ui/attributes/invalid_macro_export_argument.deny.stderr b/tests/ui/attributes/invalid_macro_export_argument.deny.stderr
index 9d44bd162c7..ad225ae187b 100644
--- a/tests/ui/attributes/invalid_macro_export_argument.deny.stderr
+++ b/tests/ui/attributes/invalid_macro_export_argument.deny.stderr
@@ -1,26 +1,103 @@
-error: `#[macro_export]` can only take 1 or 0 arguments
+error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
   --> $DIR/invalid_macro_export_argument.rs:7:1
    |
 LL | #[macro_export(hello, world)]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
+   = 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 #57571 <https://github.com/rust-lang/rust/issues/57571>
 note: the lint level is defined here
   --> $DIR/invalid_macro_export_argument.rs:4:24
    |
 LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: invalid `#[macro_export]` argument
-  --> $DIR/invalid_macro_export_argument.rs:13:16
+error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
+  --> $DIR/invalid_macro_export_argument.rs:14:1
    |
 LL | #[macro_export(not_local_inner_macros)]
-   |                ^^^^^^^^^^^^^^^^^^^^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = 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 #57571 <https://github.com/rust-lang/rust/issues/57571>
+
+error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
+  --> $DIR/invalid_macro_export_argument.rs:31:1
+   |
+LL | #[macro_export()]
+   | ^^^^^^^^^^^^^^^^^
+   |
+   = 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 #57571 <https://github.com/rust-lang/rust/issues/57571>
 
-error: invalid `#[macro_export]` argument
-  --> $DIR/invalid_macro_export_argument.rs:33:16
+error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
+  --> $DIR/invalid_macro_export_argument.rs:38:1
    |
 LL | #[macro_export("blah")]
-   |                ^^^^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = 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 #57571 <https://github.com/rust-lang/rust/issues/57571>
+
+error: aborting due to 4 previous errors
+
+Future incompatibility report: Future breakage diagnostic:
+error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
+  --> $DIR/invalid_macro_export_argument.rs:7:1
+   |
+LL | #[macro_export(hello, world)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = 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 #57571 <https://github.com/rust-lang/rust/issues/57571>
+note: the lint level is defined here
+  --> $DIR/invalid_macro_export_argument.rs:4:24
+   |
+LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
+   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Future breakage diagnostic:
+error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
+  --> $DIR/invalid_macro_export_argument.rs:14:1
+   |
+LL | #[macro_export(not_local_inner_macros)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = 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 #57571 <https://github.com/rust-lang/rust/issues/57571>
+note: the lint level is defined here
+  --> $DIR/invalid_macro_export_argument.rs:4:24
+   |
+LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
+   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 3 previous errors
+Future breakage diagnostic:
+error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
+  --> $DIR/invalid_macro_export_argument.rs:31:1
+   |
+LL | #[macro_export()]
+   | ^^^^^^^^^^^^^^^^^
+   |
+   = 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 #57571 <https://github.com/rust-lang/rust/issues/57571>
+note: the lint level is defined here
+  --> $DIR/invalid_macro_export_argument.rs:4:24
+   |
+LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
+   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Future breakage diagnostic:
+error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
+  --> $DIR/invalid_macro_export_argument.rs:38:1
+   |
+LL | #[macro_export("blah")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = 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 #57571 <https://github.com/rust-lang/rust/issues/57571>
+note: the lint level is defined here
+  --> $DIR/invalid_macro_export_argument.rs:4:24
+   |
+LL | #![cfg_attr(deny, deny(invalid_macro_export_arguments))]
+   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
diff --git a/tests/ui/attributes/invalid_macro_export_argument.rs b/tests/ui/attributes/invalid_macro_export_argument.rs
index c5fe39d062a..05a40913434 100644
--- a/tests/ui/attributes/invalid_macro_export_argument.rs
+++ b/tests/ui/attributes/invalid_macro_export_argument.rs
@@ -5,13 +5,15 @@
 #![cfg_attr(allow, allow(invalid_macro_export_arguments))]
 
 #[macro_export(hello, world)]
-//[deny]~^ ERROR `#[macro_export]` can only take 1 or 0 arguments
+//[deny]~^ ERROR valid forms for the attribute are
+//[deny]~| WARN this was previously accepted
 macro_rules! a {
     () => ()
 }
 
 #[macro_export(not_local_inner_macros)]
-//[deny]~^ ERROR invalid `#[macro_export]` argument
+//[deny]~^ ERROR valid forms for the attribute are
+//[deny]~| WARN this was previously accepted
 macro_rules! b {
     () => ()
 }
@@ -20,18 +22,22 @@ macro_rules! b {
 macro_rules! c {
     () => ()
 }
+
 #[macro_export(local_inner_macros)]
 macro_rules! d {
     () => ()
 }
 
 #[macro_export()]
+//[deny]~^ ERROR valid forms for the attribute are
+//[deny]~| WARN this was previously accepted
 macro_rules! e {
     () => ()
 }
 
 #[macro_export("blah")]
-//[deny]~^ ERROR invalid `#[macro_export]` argument
+//[deny]~^ ERROR valid forms for the attribute are
+//[deny]~| WARN this was previously accepted
 macro_rules! f {
     () => ()
 }
diff --git a/tests/ui/attributes/main-removed-2/main.rs b/tests/ui/attributes/main-removed-2/main.rs
index 53696d68ced..21a05dc4b40 100644
--- a/tests/ui/attributes/main-removed-2/main.rs
+++ b/tests/ui/attributes/main-removed-2/main.rs
@@ -2,6 +2,7 @@
 //@ proc-macro: tokyo.rs
 //@ compile-flags:--extern tokyo
 //@ edition:2021
+//@ ignore-backends: gcc
 
 use tokyo::main;
 
diff --git a/tests/ui/attributes/malformed-attrs.rs b/tests/ui/attributes/malformed-attrs.rs
index 932aaf7a9e2..820484aa015 100644
--- a/tests/ui/attributes/malformed-attrs.rs
+++ b/tests/ui/attributes/malformed-attrs.rs
@@ -185,8 +185,7 @@ extern "C" {
 #[forbid]
 //~^ ERROR malformed
 #[debugger_visualizer]
-//~^ ERROR invalid argument
-//~| ERROR malformed `debugger_visualizer` attribute input
+//~^ ERROR malformed `debugger_visualizer` attribute input
 #[automatically_derived = 18]
 //~^ ERROR malformed
 mod yooo {
@@ -211,7 +210,7 @@ extern crate wloop;
 //~^ ERROR can't find crate for `wloop` [E0463]
 
 #[macro_export = 18]
-//~^ ERROR malformed `macro_export` attribute input
+//~^ ERROR valid forms for the attribute are
 #[allow_internal_unsafe = 1]
 //~^ ERROR malformed
 //~| ERROR allow_internal_unsafe side-steps the unsafe_code lint
diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr
index b85864b401e..70ab3fb13c4 100644
--- a/tests/ui/attributes/malformed-attrs.stderr
+++ b/tests/ui/attributes/malformed-attrs.stderr
@@ -22,7 +22,7 @@ LL | #[cfg_attr(condition, attribute, other_attribute, ...)]
    |           ++++++++++++++++++++++++++++++++++++++++++++
 
 error[E0463]: can't find crate for `wloop`
-  --> $DIR/malformed-attrs.rs:210:1
+  --> $DIR/malformed-attrs.rs:209:1
    |
 LL | extern crate wloop;
    | ^^^^^^^^^^^^^^^^^^^ can't find crate
@@ -156,44 +156,20 @@ LL | #[forbid(lint1, lint2, ...)]
 LL | #[forbid(lint1, lint2, lint3, reason = "...")]
    |         +++++++++++++++++++++++++++++++++++++
 
-error: malformed `debugger_visualizer` attribute input
-  --> $DIR/malformed-attrs.rs:187:1
-   |
-LL | #[debugger_visualizer]
-   | ^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[debugger_visualizer(natvis_file = "...", gdb_script_file = "...")]`
-   |
-   = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/debugger.html#the-debugger_visualizer-attribute>
-
 error: malformed `thread_local` attribute input
-  --> $DIR/malformed-attrs.rs:202:1
+  --> $DIR/malformed-attrs.rs:201:1
    |
 LL | #[thread_local()]
    | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#[thread_local]`
 
 error: malformed `no_link` attribute input
-  --> $DIR/malformed-attrs.rs:206:1
+  --> $DIR/malformed-attrs.rs:205:1
    |
 LL | #[no_link()]
    | ^^^^^^^^^^^^ help: must be of the form: `#[no_link]`
    |
    = note: for more information, visit <https://doc.rust-lang.org/reference/items/extern-crates.html#the-no_link-attribute>
 
-error: malformed `macro_export` attribute input
-  --> $DIR/malformed-attrs.rs:213:1
-   |
-LL | #[macro_export = 18]
-   | ^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#path-based-scope>
-help: the following are the possible correct uses
-   |
-LL - #[macro_export = 18]
-LL + #[macro_export(local_inner_macros)]
-   |
-LL - #[macro_export = 18]
-LL + #[macro_export]
-   |
-
 error: the `#[proc_macro]` attribute is only usable with crates of the `proc-macro` crate type
   --> $DIR/malformed-attrs.rs:98:1
    |
@@ -213,7 +189,7 @@ LL | #[proc_macro_derive]
    | ^^^^^^^^^^^^^^^^^^^^
 
 error[E0658]: allow_internal_unsafe side-steps the unsafe_code lint
-  --> $DIR/malformed-attrs.rs:215:1
+  --> $DIR/malformed-attrs.rs:214:1
    |
 LL | #[allow_internal_unsafe = 1]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -242,16 +218,6 @@ LL | #[doc]
    = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
    = note: for more information, visit <https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html>
 
-error: invalid argument
-  --> $DIR/malformed-attrs.rs:187:1
-   |
-LL | #[debugger_visualizer]
-   | ^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: expected: `natvis_file = "..."`
-   = note: OR
-   = note: expected: `gdb_script_file = "..."`
-
 error[E0539]: malformed `export_name` attribute input
   --> $DIR/malformed-attrs.rs:29:1
    |
@@ -701,8 +667,19 @@ LL |     #[linkage = "external"]
    |               ++++++++++++
    = and 5 other candidates
 
+error[E0539]: malformed `debugger_visualizer` attribute input
+  --> $DIR/malformed-attrs.rs:187:1
+   |
+LL | #[debugger_visualizer]
+   | ^^^^^^^^^^^^^^^^^^^^^^
+   | |
+   | expected this to be a list
+   | help: must be of the form: `#[debugger_visualizer(natvis_file = "...", gdb_script_file = "...")]`
+   |
+   = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/debugger.html#the-debugger_visualizer-attribute>
+
 error[E0565]: malformed `automatically_derived` attribute input
-  --> $DIR/malformed-attrs.rs:190:1
+  --> $DIR/malformed-attrs.rs:189:1
    |
 LL | #[automatically_derived = 18]
    | ^^^^^^^^^^^^^^^^^^^^^^^^----^
@@ -711,7 +688,7 @@ LL | #[automatically_derived = 18]
    | help: must be of the form: `#[automatically_derived]`
 
 error[E0565]: malformed `non_exhaustive` attribute input
-  --> $DIR/malformed-attrs.rs:196:1
+  --> $DIR/malformed-attrs.rs:195:1
    |
 LL | #[non_exhaustive = 1]
    | ^^^^^^^^^^^^^^^^^---^
@@ -720,13 +697,19 @@ LL | #[non_exhaustive = 1]
    | help: must be of the form: `#[non_exhaustive]`
 
 error: valid forms for the attribute are `#[macro_use(name1, name2, ...)]` and `#[macro_use]`
-  --> $DIR/malformed-attrs.rs:208:1
+  --> $DIR/malformed-attrs.rs:207:1
    |
 LL | #[macro_use = 1]
    | ^^^^^^^^^^^^^^^^
 
+error: valid forms for the attribute are `#![macro_export(local_inner_macros)]` and `#![macro_export]`
+  --> $DIR/malformed-attrs.rs:212:1
+   |
+LL | #[macro_export = 18]
+   | ^^^^^^^^^^^^^^^^^^^^
+
 error[E0565]: malformed `allow_internal_unsafe` attribute input
-  --> $DIR/malformed-attrs.rs:215:1
+  --> $DIR/malformed-attrs.rs:214:1
    |
 LL | #[allow_internal_unsafe = 1]
    | ^^^^^^^^^^^^^^^^^^^^^^^^---^
@@ -810,7 +793,7 @@ LL | #[ignore()]
    = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
 
 error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]`
-  --> $DIR/malformed-attrs.rs:222:1
+  --> $DIR/malformed-attrs.rs:221:1
    |
 LL | #[ignore = 1]
    | ^^^^^^^^^^^^^
@@ -829,7 +812,7 @@ LL |     #[coroutine = 63] || {}
    = note: expected unit type `()`
               found coroutine `{coroutine@$DIR/malformed-attrs.rs:110:23: 110:25}`
 
-error: aborting due to 77 previous errors; 3 warnings emitted
+error: aborting due to 76 previous errors; 3 warnings emitted
 
 Some errors have detailed explanations: E0308, E0463, E0539, E0565, E0658, E0805.
 For more information about an error, try `rustc --explain E0308`.
@@ -881,7 +864,7 @@ LL | #[ignore()]
 
 Future breakage diagnostic:
 error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]`
-  --> $DIR/malformed-attrs.rs:222:1
+  --> $DIR/malformed-attrs.rs:221:1
    |
 LL | #[ignore = 1]
    | ^^^^^^^^^^^^^
diff --git a/tests/ui/attributes/unsafe/double-unsafe-attributes.rs b/tests/ui/attributes/unsafe/double-unsafe-attributes.rs
index 894d1327da7..c0181d96053 100644
--- a/tests/ui/attributes/unsafe/double-unsafe-attributes.rs
+++ b/tests/ui/attributes/unsafe/double-unsafe-attributes.rs
@@ -1,7 +1,7 @@
 #[unsafe(unsafe(no_mangle))]
 //~^ ERROR expected identifier, found keyword `unsafe`
 //~| ERROR cannot find attribute `r#unsafe` in this scope
-//~| ERROR `r#unsafe` is not an unsafe attribute
+//~| ERROR unnecessary `unsafe`
 fn a() {}
 
 fn main() {}
diff --git a/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr
index 0825cf79408..846800daa54 100644
--- a/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr
+++ b/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr
@@ -9,13 +9,11 @@ help: escape `unsafe` to use it as an identifier
 LL | #[unsafe(r#unsafe(no_mangle))]
    |          ++
 
-error: `r#unsafe` is not an unsafe attribute
+error: unnecessary `unsafe` on safe attribute
   --> $DIR/double-unsafe-attributes.rs:1:3
    |
 LL | #[unsafe(unsafe(no_mangle))]
-   |   ^^^^^^ this is not an unsafe attribute
-   |
-   = note: extraneous unsafe is not allowed in attributes
+   |   ^^^^^^
 
 error: cannot find attribute `r#unsafe` in this scope
   --> $DIR/double-unsafe-attributes.rs:1:10
diff --git a/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.rs b/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.rs
index 0f241cc439f..d9054248a29 100644
--- a/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.rs
+++ b/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.rs
@@ -1,4 +1,4 @@
-#[unsafe(diagnostic::on_unimplemented( //~ ERROR: is not an unsafe attribute
+#[unsafe(diagnostic::on_unimplemented( //~ ERROR: unnecessary `unsafe`
     message = "testing",
 ))]
 trait Foo {}
diff --git a/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr b/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr
index 3bc291db5ac..a7662f5ee6c 100644
--- a/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr
+++ b/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr
@@ -1,10 +1,8 @@
-error: `diagnostic::on_unimplemented` is not an unsafe attribute
+error: unnecessary `unsafe` on safe attribute
   --> $DIR/unsafe-safe-attribute_diagnostic.rs:1:3
    |
 LL | #[unsafe(diagnostic::on_unimplemented(
-   |   ^^^^^^ this is not an unsafe attribute
-   |
-   = note: extraneous unsafe is not allowed in attributes
+   |   ^^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/autodiff/flag_nott.rs b/tests/ui/autodiff/flag_nott.rs
new file mode 100644
index 00000000000..faa9949fe81
--- /dev/null
+++ b/tests/ui/autodiff/flag_nott.rs
@@ -0,0 +1,19 @@
+//@ compile-flags: -Zautodiff=Enable,NoTT
+//@ needs-enzyme
+//@ check-pass
+
+#![feature(autodiff)]
+
+use std::autodiff::autodiff_reverse;
+
+// Test that NoTT flag is accepted and doesn't cause compilation errors
+#[autodiff_reverse(d_square, Duplicated, Active)]
+fn square(x: &f64) -> f64 {
+    x * x
+}
+
+fn main() {
+    let x = 2.0;
+    let mut dx = 0.0;
+    let result = d_square(&x, &mut dx, 1.0);
+}
diff --git a/tests/ui/autodiff/zst.rs b/tests/ui/autodiff/zst.rs
new file mode 100644
index 00000000000..7b9b5f5f20b
--- /dev/null
+++ b/tests/ui/autodiff/zst.rs
@@ -0,0 +1,17 @@
+//@ compile-flags: -Zautodiff=Enable -C opt-level=3 -Clto=fat
+//@ no-prefer-dynamic
+//@ needs-enzyme
+//@ build-pass
+
+// Check that differentiating functions with ZST args does not break
+
+#![feature(autodiff)]
+
+#[core::autodiff::autodiff_forward(fd_inner, Const, Dual)]
+fn f(_zst: (), _x: &mut f64) {}
+
+fn fd(x: &mut f64, xd: &mut f64) {
+    fd_inner((), x, xd);
+}
+
+fn main() {}
diff --git a/tests/ui/backtrace/apple-no-dsymutil.rs b/tests/ui/backtrace/apple-no-dsymutil.rs
index e5aeced25ca..00c8349d129 100644
--- a/tests/ui/backtrace/apple-no-dsymutil.rs
+++ b/tests/ui/backtrace/apple-no-dsymutil.rs
@@ -3,6 +3,7 @@
 //@ compile-flags:-Cstrip=none
 //@ compile-flags:-g -Csplit-debuginfo=unpacked
 //@ only-apple
+//@ ignore-remote needs the compiler-produced `.o` file to be copied to the device
 
 use std::process::Command;
 use std::str;
diff --git a/tests/ui/backtrace/dylib-dep.rs b/tests/ui/backtrace/dylib-dep.rs
index 05fdb9afef8..cf420ec8d06 100644
--- a/tests/ui/backtrace/dylib-dep.rs
+++ b/tests/ui/backtrace/dylib-dep.rs
@@ -7,6 +7,10 @@
 //@ ignore-android FIXME #17520
 //@ ignore-fuchsia Backtraces not symbolized
 //@ ignore-musl musl doesn't support dynamic libraries (at least when the original test was written).
+//@ ignore-ios needs the `.dSYM` files to be moved to the device
+//@ ignore-tvos needs the `.dSYM` files to be moved to the device
+//@ ignore-watchos needs the `.dSYM` files to be moved to the device
+//@ ignore-visionos needs the `.dSYM` files to be moved to the device
 //@ needs-unwind
 //@ ignore-backends: gcc
 //@ compile-flags: -g -Copt-level=0 -Cstrip=none -Cforce-frame-pointers=yes
diff --git a/tests/ui/backtrace/line-tables-only.rs b/tests/ui/backtrace/line-tables-only.rs
index 6624c71e184..5863cc1d17d 100644
--- a/tests/ui/backtrace/line-tables-only.rs
+++ b/tests/ui/backtrace/line-tables-only.rs
@@ -11,6 +11,10 @@
 //@ ignore-android FIXME #17520
 //@ ignore-fuchsia Backtraces not symbolized
 //@ ignore-emscripten Requires custom symbolization code
+//@ ignore-ios needs the `.dSYM` files to be moved to the device
+//@ ignore-tvos needs the `.dSYM` files to be moved to the device
+//@ ignore-watchos needs the `.dSYM` files to be moved to the device
+//@ ignore-visionos needs the `.dSYM` files to be moved to the device
 //@ needs-unwind
 //@ aux-build: line-tables-only-helper.rs
 
diff --git a/tests/ui/backtrace/synchronized-panic-handler.rs b/tests/ui/backtrace/synchronized-panic-handler.rs
index 29431ae3c45..ef7cc1faec8 100644
--- a/tests/ui/backtrace/synchronized-panic-handler.rs
+++ b/tests/ui/backtrace/synchronized-panic-handler.rs
@@ -4,6 +4,7 @@
 //@ exec-env:RUST_BACKTRACE=0
 //@ needs-threads
 //@ needs-unwind
+//@ ignore-backends: gcc
 use std::thread;
 const PANIC_MESSAGE: &str = "oops oh no woe is me";
 
diff --git a/tests/ui/backtrace/synchronized-panic-handler.run.stderr b/tests/ui/backtrace/synchronized-panic-handler.run.stderr
index c604d49c193..5296a0d39ff 100644
--- a/tests/ui/backtrace/synchronized-panic-handler.run.stderr
+++ b/tests/ui/backtrace/synchronized-panic-handler.run.stderr
@@ -1,7 +1,7 @@
 
-thread '<unnamed>' ($TID) panicked at $DIR/synchronized-panic-handler.rs:11:5:
+thread '<unnamed>' ($TID) panicked at $DIR/synchronized-panic-handler.rs:12:5:
 oops oh no woe is me
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 
-thread '<unnamed>' ($TID) panicked at $DIR/synchronized-panic-handler.rs:11:5:
+thread '<unnamed>' ($TID) panicked at $DIR/synchronized-panic-handler.rs:12:5:
 oops oh no woe is me
diff --git a/tests/ui/issues/issue-59488.rs b/tests/ui/binop/function-comparison-errors-59488.rs
index 384501e3e5d..8ded781ef95 100644
--- a/tests/ui/issues/issue-59488.rs
+++ b/tests/ui/binop/function-comparison-errors-59488.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/59488
 fn foo() -> i32 {
     42
 }
diff --git a/tests/ui/issues/issue-59488.stderr b/tests/ui/binop/function-comparison-errors-59488.stderr
index b6611ad63a8..615458bc45b 100644
--- a/tests/ui/issues/issue-59488.stderr
+++ b/tests/ui/binop/function-comparison-errors-59488.stderr
@@ -1,5 +1,5 @@
 error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}`
-  --> $DIR/issue-59488.rs:14:9
+  --> $DIR/function-comparison-errors-59488.rs:15:9
    |
 LL |     foo > 12;
    |     --- ^ -- {integer}
@@ -12,7 +12,7 @@ LL |     foo() > 12;
    |        ++
 
 error[E0308]: mismatched types
-  --> $DIR/issue-59488.rs:14:11
+  --> $DIR/function-comparison-errors-59488.rs:15:11
    |
 LL |     foo > 12;
    |           ^^ expected fn item, found `i32`
@@ -21,7 +21,7 @@ LL |     foo > 12;
                  found type `i32`
 
 error[E0369]: binary operation `>` cannot be applied to type `fn(i64) -> i64 {bar}`
-  --> $DIR/issue-59488.rs:18:9
+  --> $DIR/function-comparison-errors-59488.rs:19:9
    |
 LL |     bar > 13;
    |     --- ^ -- {integer}
@@ -34,7 +34,7 @@ LL |     bar(/* i64 */) > 13;
    |        +++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/issue-59488.rs:18:11
+  --> $DIR/function-comparison-errors-59488.rs:19:11
    |
 LL |     bar > 13;
    |           ^^ expected fn item, found `i64`
@@ -43,7 +43,7 @@ LL |     bar > 13;
                  found type `i64`
 
 error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}`
-  --> $DIR/issue-59488.rs:22:9
+  --> $DIR/function-comparison-errors-59488.rs:23:9
    |
 LL |     foo > foo;
    |     --- ^ --- fn() -> i32 {foo}
@@ -56,7 +56,7 @@ LL |     foo() > foo();
    |        ++      ++
 
 error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}`
-  --> $DIR/issue-59488.rs:25:9
+  --> $DIR/function-comparison-errors-59488.rs:26:9
    |
 LL |     foo > bar;
    |     --- ^ --- fn(i64) -> i64 {bar}
@@ -64,7 +64,7 @@ LL |     foo > bar;
    |     fn() -> i32 {foo}
 
 error[E0308]: mismatched types
-  --> $DIR/issue-59488.rs:25:11
+  --> $DIR/function-comparison-errors-59488.rs:26:11
    |
 LL |     foo > bar;
    |           ^^^ expected fn item, found a different fn item
@@ -73,7 +73,7 @@ LL |     foo > bar;
               found fn item `fn(i64) -> i64 {bar}`
 
 error[E0369]: binary operation `==` cannot be applied to type `fn(usize) -> Foo {Foo::Bar}`
-  --> $DIR/issue-59488.rs:30:5
+  --> $DIR/function-comparison-errors-59488.rs:31:5
    |
 LL |     assert_eq!(Foo::Bar, i);
    |     ^^^^^^^^^^^^^^^^^^^^^^^
@@ -84,7 +84,7 @@ LL |     assert_eq!(Foo::Bar, i);
    = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug`
-  --> $DIR/issue-59488.rs:30:5
+  --> $DIR/function-comparison-errors-59488.rs:31:5
    |
 LL |     assert_eq!(Foo::Bar, i);
    |     ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Debug` is not implemented for fn item `fn(usize) -> Foo {Foo::Bar}`
@@ -92,7 +92,7 @@ LL |     assert_eq!(Foo::Bar, i);
    = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug`
-  --> $DIR/issue-59488.rs:30:5
+  --> $DIR/function-comparison-errors-59488.rs:31:5
    |
 LL |     assert_eq!(Foo::Bar, i);
    |     ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Debug` is not implemented for fn item `fn(usize) -> Foo {Foo::Bar}`
diff --git a/tests/ui/borrowck/fn-item-check-type-params.stderr b/tests/ui/borrowck/fn-item-check-type-params.stderr
index aafb7e66ef5..7a0a7752a14 100644
--- a/tests/ui/borrowck/fn-item-check-type-params.stderr
+++ b/tests/ui/borrowck/fn-item-check-type-params.stderr
@@ -27,6 +27,12 @@ LL |     want(&String::new(), extend_lt);
    |     |     |
    |     |     creates a temporary value which is freed while still in use
    |     argument requires that borrow lasts for `'static`
+   |
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/fn-item-check-type-params.rs:47:33
+   |
+LL |     fn want<I, O>(_: I, _: impl Fn(I) -> O) {}
+   |                                 ^^^^^^^^^^
 
 error[E0716]: temporary value dropped while borrowed
   --> $DIR/fn-item-check-type-params.rs:54:26
@@ -36,6 +42,12 @@ LL |     let val = extend_lt(&String::from("blah blah blah"));
    |               |          |
    |               |          creates a temporary value which is freed while still in use
    |               argument requires that borrow lasts for `'static`
+   |
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/fn-item-check-type-params.rs:22:21
+   |
+LL |     (T, Option<U>): Displayable,
+   |                     ^^^^^^^^^^^
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/borrowck/format-args-temporary-scopes.e2024.stderr b/tests/ui/borrowck/format-args-temporary-scopes.e2024.stderr
new file mode 100644
index 00000000000..506fc6e0965
--- /dev/null
+++ b/tests/ui/borrowck/format-args-temporary-scopes.e2024.stderr
@@ -0,0 +1,27 @@
+error[E0716]: temporary value dropped while borrowed
+  --> $DIR/format-args-temporary-scopes.rs:13:25
+   |
+LL |     println!("{:?}", { &temp() });
+   |                      ---^^^^^---
+   |                      |  |    |
+   |                      |  |    temporary value is freed at the end of this statement
+   |                      |  creates a temporary value which is freed while still in use
+   |                      borrow later used here
+   |
+   = note: consider using a `let` binding to create a longer lived value
+
+error[E0716]: temporary value dropped while borrowed
+  --> $DIR/format-args-temporary-scopes.rs:19:29
+   |
+LL |     println!("{:?}{:?}", { &temp() }, ());
+   |                          ---^^^^^---
+   |                          |  |    |
+   |                          |  |    temporary value is freed at the end of this statement
+   |                          |  creates a temporary value which is freed while still in use
+   |                          borrow later used here
+   |
+   = note: consider using a `let` binding to create a longer lived value
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0716`.
diff --git a/tests/ui/borrowck/format-args-temporary-scopes.rs b/tests/ui/borrowck/format-args-temporary-scopes.rs
new file mode 100644
index 00000000000..2641058accb
--- /dev/null
+++ b/tests/ui/borrowck/format-args-temporary-scopes.rs
@@ -0,0 +1,21 @@
+//! Test for #145784 as it relates to format arguments: arguments to macros such as `println!`
+//! should obey normal temporary scoping rules.
+//@ revisions: e2021 e2024
+//@ [e2021] check-pass
+//@ [e2021] edition: 2021
+//@ [e2024] edition: 2024
+
+fn temp() {}
+
+fn main() {
+    // In Rust 2024, block tail expressions are temporary scopes, so the result of `temp()` is
+    // dropped after evaluating `&temp()`.
+    println!("{:?}", { &temp() });
+    //[e2024]~^ ERROR: temporary value dropped while borrowed [E0716]
+
+    // In Rust 1.89, `format_args!` extended the lifetime of all extending expressions in its
+    // arguments when provided with two or more arguments. This caused the result of `temp()` to
+    // outlive the result of the block, making this compile.
+    println!("{:?}{:?}", { &temp() }, ());
+    //[e2024]~^ ERROR: temporary value dropped while borrowed [E0716]
+}
diff --git a/tests/ui/borrowck/implementation-not-general-enough-ice-133252.stderr b/tests/ui/borrowck/implementation-not-general-enough-ice-133252.stderr
index 5389226f7a7..7b840d54ed0 100644
--- a/tests/ui/borrowck/implementation-not-general-enough-ice-133252.stderr
+++ b/tests/ui/borrowck/implementation-not-general-enough-ice-133252.stderr
@@ -22,6 +22,12 @@ LL |         force_send(async_load(&not_static));
 ...
 LL |     }
    |     - `not_static` dropped here while still borrowed
+   |
+note: requirement that the value outlives `'1` introduced here
+  --> $DIR/implementation-not-general-enough-ice-133252.rs:16:18
+   |
+LL | fn force_send<T: Send>(_: T) {}
+   |                  ^^^^
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/borrowck/issue-17545.stderr b/tests/ui/borrowck/issue-17545.stderr
index 45e977e3947..63fd57cd233 100644
--- a/tests/ui/borrowck/issue-17545.stderr
+++ b/tests/ui/borrowck/issue-17545.stderr
@@ -10,6 +10,9 @@ LL | |     ));
    | |      -- temporary value is freed at the end of this statement
    | |______|
    |        argument requires that borrow lasts for `'a`
+   |
+note: requirement that the value outlives `'a` introduced here
+  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741-1.rs b/tests/ui/box/boxed-value-matching-57741.rs
index d0aae23b2fc..7e2f089dad8 100644
--- a/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741-1.rs
+++ b/tests/ui/box/boxed-value-matching-57741.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/57741
 #![allow(warnings)]
 
 // This tests that the `help: consider dereferencing the boxed value` suggestion isn't made
diff --git a/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741-1.stderr b/tests/ui/box/boxed-value-matching-57741.stderr
index 76f03bab6d1..33d7a6759ad 100644
--- a/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741-1.stderr
+++ b/tests/ui/box/boxed-value-matching-57741.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-57741-1.rs:14:9
+  --> $DIR/boxed-value-matching-57741.rs:15:9
    |
 LL |     let y = match x {
    |                   - this expression has type `Box<u32>`
@@ -10,7 +10,7 @@ LL |         S::A { a } | S::B { b: a } => a,
                 found enum `S`
 
 error[E0308]: mismatched types
-  --> $DIR/issue-57741-1.rs:14:22
+  --> $DIR/boxed-value-matching-57741.rs:15:22
    |
 LL |     let y = match x {
    |                   - this expression has type `Box<u32>`
diff --git a/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741.fixed b/tests/ui/box/dereferencing-boxed-enum-in-match-57741.fixed
index 1823f0d3d4c..ee796b56272 100644
--- a/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741.fixed
+++ b/tests/ui/box/dereferencing-boxed-enum-in-match-57741.fixed
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/57741
 //@ run-rustfix
 
 #![allow(warnings)]
diff --git a/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741.rs b/tests/ui/box/dereferencing-boxed-enum-in-match-57741.rs
index 47ab91177e0..3a45a8b56ff 100644
--- a/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741.rs
+++ b/tests/ui/box/dereferencing-boxed-enum-in-match-57741.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/57741
 //@ run-rustfix
 
 #![allow(warnings)]
diff --git a/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741.stderr b/tests/ui/box/dereferencing-boxed-enum-in-match-57741.stderr
index 62d83a54614..c07387b21bd 100644
--- a/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741.stderr
+++ b/tests/ui/box/dereferencing-boxed-enum-in-match-57741.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-57741.rs:20:9
+  --> $DIR/dereferencing-boxed-enum-in-match-57741.rs:21:9
    |
 LL |     let y = match x {
    |                   - this expression has type `Box<T>`
@@ -14,7 +14,7 @@ LL |     let y = match *x {
    |                   +
 
 error[E0308]: mismatched types
-  --> $DIR/issue-57741.rs:20:19
+  --> $DIR/dereferencing-boxed-enum-in-match-57741.rs:21:19
    |
 LL |     let y = match x {
    |                   - this expression has type `Box<T>`
@@ -29,7 +29,7 @@ LL |     let y = match *x {
    |                   +
 
 error[E0308]: mismatched types
-  --> $DIR/issue-57741.rs:27:9
+  --> $DIR/dereferencing-boxed-enum-in-match-57741.rs:28:9
    |
 LL |     let y = match x {
    |                   - this expression has type `Box<S>`
@@ -44,7 +44,7 @@ LL |     let y = match *x {
    |                   +
 
 error[E0308]: mismatched types
-  --> $DIR/issue-57741.rs:27:22
+  --> $DIR/dereferencing-boxed-enum-in-match-57741.rs:28:22
    |
 LL |     let y = match x {
    |                   - this expression has type `Box<S>`
diff --git a/tests/ui/box/unit/unwind-unique.rs b/tests/ui/box/unit/unwind-unique.rs
index 1da55c45ee9..ed549f50a74 100644
--- a/tests/ui/box/unit/unwind-unique.rs
+++ b/tests/ui/box/unit/unwind-unique.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 
 use std::thread;
 
diff --git a/tests/ui/c-variadic/inherent-method.rs b/tests/ui/c-variadic/inherent-method.rs
new file mode 100644
index 00000000000..c5256aaa1fe
--- /dev/null
+++ b/tests/ui/c-variadic/inherent-method.rs
@@ -0,0 +1,46 @@
+//@ run-pass
+//@ ignore-backends: gcc
+#![feature(c_variadic)]
+
+#[repr(transparent)]
+struct S(i32);
+
+impl S {
+    unsafe extern "C" fn associated_function(mut ap: ...) -> i32 {
+        unsafe { ap.arg() }
+    }
+
+    unsafe extern "C" fn method_owned(self, mut ap: ...) -> i32 {
+        self.0 + unsafe { ap.arg::<i32>() }
+    }
+
+    unsafe extern "C" fn method_ref(&self, mut ap: ...) -> i32 {
+        self.0 + unsafe { ap.arg::<i32>() }
+    }
+
+    unsafe extern "C" fn method_mut(&mut self, mut ap: ...) -> i32 {
+        self.0 + unsafe { ap.arg::<i32>() }
+    }
+
+    unsafe extern "C" fn fat_pointer(self: Box<Self>, mut ap: ...) -> i32 {
+        self.0 + unsafe { ap.arg::<i32>() }
+    }
+}
+
+fn main() {
+    unsafe {
+        assert_eq!(S::associated_function(32), 32);
+        assert_eq!(S(100).method_owned(32), 132);
+        assert_eq!(S(100).method_ref(32), 132);
+        assert_eq!(S(100).method_mut(32), 132);
+        assert_eq!(S::fat_pointer(Box::new(S(100)), 32), 132);
+
+        type Method<T> = unsafe extern "C" fn(T, ...) -> i32;
+
+        assert_eq!((S::associated_function as unsafe extern "C" fn(...) -> i32)(32), 32);
+        assert_eq!((S::method_owned as Method<_>)(S(100), 32), 132);
+        assert_eq!((S::method_ref as Method<_>)(&S(100), 32), 132);
+        assert_eq!((S::method_mut as Method<_>)(&mut S(100), 32), 132);
+        assert_eq!((S::fat_pointer as Method<_>)(Box::new(S(100)), 32), 132);
+    }
+}
diff --git a/tests/ui/c-variadic/naked.rs b/tests/ui/c-variadic/naked.rs
new file mode 100644
index 00000000000..46b59395485
--- /dev/null
+++ b/tests/ui/c-variadic/naked.rs
@@ -0,0 +1,40 @@
+//@ run-pass
+//@ only-x86_64
+//@ only-linux
+#![feature(c_variadic)]
+
+#[repr(C)]
+#[derive(Debug, PartialEq)]
+struct Data(i32, f64);
+
+#[unsafe(naked)]
+unsafe extern "C" fn c_variadic(_: ...) -> Data {
+    // This assembly was generated with GCC, because clang/LLVM is unable to
+    // optimize out the spilling of all registers to the stack.
+    core::arch::naked_asm!(
+        "        sub     rsp, 96",
+        "        mov     QWORD PTR [rsp-88], rdi",
+        "        test    al, al",
+        "        je      .L7",
+        "        movaps  XMMWORD PTR [rsp-40], xmm0",
+        ".L7:",
+        "        lea     rax, [rsp+104]",
+        "        mov     rcx, QWORD PTR [rsp-40]",
+        "        mov     DWORD PTR [rsp-112], 0",
+        "        mov     QWORD PTR [rsp-104], rax",
+        "        lea     rax, [rsp-88]",
+        "        mov     QWORD PTR [rsp-96], rax",
+        "        movq    xmm0, rcx",
+        "        mov     eax, DWORD PTR [rsp-88]",
+        "        mov     DWORD PTR [rsp-108], 48",
+        "        add     rsp, 96",
+        "        ret",
+    )
+}
+
+fn main() {
+    unsafe {
+        assert_eq!(c_variadic(1, 2.0), Data(1, 2.0));
+        assert_eq!(c_variadic(123, 4.56), Data(123, 4.56));
+    }
+}
diff --git a/tests/ui/c-variadic/no-closure.rs b/tests/ui/c-variadic/no-closure.rs
index c0b77786e8b..830ed962a8c 100644
--- a/tests/ui/c-variadic/no-closure.rs
+++ b/tests/ui/c-variadic/no-closure.rs
@@ -4,14 +4,17 @@
 // Check that `...` in closures is rejected.
 
 const F: extern "C" fn(...) = |_: ...| {};
-//~^ ERROR C-variadic type `...` may not be nested inside another type
+//~^ ERROR: unexpected `...`
+//~| NOTE: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
 fn foo() {
     let f = |...| {};
-    //~^ ERROR: `..` patterns are not allowed here
-    //~| ERROR: unexpected `...`
+    //~^ ERROR: unexpected `...`
+    //~| NOTE: not a valid pattern
+    //~| NOTE: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
     let f = |_: ...| {};
-    //~^ ERROR C-variadic type `...` may not be nested inside another type
+    //~^ ERROR: unexpected `...`
+    //~| NOTE: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
     f(1i64)
 }
diff --git a/tests/ui/c-variadic/no-closure.stderr b/tests/ui/c-variadic/no-closure.stderr
index 77bd106bb95..0946c4632e6 100644
--- a/tests/ui/c-variadic/no-closure.stderr
+++ b/tests/ui/c-variadic/no-closure.stderr
@@ -1,35 +1,26 @@
-error[E0743]: C-variadic type `...` may not be nested inside another type
+error: unexpected `...`
   --> $DIR/no-closure.rs:6:35
    |
 LL | const F: extern "C" fn(...) = |_: ...| {};
    |                                   ^^^
+   |
+   = note: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
 error: unexpected `...`
-  --> $DIR/no-closure.rs:10:14
+  --> $DIR/no-closure.rs:11:14
    |
 LL |     let f = |...| {};
    |              ^^^ not a valid pattern
    |
-help: for a rest pattern, use `..` instead of `...`
-   |
-LL -     let f = |...| {};
-LL +     let f = |..| {};
-   |
+   = note: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
-error[E0743]: C-variadic type `...` may not be nested inside another type
-  --> $DIR/no-closure.rs:14:17
+error: unexpected `...`
+  --> $DIR/no-closure.rs:16:17
    |
 LL |     let f = |_: ...| {};
    |                 ^^^
-
-error: `..` patterns are not allowed here
-  --> $DIR/no-closure.rs:10:14
-   |
-LL |     let f = |...| {};
-   |              ^^^
    |
-   = note: only allowed in tuple, tuple struct, and slice patterns
+   = note: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0743`.
diff --git a/tests/ui/c-variadic/not-async.rs b/tests/ui/c-variadic/not-async.rs
index 45a7e1f8972..bdb51a9a432 100644
--- a/tests/ui/c-variadic/not-async.rs
+++ b/tests/ui/c-variadic/not-async.rs
@@ -2,6 +2,14 @@
 #![feature(c_variadic)]
 #![crate_type = "lib"]
 
-async unsafe extern "C" fn cannot_be_async(x: isize, ...) {}
+async unsafe extern "C" fn fn_cannot_be_async(x: isize, ...) {}
 //~^ ERROR functions cannot be both `async` and C-variadic
 //~| ERROR hidden type for `impl Future<Output = ()>` captures lifetime that does not appear in bounds
+
+struct S;
+
+impl S {
+    async unsafe extern "C" fn method_cannot_be_async(x: isize, ...) {}
+    //~^ ERROR functions cannot be both `async` and C-variadic
+    //~| ERROR hidden type for `impl Future<Output = ()>` captures lifetime that does not appear in bounds
+}
diff --git a/tests/ui/c-variadic/not-async.stderr b/tests/ui/c-variadic/not-async.stderr
index b8caf0d8bd8..eab4c4f0822 100644
--- a/tests/ui/c-variadic/not-async.stderr
+++ b/tests/ui/c-variadic/not-async.stderr
@@ -1,19 +1,35 @@
 error: functions cannot be both `async` and C-variadic
   --> $DIR/not-async.rs:5:1
    |
-LL | async unsafe extern "C" fn cannot_be_async(x: isize, ...) {}
-   | ^^^^^ `async` because of this                        ^^^ C-variadic because of this
+LL | async unsafe extern "C" fn fn_cannot_be_async(x: isize, ...) {}
+   | ^^^^^ `async` because of this                           ^^^ C-variadic because of this
+
+error: functions cannot be both `async` and C-variadic
+  --> $DIR/not-async.rs:12:5
+   |
+LL |     async unsafe extern "C" fn method_cannot_be_async(x: isize, ...) {}
+   |     ^^^^^ `async` because of this                               ^^^ C-variadic because of this
 
 error[E0700]: hidden type for `impl Future<Output = ()>` captures lifetime that does not appear in bounds
-  --> $DIR/not-async.rs:5:59
+  --> $DIR/not-async.rs:5:62
    |
-LL | async unsafe extern "C" fn cannot_be_async(x: isize, ...) {}
-   | --------------------------------------------------------- ^^
+LL | async unsafe extern "C" fn fn_cannot_be_async(x: isize, ...) {}
+   | ------------------------------------------------------------ ^^
    | |
    | opaque type defined here
    |
-   = note: hidden type `{async fn body of cannot_be_async()}` captures lifetime `'_`
+   = note: hidden type `{async fn body of fn_cannot_be_async()}` captures lifetime `'_`
+
+error[E0700]: hidden type for `impl Future<Output = ()>` captures lifetime that does not appear in bounds
+  --> $DIR/not-async.rs:12:70
+   |
+LL |     async unsafe extern "C" fn method_cannot_be_async(x: isize, ...) {}
+   |     ---------------------------------------------------------------- ^^
+   |     |
+   |     opaque type defined here
+   |
+   = note: hidden type `{async fn body of S::method_cannot_be_async()}` captures lifetime `'_`
 
-error: aborting due to 2 previous errors
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0700`.
diff --git a/tests/ui/c-variadic/not-dyn-compatible.rs b/tests/ui/c-variadic/not-dyn-compatible.rs
new file mode 100644
index 00000000000..b40a13e5847
--- /dev/null
+++ b/tests/ui/c-variadic/not-dyn-compatible.rs
@@ -0,0 +1,35 @@
+// Traits where a method is c-variadic are not dyn compatible.
+//
+// Creating a function pointer from a method on an `&dyn T` value creates a ReifyShim.
+// This shim cannot reliably forward C-variadic arguments. Thus the trait as a whole
+// is dyn-incompatible to prevent invalid shims from being created.
+#![feature(c_variadic)]
+
+#[repr(transparent)]
+struct Struct(u64);
+
+trait Trait {
+    fn get(&self) -> u64;
+
+    unsafe extern "C" fn dyn_method_ref(&self, mut ap: ...) -> u64 {
+        self.get() + unsafe { ap.arg::<u64>() }
+    }
+}
+
+impl Trait for Struct {
+    fn get(&self) -> u64 {
+        self.0
+    }
+}
+
+fn main() {
+    unsafe {
+        let dyn_object: &dyn Trait = &Struct(64);
+        //~^ ERROR the trait `Trait` is not dyn compatible
+        assert_eq!(dyn_object.dyn_method_ref(100), 164);
+        assert_eq!(
+            (Trait::dyn_method_ref as unsafe extern "C" fn(_, ...) -> u64)(dyn_object, 100),
+            164
+        );
+    }
+}
diff --git a/tests/ui/c-variadic/not-dyn-compatible.stderr b/tests/ui/c-variadic/not-dyn-compatible.stderr
new file mode 100644
index 00000000000..76630600c51
--- /dev/null
+++ b/tests/ui/c-variadic/not-dyn-compatible.stderr
@@ -0,0 +1,21 @@
+error[E0038]: the trait `Trait` is not dyn compatible
+  --> $DIR/not-dyn-compatible.rs:27:30
+   |
+LL |         let dyn_object: &dyn Trait = &Struct(64);
+   |                              ^^^^^ `Trait` is not dyn compatible
+   |
+note: for a trait to be dyn compatible it needs to allow building a vtable
+      for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
+  --> $DIR/not-dyn-compatible.rs:14:26
+   |
+LL | trait Trait {
+   |       ----- this trait is not dyn compatible...
+...
+LL |     unsafe extern "C" fn dyn_method_ref(&self, mut ap: ...) -> u64 {
+   |                          ^^^^^^^^^^^^^^ ...because method `dyn_method_ref` is C-variadic
+   = help: consider moving `dyn_method_ref` to another trait
+   = help: only type `Struct` implements `Trait`; consider using it directly instead.
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0038`.
diff --git a/tests/ui/c-variadic/trait-method.rs b/tests/ui/c-variadic/trait-method.rs
new file mode 100644
index 00000000000..876a303f53b
--- /dev/null
+++ b/tests/ui/c-variadic/trait-method.rs
@@ -0,0 +1,74 @@
+//@ run-pass
+//@ ignore-backends: gcc
+#![feature(c_variadic)]
+
+#[repr(transparent)]
+struct Struct(i32);
+
+impl Struct {
+    unsafe extern "C" fn associated_function(mut ap: ...) -> i32 {
+        unsafe { ap.arg() }
+    }
+
+    unsafe extern "C" fn method(&self, mut ap: ...) -> i32 {
+        self.0 + unsafe { ap.arg::<i32>() }
+    }
+}
+
+trait Trait: Sized {
+    fn get(&self) -> i32;
+
+    unsafe extern "C" fn trait_associated_function(mut ap: ...) -> i32 {
+        unsafe { ap.arg() }
+    }
+
+    unsafe extern "C" fn trait_method_owned(self, mut ap: ...) -> i32 {
+        self.get() + unsafe { ap.arg::<i32>() }
+    }
+
+    unsafe extern "C" fn trait_method_ref(&self, mut ap: ...) -> i32 {
+        self.get() + unsafe { ap.arg::<i32>() }
+    }
+
+    unsafe extern "C" fn trait_method_mut(&mut self, mut ap: ...) -> i32 {
+        self.get() + unsafe { ap.arg::<i32>() }
+    }
+
+    unsafe extern "C" fn trait_fat_pointer(self: Box<Self>, mut ap: ...) -> i32 {
+        self.get() + unsafe { ap.arg::<i32>() }
+    }
+}
+
+impl Trait for Struct {
+    fn get(&self) -> i32 {
+        self.0
+    }
+}
+
+fn main() {
+    unsafe {
+        assert_eq!(Struct::associated_function(32), 32);
+        assert_eq!(Struct(100).method(32), 132);
+
+        assert_eq!(Struct::trait_associated_function(32), 32);
+        assert_eq!(Struct(100).trait_method_owned(32), 132);
+        assert_eq!(Struct(100).trait_method_ref(32), 132);
+        assert_eq!(Struct(100).trait_method_mut(32), 132);
+        assert_eq!(Struct::trait_fat_pointer(Box::new(Struct(100)), 32), 132);
+
+        assert_eq!(<Struct as Trait>::trait_associated_function(32), 32);
+        assert_eq!(Trait::trait_method_owned(Struct(100), 32), 132);
+        assert_eq!(Trait::trait_method_ref(&Struct(100), 32), 132);
+        assert_eq!(Trait::trait_method_mut(&mut Struct(100), 32), 132);
+        assert_eq!(Trait::trait_fat_pointer(Box::new(Struct(100)), 32), 132);
+
+        type Associated = unsafe extern "C" fn(...) -> i32;
+        type Method<T> = unsafe extern "C" fn(T, ...) -> i32;
+
+        assert_eq!((Struct::trait_associated_function as Associated)(32), 32);
+        assert_eq!((Struct::trait_method_owned as Method<_>)(Struct(100), 32), 132);
+        assert_eq!((Struct::trait_method_ref as Method<_>)(&Struct(100), 32), 132);
+        assert_eq!((Struct::trait_method_mut as Method<_>)(&mut Struct(100), 32), 132);
+        assert_eq!((Struct::trait_fat_pointer as Method<_>)(Box::new(Struct(100)), 32), 132);
+    }
+}
diff --git a/tests/ui/c-variadic/unsupported-abi.rs b/tests/ui/c-variadic/unsupported-abi.rs
new file mode 100644
index 00000000000..40179b164ce
--- /dev/null
+++ b/tests/ui/c-variadic/unsupported-abi.rs
@@ -0,0 +1,123 @@
+//@ add-core-stubs
+//@ needs-llvm-components: x86
+//@ compile-flags: --target=i686-pc-windows-gnu --crate-type=rlib
+#![no_core]
+#![feature(no_core, lang_items, c_variadic)]
+
+// Test that ABIs for which C-variadics are not supported report an error.
+
+extern crate minicore;
+use minicore::*;
+
+#[rustfmt::skip]
+mod foreign {
+    extern "Rust"  { fn rust_foreign_explicit(_: ...); }
+    //~^ ERROR C-variadic functions with the "Rust" calling convention are not supported
+    extern "C"  { fn c_foreign(_: ...); }
+    extern "C-unwind"  { fn c_unwind_foreign(_: ...); }
+    extern "cdecl"  { fn cdecl_foreign(_: ...); }
+    extern "cdecl-unwind"  { fn cdecl_unwind_foreign(_: ...); }
+    extern "stdcall"  { fn stdcall_foreign(_: ...); }
+    //~^ ERROR C-variadic functions with the "stdcall" calling convention are not supported
+    extern "stdcall-unwind"  { fn stdcall_unwind_foreign(_: ...); }
+    //~^ ERROR C-variadic functions with the "stdcall-unwind" calling convention are not supported
+    extern "thiscall"  { fn thiscall_foreign(_: ...); }
+    //~^ ERROR C-variadic functions with the "thiscall" calling convention are not supported
+    extern "thiscall-unwind"  { fn thiscall_unwind_foreign(_: ...); }
+    //~^ ERROR C-variadic functions with the "thiscall-unwind" calling convention are not supported
+}
+
+#[lang = "va_list"]
+struct VaList(*mut u8);
+
+unsafe fn rust_free(_: ...) {}
+//~^ ERROR `...` is not supported for non-extern functions
+unsafe extern "Rust" fn rust_free_explicit(_: ...) {}
+//~^ ERROR `...` is not supported for `extern "Rust"` functions
+
+unsafe extern "C" fn c_free(_: ...) {}
+unsafe extern "C-unwind" fn c_unwind_free(_: ...) {}
+
+unsafe extern "cdecl" fn cdecl_free(_: ...) {}
+//~^ ERROR `...` is not supported for `extern "cdecl"` functions
+unsafe extern "cdecl-unwind" fn cdecl_unwind_free(_: ...) {}
+//~^ ERROR `...` is not supported for `extern "cdecl-unwind"` functions
+unsafe extern "stdcall" fn stdcall_free(_: ...) {}
+//~^ ERROR `...` is not supported for `extern "stdcall"` functions
+unsafe extern "stdcall-unwind" fn stdcall_unwind_free(_: ...) {}
+//~^ ERROR `...` is not supported for `extern "stdcall-unwind"` functions
+unsafe extern "thiscall" fn thiscall_free(_: ...) {}
+//~^ ERROR `...` is not supported for `extern "thiscall"` functions
+unsafe extern "thiscall-unwind" fn thiscall_unwind_free(_: ...) {}
+//~^ ERROR `...` is not supported for `extern "thiscall-unwind"` functions
+
+struct S;
+
+impl S {
+    unsafe fn rust_method(_: ...) {}
+    //~^ ERROR `...` is not supported for non-extern functions
+    unsafe extern "Rust" fn rust_method_explicit(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "Rust"` functions
+
+    unsafe extern "C" fn c_method(_: ...) {}
+    unsafe extern "C-unwind" fn c_unwind_method(_: ...) {}
+
+    unsafe extern "cdecl" fn cdecl_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "cdecl"` functions
+    unsafe extern "cdecl-unwind" fn cdecl_unwind_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "cdecl-unwind"` functions
+    unsafe extern "stdcall" fn stdcall_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "stdcall"` functions
+    unsafe extern "stdcall-unwind" fn stdcall_unwind_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "stdcall-unwind"` functions
+    unsafe extern "thiscall" fn thiscall_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "thiscall"` functions
+    unsafe extern "thiscall-unwind" fn thiscall_unwind_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "thiscall-unwind"` functions
+}
+
+trait T {
+    unsafe fn rust_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for non-extern functions
+    unsafe extern "Rust" fn rust_trait_method_explicit(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "Rust"` functions
+
+    unsafe extern "C" fn c_trait_method(_: ...) {}
+    unsafe extern "C-unwind" fn c_unwind_trait_method(_: ...) {}
+
+    unsafe extern "cdecl" fn cdecl_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "cdecl"` functions
+    unsafe extern "cdecl-unwind" fn cdecl_unwind_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "cdecl-unwind"` functions
+    unsafe extern "stdcall" fn stdcall_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "stdcall"` functions
+    unsafe extern "stdcall-unwind" fn stdcall_unwind_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "stdcall-unwind"` functions
+    unsafe extern "thiscall" fn thiscall_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "thiscall"` functions
+    unsafe extern "thiscall-unwind" fn thiscall_unwind_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "thiscall-unwind"` functions
+}
+
+impl T for S {
+    unsafe fn rust_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for non-extern functions
+    unsafe extern "Rust" fn rust_trait_method_explicit(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "Rust"` functions
+
+    unsafe extern "C" fn c_trait_method(_: ...) {}
+    unsafe extern "C-unwind" fn c_unwind_trait_method(_: ...) {}
+
+    unsafe extern "cdecl" fn cdecl_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "cdecl"` functions
+    unsafe extern "cdecl-unwind" fn cdecl_unwind_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "cdecl-unwind"` functions
+    unsafe extern "stdcall" fn stdcall_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "stdcall"` functions
+    unsafe extern "stdcall-unwind" fn stdcall_unwind_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "stdcall-unwind"` functions
+    unsafe extern "thiscall" fn thiscall_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "thiscall"` functions
+    unsafe extern "thiscall-unwind" fn thiscall_unwind_trait_method(_: ...) {}
+    //~^ ERROR `...` is not supported for `extern "thiscall-unwind"` functions
+}
diff --git a/tests/ui/c-variadic/unsupported-abi.stderr b/tests/ui/c-variadic/unsupported-abi.stderr
new file mode 100644
index 00000000000..daed9171406
--- /dev/null
+++ b/tests/ui/c-variadic/unsupported-abi.stderr
@@ -0,0 +1,345 @@
+error: `...` is not supported for non-extern functions
+  --> $DIR/unsupported-abi.rs:33:21
+   |
+LL | unsafe fn rust_free(_: ...) {}
+   |                     ^^^^^^
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "Rust"` functions
+  --> $DIR/unsupported-abi.rs:35:44
+   |
+LL | unsafe extern "Rust" fn rust_free_explicit(_: ...) {}
+   |        -------------                       ^^^^^^
+   |        |
+   |        `extern "Rust"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "cdecl"` functions
+  --> $DIR/unsupported-abi.rs:41:37
+   |
+LL | unsafe extern "cdecl" fn cdecl_free(_: ...) {}
+   |        --------------               ^^^^^^
+   |        |
+   |        `extern "cdecl"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "cdecl-unwind"` functions
+  --> $DIR/unsupported-abi.rs:43:51
+   |
+LL | unsafe extern "cdecl-unwind" fn cdecl_unwind_free(_: ...) {}
+   |        ---------------------                      ^^^^^^
+   |        |
+   |        `extern "cdecl-unwind"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "stdcall"` functions
+  --> $DIR/unsupported-abi.rs:45:41
+   |
+LL | unsafe extern "stdcall" fn stdcall_free(_: ...) {}
+   |        ----------------                 ^^^^^^
+   |        |
+   |        `extern "stdcall"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "stdcall-unwind"` functions
+  --> $DIR/unsupported-abi.rs:47:55
+   |
+LL | unsafe extern "stdcall-unwind" fn stdcall_unwind_free(_: ...) {}
+   |        -----------------------                        ^^^^^^
+   |        |
+   |        `extern "stdcall-unwind"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "thiscall"` functions
+  --> $DIR/unsupported-abi.rs:49:43
+   |
+LL | unsafe extern "thiscall" fn thiscall_free(_: ...) {}
+   |        -----------------                  ^^^^^^
+   |        |
+   |        `extern "thiscall"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "thiscall-unwind"` functions
+  --> $DIR/unsupported-abi.rs:51:57
+   |
+LL | unsafe extern "thiscall-unwind" fn thiscall_unwind_free(_: ...) {}
+   |        ------------------------                         ^^^^^^
+   |        |
+   |        `extern "thiscall-unwind"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for non-extern functions
+  --> $DIR/unsupported-abi.rs:57:27
+   |
+LL |     unsafe fn rust_method(_: ...) {}
+   |                           ^^^^^^
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "Rust"` functions
+  --> $DIR/unsupported-abi.rs:59:50
+   |
+LL |     unsafe extern "Rust" fn rust_method_explicit(_: ...) {}
+   |            -------------                         ^^^^^^
+   |            |
+   |            `extern "Rust"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "cdecl"` functions
+  --> $DIR/unsupported-abi.rs:65:43
+   |
+LL |     unsafe extern "cdecl" fn cdecl_method(_: ...) {}
+   |            --------------                 ^^^^^^
+   |            |
+   |            `extern "cdecl"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "cdecl-unwind"` functions
+  --> $DIR/unsupported-abi.rs:67:57
+   |
+LL |     unsafe extern "cdecl-unwind" fn cdecl_unwind_method(_: ...) {}
+   |            ---------------------                        ^^^^^^
+   |            |
+   |            `extern "cdecl-unwind"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "stdcall"` functions
+  --> $DIR/unsupported-abi.rs:69:47
+   |
+LL |     unsafe extern "stdcall" fn stdcall_method(_: ...) {}
+   |            ----------------                   ^^^^^^
+   |            |
+   |            `extern "stdcall"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "stdcall-unwind"` functions
+  --> $DIR/unsupported-abi.rs:71:61
+   |
+LL |     unsafe extern "stdcall-unwind" fn stdcall_unwind_method(_: ...) {}
+   |            -----------------------                          ^^^^^^
+   |            |
+   |            `extern "stdcall-unwind"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "thiscall"` functions
+  --> $DIR/unsupported-abi.rs:73:49
+   |
+LL |     unsafe extern "thiscall" fn thiscall_method(_: ...) {}
+   |            -----------------                    ^^^^^^
+   |            |
+   |            `extern "thiscall"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "thiscall-unwind"` functions
+  --> $DIR/unsupported-abi.rs:75:63
+   |
+LL |     unsafe extern "thiscall-unwind" fn thiscall_unwind_method(_: ...) {}
+   |            ------------------------                           ^^^^^^
+   |            |
+   |            `extern "thiscall-unwind"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for non-extern functions
+  --> $DIR/unsupported-abi.rs:80:33
+   |
+LL |     unsafe fn rust_trait_method(_: ...) {}
+   |                                 ^^^^^^
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "Rust"` functions
+  --> $DIR/unsupported-abi.rs:82:56
+   |
+LL |     unsafe extern "Rust" fn rust_trait_method_explicit(_: ...) {}
+   |            -------------                               ^^^^^^
+   |            |
+   |            `extern "Rust"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "cdecl"` functions
+  --> $DIR/unsupported-abi.rs:88:49
+   |
+LL |     unsafe extern "cdecl" fn cdecl_trait_method(_: ...) {}
+   |            --------------                       ^^^^^^
+   |            |
+   |            `extern "cdecl"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "cdecl-unwind"` functions
+  --> $DIR/unsupported-abi.rs:90:63
+   |
+LL |     unsafe extern "cdecl-unwind" fn cdecl_unwind_trait_method(_: ...) {}
+   |            ---------------------                              ^^^^^^
+   |            |
+   |            `extern "cdecl-unwind"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "stdcall"` functions
+  --> $DIR/unsupported-abi.rs:92:53
+   |
+LL |     unsafe extern "stdcall" fn stdcall_trait_method(_: ...) {}
+   |            ----------------                         ^^^^^^
+   |            |
+   |            `extern "stdcall"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "stdcall-unwind"` functions
+  --> $DIR/unsupported-abi.rs:94:67
+   |
+LL |     unsafe extern "stdcall-unwind" fn stdcall_unwind_trait_method(_: ...) {}
+   |            -----------------------                                ^^^^^^
+   |            |
+   |            `extern "stdcall-unwind"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "thiscall"` functions
+  --> $DIR/unsupported-abi.rs:96:55
+   |
+LL |     unsafe extern "thiscall" fn thiscall_trait_method(_: ...) {}
+   |            -----------------                          ^^^^^^
+   |            |
+   |            `extern "thiscall"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "thiscall-unwind"` functions
+  --> $DIR/unsupported-abi.rs:98:69
+   |
+LL |     unsafe extern "thiscall-unwind" fn thiscall_unwind_trait_method(_: ...) {}
+   |            ------------------------                                 ^^^^^^
+   |            |
+   |            `extern "thiscall-unwind"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for non-extern functions
+  --> $DIR/unsupported-abi.rs:103:33
+   |
+LL |     unsafe fn rust_trait_method(_: ...) {}
+   |                                 ^^^^^^
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "Rust"` functions
+  --> $DIR/unsupported-abi.rs:105:56
+   |
+LL |     unsafe extern "Rust" fn rust_trait_method_explicit(_: ...) {}
+   |            -------------                               ^^^^^^
+   |            |
+   |            `extern "Rust"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "cdecl"` functions
+  --> $DIR/unsupported-abi.rs:111:49
+   |
+LL |     unsafe extern "cdecl" fn cdecl_trait_method(_: ...) {}
+   |            --------------                       ^^^^^^
+   |            |
+   |            `extern "cdecl"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "cdecl-unwind"` functions
+  --> $DIR/unsupported-abi.rs:113:63
+   |
+LL |     unsafe extern "cdecl-unwind" fn cdecl_unwind_trait_method(_: ...) {}
+   |            ---------------------                              ^^^^^^
+   |            |
+   |            `extern "cdecl-unwind"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "stdcall"` functions
+  --> $DIR/unsupported-abi.rs:115:53
+   |
+LL |     unsafe extern "stdcall" fn stdcall_trait_method(_: ...) {}
+   |            ----------------                         ^^^^^^
+   |            |
+   |            `extern "stdcall"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "stdcall-unwind"` functions
+  --> $DIR/unsupported-abi.rs:117:67
+   |
+LL |     unsafe extern "stdcall-unwind" fn stdcall_unwind_trait_method(_: ...) {}
+   |            -----------------------                                ^^^^^^
+   |            |
+   |            `extern "stdcall-unwind"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "thiscall"` functions
+  --> $DIR/unsupported-abi.rs:119:55
+   |
+LL |     unsafe extern "thiscall" fn thiscall_trait_method(_: ...) {}
+   |            -----------------                          ^^^^^^
+   |            |
+   |            `extern "thiscall"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: `...` is not supported for `extern "thiscall-unwind"` functions
+  --> $DIR/unsupported-abi.rs:121:69
+   |
+LL |     unsafe extern "thiscall-unwind" fn thiscall_unwind_trait_method(_: ...) {}
+   |            ------------------------                                 ^^^^^^
+   |            |
+   |            `extern "thiscall-unwind"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error[E0045]: C-variadic functions with the "Rust" calling convention are not supported
+  --> $DIR/unsupported-abi.rs:14:22
+   |
+LL |     extern "Rust"  { fn rust_foreign_explicit(_: ...); }
+   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
+
+error[E0045]: C-variadic functions with the "stdcall" calling convention are not supported
+  --> $DIR/unsupported-abi.rs:20:25
+   |
+LL |     extern "stdcall"  { fn stdcall_foreign(_: ...); }
+   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
+
+error[E0045]: C-variadic functions with the "stdcall-unwind" calling convention are not supported
+  --> $DIR/unsupported-abi.rs:22:32
+   |
+LL |     extern "stdcall-unwind"  { fn stdcall_unwind_foreign(_: ...); }
+   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
+
+error[E0045]: C-variadic functions with the "thiscall" calling convention are not supported
+  --> $DIR/unsupported-abi.rs:24:26
+   |
+LL |     extern "thiscall"  { fn thiscall_foreign(_: ...); }
+   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
+
+error[E0045]: C-variadic functions with the "thiscall-unwind" calling convention are not supported
+  --> $DIR/unsupported-abi.rs:26:33
+   |
+LL |     extern "thiscall-unwind"  { fn thiscall_unwind_foreign(_: ...); }
+   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention
+
+error: aborting due to 37 previous errors
+
+For more information about this error, try `rustc --explain E0045`.
diff --git a/tests/ui/c-variadic/valid.rs b/tests/ui/c-variadic/valid.rs
index 5a0b32026dc..8b42eb49329 100644
--- a/tests/ui/c-variadic/valid.rs
+++ b/tests/ui/c-variadic/valid.rs
@@ -1,4 +1,5 @@
 //@ run-pass
+//@ ignore-backends: gcc
 #![feature(c_variadic)]
 
 // In rust (and C23 and above) `...` can be the only argument.
diff --git a/tests/ui/cfg/assume-incomplete-release/assume-incomplete.rs b/tests/ui/cfg/assume-incomplete-release/assume-incomplete.rs
index cafb7389e29..2ca004d9a90 100644
--- a/tests/ui/cfg/assume-incomplete-release/assume-incomplete.rs
+++ b/tests/ui/cfg/assume-incomplete-release/assume-incomplete.rs
@@ -2,6 +2,7 @@
 //@ proc-macro: ver-cfg-rel.rs
 //@ revisions: assume no_assume
 //@ [assume]compile-flags: -Z assume-incomplete-release
+//@ ignore-backends: gcc
 
 #![feature(cfg_version)]
 
diff --git a/tests/ui/check-cfg/cfg-crate-features.stderr b/tests/ui/check-cfg/cfg-crate-features.stderr
index 6b2e628e12e..39fee52a909 100644
--- a/tests/ui/check-cfg/cfg-crate-features.stderr
+++ b/tests/ui/check-cfg/cfg-crate-features.stderr
@@ -24,7 +24,7 @@ warning: unexpected `cfg` condition value: `does_not_exist`
 LL | #![cfg(not(target(os = "does_not_exist")))]
    |                   ^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, and `tvos` and 11 more
+   = note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, and `trusty` and 12 more
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default
 
diff --git a/tests/ui/check-cfg/report-in-external-macros.cargo.stderr b/tests/ui/check-cfg/report-in-external-macros.cargo.stderr
index 989a01f2244..4b5fc91c7eb 100644
--- a/tests/ui/check-cfg/report-in-external-macros.cargo.stderr
+++ b/tests/ui/check-cfg/report-in-external-macros.cargo.stderr
@@ -18,7 +18,7 @@ warning: unexpected `cfg` condition value: `UNEXPECTED_VALUE`
 LL |     cfg_macro::my_lib_macro_value!();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: expected values for `panic` are: `abort` and `unwind`
+   = note: expected values for `panic` are: `abort`, `immediate-abort`, and `unwind`
    = note: using a cfg inside a macro will use the cfgs from the destination crate and not the ones from the defining crate
    = help: try referring to `cfg_macro::my_lib_macro_value` crate for guidance on how handle this unexpected cfg
    = help: the macro `cfg_macro::my_lib_macro_value` may come from an old version of the `cfg_macro` crate, try updating your dependency with `cargo update -p cfg_macro`
diff --git a/tests/ui/check-cfg/report-in-external-macros.rustc.stderr b/tests/ui/check-cfg/report-in-external-macros.rustc.stderr
index 95d10e014f3..0d99d061d28 100644
--- a/tests/ui/check-cfg/report-in-external-macros.rustc.stderr
+++ b/tests/ui/check-cfg/report-in-external-macros.rustc.stderr
@@ -18,7 +18,7 @@ warning: unexpected `cfg` condition value: `UNEXPECTED_VALUE`
 LL |     cfg_macro::my_lib_macro_value!();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: expected values for `panic` are: `abort` and `unwind`
+   = note: expected values for `panic` are: `abort`, `immediate-abort`, and `unwind`
    = note: using a cfg inside a macro will use the cfgs from the destination crate and not the ones from the defining crate
    = help: try referring to `cfg_macro::my_lib_macro_value` crate for guidance on how handle this unexpected cfg
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
diff --git a/tests/ui/check-cfg/well-known-values.stderr b/tests/ui/check-cfg/well-known-values.stderr
index 6490fc63fd7..e62f741b302 100644
--- a/tests/ui/check-cfg/well-known-values.stderr
+++ b/tests/ui/check-cfg/well-known-values.stderr
@@ -80,7 +80,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
 LL |     panic = "_UNEXPECTED_VALUE",
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: expected values for `panic` are: `abort` and `unwind`
+   = note: expected values for `panic` are: `abort`, `immediate-abort`, and `unwind`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
 
 warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
@@ -201,7 +201,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
 LL |     target_os = "_UNEXPECTED_VALUE",
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `vexos`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
+   = note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `vexos`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
 
 warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
@@ -274,7 +274,7 @@ LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux`
    |                   |
    |                   help: there is a expected value with a similar name: `"linux"`
    |
-   = note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `vexos`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
+   = note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `vexos`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
 
 warning: 28 warnings emitted
diff --git a/tests/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs b/tests/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs
index afb16cf58e8..4ae77ab6439 100644
--- a/tests/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs
+++ b/tests/ui/closures/2229_closure_analysis/run_pass/lit-pattern-matching-with-methods.rs
@@ -2,7 +2,6 @@
 //@check-pass
 #![warn(unused)]
 #![feature(rustc_attrs)]
-#![feature(btree_extract_if)]
 
 use std::collections::BTreeMap;
 use std::panic::{catch_unwind, AssertUnwindSafe};
diff --git a/tests/ui/closures/deduce-signature/obligation-with-leaking-placeholders.next.stderr b/tests/ui/closures/deduce-signature/obligation-with-leaking-placeholders.next.stderr
index 3d667f12371..4bb9047b303 100644
--- a/tests/ui/closures/deduce-signature/obligation-with-leaking-placeholders.next.stderr
+++ b/tests/ui/closures/deduce-signature/obligation-with-leaking-placeholders.next.stderr
@@ -5,7 +5,7 @@ LL |     needs_foo(|x| {
    |                ^
 ...
 LL |         x.to_string();
-   |         - type must be known at this point
+   |           --------- type must be known at this point
    |
 help: consider giving this closure parameter an explicit type
    |
diff --git a/tests/ui/issues/issue-59494.rs b/tests/ui/closures/generic-typed-nested-closures-59494.rs
index b4d50bd4ce7..04d7b00ff7f 100644
--- a/tests/ui/issues/issue-59494.rs
+++ b/tests/ui/closures/generic-typed-nested-closures-59494.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/59494
 fn t7p<A, B, C>(f: impl Fn(B) -> C, g: impl Fn(A) -> B) -> impl Fn(A) -> C {
     move |a: A| -> C { f(g(a)) }
 }
diff --git a/tests/ui/issues/issue-59494.stderr b/tests/ui/closures/generic-typed-nested-closures-59494.stderr
index 33d3e48c1aa..9706fea82a3 100644
--- a/tests/ui/issues/issue-59494.stderr
+++ b/tests/ui/closures/generic-typed-nested-closures-59494.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-59494.rs:20:40
+  --> $DIR/generic-typed-nested-closures-59494.rs:21:40
    |
 LL |     let t7 = |env| |a| |b| t7p(f, g)(((env, a), b));
    |                                        ^^^ cyclic type of infinite size
diff --git a/tests/ui/closures/impl-closure-147146.rs b/tests/ui/closures/impl-closure-147146.rs
new file mode 100644
index 00000000000..b709e577354
--- /dev/null
+++ b/tests/ui/closures/impl-closure-147146.rs
@@ -0,0 +1,7 @@
+impl typeof(|| {}) {}
+//~^ ERROR `typeof` is a reserved keyword but unimplemented
+
+unsafe impl Send for typeof(|| {}) {}
+//~^ ERROR `typeof` is a reserved keyword but unimplemented
+
+fn main() {}
diff --git a/tests/ui/closures/impl-closure-147146.stderr b/tests/ui/closures/impl-closure-147146.stderr
new file mode 100644
index 00000000000..6da16b5d450
--- /dev/null
+++ b/tests/ui/closures/impl-closure-147146.stderr
@@ -0,0 +1,15 @@
+error[E0516]: `typeof` is a reserved keyword but unimplemented
+  --> $DIR/impl-closure-147146.rs:1:6
+   |
+LL | impl typeof(|| {}) {}
+   |      ^^^^^^^^^^^^^ reserved keyword
+
+error[E0516]: `typeof` is a reserved keyword but unimplemented
+  --> $DIR/impl-closure-147146.rs:4:22
+   |
+LL | unsafe impl Send for typeof(|| {}) {}
+   |                      ^^^^^^^^^^^^^ reserved keyword
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0516`.
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/undeclared-lifetime.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/undeclared-lifetime.rs
new file mode 100644
index 00000000000..0a0dca804ef
--- /dev/null
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/undeclared-lifetime.rs
@@ -0,0 +1,21 @@
+//@ add-core-stubs
+//@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
+//@ incremental (required to trigger the bug)
+//@ needs-llvm-components: arm
+#![feature(abi_cmse_nonsecure_call, no_core)]
+#![no_core]
+
+extern crate minicore;
+use minicore::*;
+
+// A regression test for https://github.com/rust-lang/rust/issues/131639.
+// NOTE: `-Cincremental` was required for triggering the bug.
+
+fn foo() {
+    id::<extern "cmse-nonsecure-call" fn(&'a ())>(PhantomData);
+    //~^ ERROR use of undeclared lifetime name `'a`
+}
+
+fn id<T>(x: PhantomData<T>) -> PhantomData<T> {
+    x
+}
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-call/undeclared-lifetime.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/undeclared-lifetime.stderr
new file mode 100644
index 00000000000..7300bdb72cd
--- /dev/null
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-call/undeclared-lifetime.stderr
@@ -0,0 +1,19 @@
+error[E0261]: use of undeclared lifetime name `'a`
+  --> $DIR/undeclared-lifetime.rs:15:43
+   |
+LL |     id::<extern "cmse-nonsecure-call" fn(&'a ())>(PhantomData);
+   |                                           ^^ undeclared lifetime
+   |
+   = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
+help: consider making the type lifetime-generic with a new `'a` lifetime
+   |
+LL |     id::<for<'a> extern "cmse-nonsecure-call" fn(&'a ())>(PhantomData);
+   |          +++++++
+help: consider introducing lifetime `'a` here
+   |
+LL | fn foo<'a>() {
+   |       ++++
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0261`.
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/c-variadic.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/c-variadic.rs
new file mode 100644
index 00000000000..9317ab5cd27
--- /dev/null
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/c-variadic.rs
@@ -0,0 +1,69 @@
+//@ add-core-stubs
+//@ edition: 2018
+//@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
+//@ needs-llvm-components: arm
+#![feature(cmse_nonsecure_entry, c_variadic, no_core, lang_items)]
+#![no_core]
+
+extern crate minicore;
+use minicore::*;
+
+#[lang = "va_list"]
+struct VaList(*mut u8);
+
+unsafe extern "cmse-nonsecure-entry" fn c_variadic(_: u32, _: ...) {
+    //~^ ERROR `...` is not supported for `extern "cmse-nonsecure-entry"` functions
+}
+
+// A regression test for https://github.com/rust-lang/rust/issues/132142
+async unsafe extern "cmse-nonsecure-entry" fn async_and_c_variadic(_: ...) {
+    //~^ ERROR `...` is not supported for `extern "cmse-nonsecure-entry"` functions
+    //~| ERROR functions cannot be both `async` and C-variadic
+}
+
+// Below are the lang items that are required for a program that defines an `async` function.
+// Without them, the ICE that is tested for here is not reached for this target. For now they are in
+// this file, but they may be moved into `minicore` if/when other `#[no_core]` tests want to use
+// them.
+
+// NOTE: in `core` this type uses `NonNull`.
+#[lang = "ResumeTy"]
+pub struct ResumeTy(*mut Context<'static>);
+
+#[lang = "future_trait"]
+pub trait Future {
+    /// The type of value produced on completion.
+    #[lang = "future_output"]
+    type Output;
+
+    // NOTE: misses the `poll` method.
+}
+
+#[lang = "async_drop"]
+pub trait AsyncDrop {
+    // NOTE: misses the `drop` method.
+}
+
+#[lang = "Poll"]
+pub enum Poll<T> {
+    #[lang = "Ready"]
+    Ready(T),
+
+    #[lang = "Pending"]
+    Pending,
+}
+
+#[lang = "Context"]
+pub struct Context<'a> {
+    // NOTE: misses a bunch of fields.
+    _marker: PhantomData<fn(&'a ()) -> &'a ()>,
+}
+
+#[lang = "get_context"]
+pub unsafe fn get_context<'a, 'b>(cx: ResumeTy) -> &'a mut Context<'b> {
+    // NOTE: the actual implementation looks different.
+    mem::transmute(cx.0)
+}
+
+#[lang = "pin"]
+pub struct Pin<T>(T);
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/c-variadic.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/c-variadic.stderr
new file mode 100644
index 00000000000..948f8f5747b
--- /dev/null
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/c-variadic.stderr
@@ -0,0 +1,28 @@
+error: `...` is not supported for `extern "cmse-nonsecure-entry"` functions
+  --> $DIR/c-variadic.rs:14:60
+   |
+LL | unsafe extern "cmse-nonsecure-entry" fn c_variadic(_: u32, _: ...) {
+   |        -----------------------------                       ^^^^^^
+   |        |
+   |        `extern "cmse-nonsecure-entry"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: functions cannot be both `async` and C-variadic
+  --> $DIR/c-variadic.rs:19:1
+   |
+LL | async unsafe extern "cmse-nonsecure-entry" fn async_and_c_variadic(_: ...) {
+   | ^^^^^ `async` because of this                                      ^^^^^^ C-variadic because of this
+
+error: `...` is not supported for `extern "cmse-nonsecure-entry"` functions
+  --> $DIR/c-variadic.rs:19:68
+   |
+LL | async unsafe extern "cmse-nonsecure-entry" fn async_and_c_variadic(_: ...) {
+   |              -----------------------------                         ^^^^^^
+   |              |
+   |              `extern "cmse-nonsecure-entry"` because of this
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.rs
index eb6f4a32365..aee01e25ddc 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.rs
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.rs
@@ -1,7 +1,7 @@
 //@ add-core-stubs
 //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
 //@ needs-llvm-components: arm
-#![feature(cmse_nonsecure_entry, c_variadic, no_core, lang_items)]
+#![feature(cmse_nonsecure_entry, no_core, lang_items)]
 #![no_core]
 
 extern crate minicore;
@@ -65,8 +65,3 @@ extern "cmse-nonsecure-entry" fn wrapped_trait_object(x: WrapperTransparent) ->
     //~^ ERROR return value of `"cmse-nonsecure-entry"` function too large to pass via registers [E0798]
     x
 }
-
-unsafe extern "cmse-nonsecure-entry" fn c_variadic(_: u32, _: ...) {
-    //~^ ERROR `...` is not supported for `extern "cmse-nonsecure-entry"` functions
-    //~| ERROR requires `va_list` lang_item
-}
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.stderr
index 8937def9428..df1a9107043 100644
--- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.stderr
+++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.stderr
@@ -1,13 +1,3 @@
-error: `...` is not supported for `extern "cmse-nonsecure-entry"` functions
-  --> $DIR/generics.rs:69:60
-   |
-LL | unsafe extern "cmse-nonsecure-entry" fn c_variadic(_: u32, _: ...) {
-   |        -----------------------------                       ^^^^^^
-   |        |
-   |        `extern "cmse-nonsecure-entry"` because of this
-   |
-   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
-
 error[E0798]: functions with the `"cmse-nonsecure-entry"` ABI cannot contain generics in their type
   --> $DIR/generics.rs:30:1
    |
@@ -71,12 +61,6 @@ LL | extern "cmse-nonsecure-entry" fn wrapped_trait_object(x: WrapperTransparent
    = note: functions with the `"cmse-nonsecure-entry"` ABI must pass their result via the available return registers
    = note: the result must either be a (transparently wrapped) i64, u64 or f64, or be at most 4 bytes in size
 
-error: requires `va_list` lang_item
-  --> $DIR/generics.rs:69:60
-   |
-LL | unsafe extern "cmse-nonsecure-entry" fn c_variadic(_: u32, _: ...) {
-   |                                                            ^^^^^^
-
-error: aborting due to 9 previous errors
+error: aborting due to 7 previous errors
 
 For more information about this error, try `rustc --explain E0798`.
diff --git a/tests/ui/codegen/issue-82833-slice-miscompile.rs b/tests/ui/codegen/issue-82833-slice-miscompile.rs
index 32eac923a63..e0cb8716629 100644
--- a/tests/ui/codegen/issue-82833-slice-miscompile.rs
+++ b/tests/ui/codegen/issue-82833-slice-miscompile.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ compile-flags: -Ccodegen-units=1 -Cllvm-args=--inline-threshold=0 -Clink-dead-code -Copt-level=0 -Cdebuginfo=2
+//@ ignore-backends: gcc
 
 // Make sure LLVM does not miscompile this.
 
diff --git a/tests/ui/codegen/llvm-args-invalid-flag.rs b/tests/ui/codegen/llvm-args-invalid-flag.rs
index a8fa55a220a..f88a7101abd 100644
--- a/tests/ui/codegen/llvm-args-invalid-flag.rs
+++ b/tests/ui/codegen/llvm-args-invalid-flag.rs
@@ -1,6 +1,7 @@
 //@ compile-flags: -Cllvm-args=-not-a-real-llvm-arg
 //@ normalize-stderr: "--help" -> "-help"
 //@ normalize-stderr: "\n(\n|.)*" -> ""
+//@ ignore-backends: gcc
 
 // I'm seeing "--help" locally, but "-help" in CI, so I'm normalizing it to just "-help".
 
diff --git a/tests/ui/issues/issue-58375-monomorphize-default-impls.rs b/tests/ui/codegen/mono-item-collector-default-impl-58375.rs
index 769a1176edd..f00e79e0dc5 100644
--- a/tests/ui/issues/issue-58375-monomorphize-default-impls.rs
+++ b/tests/ui/codegen/mono-item-collector-default-impl-58375.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/58375
 // Make sure that the mono-item collector does not crash when trying to
 // instantiate a default impl for DecodeUtf16<<u8 as A>::Item>
 // See https://github.com/rust-lang/rust/issues/58375
diff --git a/tests/ui/codegen/remark-flag-functionality.rs b/tests/ui/codegen/remark-flag-functionality.rs
index 797c55ba830..4cfc5f5c8ec 100644
--- a/tests/ui/codegen/remark-flag-functionality.rs
+++ b/tests/ui/codegen/remark-flag-functionality.rs
@@ -17,6 +17,7 @@
 
 //@ dont-check-compiler-stderr
 //@ dont-require-annotations: NOTE
+//@ ignore-backends: gcc
 
 #[no_mangle]
 #[inline(never)]
diff --git a/tests/ui/codegen/virtual-function-elimination.rs b/tests/ui/codegen/virtual-function-elimination.rs
index 3cbeb1293e5..90fc86f95c5 100644
--- a/tests/ui/codegen/virtual-function-elimination.rs
+++ b/tests/ui/codegen/virtual-function-elimination.rs
@@ -2,6 +2,7 @@
 //@ compile-flags: -Zvirtual-function-elimination=true -Clto=true
 //@ only-x86_64
 //@ no-prefer-dynamic
+//@ ignore-backends: gcc
 
 // issue #123955
 pub fn test0() {
diff --git a/tests/ui/codemap_tests/huge_multispan_highlight.ascii.svg b/tests/ui/codemap_tests/huge_multispan_highlight.ascii.svg
index 1cedbf75e4b..7ffbc64b074 100644
--- a/tests/ui/codemap_tests/huge_multispan_highlight.ascii.svg
+++ b/tests/ui/codemap_tests/huge_multispan_highlight.ascii.svg
@@ -1,7 +1,7 @@
-<svg width="743px" height="758px" xmlns="http://www.w3.org/2000/svg">
+<svg width="740px" height="758px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
+    .bg { fill: #000000 }
     .fg-ansi256-009 { fill: #FF5555 }
     .fg-ansi256-012 { fill: #5555FF }
     .container {
diff --git a/tests/ui/codemap_tests/huge_multispan_highlight.unicode.svg b/tests/ui/codemap_tests/huge_multispan_highlight.unicode.svg
index 36a33b74042..5f1fcdb3d50 100644
--- a/tests/ui/codemap_tests/huge_multispan_highlight.unicode.svg
+++ b/tests/ui/codemap_tests/huge_multispan_highlight.unicode.svg
@@ -1,7 +1,7 @@
-<svg width="743px" height="758px" xmlns="http://www.w3.org/2000/svg">
+<svg width="740px" height="758px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
+    .bg { fill: #000000 }
     .fg-ansi256-009 { fill: #FF5555 }
     .fg-ansi256-012 { fill: #5555FF }
     .container {
diff --git a/tests/ui/coercion/coerce-block-tail.stderr b/tests/ui/coercion/coerce-block-tail.stderr
index 1301f3b7813..b358401b706 100644
--- a/tests/ui/coercion/coerce-block-tail.stderr
+++ b/tests/ui/coercion/coerce-block-tail.stderr
@@ -6,10 +6,11 @@ LL |     let _: &i32 = & { Box::new(1i32) };
    |
    = note: expected type `i32`
             found struct `Box<i32>`
-help: consider unboxing the value
+help: consider removing the Box
+   |
+LL -     let _: &i32 = & { Box::new(1i32) };
+LL +     let _: &i32 = & { 1i32 };
    |
-LL |     let _: &i32 = & { *Box::new(1i32) };
-   |                       +
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/coercion/coerce-box-new-to-unboxed.rs b/tests/ui/coercion/coerce-box-new-to-unboxed.rs
new file mode 100644
index 00000000000..63ff0fc4e23
--- /dev/null
+++ b/tests/ui/coercion/coerce-box-new-to-unboxed.rs
@@ -0,0 +1,4 @@
+fn main() {
+    let _: String = Box::new(String::new());
+    //~^ ERROR mismatched types
+}
diff --git a/tests/ui/coercion/coerce-box-new-to-unboxed.stderr b/tests/ui/coercion/coerce-box-new-to-unboxed.stderr
new file mode 100644
index 00000000000..bdd962686e4
--- /dev/null
+++ b/tests/ui/coercion/coerce-box-new-to-unboxed.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+  --> $DIR/coerce-box-new-to-unboxed.rs:2:21
+   |
+LL |     let _: String = Box::new(String::new());
+   |            ------   ^^^^^^^^^^^^^^^^^^^^^^^ expected `String`, found `Box<String>`
+   |            |
+   |            expected due to this
+   |
+   = note: expected struct `String`
+              found struct `Box<String>`
+help: consider removing the Box
+   |
+LL -     let _: String = Box::new(String::new());
+LL +     let _: String = String::new();
+   |
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/coercion/no_local_for_coerced_const-issue-143671.rs b/tests/ui/coercion/no_local_for_coerced_const-issue-143671.rs
new file mode 100644
index 00000000000..38479d9070b
--- /dev/null
+++ b/tests/ui/coercion/no_local_for_coerced_const-issue-143671.rs
@@ -0,0 +1,46 @@
+//@ run-pass
+
+#![feature(unsize)]
+#![feature(coerce_unsized)]
+
+use std::fmt::Display;
+use std::marker::Unsize;
+use std::ops::CoerceUnsized;
+use std::rc::Weak;
+
+#[repr(transparent)]
+struct X<'a, T: ?Sized> {
+    f: &'a T,
+}
+
+impl<'a, T: ?Sized> Drop for X<'a, T> {
+    fn drop(&mut self) {
+        panic!()
+    }
+}
+
+impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<X<'a, U>> for X<'a, T> where
+    &'a T: CoerceUnsized<&'a U>
+{
+}
+
+const Y: X<'static, i32> = X { f: &0 };
+
+fn main() {
+    let _: [X<'static, dyn Display>; 0] = [Y; 0];
+    coercion_on_weak_in_const();
+    coercion_on_weak_as_cast();
+}
+
+fn coercion_on_weak_in_const() {
+    const X: Weak<i32> = Weak::new();
+    const Y: [Weak<dyn Send>; 0] = [X; 0];
+    let _ = Y;
+}
+
+fn coercion_on_weak_as_cast() {
+    const Y: X<'static, i32> = X { f: &0 };
+    // What happens in the following code is that
+    // a constant is explicitly coerced into
+    let _a: [X<'static, dyn Display>; 0] = [Y as X<'static, dyn Display>; 0];
+}
diff --git a/tests/ui/issues/issue-57162.rs b/tests/ui/coherence/trait-implementation-coherence-check-57162.rs
index 5e62d0eb010..a57e827ca8b 100644
--- a/tests/ui/issues/issue-57162.rs
+++ b/tests/ui/coherence/trait-implementation-coherence-check-57162.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/57162
 //@ check-pass
 
 trait Foo {}
diff --git a/tests/ui/command/command-current-dir.rs b/tests/ui/command/command-current-dir.rs
index e264cbe4d70..a6b51df5f17 100644
--- a/tests/ui/command/command-current-dir.rs
+++ b/tests/ui/command/command-current-dir.rs
@@ -2,6 +2,8 @@
 //@ no-prefer-dynamic We move the binary around, so do not depend dynamically on libstd
 //@ needs-subprocess
 //@ ignore-fuchsia Needs directory creation privilege
+//@ ignore-tvos `Command::current_dir` requires fork, which is prohibited
+//@ ignore-watchos `Command::current_dir` requires fork, which is prohibited
 
 use std::env;
 use std::fs;
diff --git a/tests/ui/command/command-exec.rs b/tests/ui/command/command-exec.rs
index 77336377e88..870f8b047b9 100644
--- a/tests/ui/command/command-exec.rs
+++ b/tests/ui/command/command-exec.rs
@@ -3,6 +3,8 @@
 //@ only-unix (this is a unix-specific test)
 //@ needs-subprocess
 //@ ignore-fuchsia no execvp syscall provided
+//@ ignore-tvos execvp is prohibited
+//@ ignore-watchos execvp is prohibited
 
 use std::env;
 use std::os::unix::process::CommandExt;
diff --git a/tests/ui/command/command-pre-exec.rs b/tests/ui/command/command-pre-exec.rs
index 7299f357bd0..a62ab0b5ed6 100644
--- a/tests/ui/command/command-pre-exec.rs
+++ b/tests/ui/command/command-pre-exec.rs
@@ -2,6 +2,8 @@
 //@ only-unix (this is a unix-specific test)
 //@ needs-subprocess
 //@ ignore-fuchsia no execvp syscall
+//@ ignore-tvos execvp is prohibited
+//@ ignore-watchos execvp is prohibited
 
 #![feature(rustc_private)]
 
diff --git a/tests/ui/command/command-uid-gid.rs b/tests/ui/command/command-uid-gid.rs
index f54a0f50708..ef0653eb2cb 100644
--- a/tests/ui/command/command-uid-gid.rs
+++ b/tests/ui/command/command-uid-gid.rs
@@ -1,6 +1,8 @@
 //@ run-pass
 //@ ignore-android
 //@ ignore-fuchsia no '/bin/sh', '/bin/ls'
+//@ ignore-tvos `Command::uid/gid` requires fork, which is prohibited
+//@ ignore-watchos `Command::uid/gid` requires fork, which is prohibited
 //@ needs-subprocess
 
 #![feature(rustc_private)]
diff --git a/tests/ui/compiletest-self-test/compile-flags-incremental.rs b/tests/ui/compiletest-self-test/compile-flags-incremental.rs
new file mode 100644
index 00000000000..62a1ad84d8f
--- /dev/null
+++ b/tests/ui/compiletest-self-test/compile-flags-incremental.rs
@@ -0,0 +1,17 @@
+//@ revisions: good bad bad-space
+//@ check-pass
+
+//@[bad] compile-flags: -Cincremental=true
+//@[bad] should-fail
+
+//@[bad-space] compile-flags:  -C  incremental=dir
+//@[bad-space] should-fail
+
+fn main() {}
+
+// Tests should not try to manually enable incremental compilation with
+// `-Cincremental`, because that typically results in stray directories being
+// created in the repository root.
+//
+// Instead, use the `//@ incremental` directive, which instructs compiletest
+// to handle the details of passing `-Cincremental` with a fresh directory.
diff --git a/tests/ui/compiletest-self-test/test-aux-bin.rs b/tests/ui/compiletest-self-test/test-aux-bin.rs
index c1c28e12b3b..9ac17e6e146 100644
--- a/tests/ui/compiletest-self-test/test-aux-bin.rs
+++ b/tests/ui/compiletest-self-test/test-aux-bin.rs
@@ -1,4 +1,5 @@
 //@ ignore-cross-compile because aux-bin does not yet support it
+//@ ignore-remote because aux-bin does not yet support it
 //@ aux-bin: print-it-works.rs
 //@ run-pass
 
diff --git a/tests/ui/const-generics/adt_const_params/auxiliary/unsized_const_param.rs b/tests/ui/const-generics/adt_const_params/auxiliary/unsized_const_param.rs
index e2ba459f8dd..1bfd7c34656 100644
--- a/tests/ui/const-generics/adt_const_params/auxiliary/unsized_const_param.rs
+++ b/tests/ui/const-generics/adt_const_params/auxiliary/unsized_const_param.rs
@@ -1,6 +1,6 @@
 #![feature(adt_const_params, unsized_const_params)]
 
-#[derive(std::marker::UnsizedConstParamTy, Eq, PartialEq)]
+#[derive(std::marker::ConstParamTy, Eq, PartialEq)]
 pub struct Foo([u8]);
 
 #[derive(std::marker::ConstParamTy, Eq, PartialEq)]
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs
index 35539193a27..d482e7fad06 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs
@@ -1,7 +1,7 @@
 #![allow(incomplete_features)]
 #![feature(adt_const_params, unsized_const_params)]
 
-fn check(_: impl std::marker::UnsizedConstParamTy) {}
+fn check(_: impl std::marker::ConstParamTy_) {}
 
 fn main() {
     check(main); //~ error: `fn() {main}` can't be used as a const parameter type
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_bad.stderr b/tests/ui/const-generics/adt_const_params/const_param_ty_bad.stderr
index c05584ef909..ff514f5608f 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_bad.stderr
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_bad.stderr
@@ -2,15 +2,15 @@ error[E0277]: `fn() {main}` can't be used as a const parameter type
   --> $DIR/const_param_ty_bad.rs:7:11
    |
 LL |     check(main);
-   |     ----- ^^^^ the trait `UnsizedConstParamTy` is not implemented for fn item `fn() {main}`
+   |     ----- ^^^^ the trait `ConstParamTy_` is not implemented for fn item `fn() {main}`
    |     |
    |     required by a bound introduced by this call
    |
 note: required by a bound in `check`
   --> $DIR/const_param_ty_bad.rs:4:18
    |
-LL | fn check(_: impl std::marker::UnsizedConstParamTy) {}
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
+LL | fn check(_: impl std::marker::ConstParamTy_) {}
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
 help: use parentheses to call this function
    |
 LL |     check(main());
@@ -24,12 +24,12 @@ LL |     check(|| {});
    |     |
    |     required by a bound introduced by this call
    |
-   = help: the trait `UnsizedConstParamTy` is not implemented for closure `{closure@$DIR/const_param_ty_bad.rs:8:11: 8:13}`
+   = help: the trait `ConstParamTy_` is not implemented for closure `{closure@$DIR/const_param_ty_bad.rs:8:11: 8:13}`
 note: required by a bound in `check`
   --> $DIR/const_param_ty_bad.rs:4:18
    |
-LL | fn check(_: impl std::marker::UnsizedConstParamTy) {}
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
+LL | fn check(_: impl std::marker::ConstParamTy_) {}
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
 help: use parentheses to call this closure
    |
 LL -     check(|| {});
@@ -40,15 +40,15 @@ error[E0277]: `fn()` can't be used as a const parameter type
   --> $DIR/const_param_ty_bad.rs:9:11
    |
 LL |     check(main as fn());
-   |     ----- ^^^^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `fn()`
+   |     ----- ^^^^^^^^^^^^ the trait `ConstParamTy_` is not implemented for `fn()`
    |     |
    |     required by a bound introduced by this call
    |
 note: required by a bound in `check`
   --> $DIR/const_param_ty_bad.rs:4:18
    |
-LL | fn check(_: impl std::marker::UnsizedConstParamTy) {}
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
+LL | fn check(_: impl std::marker::ConstParamTy_) {}
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
 help: use parentheses to call this function pointer
    |
 LL |     check(main as fn()());
@@ -58,16 +58,16 @@ error[E0277]: `&mut ()` can't be used as a const parameter type
   --> $DIR/const_param_ty_bad.rs:10:11
    |
 LL |     check(&mut ());
-   |     ----- ^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `&mut ()`
+   |     ----- ^^^^^^^ the trait `ConstParamTy_` is not implemented for `&mut ()`
    |     |
    |     required by a bound introduced by this call
    |
-   = note: `UnsizedConstParamTy` is implemented for `&()`, but not for `&mut ()`
+   = note: `ConstParamTy_` is implemented for `&()`, but not for `&mut ()`
 note: required by a bound in `check`
   --> $DIR/const_param_ty_bad.rs:4:18
    |
-LL | fn check(_: impl std::marker::UnsizedConstParamTy) {}
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
+LL | fn check(_: impl std::marker::ConstParamTy_) {}
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
 help: consider removing the leading `&`-reference
    |
 LL -     check(&mut ());
@@ -78,31 +78,31 @@ error[E0277]: `*mut ()` can't be used as a const parameter type
   --> $DIR/const_param_ty_bad.rs:11:11
    |
 LL |     check(&mut () as *mut ());
-   |     ----- ^^^^^^^^^^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `*mut ()`
+   |     ----- ^^^^^^^^^^^^^^^^^^ the trait `ConstParamTy_` is not implemented for `*mut ()`
    |     |
    |     required by a bound introduced by this call
    |
-   = help: the trait `UnsizedConstParamTy` is implemented for `()`
+   = help: the trait `ConstParamTy_` is implemented for `()`
 note: required by a bound in `check`
   --> $DIR/const_param_ty_bad.rs:4:18
    |
-LL | fn check(_: impl std::marker::UnsizedConstParamTy) {}
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
+LL | fn check(_: impl std::marker::ConstParamTy_) {}
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
 
 error[E0277]: `*const ()` can't be used as a const parameter type
   --> $DIR/const_param_ty_bad.rs:12:11
    |
 LL |     check(&() as *const ());
-   |     ----- ^^^^^^^^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `*const ()`
+   |     ----- ^^^^^^^^^^^^^^^^ the trait `ConstParamTy_` is not implemented for `*const ()`
    |     |
    |     required by a bound introduced by this call
    |
-   = help: the trait `UnsizedConstParamTy` is implemented for `()`
+   = help: the trait `ConstParamTy_` is implemented for `()`
 note: required by a bound in `check`
   --> $DIR/const_param_ty_bad.rs:4:18
    |
-LL | fn check(_: impl std::marker::UnsizedConstParamTy) {}
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
+LL | fn check(_: impl std::marker::ConstParamTy_) {}
+   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
 
 error: aborting due to 6 previous errors
 
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.rs
index 6a553c2e085..2fcf872c99a 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.rs
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.rs
@@ -1,12 +1,9 @@
 #![feature(adt_const_params, unsized_const_params)]
 #![allow(incomplete_features)]
 
-use std::marker::{ConstParamTy_, UnsizedConstParamTy};
+use std::marker::ConstParamTy_;
 
 fn foo(a: &dyn ConstParamTy_) {}
 //~^ ERROR: the trait `ConstParamTy_`
 
-fn bar(a: &dyn UnsizedConstParamTy) {}
-//~^ ERROR: the trait `UnsizedConstParamTy`
-
 fn main() {}
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.stderr b/tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.stderr
index c71ec24dda3..ce695ff66d5 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.stderr
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.stderr
@@ -15,23 +15,6 @@ LL - fn foo(a: &dyn ConstParamTy_) {}
 LL + fn foo(a: &impl ConstParamTy_) {}
    |
 
-error[E0038]: the trait `UnsizedConstParamTy` is not dyn compatible
-  --> $DIR/const_param_ty_dyn_compatibility.rs:9:16
-   |
-LL | fn bar(a: &dyn UnsizedConstParamTy) {}
-   |                ^^^^^^^^^^^^^^^^^^^ `UnsizedConstParamTy` is not dyn compatible
-   |
-note: for a trait to be dyn compatible it needs to allow building a vtable
-      for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
-  --> $SRC_DIR/core/src/cmp.rs:LL:COL
-   |
-   = note: the trait is not dyn compatible because it uses `Self` as a type parameter
-help: consider using an opaque type instead
-   |
-LL - fn bar(a: &dyn UnsizedConstParamTy) {}
-LL + fn bar(a: &impl UnsizedConstParamTy) {}
-   |
-
-error: aborting due to 2 previous errors
+error: aborting due to 1 previous error
 
 For more information about this error, try `rustc --explain E0038`.
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.rs
index 7ffdafa33e9..a86d74275de 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.rs
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.rs
@@ -4,7 +4,7 @@
 #[derive(PartialEq, Eq)]
 struct NotParam;
 
-fn check<T: std::marker::UnsizedConstParamTy + ?Sized>() {}
+fn check<T: std::marker::ConstParamTy_ + ?Sized>() {}
 
 fn main() {
     check::<&NotParam>(); //~ error: `NotParam` can't be used as a const parameter type
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.stderr b/tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.stderr
index 158e76630f3..ca2aa3adcb7 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.stderr
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.stderr
@@ -4,17 +4,17 @@ error[E0277]: `NotParam` can't be used as a const parameter type
 LL |     check::<&NotParam>();
    |             ^^^^^^^^^ unsatisfied trait bound
    |
-help: the trait `UnsizedConstParamTy` is not implemented for `NotParam`
+help: the trait `ConstParamTy_` is not implemented for `NotParam`
   --> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:5:1
    |
 LL | struct NotParam;
    | ^^^^^^^^^^^^^^^
-   = note: required for `&NotParam` to implement `UnsizedConstParamTy`
+   = note: required for `&NotParam` to implement `ConstParamTy_`
 note: required by a bound in `check`
   --> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:7:13
    |
-LL | fn check<T: std::marker::UnsizedConstParamTy + ?Sized>() {}
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
+LL | fn check<T: std::marker::ConstParamTy_ + ?Sized>() {}
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
 
 error[E0277]: `NotParam` can't be used as a const parameter type
   --> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:11:13
@@ -22,17 +22,17 @@ error[E0277]: `NotParam` can't be used as a const parameter type
 LL |     check::<[NotParam]>();
    |             ^^^^^^^^^^ unsatisfied trait bound
    |
-help: the trait `UnsizedConstParamTy` is not implemented for `NotParam`
+help: the trait `ConstParamTy_` is not implemented for `NotParam`
   --> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:5:1
    |
 LL | struct NotParam;
    | ^^^^^^^^^^^^^^^
-   = note: required for `[NotParam]` to implement `UnsizedConstParamTy`
+   = note: required for `[NotParam]` to implement `ConstParamTy_`
 note: required by a bound in `check`
   --> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:7:13
    |
-LL | fn check<T: std::marker::UnsizedConstParamTy + ?Sized>() {}
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
+LL | fn check<T: std::marker::ConstParamTy_ + ?Sized>() {}
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
 
 error[E0277]: `NotParam` can't be used as a const parameter type
   --> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:12:13
@@ -40,17 +40,17 @@ error[E0277]: `NotParam` can't be used as a const parameter type
 LL |     check::<[NotParam; 17]>();
    |             ^^^^^^^^^^^^^^ unsatisfied trait bound
    |
-help: the trait `UnsizedConstParamTy` is not implemented for `NotParam`
+help: the trait `ConstParamTy_` is not implemented for `NotParam`
   --> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:5:1
    |
 LL | struct NotParam;
    | ^^^^^^^^^^^^^^^
-   = note: required for `[NotParam; 17]` to implement `UnsizedConstParamTy`
+   = note: required for `[NotParam; 17]` to implement `ConstParamTy_`
 note: required by a bound in `check`
   --> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:7:13
    |
-LL | fn check<T: std::marker::UnsizedConstParamTy + ?Sized>() {}
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
+LL | fn check<T: std::marker::ConstParamTy_ + ?Sized>() {}
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_good.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_good.rs
index 98a8eb6ee95..24bbc5a9a23 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_good.rs
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_good.rs
@@ -3,7 +3,7 @@
 #![feature(adt_const_params, unsized_const_params)]
 #![allow(incomplete_features)]
 
-use std::marker::UnsizedConstParamTy;
+use std::marker::{ConstParamTy, ConstParamTy_};
 
 #[derive(PartialEq, Eq)]
 struct S<T> {
@@ -11,15 +11,15 @@ struct S<T> {
     gen: T,
 }
 
-impl<T: UnsizedConstParamTy> UnsizedConstParamTy for S<T> {}
+impl<T: ConstParamTy_> ConstParamTy_ for S<T> {}
 
-#[derive(PartialEq, Eq, UnsizedConstParamTy)]
+#[derive(PartialEq, Eq, ConstParamTy)]
 struct D<T> {
     field: u8,
     gen: T,
 }
 
-fn check<T: UnsizedConstParamTy + ?Sized>() {}
+fn check<T: ConstParamTy_ + ?Sized>() {}
 
 fn main() {
     check::<u8>();
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.rs
index 8b3d0546010..0614ea97b1a 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.rs
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.rs
@@ -7,10 +7,10 @@ struct NotParam;
 #[derive(PartialEq, Eq)]
 struct CantParam(NotParam);
 
-impl std::marker::UnsizedConstParamTy for CantParam {}
+impl std::marker::ConstParamTy_ for CantParam {}
 //~^ error: the trait `ConstParamTy_` cannot be implemented for this type
 
-#[derive(std::marker::UnsizedConstParamTy, Eq, PartialEq)]
+#[derive(std::marker::ConstParamTy, Eq, PartialEq)]
 //~^ error: the trait `ConstParamTy_` cannot be implemented for this type
 struct CantParamDerive(NotParam);
 
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.stderr b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.stderr
index a4e5736d834..fd1836802c4 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.stderr
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.stderr
@@ -1,17 +1,17 @@
 error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
-  --> $DIR/const_param_ty_impl_bad_field.rs:10:43
+  --> $DIR/const_param_ty_impl_bad_field.rs:10:37
    |
 LL | struct CantParam(NotParam);
    |                  -------- this field does not implement `ConstParamTy_`
 LL |
-LL | impl std::marker::UnsizedConstParamTy for CantParam {}
-   |                                           ^^^^^^^^^
+LL | impl std::marker::ConstParamTy_ for CantParam {}
+   |                                     ^^^^^^^^^
 
 error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
   --> $DIR/const_param_ty_impl_bad_field.rs:13:10
    |
-LL | #[derive(std::marker::UnsizedConstParamTy, Eq, PartialEq)]
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[derive(std::marker::ConstParamTy, Eq, PartialEq)]
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^
 LL |
 LL | struct CantParamDerive(NotParam);
    |                        -------- this field does not implement `ConstParamTy_`
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs
index e743b78fd13..a1c8eccfb09 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs
@@ -3,20 +3,20 @@
 
 #[derive(PartialEq, Eq)]
 struct ImplementsConstParamTy;
-impl std::marker::UnsizedConstParamTy for ImplementsConstParamTy {}
+impl std::marker::ConstParamTy_ for ImplementsConstParamTy {}
 
 struct CantParam(ImplementsConstParamTy);
 
-impl std::marker::UnsizedConstParamTy for CantParam {}
+impl std::marker::ConstParamTy_ for CantParam {}
 //~^ error: the type `CantParam` does not `#[derive(PartialEq)]`
 //~| ERROR the trait bound `CantParam: Eq` is not satisfied
 
-#[derive(std::marker::UnsizedConstParamTy)]
+#[derive(std::marker::ConstParamTy)]
 //~^ error: the type `CantParamDerive` does not `#[derive(PartialEq)]`
 //~| ERROR the trait bound `CantParamDerive: Eq` is not satisfied
 struct CantParamDerive(ImplementsConstParamTy);
 
-fn check<T: std::marker::UnsizedConstParamTy>() {}
+fn check<T: std::marker::ConstParamTy_>() {}
 
 fn main() {
     check::<ImplementsConstParamTy>();
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.stderr b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.stderr
index d3141381db8..c6b791ed967 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.stderr
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.stderr
@@ -1,10 +1,10 @@
 error[E0277]: the trait bound `CantParam: Eq` is not satisfied
-  --> $DIR/const_param_ty_impl_no_structural_eq.rs:10:43
+  --> $DIR/const_param_ty_impl_no_structural_eq.rs:10:37
    |
-LL | impl std::marker::UnsizedConstParamTy for CantParam {}
-   |                                           ^^^^^^^^^ the trait `Eq` is not implemented for `CantParam`
+LL | impl std::marker::ConstParamTy_ for CantParam {}
+   |                                     ^^^^^^^^^ the trait `Eq` is not implemented for `CantParam`
    |
-note: required by a bound in `UnsizedConstParamTy`
+note: required by a bound in `ConstParamTy_`
   --> $SRC_DIR/core/src/marker.rs:LL:COL
 help: consider annotating `CantParam` with `#[derive(Eq)]`
    |
@@ -13,26 +13,26 @@ LL | struct CantParam(ImplementsConstParamTy);
    |
 
 error[E0277]: the type `CantParam` does not `#[derive(PartialEq)]`
-  --> $DIR/const_param_ty_impl_no_structural_eq.rs:10:43
+  --> $DIR/const_param_ty_impl_no_structural_eq.rs:10:37
    |
-LL | impl std::marker::UnsizedConstParamTy for CantParam {}
-   |                                           ^^^^^^^^^ unsatisfied trait bound
+LL | impl std::marker::ConstParamTy_ for CantParam {}
+   |                                     ^^^^^^^^^ unsatisfied trait bound
    |
 help: the trait `StructuralPartialEq` is not implemented for `CantParam`
   --> $DIR/const_param_ty_impl_no_structural_eq.rs:8:1
    |
 LL | struct CantParam(ImplementsConstParamTy);
    | ^^^^^^^^^^^^^^^^
-note: required by a bound in `UnsizedConstParamTy`
+note: required by a bound in `ConstParamTy_`
   --> $SRC_DIR/core/src/marker.rs:LL:COL
 
 error[E0277]: the trait bound `CantParamDerive: Eq` is not satisfied
   --> $DIR/const_param_ty_impl_no_structural_eq.rs:14:10
    |
-LL | #[derive(std::marker::UnsizedConstParamTy)]
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `CantParamDerive`
+LL | #[derive(std::marker::ConstParamTy)]
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `CantParamDerive`
    |
-note: required by a bound in `UnsizedConstParamTy`
+note: required by a bound in `ConstParamTy_`
   --> $SRC_DIR/core/src/marker.rs:LL:COL
 help: consider annotating `CantParamDerive` with `#[derive(Eq)]`
    |
@@ -43,15 +43,15 @@ LL | struct CantParamDerive(ImplementsConstParamTy);
 error[E0277]: the type `CantParamDerive` does not `#[derive(PartialEq)]`
   --> $DIR/const_param_ty_impl_no_structural_eq.rs:14:10
    |
-LL | #[derive(std::marker::UnsizedConstParamTy)]
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
+LL | #[derive(std::marker::ConstParamTy)]
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
    |
 help: the trait `StructuralPartialEq` is not implemented for `CantParamDerive`
   --> $DIR/const_param_ty_impl_no_structural_eq.rs:17:1
    |
 LL | struct CantParamDerive(ImplementsConstParamTy);
    | ^^^^^^^^^^^^^^^^^^^^^^
-note: required by a bound in `UnsizedConstParamTy`
+note: required by a bound in `ConstParamTy_`
   --> $SRC_DIR/core/src/marker.rs:LL:COL
 
 error: aborting due to 4 previous errors
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.rs
index 236b3bc162a..0c9b12805f7 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.rs
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.rs
@@ -12,10 +12,10 @@ impl PartialEq for Union {
 }
 impl Eq for Union {}
 
-impl std::marker::UnsizedConstParamTy for Union {}
+impl std::marker::ConstParamTy_ for Union {}
 //~^ ERROR the trait `ConstParamTy` may not be implemented for this type
 
-#[derive(std::marker::UnsizedConstParamTy)]
+#[derive(std::marker::ConstParamTy)]
 //~^ ERROR this trait cannot be derived for unions
 union UnionDerive {
     a: u8,
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.stderr b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.stderr
index 837c289c924..cc2147b49ae 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.stderr
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_union.stderr
@@ -1,14 +1,14 @@
 error: this trait cannot be derived for unions
   --> $DIR/const_param_ty_impl_union.rs:18:10
    |
-LL | #[derive(std::marker::UnsizedConstParamTy)]
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[derive(std::marker::ConstParamTy)]
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: the trait `ConstParamTy` may not be implemented for this type
-  --> $DIR/const_param_ty_impl_union.rs:15:43
+  --> $DIR/const_param_ty_impl_union.rs:15:37
    |
-LL | impl std::marker::UnsizedConstParamTy for Union {}
-   |                                           ^^^^^ type is not a structure or enumeration
+LL | impl std::marker::ConstParamTy_ for Union {}
+   |                                     ^^^^^ type is not a structure or enumeration
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/const-generics/adt_const_params/nested_bad_const_param_ty.rs b/tests/ui/const-generics/adt_const_params/nested_bad_const_param_ty.rs
index 34ea143d254..d42ef90e1b1 100644
--- a/tests/ui/const-generics/adt_const_params/nested_bad_const_param_ty.rs
+++ b/tests/ui/const-generics/adt_const_params/nested_bad_const_param_ty.rs
@@ -5,17 +5,14 @@ use std::marker::ConstParamTy;
 
 #[derive(ConstParamTy)]
 //~^ ERROR the trait `ConstParamTy_` cannot be implemented for this ty
-//~| ERROR the trait `ConstParamTy_` cannot be implemented for this ty
 struct Foo([*const u8; 1]);
 
 #[derive(ConstParamTy)]
 //~^ ERROR the trait `ConstParamTy_` cannot be implemented for this ty
-//~| ERROR the trait `ConstParamTy_` cannot be implemented for this ty
 struct Foo2([*mut u8; 1]);
 
 #[derive(ConstParamTy)]
 //~^ ERROR the trait `ConstParamTy_` cannot be implemented for this ty
-//~| ERROR the trait `ConstParamTy_` cannot be implemented for this ty
 struct Foo3([fn(); 1]);
 
 fn main() {}
diff --git a/tests/ui/const-generics/adt_const_params/nested_bad_const_param_ty.stderr b/tests/ui/const-generics/adt_const_params/nested_bad_const_param_ty.stderr
index 6b8d2394a86..442ec6b96ce 100644
--- a/tests/ui/const-generics/adt_const_params/nested_bad_const_param_ty.stderr
+++ b/tests/ui/const-generics/adt_const_params/nested_bad_const_param_ty.stderr
@@ -3,91 +3,46 @@ error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
    |
 LL | #[derive(ConstParamTy)]
    |          ^^^^^^^^^^^^
-...
+LL |
 LL | struct Foo([*const u8; 1]);
    |            -------------- this field does not implement `ConstParamTy_`
    |
 note: the `ConstParamTy_` impl for `[*const u8; 1]` requires that `*const u8: ConstParamTy_`
-  --> $DIR/nested_bad_const_param_ty.rs:9:12
+  --> $DIR/nested_bad_const_param_ty.rs:8:12
    |
 LL | struct Foo([*const u8; 1]);
    |            ^^^^^^^^^^^^^^
 
 error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
-  --> $DIR/nested_bad_const_param_ty.rs:11:10
+  --> $DIR/nested_bad_const_param_ty.rs:10:10
    |
 LL | #[derive(ConstParamTy)]
    |          ^^^^^^^^^^^^
-...
+LL |
 LL | struct Foo2([*mut u8; 1]);
    |             ------------ this field does not implement `ConstParamTy_`
    |
 note: the `ConstParamTy_` impl for `[*mut u8; 1]` requires that `*mut u8: ConstParamTy_`
-  --> $DIR/nested_bad_const_param_ty.rs:14:13
+  --> $DIR/nested_bad_const_param_ty.rs:12:13
    |
 LL | struct Foo2([*mut u8; 1]);
    |             ^^^^^^^^^^^^
 
 error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
-  --> $DIR/nested_bad_const_param_ty.rs:16:10
+  --> $DIR/nested_bad_const_param_ty.rs:14:10
    |
 LL | #[derive(ConstParamTy)]
    |          ^^^^^^^^^^^^
-...
+LL |
 LL | struct Foo3([fn(); 1]);
    |             --------- this field does not implement `ConstParamTy_`
    |
 note: the `ConstParamTy_` impl for `[fn(); 1]` requires that `fn(): ConstParamTy_`
-  --> $DIR/nested_bad_const_param_ty.rs:19:13
+  --> $DIR/nested_bad_const_param_ty.rs:16:13
    |
 LL | struct Foo3([fn(); 1]);
    |             ^^^^^^^^^
 
-error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
-  --> $DIR/nested_bad_const_param_ty.rs:6:10
-   |
-LL | #[derive(ConstParamTy)]
-   |          ^^^^^^^^^^^^
-...
-LL | struct Foo([*const u8; 1]);
-   |            -------------- this field does not implement `ConstParamTy_`
-   |
-note: the `ConstParamTy_` impl for `[*const u8; 1]` requires that `*const u8: UnsizedConstParamTy`
-  --> $DIR/nested_bad_const_param_ty.rs:9:12
-   |
-LL | struct Foo([*const u8; 1]);
-   |            ^^^^^^^^^^^^^^
-
-error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
-  --> $DIR/nested_bad_const_param_ty.rs:11:10
-   |
-LL | #[derive(ConstParamTy)]
-   |          ^^^^^^^^^^^^
-...
-LL | struct Foo2([*mut u8; 1]);
-   |             ------------ this field does not implement `ConstParamTy_`
-   |
-note: the `ConstParamTy_` impl for `[*mut u8; 1]` requires that `*mut u8: UnsizedConstParamTy`
-  --> $DIR/nested_bad_const_param_ty.rs:14:13
-   |
-LL | struct Foo2([*mut u8; 1]);
-   |             ^^^^^^^^^^^^
-
-error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
-  --> $DIR/nested_bad_const_param_ty.rs:16:10
-   |
-LL | #[derive(ConstParamTy)]
-   |          ^^^^^^^^^^^^
-...
-LL | struct Foo3([fn(); 1]);
-   |             --------- this field does not implement `ConstParamTy_`
-   |
-note: the `ConstParamTy_` impl for `[fn(); 1]` requires that `fn(): UnsizedConstParamTy`
-  --> $DIR/nested_bad_const_param_ty.rs:19:13
-   |
-LL | struct Foo3([fn(); 1]);
-   |             ^^^^^^^^^
-
-error: aborting due to 6 previous errors
+error: aborting due to 3 previous errors
 
 For more information about this error, try `rustc --explain E0204`.
diff --git a/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.stderr b/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.stderr
index b13f76eabad..72dfda50ea5 100644
--- a/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.stderr
+++ b/tests/ui/const-generics/adt_const_params/non_valtreeable_const_arg-2.stderr
@@ -9,11 +9,13 @@ help: you might be missing a const parameter
 LL | impl<const bar: /* Type */> Wrapper<{ bar() }> {
    |     +++++++++++++++++++++++
 
-error[E0741]: using function pointers as const generic parameters is forbidden
+error: using function pointers as const generic parameters is forbidden
   --> $DIR/non_valtreeable_const_arg-2.rs:8:25
    |
 LL | struct Wrapper<const F: fn()>;
    |                         ^^^^
+   |
+   = note: the only supported types are integers, `bool`, and `char`
 
 error[E0599]: the function or associated item `call` exists for struct `Wrapper<function>`, but its trait bounds were not satisfied
   --> $DIR/non_valtreeable_const_arg-2.rs:17:26
@@ -35,5 +37,5 @@ note: the trait `Fn` must be implemented
 
 error: aborting due to 3 previous errors
 
-Some errors have detailed explanations: E0425, E0599, E0741.
+Some errors have detailed explanations: E0425, E0599.
 For more information about an error, try `rustc --explain E0425`.
diff --git a/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.rs b/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.rs
index a1ee1c4cdd5..937acf2e6bb 100644
--- a/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.rs
+++ b/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.rs
@@ -1,11 +1,11 @@
 #![feature(adt_const_params, unsized_const_params)]
 #![allow(incomplete_features)]
 
-use std::marker::UnsizedConstParamTy;
+use std::marker::ConstParamTy_;
 
 struct Foo;
 
-impl UnsizedConstParamTy for &'static Foo {}
+impl ConstParamTy_ for &'static Foo {}
 //~^ ERROR: the trait `ConstParamTy_` cannot be implemented for this type
 
 fn main() {}
diff --git a/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.stderr b/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.stderr
index 5ca8e6c7516..b977cf5d44e 100644
--- a/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.stderr
+++ b/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-1.stderr
@@ -1,8 +1,8 @@
 error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
-  --> $DIR/reference_pointee_is_const_param-1.rs:8:30
+  --> $DIR/reference_pointee_is_const_param-1.rs:8:24
    |
-LL | impl UnsizedConstParamTy for &'static Foo {}
-   |                              ^^^^^^^^^^^^ this field does not implement `ConstParamTy_`
+LL | impl ConstParamTy_ for &'static Foo {}
+   |                        ^^^^^^^^^^^^ this field does not implement `ConstParamTy_`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.rs b/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.rs
index ac1b522f469..605fed26c9c 100644
--- a/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.rs
+++ b/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.rs
@@ -3,12 +3,12 @@
 
 // Regression test for #119299
 
-use std::marker::UnsizedConstParamTy;
+use std::marker::ConstParamTy_;
 
 #[derive(Eq, PartialEq)]
 struct ConstStrU(*const u8, usize);
 
-impl UnsizedConstParamTy for &'static ConstStrU {}
+impl ConstParamTy_ for &'static ConstStrU {}
 //~^ ERROR: the trait `ConstParamTy_` cannot be implemented for this type
 
 impl ConstStrU {
diff --git a/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.stderr b/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.stderr
index 5e5f6cc642d..0fe92f253a0 100644
--- a/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.stderr
+++ b/tests/ui/const-generics/adt_const_params/reference_pointee_is_const_param-2.stderr
@@ -1,8 +1,8 @@
 error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
-  --> $DIR/reference_pointee_is_const_param-2.rs:11:30
+  --> $DIR/reference_pointee_is_const_param-2.rs:11:24
    |
-LL | impl UnsizedConstParamTy for &'static ConstStrU {}
-   |                              ^^^^^^^^^^^^^^^^^^ this field does not implement `ConstParamTy_`
+LL | impl ConstParamTy_ for &'static ConstStrU {}
+   |                        ^^^^^^^^^^^^^^^^^^ this field does not implement `ConstParamTy_`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.rs b/tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.rs
index b0934508399..0fe86adb291 100644
--- a/tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.rs
+++ b/tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.rs
@@ -1,11 +1,11 @@
 #![feature(adt_const_params, unsized_const_params)]
 #![allow(incomplete_features)]
 
-use std::marker::UnsizedConstParamTy;
+use std::marker::ConstParamTy_;
 
 trait Trait {}
 
-impl UnsizedConstParamTy for dyn Trait {}
+impl ConstParamTy_ for dyn Trait {}
 //~^ ERROR: the trait `ConstParamTy` may not be implemented for this type
 
 fn foo<const N: dyn Trait>() {}
diff --git a/tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.stderr b/tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.stderr
index 9933ba6e335..67c6314e297 100644
--- a/tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.stderr
+++ b/tests/ui/const-generics/adt_const_params/trait_objects_as_a_const_generic.stderr
@@ -1,8 +1,8 @@
 error: the trait `ConstParamTy` may not be implemented for this type
-  --> $DIR/trait_objects_as_a_const_generic.rs:8:30
+  --> $DIR/trait_objects_as_a_const_generic.rs:8:24
    |
-LL | impl UnsizedConstParamTy for dyn Trait {}
-   |                              ^^^^^^^^^ type is not a structure or enumeration
+LL | impl ConstParamTy_ for dyn Trait {}
+   |                        ^^^^^^^^^ type is not a structure or enumeration
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/const-generics/adt_const_params/unsized_field-1.rs b/tests/ui/const-generics/adt_const_params/unsized_field-1.rs
index f6e5bd6e355..5db031cb900 100644
--- a/tests/ui/const-generics/adt_const_params/unsized_field-1.rs
+++ b/tests/ui/const-generics/adt_const_params/unsized_field-1.rs
@@ -14,7 +14,10 @@ struct A([u8]);
 struct B(&'static [u8]);
 
 #[derive(ConstParamTy, Eq, PartialEq)]
-//~^ ERROR: the trait `ConstParamTy_` cannot be implemented for this type
 struct C(unsized_const_param::Foo);
 
+#[derive(std::marker::ConstParamTy, Eq, PartialEq)]
+//~^ ERROR: the trait `ConstParamTy_` cannot be implemented for this type
+struct D(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>);
+
 fn main() {}
diff --git a/tests/ui/const-generics/adt_const_params/unsized_field-1.stderr b/tests/ui/const-generics/adt_const_params/unsized_field-1.stderr
index 3089b30bd76..134dbba0d63 100644
--- a/tests/ui/const-generics/adt_const_params/unsized_field-1.stderr
+++ b/tests/ui/const-generics/adt_const_params/unsized_field-1.stderr
@@ -6,6 +6,12 @@ LL | #[derive(ConstParamTy, Eq, PartialEq)]
 LL |
 LL | struct A([u8]);
    |          ---- this field does not implement `ConstParamTy_`
+   |
+note: the `ConstParamTy_` impl for `[u8]` requires that `feature(unsized_const_params) is enabled`
+  --> $DIR/unsized_field-1.rs:10:10
+   |
+LL | struct A([u8]);
+   |          ^^^^
 
 error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
   --> $DIR/unsized_field-1.rs:12:10
@@ -15,15 +21,27 @@ LL | #[derive(ConstParamTy, Eq, PartialEq)]
 LL |
 LL | struct B(&'static [u8]);
    |          ------------- this field does not implement `ConstParamTy_`
+   |
+note: the `ConstParamTy_` impl for `&'static [u8]` requires that `feature(unsized_const_params) is enabled`
+  --> $DIR/unsized_field-1.rs:14:10
+   |
+LL | struct B(&'static [u8]);
+   |          ^^^^^^^^^^^^^
 
 error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
-  --> $DIR/unsized_field-1.rs:16:10
+  --> $DIR/unsized_field-1.rs:19:10
    |
-LL | #[derive(ConstParamTy, Eq, PartialEq)]
-   |          ^^^^^^^^^^^^
+LL | #[derive(std::marker::ConstParamTy, Eq, PartialEq)]
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^
 LL |
-LL | struct C(unsized_const_param::Foo);
-   |          ------------------------ this field does not implement `ConstParamTy_`
+LL | struct D(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>);
+   |          ---------------------------------------------------------- this field does not implement `ConstParamTy_`
+   |
+note: the `ConstParamTy_` impl for `GenericNotUnsizedParam<&'static [u8]>` requires that `feature(unsized_const_params) is enabled`
+  --> $DIR/unsized_field-1.rs:21:10
+   |
+LL | struct D(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>);
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/const-generics/adt_const_params/unsized_field-2.rs b/tests/ui/const-generics/adt_const_params/unsized_field-2.rs
deleted file mode 100644
index e4a3a481b4e..00000000000
--- a/tests/ui/const-generics/adt_const_params/unsized_field-2.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-//@ aux-build:unsized_const_param.rs
-#![feature(adt_const_params, unsized_const_params)]
-//~^ WARN: the feature `unsized_const_params` is incomplete
-
-extern crate unsized_const_param;
-
-#[derive(std::marker::ConstParamTy, Eq, PartialEq)]
-//~^ ERROR: the trait `ConstParamTy_` cannot be implemented for this type
-struct A(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>);
-
-#[derive(std::marker::UnsizedConstParamTy, Eq, PartialEq)]
-struct B(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>);
-
-fn main() {}
diff --git a/tests/ui/const-generics/adt_const_params/unsized_field-2.stderr b/tests/ui/const-generics/adt_const_params/unsized_field-2.stderr
deleted file mode 100644
index cef70ca0463..00000000000
--- a/tests/ui/const-generics/adt_const_params/unsized_field-2.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-warning: the feature `unsized_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
-  --> $DIR/unsized_field-2.rs:2:30
-   |
-LL | #![feature(adt_const_params, unsized_const_params)]
-   |                              ^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
-   = note: `#[warn(incomplete_features)]` on by default
-
-error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
-  --> $DIR/unsized_field-2.rs:7:10
-   |
-LL | #[derive(std::marker::ConstParamTy, Eq, PartialEq)]
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^
-LL |
-LL | struct A(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>);
-   |          ---------------------------------------------------------- this field does not implement `ConstParamTy_`
-   |
-note: the `ConstParamTy_` impl for `GenericNotUnsizedParam<&'static [u8]>` requires that `&'static [u8]: ConstParamTy_`
-  --> $DIR/unsized_field-2.rs:9:10
-   |
-LL | struct A(unsized_const_param::GenericNotUnsizedParam<&'static [u8]>);
-   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 1 previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0204`.
diff --git a/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.rs b/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.rs
index 311f507d3c7..500e8e22b0e 100644
--- a/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.rs
+++ b/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.rs
@@ -7,7 +7,6 @@ use std::marker::ConstParamTy;
 
 #[derive(Debug, PartialEq, Eq, ConstParamTy)]
 //~^ ERROR the trait `ConstParamTy_`
-//~| ERROR the trait `ConstParamTy_`
 struct Foo {
     nested: &'static Bar<dyn std::fmt::Debug>,
     //~^ ERROR the size for values
diff --git a/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.stderr b/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.stderr
index 992a27c1c0e..d4aeb91999c 100644
--- a/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.stderr
+++ b/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.stderr
@@ -1,17 +1,17 @@
 error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:12:13
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:11:13
    |
 LL |     nested: &'static Bar<dyn std::fmt::Debug>,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
 note: required by an implicit `Sized` bound in `Bar`
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:21:12
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:20:12
    |
 LL | struct Bar<T>(T);
    |            ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
 help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:21:12
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:20:12
    |
 LL | struct Bar<T>(T);
    |            ^  - ...if indirection were used here: `Box<T>`
@@ -26,34 +26,25 @@ LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
 ...
 LL |     nested: &'static Bar<dyn std::fmt::Debug>,
    |     ----------------------------------------- this field does not implement `ConstParamTy_`
-
-error[E0204]: the trait `ConstParamTy_` cannot be implemented for this type
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:8:32
    |
-LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
-   |                                ^^^^^^^^^^^^
-...
-LL |     nested: &'static Bar<dyn std::fmt::Debug>,
-   |     ----------------------------------------- this field does not implement `ConstParamTy_`
-   |
-note: the `ConstParamTy_` impl for `&'static Bar<(dyn Debug + 'static)>` requires that `(dyn Debug + 'static): Eq`
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:12:13
+note: the `ConstParamTy_` impl for `&'static Bar<(dyn Debug + 'static)>` requires that `(dyn Debug + 'static): ConstParamTy_`
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:11:13
    |
 LL |     nested: &'static Bar<dyn std::fmt::Debug>,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: the `ConstParamTy_` impl for `&'static Bar<(dyn Debug + 'static)>` requires that `(dyn Debug + 'static): Sized`
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:12:13
+note: the `ConstParamTy_` impl for `&'static Bar<(dyn Debug + 'static)>` requires that `(dyn Debug + 'static): Eq`
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:11:13
    |
 LL |     nested: &'static Bar<dyn std::fmt::Debug>,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: the `ConstParamTy_` impl for `&'static Bar<(dyn Debug + 'static)>` requires that `(dyn Debug + 'static): UnsizedConstParamTy`
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:12:13
+note: the `ConstParamTy_` impl for `&'static Bar<(dyn Debug + 'static)>` requires that `(dyn Debug + 'static): Sized`
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:11:13
    |
 LL |     nested: &'static Bar<dyn std::fmt::Debug>,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:12:5
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:11:5
    |
 LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
    |          ----- in this derive macro expansion
@@ -64,7 +55,7 @@ LL |     nested: &'static Bar<dyn std::fmt::Debug>,
    = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
    = help: the trait `Debug` is implemented for `Bar<T>`
 note: required for `Bar<(dyn Debug + 'static)>` to implement `Debug`
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:20:10
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:19:10
    |
 LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
    |          ^^^^^
@@ -75,7 +66,7 @@ LL | struct Bar<T>(T);
    = note: required for the cast from `&&&'static Bar<(dyn Debug + 'static)>` to `&dyn Debug`
 
 error[E0369]: binary operation `==` cannot be applied to type `&Bar<dyn Debug>`
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:12:5
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:11:5
    |
 LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
    |                 --------- in this derive macro expansion
@@ -84,7 +75,7 @@ LL |     nested: &'static Bar<dyn std::fmt::Debug>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0277]: the trait bound `dyn Debug: Eq` is not satisfied
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:12:5
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:11:5
    |
 LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
    |                            -- in this derive macro expansion
@@ -94,7 +85,7 @@ LL |     nested: &'static Bar<dyn std::fmt::Debug>,
    |
    = help: the trait `Eq` is implemented for `Bar<T>`
 note: required for `Bar<dyn Debug>` to implement `Eq`
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:20:28
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:19:28
    |
 LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
    |                            ^^ unsatisfied trait bound introduced in this `derive` macro
@@ -104,7 +95,7 @@ note: required by a bound in `AssertParamIsEq`
   --> $SRC_DIR/core/src/cmp.rs:LL:COL
 
 error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:12:5
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:11:5
    |
 LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
    |                            -- in this derive macro expansion
@@ -114,12 +105,12 @@ LL |     nested: &'static Bar<dyn std::fmt::Debug>,
    |
    = help: the trait `Sized` is not implemented for `dyn Debug`
 note: required by an implicit `Sized` bound in `Bar`
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:21:12
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:20:12
    |
 LL | struct Bar<T>(T);
    |            ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
 help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:21:12
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:20:12
    |
 LL | struct Bar<T>(T);
    |            ^  - ...if indirection were used here: `Box<T>`
@@ -127,26 +118,26 @@ LL | struct Bar<T>(T);
    |            this could be changed to `T: ?Sized`...
 
 error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:26:33
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:25:33
    |
 LL |     let x: Test<{ Foo { nested: &Bar(4) } }> = Test;
    |                                 ^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
 note: required by an implicit `Sized` bound in `Bar`
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:21:12
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:20:12
    |
 LL | struct Bar<T>(T);
    |            ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
 help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
-  --> $DIR/unsizing-wfcheck-issue-126272.rs:21:12
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:20:12
    |
 LL | struct Bar<T>(T);
    |            ^  - ...if indirection were used here: `Box<T>`
    |            |
    |            this could be changed to `T: ?Sized`...
 
-error: aborting due to 8 previous errors
+error: aborting due to 7 previous errors
 
 Some errors have detailed explanations: E0204, E0277, E0369.
 For more information about an error, try `rustc --explain E0204`.
diff --git a/tests/ui/const-generics/const-param-with-additional-obligations.rs b/tests/ui/const-generics/const-param-with-additional-obligations.rs
index 98097e86c7d..5110f95d5bf 100644
--- a/tests/ui/const-generics/const-param-with-additional-obligations.rs
+++ b/tests/ui/const-generics/const-param-with-additional-obligations.rs
@@ -1,14 +1,14 @@
 #![feature(adt_const_params, unsized_const_params)]
 #![allow(incomplete_features)]
 
-use std::marker::UnsizedConstParamTy;
+use std::marker::ConstParamTy_;
 
 #[derive(Eq, PartialEq)]
 struct Foo<T>(T);
 
 trait Other {}
 
-impl<T> UnsizedConstParamTy for Foo<T> where T: Other + UnsizedConstParamTy {}
+impl<T> ConstParamTy_ for Foo<T> where T: Other + ConstParamTy_ {}
 
 fn foo<const N: Foo<u8>>() {}
 //~^ ERROR `Foo<u8>` must implement `ConstParamTy` to be used as the type of a const generic parameter
diff --git a/tests/ui/const-generics/forbid-non-structural_match-types.stderr b/tests/ui/const-generics/forbid-non-structural_match-types.stderr
index 8ef629329f1..94afded9469 100644
--- a/tests/ui/const-generics/forbid-non-structural_match-types.stderr
+++ b/tests/ui/const-generics/forbid-non-structural_match-types.stderr
@@ -6,8 +6,8 @@ LL | struct D<const X: C>;
    |
 help: add `#[derive(ConstParamTy, PartialEq, Eq)]` to the struct
    |
-LL - struct C;
 LL + #[derive(ConstParamTy, PartialEq, Eq)]
+LL | struct C;
    |
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/const-generics/generic_arg_infer/in-signature.stderr b/tests/ui/const-generics/generic_arg_infer/in-signature.stderr
index b6f2662a939..d7a7ab52c83 100644
--- a/tests/ui/const-generics/generic_arg_infer/in-signature.stderr
+++ b/tests/ui/const-generics/generic_arg_infer/in-signature.stderr
@@ -2,29 +2,39 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/in-signature.rs:6:21
    |
 LL | fn arr_fn() -> [u8; _] {
-   |                -----^-
-   |                |    |
-   |                |    not allowed in type signatures
-   |                help: replace with the correct return type: `[u8; 3]`
+   |                     ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - fn arr_fn() -> [u8; _] {
+LL + fn arr_fn() -> [u8; 3] {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/in-signature.rs:11:24
    |
 LL | fn ty_fn() -> Bar<i32, _> {
-   |               ---------^-
-   |               |        |
-   |               |        not allowed in type signatures
-   |               help: replace with the correct return type: `Bar<i32, 3>`
+   |                        ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - fn ty_fn() -> Bar<i32, _> {
+LL + fn ty_fn() -> Bar<i32, 3> {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/in-signature.rs:16:25
    |
 LL | fn ty_fn_mixed() -> Bar<_, _> {
-   |                     ----^--^-
-   |                     |   |  |
-   |                     |   |  not allowed in type signatures
-   |                     |   not allowed in type signatures
-   |                     help: replace with the correct return type: `Bar<i32, 3>`
+   |                         ^  ^ not allowed in type signatures
+   |                         |
+   |                         not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - fn ty_fn_mixed() -> Bar<_, _> {
+LL + fn ty_fn_mixed() -> Bar<i32, 3> {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
   --> $DIR/in-signature.rs:21:20
diff --git a/tests/ui/const-generics/generic_arg_infer/parend_infer.rs b/tests/ui/const-generics/generic_arg_infer/paren_infer.rs
index 9d7df8016cb..869683b7056 100644
--- a/tests/ui/const-generics/generic_arg_infer/parend_infer.rs
+++ b/tests/ui/const-generics/generic_arg_infer/paren_infer.rs
@@ -1,4 +1,5 @@
 //@ check-pass
+//@ reference: items.generics.const.inferred
 
 struct Foo<const N: usize>;
 
diff --git a/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.rs b/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.rs
index 478fa3706e8..9af351ec59f 100644
--- a/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.rs
+++ b/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.rs
@@ -11,7 +11,6 @@ where
 {
     fn unimplemented(self, _: &Foo) -> Self::Output {
         //~^ ERROR method `unimplemented` is not a member of trait `std::ops::Add`
-        //~| ERROR type annotations needed
         loop {}
     }
 }
diff --git a/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.stderr b/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.stderr
index 29bbd23a469..37eb895f9a8 100644
--- a/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/post-analysis-user-facing-param-env.stderr
@@ -3,7 +3,6 @@ error[E0407]: method `unimplemented` is not a member of trait `std::ops::Add`
    |
 LL | /     fn unimplemented(self, _: &Foo) -> Self::Output {
 LL | |
-LL | |
 LL | |         loop {}
 LL | |     }
    | |_____^ not a member of trait `std::ops::Add`
@@ -39,21 +38,7 @@ LL | impl<'a, const NUM: usize> std::ops::Add<&'a Foo> for Foo
    = note: expressions using a const parameter must map each value to a distinct output value
    = note: proving the result of expressions other than the parameter are unique is not supported
 
-error[E0284]: type annotations needed
-  --> $DIR/post-analysis-user-facing-param-env.rs:12:40
-   |
-LL |     fn unimplemented(self, _: &Foo) -> Self::Output {
-   |                                        ^^^^^^^^^^^^ cannot infer the value of const parameter `NUM`
-   |
-note: required for `Foo` to implement `Add<&'a Foo>`
-  --> $DIR/post-analysis-user-facing-param-env.rs:6:28
-   |
-LL | impl<'a, const NUM: usize> std::ops::Add<&'a Foo> for Foo
-   |          ----------------  ^^^^^^^^^^^^^^^^^^^^^^     ^^^
-   |          |
-   |          unsatisfied trait bound introduced here
-
-error: aborting due to 4 previous errors; 1 warning emitted
+error: aborting due to 3 previous errors; 1 warning emitted
 
-Some errors have detailed explanations: E0046, E0207, E0284, E0407.
+Some errors have detailed explanations: E0046, E0207, E0407.
 For more information about an error, try `rustc --explain E0046`.
diff --git a/tests/ui/const-generics/generic_const_parameter_types/no_const_param_ty_bound.stderr b/tests/ui/const-generics/generic_const_parameter_types/no_const_param_ty_bound.stderr
index 4ea323f4a5c..1eacc28b262 100644
--- a/tests/ui/const-generics/generic_const_parameter_types/no_const_param_ty_bound.stderr
+++ b/tests/ui/const-generics/generic_const_parameter_types/no_const_param_ty_bound.stderr
@@ -4,7 +4,7 @@ error[E0741]: `[T; N]` can't be used as a const parameter type
 LL | struct UsesType<T, const N: usize, const M: [T; N]>(PhantomData<T>);
    |                                             ^^^^^^
    |
-   = note: `T` must implement `UnsizedConstParamTy`, but it does not
+   = note: `T` must implement `ConstParamTy_`, but it does not
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/const-generics/issue-66451.rs b/tests/ui/const-generics/issue-66451.rs
index 0b8693e0e67..9ce7658586a 100644
--- a/tests/ui/const-generics/issue-66451.rs
+++ b/tests/ui/const-generics/issue-66451.rs
@@ -1,15 +1,15 @@
 #![feature(adt_const_params, unsized_const_params)]
 #![allow(incomplete_features)]
 
-use std::marker::UnsizedConstParamTy;
+use std::marker::ConstParamTy;
 
-#[derive(Debug, PartialEq, Eq, UnsizedConstParamTy)]
+#[derive(Debug, PartialEq, Eq, ConstParamTy)]
 struct Foo {
     value: i32,
     nested: &'static Bar<i32>,
 }
 
-#[derive(Debug, PartialEq, Eq, UnsizedConstParamTy)]
+#[derive(Debug, PartialEq, Eq, ConstParamTy)]
 struct Bar<T>(T);
 
 struct Test<const F: Foo>;
diff --git a/tests/ui/const-generics/issue-80471.stderr b/tests/ui/const-generics/issue-80471.stderr
index 8cf3d68e5d6..fff2eb53cf1 100644
--- a/tests/ui/const-generics/issue-80471.stderr
+++ b/tests/ui/const-generics/issue-80471.stderr
@@ -4,10 +4,10 @@ error[E0741]: `Nat` must implement `ConstParamTy` to be used as the type of a co
 LL | fn foo<const N: Nat>() {}
    |                 ^^^
    |
-help: add `#[derive(ConstParamTy)]` to the struct
+help: add `#[derive(ConstParamTy)]` to the enum
    |
-LL - enum Nat {
 LL + #[derive(ConstParamTy)]
+LL | enum Nat {
    |
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr b/tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr
index 8ea96428deb..1301ca92f01 100644
--- a/tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr
+++ b/tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr
@@ -4,7 +4,7 @@ error[E0741]: `&'static (dyn A + 'static)` can't be used as a const parameter ty
 LL | fn test<const T: &'static dyn A>() {
    |                  ^^^^^^^^^^^^^^
    |
-   = note: `(dyn A + 'static)` must implement `UnsizedConstParamTy`, but it does not
+   = note: `(dyn A + 'static)` must implement `ConstParamTy_`, but it does not
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/const-generics/issues/issue-97278.stderr b/tests/ui/const-generics/issues/issue-97278.stderr
index 4894ddb7b8d..21a5fc94032 100644
--- a/tests/ui/const-generics/issues/issue-97278.stderr
+++ b/tests/ui/const-generics/issues/issue-97278.stderr
@@ -4,10 +4,10 @@ error[E0741]: `Bar` must implement `ConstParamTy` to be used as the type of a co
 LL | fn test<const BAR: Bar>() {}
    |                    ^^^
    |
-help: add `#[derive(ConstParamTy)]` to the struct
+help: add `#[derive(ConstParamTy)]` to the enum
    |
-LL - enum Bar {
 LL + #[derive(ConstParamTy)]
+LL | enum Bar {
    |
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/const-generics/slice-const-param-mismatch.adt_const_params.stderr b/tests/ui/const-generics/slice-const-param-mismatch.adt_const_params.stderr
index bcb2bd255da..d970b12df6a 100644
--- a/tests/ui/const-generics/slice-const-param-mismatch.adt_const_params.stderr
+++ b/tests/ui/const-generics/slice-const-param-mismatch.adt_const_params.stderr
@@ -1,14 +1,22 @@
-error[E0741]: `&'static str` can't be used as a const parameter type
-  --> $DIR/slice-const-param-mismatch.rs:8:29
+error[E0658]: use of unstable library feature `unsized_const_params`
+  --> $DIR/slice-const-param-mismatch.rs:8:20
    |
 LL | struct ConstString<const T: &'static str>;
-   |                             ^^^^^^^^^^^^
+   |                    ^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: add `#![feature(unsized_const_params)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+   = note: required for `&'static str` to implement `ConstParamTy_`
 
-error[E0741]: `&'static [u8]` can't be used as a const parameter type
-  --> $DIR/slice-const-param-mismatch.rs:11:28
+error[E0658]: use of unstable library feature `unsized_const_params`
+  --> $DIR/slice-const-param-mismatch.rs:11:19
    |
 LL | struct ConstBytes<const T: &'static [u8]>;
-   |                            ^^^^^^^^^^^^^
+   |                   ^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: add `#![feature(unsized_const_params)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+   = note: required for `&'static [u8]` to implement `ConstParamTy_`
 
 error[E0308]: mismatched types
   --> $DIR/slice-const-param-mismatch.rs:17:35
@@ -45,5 +53,5 @@ LL |     let _: ConstBytes<b"AAA"> = ConstBytes::<b"BBB">;
 
 error: aborting due to 5 previous errors
 
-Some errors have detailed explanations: E0308, E0741.
+Some errors have detailed explanations: E0308, E0658.
 For more information about an error, try `rustc --explain E0308`.
diff --git a/tests/ui/const-generics/slice-const-param.rs b/tests/ui/const-generics/slice-const-param.rs
index 1c5088b5283..8b5e934149e 100644
--- a/tests/ui/const-generics/slice-const-param.rs
+++ b/tests/ui/const-generics/slice-const-param.rs
@@ -12,7 +12,7 @@ pub fn function_with_bytes<const BYTES: &'static [u8]>() -> &'static [u8] {
 }
 
 // Also check the codepaths for custom DST
-#[derive(std::marker::UnsizedConstParamTy, PartialEq, Eq)]
+#[derive(std::marker::ConstParamTy, PartialEq, Eq)]
 struct MyStr(str);
 
 fn function_with_my_str<const S: &'static MyStr>() -> &'static MyStr {
diff --git a/tests/ui/const-generics/transmute-const-param-static-reference.adt_const_params.stderr b/tests/ui/const-generics/transmute-const-param-static-reference.adt_const_params.stderr
index 7a936ced030..c2351c707d7 100644
--- a/tests/ui/const-generics/transmute-const-param-static-reference.adt_const_params.stderr
+++ b/tests/ui/const-generics/transmute-const-param-static-reference.adt_const_params.stderr
@@ -1,9 +1,13 @@
-error[E0741]: `&'static ()` can't be used as a const parameter type
-  --> $DIR/transmute-const-param-static-reference.rs:9:23
+error[E0658]: use of unstable library feature `unsized_const_params`
+  --> $DIR/transmute-const-param-static-reference.rs:9:14
    |
 LL | struct Const<const P: &'static ()>;
-   |                       ^^^^^^^^^^^
+   |              ^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: add `#![feature(unsized_const_params)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+   = note: required for `&'static ()` to implement `ConstParamTy_`
 
 error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0741`.
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/const-generics/transmute-const-param-static-reference.rs b/tests/ui/const-generics/transmute-const-param-static-reference.rs
index 0b47fd31eaf..bf164bdadb0 100644
--- a/tests/ui/const-generics/transmute-const-param-static-reference.rs
+++ b/tests/ui/const-generics/transmute-const-param-static-reference.rs
@@ -8,7 +8,7 @@
 
 struct Const<const P: &'static ()>;
 //[min]~^ ERROR `&'static ()` is forbidden as the type of a const generic parameter
-//[adt_const_params]~^^ ERROR `&'static ()` can't be used as a const parameter type
+//[adt_const_params]~^^ ERROR use of unstable library feature `unsized_const_params`
 
 fn main() {
     const A: &'static () = unsafe { std::mem::transmute(10 as *const ()) };
diff --git a/tests/ui/const-generics/unsized_const_params/symbol_mangling_v0_str.rs b/tests/ui/const-generics/unsized_const_params/symbol_mangling_v0_str.rs
index 359126f1251..429c401af1f 100644
--- a/tests/ui/const-generics/unsized_const_params/symbol_mangling_v0_str.rs
+++ b/tests/ui/const-generics/unsized_const_params/symbol_mangling_v0_str.rs
@@ -1,13 +1,13 @@
 //@ check-pass
 //@ compile-flags: -Csymbol-mangling-version=v0
 #![allow(incomplete_features)]
-#![feature(unsized_const_params)]
+#![feature(adt_const_params, unsized_const_params)]
 
 // Regression test for #116303
 
 #[derive(PartialEq, Eq)]
 struct MyStr(str);
-impl std::marker::UnsizedConstParamTy for MyStr {}
+impl std::marker::ConstParamTy_ for MyStr {}
 
 fn function_with_my_str<const S: &'static MyStr>() -> &'static MyStr {
     S
diff --git a/tests/ui/consts/const-eval/ub-nonnull.rs b/tests/ui/consts/const-eval/ub-nonnull.rs
index 91646842624..851f3996cd1 100644
--- a/tests/ui/consts/const-eval/ub-nonnull.rs
+++ b/tests/ui/consts/const-eval/ub-nonnull.rs
@@ -57,4 +57,8 @@ const NULL_FAT_PTR: NonNull<dyn Send> = unsafe {
     mem::transmute((0_usize, meta))
 };
 
+static S: u32 = 0; // just a static to construct a maybe-null pointer off of
+const MAYBE_NULL_PTR: NonNull<()> = unsafe { mem::transmute((&raw const S).wrapping_add(4)) };
+//~^ ERROR invalid value
+
 fn main() {}
diff --git a/tests/ui/consts/const-eval/ub-nonnull.stderr b/tests/ui/consts/const-eval/ub-nonnull.stderr
index 91c82efbc5e..e4486e3c500 100644
--- a/tests/ui/consts/const-eval/ub-nonnull.stderr
+++ b/tests/ui/consts/const-eval/ub-nonnull.stderr
@@ -9,7 +9,7 @@ LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
                HEX_DUMP
            }
 
-error[E0080]: in-bounds pointer arithmetic failed: attempting to offset pointer by 255 bytes, but got ALLOC1 which is only 1 byte from the end of the allocation
+error[E0080]: in-bounds pointer arithmetic failed: attempting to offset pointer by 255 bytes, but got ALLOC2 which is only 1 byte from the end of the allocation
   --> $DIR/ub-nonnull.rs:22:29
    |
 LL |     let out_of_bounds_ptr = &ptr[255];
@@ -37,7 +37,7 @@ LL | const NULL_USIZE: NonZero<usize> = unsafe { mem::transmute(0usize) };
                HEX_DUMP
            }
 
-error[E0080]: reading memory at ALLOC2[0x0..0x1], but memory is uninitialized at [0x0..0x1], and this operation requires initialized memory
+error[E0080]: reading memory at ALLOC3[0x0..0x1], but memory is uninitialized at [0x0..0x1], and this operation requires initialized memory
   --> $DIR/ub-nonnull.rs:36:38
    |
 LL | const UNINIT: NonZero<u8> = unsafe { MaybeUninit { uninit: () }.init };
@@ -80,6 +80,17 @@ LL | const NULL_FAT_PTR: NonNull<dyn Send> = unsafe {
                HEX_DUMP
            }
 
-error: aborting due to 8 previous errors
+error[E0080]: constructing invalid value: encountered a maybe-null pointer, but expected something that is definitely non-zero
+  --> $DIR/ub-nonnull.rs:61:1
+   |
+LL | const MAYBE_NULL_PTR: NonNull<()> = unsafe { mem::transmute((&raw const S).wrapping_add(4)) };
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+   |
+   = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+   = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+               HEX_DUMP
+           }
+
+error: aborting due to 9 previous errors
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const-eval/ub-ref-ptr.rs b/tests/ui/consts/const-eval/ub-ref-ptr.rs
index d8e5102fcbe..a5fdde1f9a4 100644
--- a/tests/ui/consts/const-eval/ub-ref-ptr.rs
+++ b/tests/ui/consts/const-eval/ub-ref-ptr.rs
@@ -4,7 +4,7 @@
 //@ normalize-stderr: "([0-9a-f][0-9a-f] |__ |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
 //@ dont-require-annotations: NOTE
 //@ normalize-stderr: "0x[0-9](\.\.|\])" -> "0x%$1"
-
+#![feature(rustc_attrs)]
 #![allow(invalid_value)]
 
 use std::mem;
@@ -27,6 +27,11 @@ const NULL: &u16 = unsafe { mem::transmute(0usize) };
 const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
 //~^ ERROR invalid value
 
+const MAYBE_NULL_BOX: Box<()> = unsafe { mem::transmute({
+//~^ ERROR maybe-null
+    let ref_ = &0u8;
+    (ref_ as *const u8).wrapping_add(10)
+}) };
 
 // It is very important that we reject this: We do promote `&(4 * REF_AS_USIZE)`,
 // but that would fail to compile; so we ended up breaking user code that would
@@ -57,7 +62,12 @@ const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
 //~^ ERROR invalid value
 const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
 //~^ ERROR invalid value
-
+const MAYBE_NULL_FN_PTR: fn() = unsafe { mem::transmute({
+//~^ ERROR invalid value
+    fn fun() {}
+    let ptr = fun as fn();
+    (ptr as *const u8).wrapping_add(10)
+}) };
 
 const UNALIGNED_READ: () = unsafe {
     let x = &[0u8; 4];
@@ -65,5 +75,14 @@ const UNALIGNED_READ: () = unsafe {
     ptr.read(); //~ ERROR accessing memory
 };
 
+// Check the general case of a pointer value not falling into the scalar valid range.
+#[rustc_layout_scalar_valid_range_start(1000)]
+pub struct High {
+    pointer: *const (),
+}
+static S: u32 = 0; // just a static to construct a pointer with unknown absolute address
+const INVALID_VALUE_PTR: High = unsafe { mem::transmute(&S) };
+//~^ ERROR invalid value
+
 
 fn main() {}
diff --git a/tests/ui/consts/const-eval/ub-ref-ptr.stderr b/tests/ui/consts/const-eval/ub-ref-ptr.stderr
index c45f66c2925..349a98f11be 100644
--- a/tests/ui/consts/const-eval/ub-ref-ptr.stderr
+++ b/tests/ui/consts/const-eval/ub-ref-ptr.stderr
@@ -42,8 +42,19 @@ LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
                HEX_DUMP
            }
 
+error[E0080]: constructing invalid value: encountered a maybe-null box
+  --> $DIR/ub-ref-ptr.rs:30:1
+   |
+LL | const MAYBE_NULL_BOX: Box<()> = unsafe { mem::transmute({
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+   |
+   = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+   = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+               HEX_DUMP
+           }
+
 error[E0080]: unable to turn pointer into integer
-  --> $DIR/ub-ref-ptr.rs:34:1
+  --> $DIR/ub-ref-ptr.rs:39:1
    |
 LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `REF_AS_USIZE` failed here
@@ -52,7 +63,7 @@ LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: unable to turn pointer into integer
-  --> $DIR/ub-ref-ptr.rs:37:39
+  --> $DIR/ub-ref-ptr.rs:42:39
    |
 LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `REF_AS_USIZE_SLICE` failed here
@@ -61,13 +72,13 @@ LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 note: erroneous constant encountered
-  --> $DIR/ub-ref-ptr.rs:37:38
+  --> $DIR/ub-ref-ptr.rs:42:38
    |
 LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: unable to turn pointer into integer
-  --> $DIR/ub-ref-ptr.rs:40:86
+  --> $DIR/ub-ref-ptr.rs:45:86
    |
 LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
    |                                                                                      ^^^^^^^^^^^^^^^^^^^^ evaluation of `REF_AS_USIZE_BOX_SLICE` failed here
@@ -76,13 +87,13 @@ LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[us
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 note: erroneous constant encountered
-  --> $DIR/ub-ref-ptr.rs:40:85
+  --> $DIR/ub-ref-ptr.rs:45:85
    |
 LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
    |                                                                                     ^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: constructing invalid value: encountered a dangling reference (0x539[noalloc] has no provenance)
-  --> $DIR/ub-ref-ptr.rs:43:1
+  --> $DIR/ub-ref-ptr.rs:48:1
    |
 LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -93,7 +104,7 @@ LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
            }
 
 error[E0080]: constructing invalid value: encountered a dangling box (0x539[noalloc] has no provenance)
-  --> $DIR/ub-ref-ptr.rs:46:1
+  --> $DIR/ub-ref-ptr.rs:51:1
    |
 LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -103,8 +114,8 @@ LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
                HEX_DUMP
            }
 
-error[E0080]: reading memory at ALLOC3[0x%..0x%], but memory is uninitialized at [0x%..0x%], and this operation requires initialized memory
-  --> $DIR/ub-ref-ptr.rs:49:41
+error[E0080]: reading memory at ALLOC6[0x%..0x%], but memory is uninitialized at [0x%..0x%], and this operation requires initialized memory
+  --> $DIR/ub-ref-ptr.rs:54:41
    |
 LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `UNINIT_PTR` failed here
@@ -114,7 +125,7 @@ LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
            }
 
 error[E0080]: constructing invalid value: encountered null pointer, but expected a function pointer
-  --> $DIR/ub-ref-ptr.rs:52:1
+  --> $DIR/ub-ref-ptr.rs:57:1
    |
 LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -124,8 +135,8 @@ LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
                HEX_DUMP
            }
 
-error[E0080]: reading memory at ALLOC4[0x%..0x%], but memory is uninitialized at [0x%..0x%], and this operation requires initialized memory
-  --> $DIR/ub-ref-ptr.rs:54:38
+error[E0080]: reading memory at ALLOC7[0x%..0x%], but memory is uninitialized at [0x%..0x%], and this operation requires initialized memory
+  --> $DIR/ub-ref-ptr.rs:59:38
    |
 LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `UNINIT_FN_PTR` failed here
@@ -135,7 +146,7 @@ LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
            }
 
 error[E0080]: constructing invalid value: encountered 0xd[noalloc], but expected a function pointer
-  --> $DIR/ub-ref-ptr.rs:56:1
+  --> $DIR/ub-ref-ptr.rs:61:1
    |
 LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -145,8 +156,8 @@ LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
                HEX_DUMP
            }
 
-error[E0080]: constructing invalid value: encountered ALLOC2<imm>, but expected a function pointer
-  --> $DIR/ub-ref-ptr.rs:58:1
+error[E0080]: constructing invalid value: encountered ALLOC3<imm>, but expected a function pointer
+  --> $DIR/ub-ref-ptr.rs:63:1
    |
 LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
@@ -156,12 +167,34 @@ LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
                HEX_DUMP
            }
 
+error[E0080]: constructing invalid value: encountered ALLOC4+0xa, but expected a function pointer
+  --> $DIR/ub-ref-ptr.rs:65:1
+   |
+LL | const MAYBE_NULL_FN_PTR: fn() = unsafe { mem::transmute({
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+   |
+   = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+   = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+               HEX_DUMP
+           }
+
 error[E0080]: accessing memory based on pointer with alignment 1, but alignment 4 is required
-  --> $DIR/ub-ref-ptr.rs:65:5
+  --> $DIR/ub-ref-ptr.rs:75:5
    |
 LL |     ptr.read();
    |     ^^^^^^^^^^ evaluation of `UNALIGNED_READ` failed here
 
-error: aborting due to 15 previous errors
+error[E0080]: constructing invalid value: encountered a pointer with unknown absolute address, but expected something that is definitely greater or equal to 1000
+  --> $DIR/ub-ref-ptr.rs:84:1
+   |
+LL | const INVALID_VALUE_PTR: High = unsafe { mem::transmute(&S) };
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+   |
+   = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+   = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+               HEX_DUMP
+           }
+
+error: aborting due to 18 previous errors
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/const_refs_to_static_fail.stderr b/tests/ui/consts/const_refs_to_static_fail.stderr
index c567b3e0ce1..2bb6d2b8fef 100644
--- a/tests/ui/consts/const_refs_to_static_fail.stderr
+++ b/tests/ui/consts/const_refs_to_static_fail.stderr
@@ -16,7 +16,7 @@ error: constant BAD_PATTERN cannot be used as pattern
 LL |         BAD_PATTERN => {},
    |         ^^^^^^^^^^^
    |
-   = note: constants that reference mutable or external memory cannot be used as pattern
+   = note: constants that reference mutable or external memory cannot be used as patterns
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/consts/const_refs_to_static_fail_invalid.stderr b/tests/ui/consts/const_refs_to_static_fail_invalid.stderr
index f9088c318a6..226a9de285d 100644
--- a/tests/ui/consts/const_refs_to_static_fail_invalid.stderr
+++ b/tests/ui/consts/const_refs_to_static_fail_invalid.stderr
@@ -15,7 +15,7 @@ error: constant extern_::C cannot be used as pattern
 LL |         C => {}
    |         ^
    |
-   = note: constants that reference mutable or external memory cannot be used as pattern
+   = note: constants that reference mutable or external memory cannot be used as patterns
 
 error: constant mutable::C cannot be used as pattern
   --> $DIR/const_refs_to_static_fail_invalid.rs:42:9
@@ -23,7 +23,7 @@ error: constant mutable::C cannot be used as pattern
 LL |         C => {}
    |         ^
    |
-   = note: constants that reference mutable or external memory cannot be used as pattern
+   = note: constants that reference mutable or external memory cannot be used as patterns
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/consts/const_transmute_type_id7.rs b/tests/ui/consts/const_transmute_type_id7.rs
new file mode 100644
index 00000000000..73b8187a800
--- /dev/null
+++ b/tests/ui/consts/const_transmute_type_id7.rs
@@ -0,0 +1,16 @@
+//! Ensure a decent error message for maybe-null references.
+//! (see <https://github.com/rust-lang/rust/issues/146748>)
+
+// Strip out raw byte dumps to make comparison platform-independent:
+//@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
+//@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
+
+#![feature(const_trait_impl, const_cmp)]
+
+use std::any::TypeId;
+use std::mem::transmute;
+
+const A: [&(); 16 / size_of::<*const ()>()] = unsafe { transmute(TypeId::of::<i32>()) };
+//~^ERROR: maybe-null
+
+fn main() {}
diff --git a/tests/ui/consts/const_transmute_type_id7.stderr b/tests/ui/consts/const_transmute_type_id7.stderr
new file mode 100644
index 00000000000..664975831f4
--- /dev/null
+++ b/tests/ui/consts/const_transmute_type_id7.stderr
@@ -0,0 +1,14 @@
+error[E0080]: constructing invalid value at [0]: encountered a maybe-null reference
+  --> $DIR/const_transmute_type_id7.rs:13:1
+   |
+LL | const A: [&(); 16 / size_of::<*const ()>()] = unsafe { transmute(TypeId::of::<i32>()) };
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
+   |
+   = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+   = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
+               HEX_DUMP
+           }
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static.stderr
index 6b70a211a72..5b8797c5116 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static.stderr
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static.stderr
@@ -22,7 +22,7 @@ error: constant REF_INTERIOR_MUT cannot be used as pattern
 LL |         REF_INTERIOR_MUT => {},
    |         ^^^^^^^^^^^^^^^^
    |
-   = note: constants that reference mutable or external memory cannot be used as pattern
+   = note: constants that reference mutable or external memory cannot be used as patterns
 
 warning: skipping const checks
    |
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr
index d753506cc94..c2b730375f2 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr
@@ -10,7 +10,7 @@ error: constant SLICE_MUT cannot be used as pattern
 LL |         SLICE_MUT => true,
    |         ^^^^^^^^^
    |
-   = note: constants that reference mutable or external memory cannot be used as pattern
+   = note: constants that reference mutable or external memory cannot be used as patterns
 
 error: constant U8_MUT cannot be used as pattern
   --> $DIR/const_refers_to_static_cross_crate.rs:44:9
@@ -18,7 +18,7 @@ error: constant U8_MUT cannot be used as pattern
 LL |         U8_MUT => true,
    |         ^^^^^^
    |
-   = note: constants that reference mutable or external memory cannot be used as pattern
+   = note: constants that reference mutable or external memory cannot be used as patterns
 
 error: constant U8_MUT2 cannot be used as pattern
   --> $DIR/const_refers_to_static_cross_crate.rs:53:9
@@ -26,7 +26,7 @@ error: constant U8_MUT2 cannot be used as pattern
 LL |         U8_MUT2 => true,
    |         ^^^^^^^
    |
-   = note: constants that reference mutable or external memory cannot be used as pattern
+   = note: constants that reference mutable or external memory cannot be used as patterns
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/issues/issue-57781.rs b/tests/ui/consts/oncecell-const-init-57781.rs
index 7f0d2eda9bb..27426ef2549 100644
--- a/tests/ui/issues/issue-57781.rs
+++ b/tests/ui/consts/oncecell-const-init-57781.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/57781
 //@ run-pass
 
 use std::cell::UnsafeCell;
diff --git a/tests/ui/consts/promoted_const_call2.rs b/tests/ui/consts/promoted_const_call2.rs
index f332cd18cea..62391f098e5 100644
--- a/tests/ui/consts/promoted_const_call2.rs
+++ b/tests/ui/consts/promoted_const_call2.rs
@@ -4,7 +4,6 @@ pub const C: () = {
     let _: &'static _ = &id(&String::new());
     //~^ ERROR: temporary value dropped while borrowed
     //~| ERROR: temporary value dropped while borrowed
-    //~| ERROR: destructor of `String` cannot be evaluated at compile-time
 };
 
 fn main() {
diff --git a/tests/ui/consts/promoted_const_call2.stderr b/tests/ui/consts/promoted_const_call2.stderr
index bdb43385d20..e62458d1a6a 100644
--- a/tests/ui/consts/promoted_const_call2.stderr
+++ b/tests/ui/consts/promoted_const_call2.stderr
@@ -18,16 +18,8 @@ LL |     let _: &'static _ = &id(&String::new());
    |            |                 creates a temporary value which is freed while still in use
    |            type annotation requires that borrow lasts for `'static`
 
-error[E0493]: destructor of `String` cannot be evaluated at compile-time
-  --> $DIR/promoted_const_call2.rs:4:30
-   |
-LL |     let _: &'static _ = &id(&String::new());
-   |                              ^^^^^^^^^^^^^ - value is dropped here
-   |                              |
-   |                              the destructor for this type cannot be evaluated in constants
-
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promoted_const_call2.rs:11:26
+  --> $DIR/promoted_const_call2.rs:10:26
    |
 LL |     let _: &'static _ = &id(&String::new());
    |            ----------    ^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -38,7 +30,7 @@ LL | }
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promoted_const_call2.rs:11:30
+  --> $DIR/promoted_const_call2.rs:10:30
    |
 LL |     let _: &'static _ = &id(&String::new());
    |            ----------        ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
@@ -46,7 +38,6 @@ LL |     let _: &'static _ = &id(&String::new());
    |            |                 creates a temporary value which is freed while still in use
    |            type annotation requires that borrow lasts for `'static`
 
-error: aborting due to 5 previous errors
+error: aborting due to 4 previous errors
 
-Some errors have detailed explanations: E0493, E0716.
-For more information about an error, try `rustc --explain E0493`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/tests/ui/consts/refs_check_const_eq-issue-88384.stderr b/tests/ui/consts/refs_check_const_eq-issue-88384.stderr
index 65e4dc22c28..62c5c527641 100644
--- a/tests/ui/consts/refs_check_const_eq-issue-88384.stderr
+++ b/tests/ui/consts/refs_check_const_eq-issue-88384.stderr
@@ -15,8 +15,8 @@ LL | struct Foo<const T: CompileTimeSettings>;
    |
 help: add `#[derive(ConstParamTy)]` to the struct
    |
-LL - struct CompileTimeSettings {
 LL + #[derive(ConstParamTy)]
+LL | struct CompileTimeSettings {
    |
 
 error[E0741]: `CompileTimeSettings` must implement `ConstParamTy` to be used as the type of a const generic parameter
@@ -27,8 +27,8 @@ LL | impl<const T: CompileTimeSettings> Foo<T> {
    |
 help: add `#[derive(ConstParamTy)]` to the struct
    |
-LL - struct CompileTimeSettings {
 LL + #[derive(ConstParamTy)]
+LL | struct CompileTimeSettings {
    |
 
 error: aborting due to 2 previous errors; 1 warning emitted
diff --git a/tests/ui/consts/required-consts/collect-in-promoted-const.noopt.stderr b/tests/ui/consts/required-consts/collect-in-promoted-const.noopt.stderr
index 67f5009c4ff..c1ae42b3939 100644
--- a/tests/ui/consts/required-consts/collect-in-promoted-const.noopt.stderr
+++ b/tests/ui/consts/required-consts/collect-in-promoted-const.noopt.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation panicked: explicit panic
-  --> $DIR/collect-in-promoted-const.rs:9:19
+  --> $DIR/collect-in-promoted-const.rs:11:19
    |
 LL |     const C: () = panic!();
    |                   ^^^^^^^^ evaluation of `Fail::<i32>::C` failed here
 
 note: erroneous constant encountered
-  --> $DIR/collect-in-promoted-const.rs:20:21
+  --> $DIR/collect-in-promoted-const.rs:22:21
    |
 LL |         let _val = &Fail::<T>::C;
    |                     ^^^^^^^^^^^^
 
 note: the above error was encountered while instantiating `fn f::<i32>`
-  --> $DIR/collect-in-promoted-const.rs:25:5
+  --> $DIR/collect-in-promoted-const.rs:27:5
    |
 LL |     f::<i32>();
    |     ^^^^^^^^^^
diff --git a/tests/ui/consts/required-consts/collect-in-promoted-const.opt.stderr b/tests/ui/consts/required-consts/collect-in-promoted-const.opt.stderr
index 5c3edf68d95..0d7ac48172c 100644
--- a/tests/ui/consts/required-consts/collect-in-promoted-const.opt.stderr
+++ b/tests/ui/consts/required-consts/collect-in-promoted-const.opt.stderr
@@ -1,23 +1,23 @@
 error[E0080]: evaluation panicked: explicit panic
-  --> $DIR/collect-in-promoted-const.rs:9:19
+  --> $DIR/collect-in-promoted-const.rs:11:19
    |
 LL |     const C: () = panic!();
    |                   ^^^^^^^^ evaluation of `Fail::<T>::C` failed here
 
 note: erroneous constant encountered
-  --> $DIR/collect-in-promoted-const.rs:20:21
+  --> $DIR/collect-in-promoted-const.rs:22:21
    |
 LL |         let _val = &Fail::<T>::C;
    |                     ^^^^^^^^^^^^
 
 error[E0080]: evaluation panicked: explicit panic
-  --> $DIR/collect-in-promoted-const.rs:9:19
+  --> $DIR/collect-in-promoted-const.rs:11:19
    |
 LL |     const C: () = panic!();
    |                   ^^^^^^^^ evaluation of `Fail::<i32>::C` failed here
 
 note: erroneous constant encountered
-  --> $DIR/collect-in-promoted-const.rs:20:21
+  --> $DIR/collect-in-promoted-const.rs:22:21
    |
 LL |         let _val = &Fail::<T>::C;
    |                     ^^^^^^^^^^^^
@@ -25,7 +25,7 @@ LL |         let _val = &Fail::<T>::C;
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: the above error was encountered while instantiating `fn f::<i32>`
-  --> $DIR/collect-in-promoted-const.rs:25:5
+  --> $DIR/collect-in-promoted-const.rs:27:5
    |
 LL |     f::<i32>();
    |     ^^^^^^^^^^
diff --git a/tests/ui/consts/required-consts/collect-in-promoted-const.rs b/tests/ui/consts/required-consts/collect-in-promoted-const.rs
index 25c8cb7e804..498328abe21 100644
--- a/tests/ui/consts/required-consts/collect-in-promoted-const.rs
+++ b/tests/ui/consts/required-consts/collect-in-promoted-const.rs
@@ -1,6 +1,8 @@
 //@revisions: noopt opt
 //@ build-fail
 //@[noopt] compile-flags: -Copt-level=0
+// FIXME(#61117): Respect debuginfo-level-tests, do not force debuginfo=0
+//@[opt] compile-flags: -C debuginfo=0
 //@[opt] compile-flags: -O
 //! Make sure we error on erroneous consts even if they get promoted.
 
diff --git a/tests/ui/coroutine/copy-fast-path-query-cycle.rs b/tests/ui/coroutine/copy-fast-path-query-cycle.rs
new file mode 100644
index 00000000000..644cba0d47a
--- /dev/null
+++ b/tests/ui/coroutine/copy-fast-path-query-cycle.rs
@@ -0,0 +1,40 @@
+//@ edition: 2024
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@ check-pass
+
+// Regression test for #146813. We previously used a pseudo-canonical
+// query during HIR typeck which caused a query cycle when looking at the
+// witness of a coroutine.
+
+use std::future::Future;
+
+trait ConnectMiddleware {}
+
+trait ConnectHandler: Sized {
+    fn with<M>(self, _: M) -> impl ConnectHandler
+    where
+        M: ConnectMiddleware,
+    {
+        LayeredConnectHandler
+    }
+}
+
+struct LayeredConnectHandler;
+impl ConnectHandler for LayeredConnectHandler {}
+impl<F> ConnectHandler for F where F: FnOnce() {}
+
+impl<F, Fut> ConnectMiddleware for F
+where
+    F: FnOnce() -> Fut,
+    Fut: Future<Output = ()> + Send,
+{
+}
+
+pub async fn fails() {
+    { || {} }
+        .with(async || ())
+        .with(async || ())
+        .with(async || ());
+}
+fn main() {}
diff --git a/tests/ui/coroutine/gen_block_panic.rs b/tests/ui/coroutine/gen_block_panic.rs
index b6362d5046a..5417ed583e8 100644
--- a/tests/ui/coroutine/gen_block_panic.rs
+++ b/tests/ui/coroutine/gen_block_panic.rs
@@ -1,6 +1,7 @@
 //@ edition: 2024
 //@ run-pass
 //@ needs-unwind
+//@ ignore-backends: gcc
 #![feature(gen_blocks)]
 
 fn main() {
diff --git a/tests/ui/coroutine/gen_block_panic.stderr b/tests/ui/coroutine/gen_block_panic.stderr
index a43c9e03691..d0a146e7baf 100644
--- a/tests/ui/coroutine/gen_block_panic.stderr
+++ b/tests/ui/coroutine/gen_block_panic.stderr
@@ -1,5 +1,5 @@
 warning: unreachable statement
-  --> $DIR/gen_block_panic.rs:10:9
+  --> $DIR/gen_block_panic.rs:11:9
    |
 LL |         panic!("foo");
    |         ------------- any code following this expression is unreachable
diff --git a/tests/ui/coroutine/handle_opaques_before_coroutines.rs b/tests/ui/coroutine/handle_opaques_before_coroutines.rs
new file mode 100644
index 00000000000..2771c77429c
--- /dev/null
+++ b/tests/ui/coroutine/handle_opaques_before_coroutines.rs
@@ -0,0 +1,15 @@
+// test for https://github.com/rust-lang/trait-system-refactor-initiative/issues/239
+//@edition: 2024
+//@ check-pass
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
+
+fn foo<'a>() -> impl Send {
+    if false {
+        foo();
+    }
+    async {}
+}
+
+fn main() {}
diff --git a/tests/crashes/122630.rs b/tests/ui/coroutine/moved-twice.rs
index e66624431c5..72b83e274c9 100644
--- a/tests/crashes/122630.rs
+++ b/tests/ui/coroutine/moved-twice.rs
@@ -1,22 +1,27 @@
-//@ known-bug: #122630
+//! Regression test for #122630
 //@ compile-flags: -Zvalidate-mir
 
+#![feature(coroutines, coroutine_trait, yield_expr)]
+
 use std::ops::Coroutine;
 
 const FOO_SIZE: usize = 1024;
 struct Foo([u8; FOO_SIZE]);
 
 impl Drop for Foo {
-    fn move_before_yield_with_noop() -> impl Coroutine<Yield = ()> {}
+    fn drop(&mut self) {}
 }
 
 fn overlap_move_points() -> impl Coroutine<Yield = ()> {
-    static || {
+    #[coroutine] static || {
         let first = Foo([0; FOO_SIZE]);
         yield;
         let second = first;
         yield;
         let second = first;
+        //~^ ERROR: use of moved value: `first` [E0382]
         yield;
     }
 }
+
+fn main() {}
diff --git a/tests/ui/coroutine/moved-twice.stderr b/tests/ui/coroutine/moved-twice.stderr
new file mode 100644
index 00000000000..2b21f6c59f0
--- /dev/null
+++ b/tests/ui/coroutine/moved-twice.stderr
@@ -0,0 +1,24 @@
+error[E0382]: use of moved value: `first`
+  --> $DIR/moved-twice.rs:21:22
+   |
+LL |         let first = Foo([0; FOO_SIZE]);
+   |             ----- move occurs because `first` has type `Foo`, which does not implement the `Copy` trait
+LL |         yield;
+LL |         let second = first;
+   |                      ----- value moved here
+LL |         yield;
+LL |         let second = first;
+   |                      ^^^^^ value used here after move
+   |
+note: if `Foo` implemented `Clone`, you could clone the value
+  --> $DIR/moved-twice.rs:9:1
+   |
+LL | struct Foo([u8; FOO_SIZE]);
+   | ^^^^^^^^^^ consider implementing `Clone` for this type
+...
+LL |         let second = first;
+   |                      ----- you could clone this value
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0382`.
diff --git a/tests/ui/cross-crate/exporting-impl-from-root-causes-ice-2472.rs b/tests/ui/cross-crate/exporting-impl-from-root-causes-ice-2472.rs
index 86d637b579d..c6cfae1e545 100644
--- a/tests/ui/cross-crate/exporting-impl-from-root-causes-ice-2472.rs
+++ b/tests/ui/cross-crate/exporting-impl-from-root-causes-ice-2472.rs
@@ -1,6 +1,9 @@
 //@ run-pass
 //@ aux-build:exporting-impl-from-root-causes-ice-2472-b.rs
-
+//@ ignore-ios FIXME(madsmtm): For some reason the necessary dylib isn't copied to the remote?
+//@ ignore-tvos FIXME(madsmtm): For some reason the necessary dylib isn't copied to the remote?
+//@ ignore-watchos FIXME(madsmtm): For some reason the necessary dylib isn't copied to the remote?
+//@ ignore-visionos FIXME(madsmtm): For some reason the necessary dylib isn't copied to the remote?
 
 extern crate exporting_impl_from_root_causes_ice_2472_b as lib;
 
diff --git a/tests/ui/darwin-objc/darwin-objc-bad-arg.rs b/tests/ui/darwin-objc/darwin-objc-bad-arg.rs
new file mode 100644
index 00000000000..70eb83aa052
--- /dev/null
+++ b/tests/ui/darwin-objc/darwin-objc-bad-arg.rs
@@ -0,0 +1,36 @@
+// Test that `objc::class!` and `objc::selector!` only take string literals.
+
+//@ edition: 2024
+//@ only-apple
+
+#![feature(darwin_objc)]
+
+use std::os::darwin::objc;
+
+pub fn main() {
+    let s = "NSObject";
+    objc::class!(s);
+    //~^ ERROR attribute value must be a literal
+
+    objc::class!(NSObject);
+    //~^ ERROR attribute value must be a literal
+
+    objc::class!(123);
+    //~^ ERROR `objc::class!` expected a string literal
+
+    objc::class!("NSObject\0");
+    //~^ ERROR `objc::class!` may not contain null characters
+
+    let s = "alloc";
+    objc::selector!(s);
+    //~^ ERROR attribute value must be a literal
+
+    objc::selector!(alloc);
+    //~^ ERROR attribute value must be a literal
+
+    objc::selector!(123);
+    //~^ ERROR `objc::selector!` expected a string literal
+
+    objc::selector!("alloc\0");
+    //~^ ERROR `objc::selector!` may not contain null characters
+}
diff --git a/tests/ui/darwin-objc/darwin-objc-bad-arg.stderr b/tests/ui/darwin-objc/darwin-objc-bad-arg.stderr
new file mode 100644
index 00000000000..99eeb27e30c
--- /dev/null
+++ b/tests/ui/darwin-objc/darwin-objc-bad-arg.stderr
@@ -0,0 +1,50 @@
+error: attribute value must be a literal
+  --> $DIR/darwin-objc-bad-arg.rs:12:18
+   |
+LL |     objc::class!(s);
+   |                  ^
+
+error: attribute value must be a literal
+  --> $DIR/darwin-objc-bad-arg.rs:15:18
+   |
+LL |     objc::class!(NSObject);
+   |                  ^^^^^^^^
+
+error: `objc::class!` expected a string literal
+  --> $DIR/darwin-objc-bad-arg.rs:18:18
+   |
+LL |     objc::class!(123);
+   |                  ^^^
+
+error: `objc::class!` may not contain null characters
+  --> $DIR/darwin-objc-bad-arg.rs:21:18
+   |
+LL |     objc::class!("NSObject\0");
+   |                  ^^^^^^^^^^^^
+
+error: attribute value must be a literal
+  --> $DIR/darwin-objc-bad-arg.rs:25:21
+   |
+LL |     objc::selector!(s);
+   |                     ^
+
+error: attribute value must be a literal
+  --> $DIR/darwin-objc-bad-arg.rs:28:21
+   |
+LL |     objc::selector!(alloc);
+   |                     ^^^^^
+
+error: `objc::selector!` expected a string literal
+  --> $DIR/darwin-objc-bad-arg.rs:31:21
+   |
+LL |     objc::selector!(123);
+   |                     ^^^
+
+error: `objc::selector!` may not contain null characters
+  --> $DIR/darwin-objc-bad-arg.rs:34:21
+   |
+LL |     objc::selector!("alloc\0");
+   |                     ^^^^^^^^^
+
+error: aborting due to 8 previous errors
+
diff --git a/tests/ui/darwin-objc/darwin-objc-bad-const.rs b/tests/ui/darwin-objc/darwin-objc-bad-const.rs
new file mode 100644
index 00000000000..ccf28697b48
--- /dev/null
+++ b/tests/ui/darwin-objc/darwin-objc-bad-const.rs
@@ -0,0 +1,17 @@
+// Test that `objc::class!` and `objc::selector!` aren't `const` expressions.
+// The system gives them their final values at dynamic load time.
+
+//@ edition: 2024
+//@ only-apple
+
+#![feature(darwin_objc)]
+
+use std::os::darwin::objc;
+
+pub const CLASS: objc::Class = objc::class!("NSObject");
+//~^ ERROR cannot access extern static `CLASS::VAL` [E0080]
+
+pub const SELECTOR: objc::SEL = objc::selector!("alloc");
+//~^ ERROR cannot access extern static `SELECTOR::VAL` [E0080]
+
+pub fn main() {}
diff --git a/tests/ui/darwin-objc/darwin-objc-bad-const.stderr b/tests/ui/darwin-objc/darwin-objc-bad-const.stderr
new file mode 100644
index 00000000000..43d0b7d761f
--- /dev/null
+++ b/tests/ui/darwin-objc/darwin-objc-bad-const.stderr
@@ -0,0 +1,19 @@
+error[E0080]: cannot access extern static `CLASS::VAL`
+  --> $DIR/darwin-objc-bad-const.rs:11:32
+   |
+LL | pub const CLASS: objc::Class = objc::class!("NSObject");
+   |                                ^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `CLASS` failed here
+   |
+   = note: this error originates in the macro `objc::class` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: cannot access extern static `SELECTOR::VAL`
+  --> $DIR/darwin-objc-bad-const.rs:14:33
+   |
+LL | pub const SELECTOR: objc::SEL = objc::selector!("alloc");
+   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `SELECTOR` failed here
+   |
+   = note: this error originates in the macro `objc::selector` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/tests/ui/darwin-objc/darwin-objc-bad-ref.rs b/tests/ui/darwin-objc/darwin-objc-bad-ref.rs
new file mode 100644
index 00000000000..fb1437366dd
--- /dev/null
+++ b/tests/ui/darwin-objc/darwin-objc-bad-ref.rs
@@ -0,0 +1,31 @@
+// Test that `objc::class!` and `objc::selector!` can't be returned by reference.
+// A single instance may have multiple addresses (e.g. across dylib boundaries).
+
+//@ edition: 2024
+//@ only-apple
+
+#![feature(darwin_objc)]
+
+use std::os::darwin::objc;
+
+pub fn class_ref<'a>() -> &'a objc::Class {
+    &objc::class!("NSObject")
+    //~^ ERROR cannot return reference to temporary value [E0515]
+}
+
+pub fn class_ref_static() -> &'static objc::Class {
+    &objc::class!("NSObject")
+    //~^ ERROR cannot return reference to temporary value [E0515]
+}
+
+pub fn selector_ref<'a>() -> &'a objc::SEL {
+    &objc::selector!("alloc")
+    //~^ ERROR cannot return reference to temporary value [E0515]
+}
+
+pub fn selector_ref_static() -> &'static objc::SEL {
+    &objc::selector!("alloc")
+    //~^ ERROR cannot return reference to temporary value [E0515]
+}
+
+pub fn main() {}
diff --git a/tests/ui/darwin-objc/darwin-objc-bad-ref.stderr b/tests/ui/darwin-objc/darwin-objc-bad-ref.stderr
new file mode 100644
index 00000000000..b09e6a75c84
--- /dev/null
+++ b/tests/ui/darwin-objc/darwin-objc-bad-ref.stderr
@@ -0,0 +1,39 @@
+error[E0515]: cannot return reference to temporary value
+  --> $DIR/darwin-objc-bad-ref.rs:12:5
+   |
+LL |     &objc::class!("NSObject")
+   |     ^------------------------
+   |     ||
+   |     |temporary value created here
+   |     returns a reference to data owned by the current function
+
+error[E0515]: cannot return reference to temporary value
+  --> $DIR/darwin-objc-bad-ref.rs:17:5
+   |
+LL |     &objc::class!("NSObject")
+   |     ^------------------------
+   |     ||
+   |     |temporary value created here
+   |     returns a reference to data owned by the current function
+
+error[E0515]: cannot return reference to temporary value
+  --> $DIR/darwin-objc-bad-ref.rs:22:5
+   |
+LL |     &objc::selector!("alloc")
+   |     ^------------------------
+   |     ||
+   |     |temporary value created here
+   |     returns a reference to data owned by the current function
+
+error[E0515]: cannot return reference to temporary value
+  --> $DIR/darwin-objc-bad-ref.rs:27:5
+   |
+LL |     &objc::selector!("alloc")
+   |     ^------------------------
+   |     ||
+   |     |temporary value created here
+   |     returns a reference to data owned by the current function
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0515`.
diff --git a/tests/ui/darwin-objc/darwin-objc-class-selector.rs b/tests/ui/darwin-objc/darwin-objc-class-selector.rs
new file mode 100644
index 00000000000..b9a2fc3634f
--- /dev/null
+++ b/tests/ui/darwin-objc/darwin-objc-class-selector.rs
@@ -0,0 +1,31 @@
+// Call `[NSObject class]` using `objc::class!` and `objc::selector!`.
+
+//@ edition: 2024
+//@ only-apple
+//@ run-pass
+
+#![feature(darwin_objc)]
+
+use std::mem::transmute;
+use std::os::darwin::objc;
+
+#[link(name = "Foundation", kind = "framework")]
+unsafe extern "C" {}
+
+#[link(name = "objc", kind = "dylib")]
+unsafe extern "C" {
+    unsafe fn objc_msgSend();
+}
+
+fn main() {
+    let msg_send_fn = unsafe {
+        transmute::<
+            unsafe extern "C" fn(),
+            unsafe extern "C" fn(objc::Class, objc::SEL) -> objc::Class,
+        >(objc_msgSend)
+    };
+    let static_sel = objc::selector!("class");
+    let static_class = objc::class!("NSObject");
+    let runtime_class = unsafe { msg_send_fn(static_class, static_sel) };
+    assert_eq!(static_class, runtime_class);
+}
diff --git a/tests/ui/darwin-objc/darwin-objc-class.rs b/tests/ui/darwin-objc/darwin-objc-class.rs
new file mode 100644
index 00000000000..851149d8726
--- /dev/null
+++ b/tests/ui/darwin-objc/darwin-objc-class.rs
@@ -0,0 +1,39 @@
+// Test that `objc::class!` returns the same thing as `objc_lookUpClass`.
+
+//@ edition: 2024
+//@ only-apple
+//@ run-pass
+
+#![feature(darwin_objc)]
+
+use std::ffi::c_char;
+use std::os::darwin::objc;
+
+#[link(name = "Foundation", kind = "framework")]
+unsafe extern "C" {}
+
+#[link(name = "objc")]
+unsafe extern "C" {
+    fn objc_lookUpClass(methname: *const c_char) -> objc::Class;
+}
+
+fn get_object_class() -> objc::Class {
+    objc::class!("NSObject")
+}
+
+fn lookup_object_class() -> objc::Class {
+    unsafe { objc_lookUpClass(c"NSObject".as_ptr()) }
+}
+
+fn get_string_class() -> objc::Class {
+    objc::class!("NSString")
+}
+
+fn lookup_string_class() -> objc::Class {
+    unsafe { objc_lookUpClass(c"NSString".as_ptr()) }
+}
+
+fn main() {
+    assert_eq!(get_object_class(), lookup_object_class());
+    assert_eq!(get_string_class(), lookup_string_class());
+}
diff --git a/tests/ui/darwin-objc/darwin-objc-selector.rs b/tests/ui/darwin-objc/darwin-objc-selector.rs
new file mode 100644
index 00000000000..008ae4c4ca4
--- /dev/null
+++ b/tests/ui/darwin-objc/darwin-objc-selector.rs
@@ -0,0 +1,36 @@
+// Test that `objc::selector!` returns the same thing as `sel_registerName`.
+
+//@ edition: 2024
+//@ only-apple
+//@ run-pass
+
+#![feature(darwin_objc)]
+
+use std::ffi::c_char;
+use std::os::darwin::objc;
+
+#[link(name = "objc")]
+unsafe extern "C" {
+    fn sel_registerName(methname: *const c_char) -> objc::SEL;
+}
+
+fn get_alloc_selector() -> objc::SEL {
+    objc::selector!("alloc")
+}
+
+fn register_alloc_selector() -> objc::SEL {
+    unsafe { sel_registerName(c"alloc".as_ptr()) }
+}
+
+fn get_init_selector() -> objc::SEL {
+    objc::selector!("initWithCString:encoding:")
+}
+
+fn register_init_selector() -> objc::SEL {
+    unsafe { sel_registerName(c"initWithCString:encoding:".as_ptr()) }
+}
+
+fn main() {
+    assert_eq!(get_alloc_selector(), register_alloc_selector());
+    assert_eq!(get_init_selector(), register_init_selector());
+}
diff --git a/tests/ui/issues/issue-58463.rs b/tests/ui/debuginfo/impl-copy-function-debuginfo-58463.rs
index 6e4b909bc38..72388c36ce4 100644
--- a/tests/ui/issues/issue-58463.rs
+++ b/tests/ui/debuginfo/impl-copy-function-debuginfo-58463.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/58463
 //@ run-pass
 //@ compile-flags:-C debuginfo=2
 
diff --git a/tests/ui/delegation/fn-header-variadic.rs b/tests/ui/delegation/fn-header-variadic.rs
index 2c83d64d0b3..346c49f08e5 100644
--- a/tests/ui/delegation/fn-header-variadic.rs
+++ b/tests/ui/delegation/fn-header-variadic.rs
@@ -1,4 +1,5 @@
 //@ aux-crate:fn_header_aux=fn-header-aux.rs
+//@ ignore-backends: gcc
 
 #![feature(c_variadic)]
 #![feature(fn_delegation)]
diff --git a/tests/ui/delegation/fn-header-variadic.stderr b/tests/ui/delegation/fn-header-variadic.stderr
index 688a965fb4d..c2d7672939f 100644
--- a/tests/ui/delegation/fn-header-variadic.stderr
+++ b/tests/ui/delegation/fn-header-variadic.stderr
@@ -1,5 +1,5 @@
 error: delegation to C-variadic functions is not allowed
-  --> $DIR/fn-header-variadic.rs:11:17
+  --> $DIR/fn-header-variadic.rs:12:17
    |
 LL |     pub unsafe extern "C" fn variadic_fn(n: usize, mut args: ...) {}
    |     ------------------------------------------------------------- callee defined here
@@ -8,7 +8,7 @@ LL | reuse to_reuse::variadic_fn;
    |                 ^^^^^^^^^^^
 
 error: delegation to C-variadic functions is not allowed
-  --> $DIR/fn-header-variadic.rs:13:22
+  --> $DIR/fn-header-variadic.rs:14:22
    |
 LL | reuse fn_header_aux::variadic_fn_extern;
    |                      ^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/diagnostic-flags/colored-session-opt-error.svg b/tests/ui/diagnostic-flags/colored-session-opt-error.svg
index 69f452f29f3..136c6fa5628 100644
--- a/tests/ui/diagnostic-flags/colored-session-opt-error.svg
+++ b/tests/ui/diagnostic-flags/colored-session-opt-error.svg
@@ -1,7 +1,7 @@
-<svg width="750px" height="74px" xmlns="http://www.w3.org/2000/svg">
+<svg width="740px" height="74px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
+    .bg { fill: #000000 }
     .fg-yellow { fill: #AA5500 }
     .container {
       padding: 0 10px;
diff --git a/tests/ui/diagnostic-flags/terminal_urls.rs b/tests/ui/diagnostic-flags/terminal_urls.rs
index 3c74e992395..631512ab579 100644
--- a/tests/ui/diagnostic-flags/terminal_urls.rs
+++ b/tests/ui/diagnostic-flags/terminal_urls.rs
@@ -1,4 +1,4 @@
-//@ compile-flags: -Zterminal-urls=yes
+//@ compile-flags: -Zterminal-urls=yes --error-format=human --color=always
 fn main() {
-    let () = 4; //~ ERROR
+    let () = 4;
 }
diff --git a/tests/ui/diagnostic-flags/terminal_urls.stderr b/tests/ui/diagnostic-flags/terminal_urls.stderr
deleted file mode 100644
index e5dfcdf6431..00000000000
--- a/tests/ui/diagnostic-flags/terminal_urls.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[]8;;https://doc.rust-lang.org/error_codes/E0308.htmlE0308]8;;]: mismatched types
-  --> $DIR/terminal_urls.rs:3:9
-   |
-LL |     let () = 4;
-   |         ^^   - this expression has type `{integer}`
-   |         |
-   |         expected integer, found `()`
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/diagnostic-flags/terminal_urls.svg b/tests/ui/diagnostic-flags/terminal_urls.svg
new file mode 100644
index 00000000000..fcb65637c4a
--- /dev/null
+++ b/tests/ui/diagnostic-flags/terminal_urls.svg
@@ -0,0 +1,48 @@
+<svg width="740px" height="236px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { fill: #000000 }
+    .fg-ansi256-009 { fill: #FF5555 }
+    .fg-ansi256-012 { fill: #5555FF }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    .bold { font-weight: bold; }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan class="fg-ansi256-009 bold">error[</tspan><tspan class="fg-ansi256-009 bold"><a href="https://doc.rust-lang.org/error_codes/E0308.html">E0308</a></tspan><tspan class="fg-ansi256-009 bold">]</tspan><tspan class="bold">: mismatched types</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan>  </tspan><tspan class="fg-ansi256-012 bold">--&gt; </tspan><tspan>$DIR/terminal_urls.rs:3:9</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>   </tspan><tspan class="fg-ansi256-012 bold">|</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan>     let () = 4;</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>   </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan>         </tspan><tspan class="fg-ansi256-009 bold">^^</tspan><tspan>   </tspan><tspan class="fg-ansi256-012 bold">-</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">this expression has type `{integer}`</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>   </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan>         </tspan><tspan class="fg-ansi256-009 bold">|</tspan>
+</tspan>
+    <tspan x="10px" y="136px"><tspan>   </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan>         </tspan><tspan class="fg-ansi256-009 bold">expected integer, found `()`</tspan>
+</tspan>
+    <tspan x="10px" y="154px">
+</tspan>
+    <tspan x="10px" y="172px"><tspan class="fg-ansi256-009 bold">error</tspan><tspan class="bold">: aborting due to 1 previous error</tspan>
+</tspan>
+    <tspan x="10px" y="190px">
+</tspan>
+    <tspan x="10px" y="208px"><tspan class="bold">For more information about this error, try `rustc --explain E0308`.</tspan>
+</tspan>
+    <tspan x="10px" y="226px">
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/ui/diagnostic-flags/terminal_urls.windows.svg b/tests/ui/diagnostic-flags/terminal_urls.windows.svg
new file mode 100644
index 00000000000..e7b46638399
--- /dev/null
+++ b/tests/ui/diagnostic-flags/terminal_urls.windows.svg
@@ -0,0 +1,49 @@
+<svg width="740px" height="236px" xmlns="http://www.w3.org/2000/svg">
+  <style>
+    .fg { fill: #AAAAAA }
+    .bg { fill: #000000 }
+    .fg-ansi256-009 { fill: #FF5555 }
+    .fg-ansi256-014 { fill: #55FFFF }
+    .fg-ansi256-015 { fill: #FFFFFF }
+    .container {
+      padding: 0 10px;
+      line-height: 18px;
+    }
+    .bold { font-weight: bold; }
+    tspan {
+      font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
+      white-space: pre;
+      line-height: 18px;
+    }
+  </style>
+
+  <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
+
+  <text xml:space="preserve" class="container fg">
+    <tspan x="10px" y="28px"><tspan class="fg-ansi256-009 bold">error[</tspan><tspan class="fg-ansi256-009 bold"><a href="https://doc.rust-lang.org/error_codes/E0308.html">E0308</a></tspan><tspan class="fg-ansi256-009 bold">]</tspan><tspan class="fg-ansi256-015 bold">: mismatched types</tspan>
+</tspan>
+    <tspan x="10px" y="46px"><tspan>  </tspan><tspan class="fg-ansi256-014 bold">--&gt; </tspan><tspan>$DIR/terminal_urls.rs:3:9</tspan>
+</tspan>
+    <tspan x="10px" y="64px"><tspan>   </tspan><tspan class="fg-ansi256-014 bold">|</tspan>
+</tspan>
+    <tspan x="10px" y="82px"><tspan class="fg-ansi256-014 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-014 bold">|</tspan><tspan>     let () = 4;</tspan>
+</tspan>
+    <tspan x="10px" y="100px"><tspan>   </tspan><tspan class="fg-ansi256-014 bold">|</tspan><tspan>         </tspan><tspan class="fg-ansi256-009 bold">^^</tspan><tspan>   </tspan><tspan class="fg-ansi256-014 bold">-</tspan><tspan> </tspan><tspan class="fg-ansi256-014 bold">this expression has type `{integer}`</tspan>
+</tspan>
+    <tspan x="10px" y="118px"><tspan>   </tspan><tspan class="fg-ansi256-014 bold">|</tspan><tspan>         </tspan><tspan class="fg-ansi256-009 bold">|</tspan>
+</tspan>
+    <tspan x="10px" y="136px"><tspan>   </tspan><tspan class="fg-ansi256-014 bold">|</tspan><tspan>         </tspan><tspan class="fg-ansi256-009 bold">expected integer, found `()`</tspan>
+</tspan>
+    <tspan x="10px" y="154px">
+</tspan>
+    <tspan x="10px" y="172px"><tspan class="fg-ansi256-009 bold">error</tspan><tspan class="fg-ansi256-015 bold">: aborting due to 1 previous error</tspan>
+</tspan>
+    <tspan x="10px" y="190px">
+</tspan>
+    <tspan x="10px" y="208px"><tspan class="fg-ansi256-015 bold">For more information about this error, try `rustc --explain E0308`.</tspan>
+</tspan>
+    <tspan x="10px" y="226px">
+</tspan>
+  </text>
+
+</svg>
diff --git a/tests/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr b/tests/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr
index c74cb89f85c..286d6021396 100644
--- a/tests/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr
+++ b/tests/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr
@@ -32,10 +32,10 @@ help: try adding parentheses to match on a tuple...
    |
 LL |         (Nucleotide::Adenine, Nucleotide::Cytosine, _) => true
    |         +                                            +
-help: ...or a vertical bar to match on multiple alternatives
+help: ...or a vertical bar to match on alternatives
    |
 LL -         Nucleotide::Adenine, Nucleotide::Cytosine, _ => true
-LL +         Nucleotide::Adenine | Nucleotide::Cytosine | _ => true
+LL +         Nucleotide::Adenine | Nucleotide::Cytosine, _ => true
    |
 
 error: unexpected `,` in pattern
diff --git a/tests/ui/did_you_mean/recursion_limit_deref.rs b/tests/ui/did_you_mean/recursion_limit_deref.rs
index e53007388af..3ae956b751d 100644
--- a/tests/ui/did_you_mean/recursion_limit_deref.rs
+++ b/tests/ui/did_you_mean/recursion_limit_deref.rs
@@ -1,3 +1,6 @@
+//~ ERROR reached the recursion limit finding the struct tail for `K`
+//~| ERROR reached the recursion limit finding the struct tail for `Bottom`
+
 // Test that the recursion limit can be changed and that the compiler
 // suggests a fix. In this case, we have a long chain of Deref impls
 // which will cause an overflow during the autoderef loop.
@@ -9,6 +12,7 @@
 macro_rules! link {
     ($outer:ident, $inner:ident) => {
         struct $outer($inner);
+        //~^ ERROR reached the recursion limit finding the struct tail for `Bottom`
 
         impl $outer {
             fn new() -> $outer {
@@ -51,6 +55,3 @@ fn main() {
     let x: &Bottom = &t; //~ ERROR mismatched types
     //~^ error recursion limit
 }
-
-//~? ERROR reached the recursion limit finding the struct tail for `K`
-//~? ERROR reached the recursion limit finding the struct tail for `Bottom`
diff --git a/tests/ui/did_you_mean/recursion_limit_deref.stderr b/tests/ui/did_you_mean/recursion_limit_deref.stderr
index 23341ec6bdc..faa85dc5ae9 100644
--- a/tests/ui/did_you_mean/recursion_limit_deref.stderr
+++ b/tests/ui/did_you_mean/recursion_limit_deref.stderr
@@ -6,8 +6,20 @@ error: reached the recursion limit finding the struct tail for `Bottom`
    |
    = help: consider increasing the recursion limit by adding a `#![recursion_limit = "20"]`
 
+error: reached the recursion limit finding the struct tail for `Bottom`
+  --> $DIR/recursion_limit_deref.rs:14:9
+   |
+LL |         struct $outer($inner);
+   |         ^^^^^^^^^^^^^^^^^^^^^^
+...
+LL | link!(A, B);
+   | ----------- in this macro invocation
+   |
+   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "20"]`
+   = note: this error originates in the macro `link` (in Nightly builds, run with -Z macro-backtrace for more info)
+
 error[E0055]: reached the recursion limit while auto-dereferencing `J`
-  --> $DIR/recursion_limit_deref.rs:51:22
+  --> $DIR/recursion_limit_deref.rs:55:22
    |
 LL |     let x: &Bottom = &t;
    |                      ^^ deref recursion limit reached
@@ -15,7 +27,7 @@ LL |     let x: &Bottom = &t;
    = help: consider increasing the recursion limit by adding a `#![recursion_limit = "20"]` attribute to your crate (`recursion_limit_deref`)
 
 error[E0308]: mismatched types
-  --> $DIR/recursion_limit_deref.rs:51:22
+  --> $DIR/recursion_limit_deref.rs:55:22
    |
 LL |     let x: &Bottom = &t;
    |            -------   ^^ expected `&Bottom`, found `&Top`
@@ -25,7 +37,7 @@ LL |     let x: &Bottom = &t;
    = note: expected reference `&Bottom`
               found reference `&Top`
 
-error: aborting due to 4 previous errors
+error: aborting due to 5 previous errors
 
 Some errors have detailed explanations: E0055, E0308.
 For more information about an error, try `rustc --explain E0055`.
diff --git a/tests/ui/dist/cranelift-x86_64-unknown-linux-gnu-dist.rs b/tests/ui/dist/cranelift-x86_64-unknown-linux-gnu-dist.rs
index 198f8d1bc10..6d12ab1e4cf 100644
--- a/tests/ui/dist/cranelift-x86_64-unknown-linux-gnu-dist.rs
+++ b/tests/ui/dist/cranelift-x86_64-unknown-linux-gnu-dist.rs
@@ -2,6 +2,7 @@
 // dist artifacts.
 
 //@ only-dist
+//@ only-nightly (cranelift is not stable yet)
 //@ only-x86_64-unknown-linux-gnu
 //@ compile-flags: -Z codegen-backend=cranelift
 //@ run-pass
diff --git a/tests/ui/drop/drop-trait-enum.rs b/tests/ui/drop/drop-trait-enum.rs
index 5a88d959ec6..efb6b2a912a 100644
--- a/tests/ui/drop/drop-trait-enum.rs
+++ b/tests/ui/drop/drop-trait-enum.rs
@@ -4,6 +4,7 @@
 #![allow(unused_variables)]
 //@ needs-threads
 //@ needs-unwind
+//@ ignore-backends: gcc
 
 use std::thread;
 use std::sync::mpsc::{channel, Sender};
diff --git a/tests/ui/drop/super-let-tail-expr-drop-order.rs b/tests/ui/drop/super-let-tail-expr-drop-order.rs
new file mode 100644
index 00000000000..5b2ecfbb320
--- /dev/null
+++ b/tests/ui/drop/super-let-tail-expr-drop-order.rs
@@ -0,0 +1,192 @@
+//! Test for #145784: the argument to `pin!` should be treated as an extending expression if and
+//! only if the whole `pin!` invocation is an extending expression. Likewise, since `pin!` is
+//! implemented in terms of `super let`, test the same for `super let` initializers. Since the
+//! argument to `pin!` and the initializer of `super let` are not temporary drop scopes, this only
+//! affects lifetimes in two cases:
+//!
+//! - Block tail expressions in Rust 2024, which are both extending expressions and temporary drop
+//! scopes; treating them as extending expressions within a non-extending `pin!` resulted in borrow
+//! expression operands living past the end of the block.
+//!
+//! - Nested `super let` statements, which can have their binding and temporary lifetimes extended
+//! when the block they're in is an extending expression.
+//!
+//! For more information on extending expressions, see
+//! https://doc.rust-lang.org/reference/destructors.html#extending-based-on-expressions
+//!
+//! For tests that `super let` initializers aren't temporary drop scopes, and tests for
+//! lifetime-extended `super let`, see tests/ui/borrowck/super-let-lifetime-and-drop.rs
+//@ run-pass
+//@ revisions: e2021 e2024
+//@ [e2021] edition: 2021
+//@ [e2024] edition: 2024
+
+#![feature(super_let)]
+#![allow(unused_braces)]
+
+use std::cell::RefCell;
+use std::pin::pin;
+
+fn f<T>(_: LogDrop<'_>, x: T) -> T { x }
+
+fn main() {
+    // Test block arguments to `pin!` in non-extending expressions.
+    // In Rust 2021, block tail expressions aren't temporary drop scopes, so their temporaries
+    // should outlive the `pin!` invocation.
+    // In Rust 2024, block tail expressions are temporary drop scopes, so their temporaries should
+    // be dropped after evaluating the tail expression within the `pin!` invocation.
+    // By nesting two `pin!` calls, this ensures non-extended `pin!` doesn't extend an inner `pin!`.
+    assert_drop_order(1..=3, |o| {
+        #[cfg(e2021)]
+        (
+            pin!((
+                pin!({ &o.log(3) as *const LogDrop<'_> }),
+                drop(o.log(1)),
+            )),
+            drop(o.log(2)),
+        );
+        #[cfg(e2024)]
+        (
+            pin!((
+                pin!({ &o.log(1) as *const LogDrop<'_> }),
+                drop(o.log(2)),
+            )),
+            drop(o.log(3)),
+        );
+    });
+
+    // The same holds for `super let` initializers in non-extending expressions.
+    assert_drop_order(1..=4, |o| {
+        #[cfg(e2021)]
+        (
+            {
+                super let _ = {
+                    super let _ = { &o.log(4) as *const LogDrop<'_> };
+                    drop(o.log(1))
+                };
+                drop(o.log(2))
+            },
+            drop(o.log(3)),
+        );
+        #[cfg(e2024)]
+        (
+            {
+                super let _ = {
+                    super let _ = { &o.log(1) as *const LogDrop<'_> };
+                    drop(o.log(2))
+                };
+                drop(o.log(3))
+            },
+            drop(o.log(4)),
+        );
+    });
+
+    // Within an extending expression, the argument to `pin!` is also an extending expression,
+    // allowing borrow operands in block tail expressions to have extended lifetimes.
+    assert_drop_order(1..=2, |o| {
+        let _ = pin!({ &o.log(2) as *const LogDrop<'_> });
+        drop(o.log(1));
+    });
+
+    // The same holds for `super let` initializers in extending expressions.
+    assert_drop_order(1..=2, |o| {
+        let _ =  { super let _ = { &o.log(2) as *const LogDrop<'_> }; };
+        drop(o.log(1));
+    });
+
+    // We have extending borrow expressions within an extending block
+    // expression (within an extending borrow expression) within a
+    // non-extending expresion within the initializer expression.
+    #[cfg(e2021)]
+    {
+        // These two should be the same.
+        assert_drop_order(1..=3, |e| {
+            let _v = f(e.log(1), &{ &raw const *&e.log(2) });
+            drop(e.log(3));
+        });
+        assert_drop_order(1..=3, |e| {
+            let _v = f(e.log(1), {
+                super let v = &{ &raw const *&e.log(2) };
+                v
+            });
+            drop(e.log(3));
+        });
+    }
+    #[cfg(e2024)]
+    {
+        // These two should be the same.
+        assert_drop_order(1..=3, |e| {
+            let _v = f(e.log(2), &{ &raw const *&e.log(1) });
+            drop(e.log(3));
+        });
+        assert_drop_order(1..=3, |e| {
+            let _v = f(e.log(2), {
+                super let v = &{ &raw const *&e.log(1) };
+                v
+            });
+            drop(e.log(3));
+        });
+    }
+
+    // We have extending borrow expressions within a non-extending
+    // expression within the initializer expression.
+    //
+    // These two should be the same.
+    assert_drop_order(1..=3, |e| {
+        let _v = f(e.log(1), &&raw const *&e.log(2));
+        drop(e.log(3));
+    });
+    assert_drop_order(1..=3, |e| {
+        let _v = f(e.log(1), {
+            super let v = &&raw const *&e.log(2);
+            v
+        });
+        drop(e.log(3));
+    });
+
+    // We have extending borrow expressions within an extending block
+    // expression (within an extending borrow expression) within the
+    // initializer expression.
+    //
+    // These two should be the same.
+    assert_drop_order(1..=2, |e| {
+        let _v = &{ &raw const *&e.log(2) };
+        drop(e.log(1));
+    });
+    assert_drop_order(1..=2, |e| {
+        let _v = {
+            super let v = &{ &raw const *&e.log(2) };
+            v
+        };
+        drop(e.log(1));
+    });
+}
+
+// # Test scaffolding...
+
+struct DropOrder(RefCell<Vec<u64>>);
+struct LogDrop<'o>(&'o DropOrder, u64);
+
+impl DropOrder {
+    fn log(&self, n: u64) -> LogDrop<'_> {
+        LogDrop(self, n)
+    }
+}
+
+impl<'o> Drop for LogDrop<'o> {
+    fn drop(&mut self) {
+        self.0.0.borrow_mut().push(self.1);
+    }
+}
+
+#[track_caller]
+fn assert_drop_order(
+    ex: impl IntoIterator<Item = u64>,
+    f: impl Fn(&DropOrder),
+) {
+    let order = DropOrder(RefCell::new(Vec::new()));
+    f(&order);
+    let order = order.0.into_inner();
+    let expected: Vec<u64> = ex.into_iter().collect();
+    assert_eq!(order, expected);
+}
diff --git a/tests/ui/drop/terminate-in-initializer.rs b/tests/ui/drop/terminate-in-initializer.rs
index 24ec39fe096..5dd8fe43c71 100644
--- a/tests/ui/drop/terminate-in-initializer.rs
+++ b/tests/ui/drop/terminate-in-initializer.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 
 // Issue #787
 // Don't try to clean up uninitialized locals
diff --git a/tests/ui/issues/issue-58734.rs b/tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.rs
index e5b371f5530..3e9ebb497a2 100644
--- a/tests/ui/issues/issue-58734.rs
+++ b/tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/58734
 trait Trait {
     fn exists(self) -> ();
 
diff --git a/tests/ui/issues/issue-58734.stderr b/tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.stderr
index 2336a94f150..140461283f3 100644
--- a/tests/ui/issues/issue-58734.stderr
+++ b/tests/ui/dyn-compatibility/spurious-dyn-compat-errors-58734.stderr
@@ -1,5 +1,5 @@
 warning: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/issue-58734.rs:20:5
+  --> $DIR/spurious-dyn-compat-errors-58734.rs:21:5
    |
 LL |     Trait::nonexistent(());
    |     ^^^^^
@@ -13,14 +13,14 @@ LL |     <dyn Trait>::nonexistent(());
    |     ++++      +
 
 error[E0038]: the trait `Trait` is not dyn compatible
-  --> $DIR/issue-58734.rs:20:5
+  --> $DIR/spurious-dyn-compat-errors-58734.rs:21:5
    |
 LL |     Trait::nonexistent(());
    |     ^^^^^ `Trait` is not dyn compatible
    |
 note: for a trait to be dyn compatible it needs to allow building a vtable
       for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
-  --> $DIR/issue-58734.rs:4:8
+  --> $DIR/spurious-dyn-compat-errors-58734.rs:5:8
    |
 LL | trait Trait {
    |       ----- this trait is not dyn compatible...
diff --git a/tests/ui/empty/empty-attributes.stderr b/tests/ui/empty/empty-attributes.stderr
index f0be56ddc6a..41dc790737d 100644
--- a/tests/ui/empty/empty-attributes.stderr
+++ b/tests/ui/empty/empty-attributes.stderr
@@ -56,12 +56,16 @@ error: unused attribute
    |
 LL | #[repr()]
    | ^^^^^^^^^ help: remove this attribute
+   |
+   = note: using `repr` with an empty list has no effect
 
 error: unused attribute
   --> $DIR/empty-attributes.rs:12:1
    |
 LL | #[target_feature()]
    | ^^^^^^^^^^^^^^^^^^^ help: remove this attribute
+   |
+   = note: using `target_feature` with an empty list has no effect
 
 error: aborting due to 8 previous errors
 
diff --git a/tests/ui/error-codes/E0121.stderr b/tests/ui/error-codes/E0121.stderr
index b169373f643..074929c4e74 100644
--- a/tests/ui/error-codes/E0121.stderr
+++ b/tests/ui/error-codes/E0121.stderr
@@ -2,10 +2,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/E0121.rs:1:13
    |
 LL | fn foo() -> _ { 5 }
-   |             ^
-   |             |
-   |             not allowed in type signatures
-   |             help: replace with the correct return type: `i32`
+   |             ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - fn foo() -> _ { 5 }
+LL + fn foo() -> i32 { 5 }
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
   --> $DIR/E0121.rs:3:13
diff --git a/tests/ui/error-codes/E0719.rs b/tests/ui/error-codes/E0719.rs
index 0ea6d19000b..d7b4b876d1b 100644
--- a/tests/ui/error-codes/E0719.rs
+++ b/tests/ui/error-codes/E0719.rs
@@ -1,8 +1,3 @@
-trait Foo: Iterator<Item = i32, Item = i32> {}
-//~^ ERROR is already specified
-//~| ERROR is already specified
-//~| ERROR is already specified
-
 type Unit = ();
 
 fn test() -> Box<dyn Iterator<Item = (), Item = Unit>> {
diff --git a/tests/ui/error-codes/E0719.stderr b/tests/ui/error-codes/E0719.stderr
index 7e8329db1f4..f4817568924 100644
--- a/tests/ui/error-codes/E0719.stderr
+++ b/tests/ui/error-codes/E0719.stderr
@@ -1,33 +1,5 @@
 error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/E0719.rs:1:33
-   |
-LL | trait Foo: Iterator<Item = i32, Item = i32> {}
-   |                     ----------  ^^^^^^^^^^ re-bound here
-   |                     |
-   |                     `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/E0719.rs:1:33
-   |
-LL | trait Foo: Iterator<Item = i32, Item = i32> {}
-   |                     ----------  ^^^^^^^^^^ re-bound here
-   |                     |
-   |                     `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/E0719.rs:1:33
-   |
-LL | trait Foo: Iterator<Item = i32, Item = i32> {}
-   |                     ----------  ^^^^^^^^^^ re-bound here
-   |                     |
-   |                     `Item` bound here first
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/E0719.rs:8:42
+  --> $DIR/E0719.rs:3:42
    |
 LL | fn test() -> Box<dyn Iterator<Item = (), Item = Unit>> {
    |                               ---------  ^^^^^^^^^^^ re-bound here
@@ -35,13 +7,13 @@ LL | fn test() -> Box<dyn Iterator<Item = (), Item = Unit>> {
    |                               `Item` bound here first
 
 error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified
-  --> $DIR/E0719.rs:14:38
+  --> $DIR/E0719.rs:9:38
    |
 LL |     let _: &dyn Iterator<Item = i32, Item = i32>;
    |                          ----------  ^^^^^^^^^^ re-bound here
    |                          |
    |                          `Item` bound here first
 
-error: aborting due to 5 previous errors
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0719`.
diff --git a/tests/ui/error-emitter/E0308-clarification.svg b/tests/ui/error-emitter/E0308-clarification.svg
index 9432e3a4ee9..03ee973882d 100644
--- a/tests/ui/error-emitter/E0308-clarification.svg
+++ b/tests/ui/error-emitter/E0308-clarification.svg
@@ -1,7 +1,7 @@
 <svg width="740px" height="668px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
+    .bg { fill: #000000 }
     .fg-ansi256-009 { fill: #FF5555 }
     .fg-ansi256-012 { fill: #5555FF }
     .fg-magenta { fill: #AA00AA }
diff --git a/tests/ui/error-emitter/highlighting.svg b/tests/ui/error-emitter/highlighting.svg
index 19818ab6146..d414f042f0a 100644
--- a/tests/ui/error-emitter/highlighting.svg
+++ b/tests/ui/error-emitter/highlighting.svg
@@ -1,7 +1,7 @@
 <svg width="785px" height="434px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
+    .bg { fill: #000000 }
     .fg-ansi256-009 { fill: #FF5555 }
     .fg-ansi256-010 { fill: #55FF55 }
     .fg-ansi256-012 { fill: #5555FF }
diff --git a/tests/ui/error-emitter/highlighting.windows.svg b/tests/ui/error-emitter/highlighting.windows.svg
index f891bc1d2a6..92f9055cd1d 100644
--- a/tests/ui/error-emitter/highlighting.windows.svg
+++ b/tests/ui/error-emitter/highlighting.windows.svg
@@ -1,7 +1,7 @@
 <svg width="785px" height="434px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
+    .bg { fill: #000000 }
     .fg-ansi256-009 { fill: #FF5555 }
     .fg-ansi256-010 { fill: #55FF55 }
     .fg-ansi256-014 { fill: #55FFFF }
diff --git a/tests/ui/error-emitter/multiline-multipart-suggestion.svg b/tests/ui/error-emitter/multiline-multipart-suggestion.svg
index dd84234236d..5ffdc5a53fa 100644
--- a/tests/ui/error-emitter/multiline-multipart-suggestion.svg
+++ b/tests/ui/error-emitter/multiline-multipart-suggestion.svg
@@ -1,7 +1,7 @@
 <svg width="1306px" height="866px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
+    .bg { fill: #000000 }
     .fg-ansi256-009 { fill: #FF5555 }
     .fg-ansi256-010 { fill: #55FF55 }
     .fg-ansi256-012 { fill: #5555FF }
diff --git a/tests/ui/error-emitter/multiline-multipart-suggestion.windows.svg b/tests/ui/error-emitter/multiline-multipart-suggestion.windows.svg
index 144e57165da..37dc37e3e04 100644
--- a/tests/ui/error-emitter/multiline-multipart-suggestion.windows.svg
+++ b/tests/ui/error-emitter/multiline-multipart-suggestion.windows.svg
@@ -1,7 +1,7 @@
 <svg width="1306px" height="866px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
+    .bg { fill: #000000 }
     .fg-ansi256-009 { fill: #FF5555 }
     .fg-ansi256-010 { fill: #55FF55 }
     .fg-ansi256-014 { fill: #55FFFF }
diff --git a/tests/ui/error-emitter/multiline-removal-suggestion.svg b/tests/ui/error-emitter/multiline-removal-suggestion.svg
index 7a88ac55b23..a774d558b58 100644
--- a/tests/ui/error-emitter/multiline-removal-suggestion.svg
+++ b/tests/ui/error-emitter/multiline-removal-suggestion.svg
@@ -1,7 +1,7 @@
-<svg width="2238px" height="3890px" xmlns="http://www.w3.org/2000/svg">
+<svg width="2288px" height="3890px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
+    .bg { fill: #000000 }
     .fg-ansi256-009 { fill: #FF5555 }
     .fg-ansi256-010 { fill: #55FF55 }
     .fg-ansi256-012 { fill: #5555FF }
diff --git a/tests/ui/error-emitter/unicode-output.svg b/tests/ui/error-emitter/unicode-output.svg
index b253fff643b..bda4d1a2f28 100644
--- a/tests/ui/error-emitter/unicode-output.svg
+++ b/tests/ui/error-emitter/unicode-output.svg
@@ -1,7 +1,7 @@
 <svg width="785px" height="434px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
+    .bg { fill: #000000 }
     .fg-ansi256-009 { fill: #FF5555 }
     .fg-ansi256-010 { fill: #55FF55 }
     .fg-ansi256-012 { fill: #5555FF }
diff --git a/tests/ui/errors/auxiliary/remapped_dep.rs b/tests/ui/errors/auxiliary/remapped_dep.rs
index 36d4699a306..997118f822c 100644
--- a/tests/ui/errors/auxiliary/remapped_dep.rs
+++ b/tests/ui/errors/auxiliary/remapped_dep.rs
@@ -1,4 +1,4 @@
 //@ compile-flags: --remap-path-prefix={{src-base}}/errors/auxiliary=remapped-aux
-// no-remap-src-base: Manually remap, so the remapped path remains in .stderr file.
+// Manually remap, so the remapped path remains in .stderr file.
 
 pub struct SomeStruct {} // This line should be show as part of the error.
diff --git a/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr b/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr
index b4f83f6bfc0..b2651f3e03a 100644
--- a/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr
+++ b/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr
@@ -1,5 +1,5 @@
 error[E0423]: expected value, found struct `remapped_dep::SomeStruct`
-  --> $DIR/remap-path-prefix-reverse.rs:16:13
+  --> $DIR/remap-path-prefix-reverse.rs:15:13
    |
 LL |     let _ = remapped_dep::SomeStruct;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `remapped_dep::SomeStruct {}`
diff --git a/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr b/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr
index b4f83f6bfc0..b2651f3e03a 100644
--- a/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr
+++ b/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr
@@ -1,5 +1,5 @@
 error[E0423]: expected value, found struct `remapped_dep::SomeStruct`
-  --> $DIR/remap-path-prefix-reverse.rs:16:13
+  --> $DIR/remap-path-prefix-reverse.rs:15:13
    |
 LL |     let _ = remapped_dep::SomeStruct;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `remapped_dep::SomeStruct {}`
diff --git a/tests/ui/errors/remap-path-prefix-reverse.rs b/tests/ui/errors/remap-path-prefix-reverse.rs
index 28fdabb8f4d..562e44690f7 100644
--- a/tests/ui/errors/remap-path-prefix-reverse.rs
+++ b/tests/ui/errors/remap-path-prefix-reverse.rs
@@ -2,7 +2,6 @@
 //@ compile-flags: --remap-path-prefix={{src-base}}/errors/auxiliary=remapped-aux
 
 //@ revisions: local-self remapped-self
-// [local-self] no-remap-src-base: The hack should work regardless of remapping.
 //@ [remapped-self] remap-src-base
 
 // Verify that the expected source code is shown.
diff --git a/tests/ui/errors/remap-path-prefix.rs b/tests/ui/errors/remap-path-prefix.rs
index 7e38e16280f..de18aa8cc20 100644
--- a/tests/ui/errors/remap-path-prefix.rs
+++ b/tests/ui/errors/remap-path-prefix.rs
@@ -2,7 +2,7 @@
 //@ compile-flags: --remap-path-prefix={{src-base}}=remapped
 //@ [with-diagnostic-scope]compile-flags: -Zremap-path-scope=diagnostics
 //@ [without-diagnostic-scope]compile-flags: -Zremap-path-scope=object
-// no-remap-src-base: Manually remap, so the remapped path remains in .stderr file.
+// Manually remap, so the remapped path remains in .stderr file.
 
 // The remapped paths are not normalized by compiletest.
 //@ normalize-stderr: "\\(errors)" -> "/$1"
diff --git a/tests/ui/errors/span-format_args-issue-140578.rs b/tests/ui/errors/span-format_args-issue-140578.rs
new file mode 100644
index 00000000000..8c91ded8337
--- /dev/null
+++ b/tests/ui/errors/span-format_args-issue-140578.rs
@@ -0,0 +1,32 @@
+fn check_format_args() {
+  print!("{:?} {a} {a:?}", [], a = 1 + 1);
+  //~^ ERROR type annotations needed
+}
+
+fn check_format_args_nl() {
+  println!("{:?} {a} {a:?}", [], a = 1 + 1);
+  //~^ ERROR type annotations needed
+}
+
+fn check_multi1() {
+  println!("{:?} {:?} {a} {a:?}", [], [], a = 1 + 1);
+  //~^ ERROR type annotations needed
+}
+
+fn check_multi2() {
+  println!("{:?} {:?} {a} {a:?} {b:?}", [], [], a = 1 + 1, b = []);
+  //~^ ERROR type annotations needed
+}
+
+fn check_unformatted() {
+  println!("
+  {:?} {:?}
+{a}
+{a:?}",
+        [],
+        //~^ ERROR type annotations needed
+ [],
+a = 1 + 1);
+}
+
+fn main() {}
diff --git a/tests/ui/errors/span-format_args-issue-140578.stderr b/tests/ui/errors/span-format_args-issue-140578.stderr
new file mode 100644
index 00000000000..6a273e5cd51
--- /dev/null
+++ b/tests/ui/errors/span-format_args-issue-140578.stderr
@@ -0,0 +1,43 @@
+error[E0282]: type annotations needed
+  --> $DIR/span-format_args-issue-140578.rs:2:28
+   |
+LL |   print!("{:?} {a} {a:?}", [], a = 1 + 1);
+   |                            ^^ cannot infer type
+   |
+   = note: this error originates in the macro `$crate::format_args` which comes from the expansion of the macro `print` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0282]: type annotations needed
+  --> $DIR/span-format_args-issue-140578.rs:7:30
+   |
+LL |   println!("{:?} {a} {a:?}", [], a = 1 + 1);
+   |                              ^^ cannot infer type
+   |
+   = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0282]: type annotations needed
+  --> $DIR/span-format_args-issue-140578.rs:12:35
+   |
+LL |   println!("{:?} {:?} {a} {a:?}", [], [], a = 1 + 1);
+   |                                   ^^ cannot infer type
+   |
+   = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0282]: type annotations needed
+  --> $DIR/span-format_args-issue-140578.rs:17:41
+   |
+LL |   println!("{:?} {:?} {a} {a:?} {b:?}", [], [], a = 1 + 1, b = []);
+   |                                         ^^ cannot infer type
+   |
+   = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0282]: type annotations needed
+  --> $DIR/span-format_args-issue-140578.rs:26:9
+   |
+LL |         [],
+   |         ^^ cannot infer type
+   |
+   = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/explicit-tail-calls/c-variadic.rs b/tests/ui/explicit-tail-calls/c-variadic.rs
new file mode 100644
index 00000000000..e6eebe4228e
--- /dev/null
+++ b/tests/ui/explicit-tail-calls/c-variadic.rs
@@ -0,0 +1,14 @@
+#![expect(incomplete_features)]
+#![feature(c_variadic, explicit_tail_calls)]
+#![allow(unused)]
+
+unsafe extern "C" fn foo(mut ap: ...) -> u32 {
+    ap.arg::<u32>()
+}
+
+extern "C" fn bar() -> u32 {
+    unsafe { become foo(1, 2, 3) }
+    //~^ ERROR c-variadic functions can't be tail-called
+}
+
+fn main() {}
diff --git a/tests/ui/explicit-tail-calls/c-variadic.stderr b/tests/ui/explicit-tail-calls/c-variadic.stderr
new file mode 100644
index 00000000000..5293339d218
--- /dev/null
+++ b/tests/ui/explicit-tail-calls/c-variadic.stderr
@@ -0,0 +1,8 @@
+error: c-variadic functions can't be tail-called
+  --> $DIR/c-variadic.rs:10:14
+   |
+LL |     unsafe { become foo(1, 2, 3) }
+   |              ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/explicit-tail-calls/callee_is_track_caller.rs b/tests/ui/explicit-tail-calls/callee_is_track_caller.rs
index b85b335844b..1246a3801fc 100644
--- a/tests/ui/explicit-tail-calls/callee_is_track_caller.rs
+++ b/tests/ui/explicit-tail-calls/callee_is_track_caller.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ ignore-pass
+//@ ignore-backends: gcc
 #![expect(incomplete_features)]
 #![feature(explicit_tail_calls)]
 
diff --git a/tests/ui/explicit-tail-calls/callee_is_track_caller.stderr b/tests/ui/explicit-tail-calls/callee_is_track_caller.stderr
index e1a251d156f..020a0542a57 100644
--- a/tests/ui/explicit-tail-calls/callee_is_track_caller.stderr
+++ b/tests/ui/explicit-tail-calls/callee_is_track_caller.stderr
@@ -1,5 +1,5 @@
 warning: tail calling a function marked with `#[track_caller]` has no special effect
-  --> $DIR/callee_is_track_caller.rs:7:12
+  --> $DIR/callee_is_track_caller.rs:8:12
    |
 LL |     become b(x);
    |            ^^^^
diff --git a/tests/ui/explicit-tail-calls/callee_is_track_caller_polymorphic.rs b/tests/ui/explicit-tail-calls/callee_is_track_caller_polymorphic.rs
index 33384de83eb..51688897b40 100644
--- a/tests/ui/explicit-tail-calls/callee_is_track_caller_polymorphic.rs
+++ b/tests/ui/explicit-tail-calls/callee_is_track_caller_polymorphic.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ ignore-pass
+//@ ignore-backends: gcc
 #![expect(incomplete_features)]
 #![feature(explicit_tail_calls)]
 
diff --git a/tests/ui/explicit-tail-calls/callee_is_track_caller_polymorphic.stderr b/tests/ui/explicit-tail-calls/callee_is_track_caller_polymorphic.stderr
index 5a1c40509ad..7b4c144acff 100644
--- a/tests/ui/explicit-tail-calls/callee_is_track_caller_polymorphic.stderr
+++ b/tests/ui/explicit-tail-calls/callee_is_track_caller_polymorphic.stderr
@@ -1,5 +1,5 @@
 warning: tail calling a function marked with `#[track_caller]` has no special effect
-  --> $DIR/callee_is_track_caller_polymorphic.rs:7:12
+  --> $DIR/callee_is_track_caller_polymorphic.rs:8:12
    |
 LL |     become T::f();
    |            ^^^^^^
diff --git a/tests/ui/explicit-tail-calls/callee_is_weird.stderr b/tests/ui/explicit-tail-calls/callee_is_weird.stderr
index a4e5a38ce33..9a5da28b559 100644
--- a/tests/ui/explicit-tail-calls/callee_is_weird.stderr
+++ b/tests/ui/explicit-tail-calls/callee_is_weird.stderr
@@ -12,7 +12,7 @@ error: tail calls can only be performed with function definitions or pointers
 LL |     become (&mut &std::sync::Exclusive::new(f))()
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: callee has type `Exclusive<fn() {f}>`
+   = note: callee has type `&Exclusive<fn() {f}>`
 
 error: tail calls can only be performed with function definitions or pointers
   --> $DIR/callee_is_weird.rs:22:12
diff --git a/tests/ui/explicit-tail-calls/drop-order.rs b/tests/ui/explicit-tail-calls/drop-order.rs
index 58e1afbdf0c..ff6e2f09f57 100644
--- a/tests/ui/explicit-tail-calls/drop-order.rs
+++ b/tests/ui/explicit-tail-calls/drop-order.rs
@@ -1,4 +1,5 @@
 //@ run-pass
+//@ ignore-backends: gcc
 #![expect(incomplete_features)]
 #![feature(explicit_tail_calls)]
 use std::cell::RefCell;
diff --git a/tests/ui/explicit-tail-calls/indexer.rs b/tests/ui/explicit-tail-calls/indexer.rs
index 5644506b2f5..c26d9774ce7 100644
--- a/tests/ui/explicit-tail-calls/indexer.rs
+++ b/tests/ui/explicit-tail-calls/indexer.rs
@@ -1,4 +1,5 @@
 //@ run-pass
+//@ ignore-backends: gcc
 // Indexing taken from
 // https://github.com/phi-go/rfcs/blob/guaranteed-tco/text%2F0000-explicit-tail-calls.md#tail-call-elimination
 // no other test has utilized the "function table"
diff --git a/tests/ui/explicit-tail-calls/recursion-etc.rs b/tests/ui/explicit-tail-calls/recursion-etc.rs
index 8c89ceb7869..c22401d2379 100644
--- a/tests/ui/explicit-tail-calls/recursion-etc.rs
+++ b/tests/ui/explicit-tail-calls/recursion-etc.rs
@@ -1,4 +1,5 @@
 //@ run-pass
+//@ ignore-backends: gcc
 #![expect(incomplete_features)]
 #![feature(explicit_tail_calls)]
 
diff --git a/tests/ui/extern/extern-types-field-offset.rs b/tests/ui/extern/extern-types-field-offset.rs
index 035f063cd50..470ae07a0b5 100644
--- a/tests/ui/extern/extern-types-field-offset.rs
+++ b/tests/ui/extern/extern-types-field-offset.rs
@@ -2,6 +2,7 @@
 //@ check-run-results
 //@ exec-env:RUST_BACKTRACE=0
 //@ normalize-stderr: "(core/src/panicking\.rs):[0-9]+:[0-9]+" -> "$1:$$LINE:$$COL"
+//@ ignore-backends: gcc
 #![feature(extern_types)]
 
 extern "C" {
@@ -22,12 +23,17 @@ fn main() {
     let x: &Newtype = unsafe { &*(&buf as *const _ as *const Newtype) };
     // Projecting to the newtype works, because it is always at offset 0.
     let field = &x.0;
+    // Avoid being eliminated by DSE.
+    std::hint::black_box(field);
 
     let x: &S = unsafe { &*(&buf as *const _ as *const S) };
     // Accessing sized fields is perfectly fine, even at non-zero offsets.
     let field = &x.i;
+    std::hint::black_box(field);
     let field = &x.j;
+    std::hint::black_box(field);
     // This needs to compute the field offset, but we don't know the type's alignment,
     // so this panics.
     let field = &x.a;
+    std::hint::black_box(field);
 }
diff --git a/tests/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs b/tests/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs
index 1cd52b70315..4d0afa1cdfa 100644
--- a/tests/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs
+++ b/tests/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs
@@ -21,6 +21,7 @@
 //@[no]compile-flags: -C lto=no
 //@[thin]compile-flags: -C lto=thin
 //@[fat]compile-flags: -C lto=fat
+//@ ignore-backends: gcc
 
 #![feature(panic_internals)]
 
diff --git a/tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs b/tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs
index a44eb3828d0..1fc3409c1f9 100644
--- a/tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs
+++ b/tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs
@@ -48,6 +48,7 @@
 //@[fat1]compile-flags: -C opt-level=1 -C lto=fat
 //@[fat2]compile-flags: -C opt-level=2 -C lto=fat
 //@[fat3]compile-flags: -C opt-level=3 -C lto=fat
+//@ ignore-backends: gcc
 
 fn main() {
     use std::sync::atomic::{AtomicUsize, Ordering};
diff --git a/tests/ui/feature-gates/feature-gate-adt_const_params.rs b/tests/ui/feature-gates/feature-gate-adt_const_params.rs
index 8a3bcf25963..7efa529c557 100644
--- a/tests/ui/feature-gates/feature-gate-adt_const_params.rs
+++ b/tests/ui/feature-gates/feature-gate-adt_const_params.rs
@@ -1,2 +1,6 @@
-struct Foo<const NAME: &'static str>; //~ ERROR `&'static str` is forbidden
+struct Bar(u8);
+
+struct Foo<const N: Bar>;
+//~^ ERROR: `Bar` is forbidden as the type of a const generic parameter
+
 fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-adt_const_params.stderr b/tests/ui/feature-gates/feature-gate-adt_const_params.stderr
index 18d514f8cb5..7ea91a8f4c2 100644
--- a/tests/ui/feature-gates/feature-gate-adt_const_params.stderr
+++ b/tests/ui/feature-gates/feature-gate-adt_const_params.stderr
@@ -1,18 +1,14 @@
-error: `&'static str` is forbidden as the type of a const generic parameter
-  --> $DIR/feature-gate-adt_const_params.rs:1:24
+error: `Bar` is forbidden as the type of a const generic parameter
+  --> $DIR/feature-gate-adt_const_params.rs:3:21
    |
-LL | struct Foo<const NAME: &'static str>;
-   |                        ^^^^^^^^^^^^
+LL | struct Foo<const N: Bar>;
+   |                     ^^^
    |
    = note: the only supported types are integers, `bool`, and `char`
 help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
    |
 LL + #![feature(adt_const_params)]
    |
-help: add `#![feature(unsized_const_params)]` to the crate attributes to enable references to implement the `ConstParamTy` trait
-   |
-LL + #![feature(unsized_const_params)]
-   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/feature-gates/feature-gate-c_variadic.rs b/tests/ui/feature-gates/feature-gate-c_variadic.rs
index 88d91dbd081..649816b48d7 100644
--- a/tests/ui/feature-gates/feature-gate-c_variadic.rs
+++ b/tests/ui/feature-gates/feature-gate-c_variadic.rs
@@ -6,5 +6,4 @@ pub unsafe extern "C" fn test(_: i32, ap: ...) {}
 trait Trait {
     unsafe extern "C" fn trait_test(_: i32, ap: ...) {}
     //~^ ERROR C-variadic functions are unstable
-    //~| ERROR associated functions cannot have a C variable argument list
 }
diff --git a/tests/ui/feature-gates/feature-gate-c_variadic.stderr b/tests/ui/feature-gates/feature-gate-c_variadic.stderr
index 808aa20948d..ae880093b98 100644
--- a/tests/ui/feature-gates/feature-gate-c_variadic.stderr
+++ b/tests/ui/feature-gates/feature-gate-c_variadic.stderr
@@ -1,9 +1,3 @@
-error: associated functions cannot have a C variable argument list
-  --> $DIR/feature-gate-c_variadic.rs:7:45
-   |
-LL |     unsafe extern "C" fn trait_test(_: i32, ap: ...) {}
-   |                                             ^^^^^^^
-
 error[E0658]: C-variadic functions are unstable
   --> $DIR/feature-gate-c_variadic.rs:3:1
    |
@@ -24,6 +18,6 @@ LL |     unsafe extern "C" fn trait_test(_: i32, ap: ...) {}
    = help: add `#![feature(c_variadic)]` 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 3 previous errors
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/feature-gates/feature-gate-doc_cfg.rs b/tests/ui/feature-gates/feature-gate-doc_cfg.rs
index b12b8a10571..213a5a8c5a9 100644
--- a/tests/ui/feature-gates/feature-gate-doc_cfg.rs
+++ b/tests/ui/feature-gates/feature-gate-doc_cfg.rs
@@ -1,2 +1,2 @@
-#[doc(cfg(unix))] //~ ERROR: `#[doc(cfg)]` is experimental
+#[doc(cfg(unix))] //~ ERROR
 fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-macro-attr.stderr b/tests/ui/feature-gates/feature-gate-macro-attr.stderr
index b58418527c5..75bc93e8027 100644
--- a/tests/ui/feature-gates/feature-gate-macro-attr.stderr
+++ b/tests/ui/feature-gates/feature-gate-macro-attr.stderr
@@ -4,7 +4,7 @@ error[E0658]: `macro_rules!` attributes are unstable
 LL | macro_rules! myattr { attr() {} => {} }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
+   = note: see issue #143547 <https://github.com/rust-lang/rust/issues/143547> for more information
    = help: add `#![feature(macro_attr)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
diff --git a/tests/ui/feature-gates/feature-gate-macro-derive.stderr b/tests/ui/feature-gates/feature-gate-macro-derive.stderr
index b7ca6717bd5..177518edafb 100644
--- a/tests/ui/feature-gates/feature-gate-macro-derive.stderr
+++ b/tests/ui/feature-gates/feature-gate-macro-derive.stderr
@@ -4,8 +4,8 @@ error[E0658]: `macro_rules!` derives are unstable
 LL | macro_rules! MyDerive { derive() {} => {} }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
-   = help: add `#![feature(macro_attr)]` to the crate attributes to enable
+   = note: see issue #143549 <https://github.com/rust-lang/rust/issues/143549> for more information
+   = help: add `#![feature(macro_derive)]` 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 1 previous error
diff --git a/tests/ui/feature-gates/feature-gate-never_patterns.stderr b/tests/ui/feature-gates/feature-gate-never_patterns.stderr
index 473e263c796..e655209924a 100644
--- a/tests/ui/feature-gates/feature-gate-never_patterns.stderr
+++ b/tests/ui/feature-gates/feature-gate-never_patterns.stderr
@@ -8,7 +8,7 @@ help: try adding parentheses to match on a tuple...
    |
 LL |         (Some(_),)
    |         +        +
-help: ...or a vertical bar to match on multiple alternatives
+help: ...or a vertical bar to match on alternatives
    |
 LL -         Some(_),
 LL +         Some(_) |
diff --git a/tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.rs b/tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.rs
index b4dc1fd4556..e37e405d1af 100644
--- a/tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.rs
+++ b/tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.rs
@@ -3,7 +3,7 @@ fn main() {
         //~^ ERROR non-exhaustive patterns: `usize::MAX..` not covered
         //~| NOTE pattern `usize::MAX..` not covered
         //~| NOTE the matched value is of type `usize`
-        //~| NOTE `usize` does not have a fixed maximum value
+        //~| NOTE `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
         0..=usize::MAX => {}
     }
 
@@ -11,7 +11,7 @@ fn main() {
         //~^ ERROR non-exhaustive patterns: `..isize::MIN` and `isize::MAX..` not covered
         //~| NOTE patterns `..isize::MIN` and `isize::MAX..` not covered
         //~| NOTE the matched value is of type `isize`
-        //~| NOTE `isize` does not have fixed minimum and maximum values
+        //~| NOTE `isize::MIN` and `isize::MAX` are not treated as exhaustive, so half-open ranges are necessary to match exhaustively
         isize::MIN..=isize::MAX => {}
     }
 }
diff --git a/tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr b/tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr
index c89dcaf727a..cfb00d6e741 100644
--- a/tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr
+++ b/tests/ui/feature-gates/feature-gate-precise_pointer_size_matching.stderr
@@ -5,7 +5,7 @@ LL |     match 0usize {
    |           ^^^^^^ pattern `usize::MAX..` not covered
    |
    = note: the matched value is of type `usize`
-   = note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
+   = note: `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
 LL ~         0..=usize::MAX => {},
@@ -19,7 +19,7 @@ LL |     match 0isize {
    |           ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
    |
    = note: the matched value is of type `isize`
-   = note: `isize` does not have fixed minimum and maximum values, so half-open ranges are necessary to match exhaustively
+   = note: `isize::MIN` and `isize::MAX` are not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
    |
 LL ~         isize::MIN..=isize::MAX => {},
diff --git a/tests/ui/feature-gates/feature-gate-reborrow-coerce-shared.rs b/tests/ui/feature-gates/feature-gate-reborrow-coerce-shared.rs
new file mode 100644
index 00000000000..c8ca4537089
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-reborrow-coerce-shared.rs
@@ -0,0 +1,3 @@
+use std::ops::CoerceShared; //~ ERROR  use of unstable library feature `reborrow`
+
+fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-reborrow-coerce-shared.stderr b/tests/ui/feature-gates/feature-gate-reborrow-coerce-shared.stderr
new file mode 100644
index 00000000000..dbbbcdf2fd5
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-reborrow-coerce-shared.stderr
@@ -0,0 +1,13 @@
+error[E0658]: use of unstable library feature `reborrow`
+  --> $DIR/feature-gate-reborrow-coerce-shared.rs:1:5
+   |
+LL | use std::ops::CoerceShared;
+   |     ^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #145612 <https://github.com/rust-lang/rust/issues/145612> for more information
+   = help: add `#![feature(reborrow)]` 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 1 previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/feature-gates/feature-gate-reborrow.rs b/tests/ui/feature-gates/feature-gate-reborrow.rs
index f016f6c6bfa..96eecfb28a1 100644
--- a/tests/ui/feature-gates/feature-gate-reborrow.rs
+++ b/tests/ui/feature-gates/feature-gate-reborrow.rs
@@ -1,3 +1,3 @@
-use std::marker::Reborrow; //~ ERROR  use of unstable library feature `reborrow`
+use std::ops::Reborrow; //~ ERROR  use of unstable library feature `reborrow`
 
 fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-reborrow.stderr b/tests/ui/feature-gates/feature-gate-reborrow.stderr
index 5e3033f3bf1..1224909f564 100644
--- a/tests/ui/feature-gates/feature-gate-reborrow.stderr
+++ b/tests/ui/feature-gates/feature-gate-reborrow.stderr
@@ -1,8 +1,8 @@
 error[E0658]: use of unstable library feature `reborrow`
   --> $DIR/feature-gate-reborrow.rs:1:5
    |
-LL | use std::marker::Reborrow;
-   |     ^^^^^^^^^^^^^^^^^^^^^
+LL | use std::ops::Reborrow;
+   |     ^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #145612 <https://github.com/rust-lang/rust/issues/145612> for more information
    = help: add `#![feature(reborrow)]` to the crate attributes to enable
diff --git a/tests/ui/feature-gates/feature-gate-sanitize.stderr b/tests/ui/feature-gates/feature-gate-sanitize.stderr
index 513999636a9..59e8b69de2e 100644
--- a/tests/ui/feature-gates/feature-gate-sanitize.stderr
+++ b/tests/ui/feature-gates/feature-gate-sanitize.stderr
@@ -4,7 +4,7 @@ error[E0557]: feature has been removed
 LL | #![feature(no_sanitize)]
    |            ^^^^^^^^^^^ feature has been removed
    |
-   = note: removed in CURRENT_RUSTC_VERSION; see <https://github.com/rust-lang/rust/pull/142681> for more information
+   = note: removed in 1.91.0; see <https://github.com/rust-lang/rust/pull/142681> for more information
    = note: renamed to sanitize(xyz = "on|off")
 
 error[E0658]: the `#[sanitize]` attribute is an experimental feature
diff --git a/tests/ui/feature-gates/feature-gate-static_align-thread_local.rs b/tests/ui/feature-gates/feature-gate-static_align-thread_local.rs
new file mode 100644
index 00000000000..29d4facffce
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-static_align-thread_local.rs
@@ -0,0 +1,11 @@
+// The feature gate error may be emitted twice, but only on certain targets
+//@ dont-require-annotations: ERROR
+//@ dont-check-compiler-stderr
+
+#![crate_type = "lib"]
+
+thread_local! {
+    //~^ ERROR the `#[rustc_align_static]` attribute is an experimental feature
+    #[rustc_align_static(16)]
+    static THREAD_LOCAL: u16 = 0;
+}
diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs
index f391cf92fb6..a1a78df8d53 100644
--- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs
+++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs
@@ -8,7 +8,7 @@
 
 
 #![macro_export]
-//~^ ERROR: `macro_export` attribute cannot be used at crate level
+//~^ ERROR:  `#[macro_export]` attribute cannot be used on crates
 #![rustc_main]
 //~^ ERROR: `rustc_main` attribute cannot be used at crate level
 //~| ERROR: use of an internal attribute [E0658]
@@ -32,7 +32,6 @@
 mod inline {
     //~^ NOTE the inner attribute doesn't annotate this module
     //~| NOTE the inner attribute doesn't annotate this module
-    //~| NOTE the inner attribute doesn't annotate this module
 
     mod inner { #![inline] }
     //~^ ERROR attribute cannot be used on
diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
index 3b010c3e312..4f4edeef420 100644
--- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
+++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
@@ -8,6 +8,14 @@ LL | #![rustc_main]
    = note: the `#[rustc_main]` attribute is an internal implementation detail that will never be stable
    = note: the `#[rustc_main]` attribute is used internally to specify test entry point function
 
+error: `#[macro_export]` attribute cannot be used on crates
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:10:1
+   |
+LL | #![macro_export]
+   | ^^^^^^^^^^^^^^^^
+   |
+   = help: `#[macro_export]` can only be applied to macro defs
+
 error: `#[path]` attribute cannot be used on crates
   --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:19:1
    |
@@ -49,7 +57,7 @@ LL | #[inline]
    = help: `#[inline]` can only be applied to functions
 
 error: `#[inline]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:37:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:36:17
    |
 LL |     mod inner { #![inline] }
    |                 ^^^^^^^^^^
@@ -57,7 +65,7 @@ LL |     mod inner { #![inline] }
    = help: `#[inline]` can only be applied to functions
 
 error: `#[inline]` attribute cannot be used on structs
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:46:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:45:5
    |
 LL |     #[inline] struct S;
    |     ^^^^^^^^^
@@ -65,7 +73,7 @@ LL |     #[inline] struct S;
    = help: `#[inline]` can only be applied to functions
 
 error: `#[inline]` attribute cannot be used on type aliases
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:49:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:48:5
    |
 LL |     #[inline] type T = S;
    |     ^^^^^^^^^
@@ -73,7 +81,7 @@ LL |     #[inline] type T = S;
    = help: `#[inline]` can only be applied to functions
 
 error: `#[inline]` attribute cannot be used on inherent impl blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:52:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:51:5
    |
 LL |     #[inline] impl S { }
    |     ^^^^^^^^^
@@ -81,7 +89,7 @@ LL |     #[inline] impl S { }
    = help: `#[inline]` can only be applied to functions
 
 error: `#[export_name]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:82:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:81:1
    |
 LL | #[export_name = "2200"]
    | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -89,7 +97,7 @@ LL | #[export_name = "2200"]
    = help: `#[export_name]` can be applied to functions and statics
 
 error: `#[export_name]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:85:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:84:17
    |
 LL |     mod inner { #![export_name="2200"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^
@@ -97,7 +105,7 @@ LL |     mod inner { #![export_name="2200"] }
    = help: `#[export_name]` can be applied to functions and statics
 
 error: `#[export_name]` attribute cannot be used on structs
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:90:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:89:5
    |
 LL |     #[export_name = "2200"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^
@@ -105,7 +113,7 @@ LL |     #[export_name = "2200"] struct S;
    = help: `#[export_name]` can be applied to functions and statics
 
 error: `#[export_name]` attribute cannot be used on type aliases
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:93:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:92:5
    |
 LL |     #[export_name = "2200"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^
@@ -113,7 +121,7 @@ LL |     #[export_name = "2200"] type T = S;
    = help: `#[export_name]` can be applied to functions and statics
 
 error: `#[export_name]` attribute cannot be used on inherent impl blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:96:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:95:5
    |
 LL |     #[export_name = "2200"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^
@@ -121,7 +129,7 @@ LL |     #[export_name = "2200"] impl S { }
    = help: `#[export_name]` can be applied to functions and statics
 
 error: `#[export_name]` attribute cannot be used on required trait methods
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:100:9
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:99:9
    |
 LL |         #[export_name = "2200"] fn foo();
    |         ^^^^^^^^^^^^^^^^^^^^^^^
@@ -129,7 +137,7 @@ LL |         #[export_name = "2200"] fn foo();
    = help: `#[export_name]` can be applied to statics, functions, inherent methods, provided trait methods, and trait methods in impl blocks
 
 error: attribute should be applied to an `extern crate` item
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:56:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:55:1
    |
 LL |   #[no_link]
    |   ^^^^^^^^^^
@@ -143,7 +151,7 @@ LL | | }
    | |_- not an `extern crate` item
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:107:8
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:106:8
    |
 LL |   #[repr(C)]
    |          ^
@@ -156,7 +164,7 @@ LL | | }
    | |_- not a struct, enum, or union
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:131:8
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:130:8
    |
 LL |   #[repr(Rust)]
    |          ^^^^
@@ -174,21 +182,6 @@ error: attribute should be applied to an `extern crate` item
 LL | #![no_link]
    | ^^^^^^^^^^^ not an `extern crate` item
 
-error: `macro_export` attribute cannot be used at crate level
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:10:1
-   |
-LL | #![macro_export]
-   | ^^^^^^^^^^^^^^^^
-...
-LL | mod inline {
-   |     ------ the inner attribute doesn't annotate this module
-   |
-help: perhaps you meant to use an outer attribute
-   |
-LL - #![macro_export]
-LL + #[macro_export]
-   |
-
 error: `rustc_main` attribute cannot be used at crate level
   --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:12:1
    |
@@ -220,85 +213,85 @@ LL + #[repr()]
    |
 
 error: attribute should be applied to an `extern crate` item
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:61:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:60:17
    |
 LL |     mod inner { #![no_link] }
    |     ------------^^^^^^^^^^^-- not an `extern crate` item
 
 error: attribute should be applied to an `extern crate` item
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:65:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:64:5
    |
 LL |     #[no_link] fn f() { }
    |     ^^^^^^^^^^ ---------- not an `extern crate` item
 
 error: attribute should be applied to an `extern crate` item
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:69:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:68:5
    |
 LL |     #[no_link] struct S;
    |     ^^^^^^^^^^ --------- not an `extern crate` item
 
 error: attribute should be applied to an `extern crate` item
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:73:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:72:5
    |
 LL |     #[no_link]type T = S;
    |     ^^^^^^^^^^----------- not an `extern crate` item
 
 error: attribute should be applied to an `extern crate` item
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:77:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:76:5
    |
 LL |     #[no_link] impl S { }
    |     ^^^^^^^^^^ ---------- not an `extern crate` item
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:111:25
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:110:25
    |
 LL |     mod inner { #![repr(C)] }
    |     --------------------^---- not a struct, enum, or union
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:115:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:114:12
    |
 LL |     #[repr(C)] fn f() { }
    |            ^   ---------- not a struct, enum, or union
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:121:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:120:12
    |
 LL |     #[repr(C)] type T = S;
    |            ^   ----------- not a struct, enum, or union
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:125:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:124:12
    |
 LL |     #[repr(C)] impl S { }
    |            ^   ---------- not a struct, enum, or union
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:135:25
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:134:25
    |
 LL |     mod inner { #![repr(Rust)] }
    |     --------------------^^^^---- not a struct, enum, or union
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:139:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:138:12
    |
 LL |     #[repr(Rust)] fn f() { }
    |            ^^^^   ---------- not a struct, enum, or union
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:145:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:144:12
    |
 LL |     #[repr(Rust)] type T = S;
    |            ^^^^   ----------- not a struct, enum, or union
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:149:12
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:148:12
    |
 LL |     #[repr(Rust)] impl S { }
    |            ^^^^   ---------- not a struct, enum, or union
 
 error: valid forms for the attribute are `#[inline(always)]`, `#[inline(never)]`, and `#[inline]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:40:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:39:5
    |
 LL |     #[inline = "2100"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^
@@ -313,7 +306,7 @@ Some errors have detailed explanations: E0517, E0658.
 For more information about an error, try `rustc --explain E0517`.
 Future incompatibility report: Future breakage diagnostic:
 error: valid forms for the attribute are `#[inline(always)]`, `#[inline(never)]`, and `#[inline]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:40:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:39:5
    |
 LL |     #[inline = "2100"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
index 546aa4052d3..aa5aab41e72 100644
--- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
+++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
@@ -214,22 +214,40 @@ mod macro_use {
 }
 
 #[macro_export]
-//~^ WARN `#[macro_export]` only has an effect on macro definitions
+//~^ WARN `#[macro_export]` attribute cannot be used on modules [unused_attributes]
+//~| WARN previously accepted
+//~| HELP can only be applied to
+//~| HELP remove the attribute
 mod macro_export {
     mod inner { #![macro_export] }
-    //~^ WARN `#[macro_export]` only has an effect on macro definitions
+    //~^ WARN `#[macro_export]` attribute cannot be used on modules
+    //~| WARN previously accepted
+    //~| HELP can only be applied to
+    //~| HELP remove the attribute
 
     #[macro_export] fn f() { }
-    //~^ WARN `#[macro_export]` only has an effect on macro definitions
+    //~^ WARN `#[macro_export]` attribute cannot be used on function
+    //~| WARN previously accepted
+    //~| HELP can only be applied to
+    //~| HELP remove the attribute
 
     #[macro_export] struct S;
-    //~^ WARN `#[macro_export]` only has an effect on macro definitions
+    //~^ WARN `#[macro_export]` attribute cannot be used on structs
+    //~| WARN previously accepted
+    //~| HELP can only be applied to
+    //~| HELP remove the attribute
 
     #[macro_export] type T = S;
-    //~^ WARN `#[macro_export]` only has an effect on macro definitions
+    //~^ WARN `#[macro_export]` attribute cannot be used on type aliases
+    //~| WARN previously accepted
+    //~| HELP can only be applied to
+    //~| HELP remove the attribute
 
     #[macro_export] impl S { }
-    //~^ WARN `#[macro_export]` only has an effect on macro definitions
+    //~^ WARN  `#[macro_export]` attribute cannot be used on inherent impl blocks
+    //~| WARN previously accepted
+    //~| HELP can only be applied to
+    //~| HELP remove the attribute
 }
 
 // At time of unit test authorship, if compiling without `--test` then
diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
index 3c835be5cff..5e2029c4516 100644
--- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
+++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
@@ -1,5 +1,5 @@
 warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:511:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:529:17
    |
 LL |     mod inner { #![macro_escape] }
    |                 ^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL |     mod inner { #![macro_escape] }
    = help: try an outer attribute: `#[macro_use]`
 
 warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:508:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:526:1
    |
 LL | #[macro_escape]
    | ^^^^^^^^^^^^^^^
@@ -186,31 +186,24 @@ warning: unknown lint: `x5100`
 LL |     #[deny(x5100)] impl S { }
    |            ^^^^^
 
-warning: `#[macro_export]` only has an effect on macro definitions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:216:1
+warning: crate-level attribute should be an inner attribute
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:501:1
    |
-LL | #[macro_export]
-   | ^^^^^^^^^^^^^^^
+LL | #[reexport_test_harness_main = "2900"]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: the lint level is defined here
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:37:9
    |
 LL | #![warn(unused_attributes, unknown_lints)]
    |         ^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:483:1
-   |
-LL | #[reexport_test_harness_main = "2900"]
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
 help: add a `!`
    |
 LL | #![reexport_test_harness_main = "2900"]
    |  +
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:713:1
    |
 LL |   #[link(name = "x")]
    |   ^^^^^^^^^^^^^^^^^^^
@@ -226,7 +219,7 @@ LL | | }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:771:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:1
    |
 LL | #[windows_subsystem = "windows"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -237,7 +230,7 @@ LL | #![windows_subsystem = "windows"]
    |  +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:821:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:839:1
    |
 LL | #[crate_type = "0800"]
    | ^^^^^^^^^^^^^^^^^^^^^^
@@ -248,7 +241,7 @@ LL | #![crate_type = "0800"]
    |  +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:845:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:863:1
    |
 LL | #[feature(x0600)]
    | ^^^^^^^^^^^^^^^^^
@@ -259,7 +252,7 @@ LL | #![feature(x0600)]
    |  +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:870:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:888:1
    |
 LL | #[no_main]
    | ^^^^^^^^^^
@@ -270,7 +263,7 @@ LL | #![no_main]
    |  +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:894:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:912:1
    |
 LL | #[no_builtins]
    | ^^^^^^^^^^^^^^
@@ -296,44 +289,14 @@ LL | #![feature(rust1)]
    |
    = note: `#[warn(stable_features)]` on by default
 
-warning: `#[macro_export]` only has an effect on macro definitions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:219:17
-   |
-LL |     mod inner { #![macro_export] }
-   |                 ^^^^^^^^^^^^^^^^
-
-warning: `#[macro_export]` only has an effect on macro definitions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:222:5
-   |
-LL |     #[macro_export] fn f() { }
-   |     ^^^^^^^^^^^^^^^
-
-warning: `#[macro_export]` only has an effect on macro definitions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:225:5
-   |
-LL |     #[macro_export] struct S;
-   |     ^^^^^^^^^^^^^^^
-
-warning: `#[macro_export]` only has an effect on macro definitions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:228:5
-   |
-LL |     #[macro_export] type T = S;
-   |     ^^^^^^^^^^^^^^^
-
-warning: `#[macro_export]` only has an effect on macro definitions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:231:5
-   |
-LL |     #[macro_export] impl S { }
-   |     ^^^^^^^^^^^^^^^
-
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:487:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:505:17
    |
 LL |     mod inner { #![reexport_test_harness_main="2900"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:490:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:508:5
    |
 LL |     #[reexport_test_harness_main = "2900"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -344,7 +307,7 @@ LL |     #![reexport_test_harness_main = "2900"] fn f() { }
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:494:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:5
    |
 LL |     #[reexport_test_harness_main = "2900"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -355,7 +318,7 @@ LL |     #![reexport_test_harness_main = "2900"] struct S;
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:498:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:516:5
    |
 LL |     #[reexport_test_harness_main = "2900"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -366,7 +329,7 @@ LL |     #![reexport_test_harness_main = "2900"] type T = S;
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:502:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:520:5
    |
 LL |     #[reexport_test_harness_main = "2900"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -377,7 +340,7 @@ LL |     #![reexport_test_harness_main = "2900"] impl S { }
    |      +
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:701:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:719:17
    |
 LL |     mod inner { #![link(name = "x")] }
    |     ------------^^^^^^^^^^^^^^^^^^^^-- not an `extern` block
@@ -385,7 +348,7 @@ LL |     mod inner { #![link(name = "x")] }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:5
    |
 LL |     #[link(name = "x")] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^ ---------- not an `extern` block
@@ -393,7 +356,7 @@ LL |     #[link(name = "x")] fn f() { }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:711:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5
    |
 LL |     #[link(name = "x")] struct S;
    |     ^^^^^^^^^^^^^^^^^^^ --------- not an `extern` block
@@ -401,7 +364,7 @@ LL |     #[link(name = "x")] struct S;
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:734:5
    |
 LL |     #[link(name = "x")] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^ ----------- not an `extern` block
@@ -409,7 +372,7 @@ LL |     #[link(name = "x")] type T = S;
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:5
    |
 LL |     #[link(name = "x")] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^ ---------- not an `extern` block
@@ -417,7 +380,7 @@ LL |     #[link(name = "x")] impl S { }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: attribute should be applied to an `extern` block with non-Rust ABI
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:726:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:5
    |
 LL |     #[link(name = "x")] extern "Rust" {}
    |     ^^^^^^^^^^^^^^^^^^^
@@ -425,13 +388,13 @@ LL |     #[link(name = "x")] extern "Rust" {}
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:775:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:17
    |
 LL |     mod inner { #![windows_subsystem="windows"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:778:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:796:5
    |
 LL |     #[windows_subsystem = "windows"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -442,7 +405,7 @@ LL |     #![windows_subsystem = "windows"] fn f() { }
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:782:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:800:5
    |
 LL |     #[windows_subsystem = "windows"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -453,7 +416,7 @@ LL |     #![windows_subsystem = "windows"] struct S;
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:786:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:804:5
    |
 LL |     #[windows_subsystem = "windows"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -464,7 +427,7 @@ LL |     #![windows_subsystem = "windows"] type T = S;
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:790:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:808:5
    |
 LL |     #[windows_subsystem = "windows"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -475,13 +438,13 @@ LL |     #![windows_subsystem = "windows"] impl S { }
    |      +
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:825:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:843:17
    |
 LL |     mod inner { #![crate_type="0800"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:828:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:846:5
    |
 LL |     #[crate_type = "0800"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -492,7 +455,7 @@ LL |     #![crate_type = "0800"] fn f() { }
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:832:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:850:5
    |
 LL |     #[crate_type = "0800"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -503,7 +466,7 @@ LL |     #![crate_type = "0800"] struct S;
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:836:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:854:5
    |
 LL |     #[crate_type = "0800"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -514,7 +477,7 @@ LL |     #![crate_type = "0800"] type T = S;
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:840:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:858:5
    |
 LL |     #[crate_type = "0800"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -525,13 +488,13 @@ LL |     #![crate_type = "0800"] impl S { }
    |      +
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:849:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:867:17
    |
 LL |     mod inner { #![feature(x0600)] }
    |                 ^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:852:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:870:5
    |
 LL |     #[feature(x0600)] fn f() { }
    |     ^^^^^^^^^^^^^^^^^
@@ -542,7 +505,7 @@ LL |     #![feature(x0600)] fn f() { }
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:856:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:874:5
    |
 LL |     #[feature(x0600)] struct S;
    |     ^^^^^^^^^^^^^^^^^
@@ -553,7 +516,7 @@ LL |     #![feature(x0600)] struct S;
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:860:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:878:5
    |
 LL |     #[feature(x0600)] type T = S;
    |     ^^^^^^^^^^^^^^^^^
@@ -564,7 +527,7 @@ LL |     #![feature(x0600)] type T = S;
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:864:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:882:5
    |
 LL |     #[feature(x0600)] impl S { }
    |     ^^^^^^^^^^^^^^^^^
@@ -575,13 +538,13 @@ LL |     #![feature(x0600)] impl S { }
    |      +
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:874:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:892:17
    |
 LL |     mod inner { #![no_main] }
    |                 ^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:877:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:895:5
    |
 LL |     #[no_main] fn f() { }
    |     ^^^^^^^^^^
@@ -592,7 +555,7 @@ LL |     #![no_main] fn f() { }
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:881:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:899:5
    |
 LL |     #[no_main] struct S;
    |     ^^^^^^^^^^
@@ -603,7 +566,7 @@ LL |     #![no_main] struct S;
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:885:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:903:5
    |
 LL |     #[no_main] type T = S;
    |     ^^^^^^^^^^
@@ -614,7 +577,7 @@ LL |     #![no_main] type T = S;
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:889:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:907:5
    |
 LL |     #[no_main] impl S { }
    |     ^^^^^^^^^^
@@ -625,13 +588,13 @@ LL |     #![no_main] impl S { }
    |      +
 
 warning: crate-level attribute should be in the root module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:898:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:916:17
    |
 LL |     mod inner { #![no_builtins] }
    |                 ^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:901:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:919:5
    |
 LL |     #[no_builtins] fn f() { }
    |     ^^^^^^^^^^^^^^
@@ -642,7 +605,7 @@ LL |     #![no_builtins] fn f() { }
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:905:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:923:5
    |
 LL |     #[no_builtins] struct S;
    |     ^^^^^^^^^^^^^^
@@ -653,7 +616,7 @@ LL |     #![no_builtins] struct S;
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:909:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:927:5
    |
 LL |     #[no_builtins] type T = S;
    |     ^^^^^^^^^^^^^^
@@ -664,7 +627,7 @@ LL |     #![no_builtins] type T = S;
    |      +
 
 warning: crate-level attribute should be an inner attribute
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:913:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:931:5
    |
 LL |     #[no_builtins] impl S { }
    |     ^^^^^^^^^^^^^^
@@ -710,8 +673,62 @@ LL |     #[macro_use] impl S { }
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = help: `#[macro_use]` can be applied to modules, extern crates, and crates
 
+warning: `#[macro_export]` attribute cannot be used on modules
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:216:1
+   |
+LL | #[macro_export]
+   | ^^^^^^^^^^^^^^^
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = help: `#[macro_export]` can only be applied to macro defs
+
+warning: `#[macro_export]` attribute cannot be used on modules
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:222:17
+   |
+LL |     mod inner { #![macro_export] }
+   |                 ^^^^^^^^^^^^^^^^
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = help: `#[macro_export]` can only be applied to macro defs
+
+warning: `#[macro_export]` attribute cannot be used on functions
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:228:5
+   |
+LL |     #[macro_export] fn f() { }
+   |     ^^^^^^^^^^^^^^^
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = help: `#[macro_export]` can only be applied to macro defs
+
+warning: `#[macro_export]` attribute cannot be used on structs
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:234:5
+   |
+LL |     #[macro_export] struct S;
+   |     ^^^^^^^^^^^^^^^
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = help: `#[macro_export]` can only be applied to macro defs
+
+warning: `#[macro_export]` attribute cannot be used on type aliases
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:240:5
+   |
+LL |     #[macro_export] type T = S;
+   |     ^^^^^^^^^^^^^^^
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = help: `#[macro_export]` can only be applied to macro defs
+
+warning: `#[macro_export]` attribute cannot be used on inherent impl blocks
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:246:5
+   |
+LL |     #[macro_export] impl S { }
+   |     ^^^^^^^^^^^^^^^
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = help: `#[macro_export]` can only be applied to macro defs
+
 warning: `#[path]` attribute cannot be used on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:271:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:289:5
    |
 LL |     #[path = "3800"] fn f() { }
    |     ^^^^^^^^^^^^^^^^
@@ -720,7 +737,7 @@ LL |     #[path = "3800"] fn f() { }
    = help: `#[path]` can only be applied to modules
 
 warning: `#[path]` attribute cannot be used on structs
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:277:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:295:5
    |
 LL |     #[path = "3800"]  struct S;
    |     ^^^^^^^^^^^^^^^^
@@ -729,7 +746,7 @@ LL |     #[path = "3800"]  struct S;
    = help: `#[path]` can only be applied to modules
 
 warning: `#[path]` attribute cannot be used on type aliases
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:283:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:301:5
    |
 LL |     #[path = "3800"] type T = S;
    |     ^^^^^^^^^^^^^^^^
@@ -738,7 +755,7 @@ LL |     #[path = "3800"] type T = S;
    = help: `#[path]` can only be applied to modules
 
 warning: `#[path]` attribute cannot be used on inherent impl blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:289:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:307:5
    |
 LL |     #[path = "3800"] impl S { }
    |     ^^^^^^^^^^^^^^^^
@@ -747,7 +764,7 @@ LL |     #[path = "3800"] impl S { }
    = help: `#[path]` can only be applied to modules
 
 warning: `#[automatically_derived]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:296:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:314:1
    |
 LL | #[automatically_derived]
    | ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -756,7 +773,7 @@ LL | #[automatically_derived]
    = help: `#[automatically_derived]` can only be applied to trait impl blocks
 
 warning: `#[automatically_derived]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:302:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:320:17
    |
 LL |     mod inner { #![automatically_derived] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -765,7 +782,7 @@ LL |     mod inner { #![automatically_derived] }
    = help: `#[automatically_derived]` can only be applied to trait impl blocks
 
 warning: `#[automatically_derived]` attribute cannot be used on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:308:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:326:5
    |
 LL |     #[automatically_derived] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -774,7 +791,7 @@ LL |     #[automatically_derived] fn f() { }
    = help: `#[automatically_derived]` can only be applied to trait impl blocks
 
 warning: `#[automatically_derived]` attribute cannot be used on structs
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:314:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:332:5
    |
 LL |     #[automatically_derived] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -783,7 +800,7 @@ LL |     #[automatically_derived] struct S;
    = help: `#[automatically_derived]` can only be applied to trait impl blocks
 
 warning: `#[automatically_derived]` attribute cannot be used on type aliases
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:320:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:338:5
    |
 LL |     #[automatically_derived] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -792,7 +809,7 @@ LL |     #[automatically_derived] type T = S;
    = help: `#[automatically_derived]` can only be applied to trait impl blocks
 
 warning: `#[automatically_derived]` attribute cannot be used on traits
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:326:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:344:5
    |
 LL |     #[automatically_derived] trait W { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -801,7 +818,7 @@ LL |     #[automatically_derived] trait W { }
    = help: `#[automatically_derived]` can only be applied to trait impl blocks
 
 warning: `#[automatically_derived]` attribute cannot be used on inherent impl blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:332:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:350:5
    |
 LL |     #[automatically_derived] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -810,7 +827,7 @@ LL |     #[automatically_derived] impl S { }
    = help: `#[automatically_derived]` can only be applied to trait impl blocks
 
 warning: `#[no_mangle]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:341:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:359:1
    |
 LL | #[no_mangle]
    | ^^^^^^^^^^^^
@@ -819,7 +836,7 @@ LL | #[no_mangle]
    = help: `#[no_mangle]` can be applied to functions and statics
 
 warning: `#[no_mangle]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:347:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:365:17
    |
 LL |     mod inner { #![no_mangle] }
    |                 ^^^^^^^^^^^^^
@@ -828,7 +845,7 @@ LL |     mod inner { #![no_mangle] }
    = help: `#[no_mangle]` can be applied to functions and statics
 
 warning: `#[no_mangle]` attribute cannot be used on structs
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:355:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:373:5
    |
 LL |     #[no_mangle] struct S;
    |     ^^^^^^^^^^^^
@@ -837,7 +854,7 @@ LL |     #[no_mangle] struct S;
    = help: `#[no_mangle]` can be applied to functions and statics
 
 warning: `#[no_mangle]` attribute cannot be used on type aliases
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:361:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:379:5
    |
 LL |     #[no_mangle] type T = S;
    |     ^^^^^^^^^^^^
@@ -846,7 +863,7 @@ LL |     #[no_mangle] type T = S;
    = help: `#[no_mangle]` can be applied to functions and statics
 
 warning: `#[no_mangle]` attribute cannot be used on inherent impl blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:367:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:385:5
    |
 LL |     #[no_mangle] impl S { }
    |     ^^^^^^^^^^^^
@@ -855,7 +872,7 @@ LL |     #[no_mangle] impl S { }
    = help: `#[no_mangle]` can be applied to functions and statics
 
 warning: `#[no_mangle]` attribute cannot be used on required trait methods
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:374:9
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:392:9
    |
 LL |         #[no_mangle] fn foo();
    |         ^^^^^^^^^^^^
@@ -864,7 +881,7 @@ LL |         #[no_mangle] fn foo();
    = help: `#[no_mangle]` can be applied to functions, statics, inherent methods, and trait methods in impl blocks
 
 warning: `#[no_mangle]` attribute cannot be used on provided trait methods
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:380:9
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:398:9
    |
 LL |         #[no_mangle] fn bar() {}
    |         ^^^^^^^^^^^^
@@ -873,7 +890,7 @@ LL |         #[no_mangle] fn bar() {}
    = help: `#[no_mangle]` can be applied to functions, statics, inherent methods, and trait methods in impl blocks
 
 warning: `#[should_panic]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:388:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:406:1
    |
 LL | #[should_panic]
    | ^^^^^^^^^^^^^^^
@@ -882,7 +899,7 @@ LL | #[should_panic]
    = help: `#[should_panic]` can only be applied to functions
 
 warning: `#[should_panic]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:394:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:412:17
    |
 LL |     mod inner { #![should_panic] }
    |                 ^^^^^^^^^^^^^^^^
@@ -891,7 +908,7 @@ LL |     mod inner { #![should_panic] }
    = help: `#[should_panic]` can only be applied to functions
 
 warning: `#[should_panic]` attribute cannot be used on structs
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:402:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:420:5
    |
 LL |     #[should_panic] struct S;
    |     ^^^^^^^^^^^^^^^
@@ -900,7 +917,7 @@ LL |     #[should_panic] struct S;
    = help: `#[should_panic]` can only be applied to functions
 
 warning: `#[should_panic]` attribute cannot be used on type aliases
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:408:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:5
    |
 LL |     #[should_panic] type T = S;
    |     ^^^^^^^^^^^^^^^
@@ -909,7 +926,7 @@ LL |     #[should_panic] type T = S;
    = help: `#[should_panic]` can only be applied to functions
 
 warning: `#[should_panic]` attribute cannot be used on inherent impl blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:414:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:432:5
    |
 LL |     #[should_panic] impl S { }
    |     ^^^^^^^^^^^^^^^
@@ -918,7 +935,7 @@ LL |     #[should_panic] impl S { }
    = help: `#[should_panic]` can only be applied to functions
 
 warning: `#[ignore]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:421:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:439:1
    |
 LL | #[ignore]
    | ^^^^^^^^^
@@ -927,7 +944,7 @@ LL | #[ignore]
    = help: `#[ignore]` can only be applied to functions
 
 warning: `#[ignore]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:427:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:445:17
    |
 LL |     mod inner { #![ignore] }
    |                 ^^^^^^^^^^
@@ -936,7 +953,7 @@ LL |     mod inner { #![ignore] }
    = help: `#[ignore]` can only be applied to functions
 
 warning: `#[ignore]` attribute cannot be used on structs
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:435:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:453:5
    |
 LL |     #[ignore] struct S;
    |     ^^^^^^^^^
@@ -945,7 +962,7 @@ LL |     #[ignore] struct S;
    = help: `#[ignore]` can only be applied to functions
 
 warning: `#[ignore]` attribute cannot be used on type aliases
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:441:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:459:5
    |
 LL |     #[ignore] type T = S;
    |     ^^^^^^^^^
@@ -954,7 +971,7 @@ LL |     #[ignore] type T = S;
    = help: `#[ignore]` can only be applied to functions
 
 warning: `#[ignore]` attribute cannot be used on inherent impl blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:447:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:465:5
    |
 LL |     #[ignore] impl S { }
    |     ^^^^^^^^^
@@ -963,7 +980,7 @@ LL |     #[ignore] impl S { }
    = help: `#[ignore]` can only be applied to functions
 
 warning: `#[no_implicit_prelude]` attribute cannot be used on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:458:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:5
    |
 LL |     #[no_implicit_prelude] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -972,7 +989,7 @@ LL |     #[no_implicit_prelude] fn f() { }
    = help: `#[no_implicit_prelude]` can be applied to modules and crates
 
 warning: `#[no_implicit_prelude]` attribute cannot be used on structs
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:464:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:482:5
    |
 LL |     #[no_implicit_prelude] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -981,7 +998,7 @@ LL |     #[no_implicit_prelude] struct S;
    = help: `#[no_implicit_prelude]` can be applied to modules and crates
 
 warning: `#[no_implicit_prelude]` attribute cannot be used on type aliases
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:470:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:488:5
    |
 LL |     #[no_implicit_prelude] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -990,7 +1007,7 @@ LL |     #[no_implicit_prelude] type T = S;
    = help: `#[no_implicit_prelude]` can be applied to modules and crates
 
 warning: `#[no_implicit_prelude]` attribute cannot be used on inherent impl blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:494:5
    |
 LL |     #[no_implicit_prelude] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -999,7 +1016,7 @@ LL |     #[no_implicit_prelude] impl S { }
    = help: `#[no_implicit_prelude]` can be applied to modules and crates
 
 warning: `#[macro_escape]` attribute cannot be used on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:515:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:533:5
    |
 LL |     #[macro_escape] fn f() { }
    |     ^^^^^^^^^^^^^^^
@@ -1008,7 +1025,7 @@ LL |     #[macro_escape] fn f() { }
    = help: `#[macro_escape]` can be applied to modules, extern crates, and crates
 
 warning: `#[macro_escape]` attribute cannot be used on structs
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:521:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:539:5
    |
 LL |     #[macro_escape] struct S;
    |     ^^^^^^^^^^^^^^^
@@ -1017,7 +1034,7 @@ LL |     #[macro_escape] struct S;
    = help: `#[macro_escape]` can be applied to modules, extern crates, and crates
 
 warning: `#[macro_escape]` attribute cannot be used on type aliases
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:527:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:545:5
    |
 LL |     #[macro_escape] type T = S;
    |     ^^^^^^^^^^^^^^^
@@ -1026,7 +1043,7 @@ LL |     #[macro_escape] type T = S;
    = help: `#[macro_escape]` can be applied to modules, extern crates, and crates
 
 warning: `#[macro_escape]` attribute cannot be used on inherent impl blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:533:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:551:5
    |
 LL |     #[macro_escape] impl S { }
    |     ^^^^^^^^^^^^^^^
@@ -1035,13 +1052,13 @@ LL |     #[macro_escape] impl S { }
    = help: `#[macro_escape]` can be applied to modules, extern crates, and crates
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:540:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:558:1
    |
 LL | #[no_std]
    | ^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:542:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:560:1
    |
 LL | / mod no_std {
 LL | |
@@ -1051,61 +1068,61 @@ LL | | }
    | |_^
 
 warning: the `#![no_std]` attribute can only be used at the crate root
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:544:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:562:17
    |
 LL |     mod inner { #![no_std] }
    |                 ^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:547:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:565:5
    |
 LL |     #[no_std] fn f() { }
    |     ^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this function
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:547:15
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:565:15
    |
 LL |     #[no_std] fn f() { }
    |               ^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:551:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:569:5
    |
 LL |     #[no_std] struct S;
    |     ^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this struct
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:551:15
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:569:15
    |
 LL |     #[no_std] struct S;
    |               ^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:555:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:573:5
    |
 LL |     #[no_std] type T = S;
    |     ^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this type alias
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:555:15
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:573:15
    |
 LL |     #[no_std] type T = S;
    |               ^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:559:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:577:5
    |
 LL |     #[no_std] impl S { }
    |     ^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this implementation block
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:559:15
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:577:15
    |
 LL |     #[no_std] impl S { }
    |               ^^^^^^^^^^
 
 warning: `#[cold]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:581:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:599:1
    |
 LL | #[cold]
    | ^^^^^^^
@@ -1114,7 +1131,7 @@ LL | #[cold]
    = help: `#[cold]` can only be applied to functions
 
 warning: `#[cold]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:588:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:606:17
    |
 LL |     mod inner { #![cold] }
    |                 ^^^^^^^^
@@ -1123,7 +1140,7 @@ LL |     mod inner { #![cold] }
    = help: `#[cold]` can only be applied to functions
 
 warning: `#[cold]` attribute cannot be used on structs
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:596:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:614:5
    |
 LL |     #[cold] struct S;
    |     ^^^^^^^
@@ -1132,7 +1149,7 @@ LL |     #[cold] struct S;
    = help: `#[cold]` can only be applied to functions
 
 warning: `#[cold]` attribute cannot be used on type aliases
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:602:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:620:5
    |
 LL |     #[cold] type T = S;
    |     ^^^^^^^
@@ -1141,7 +1158,7 @@ LL |     #[cold] type T = S;
    = help: `#[cold]` can only be applied to functions
 
 warning: `#[cold]` attribute cannot be used on inherent impl blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:608:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:626:5
    |
 LL |     #[cold] impl S { }
    |     ^^^^^^^
@@ -1150,7 +1167,7 @@ LL |     #[cold] impl S { }
    = help: `#[cold]` can only be applied to functions
 
 warning: `#[link_name]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:615:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:633:1
    |
 LL | #[link_name = "1900"]
    | ^^^^^^^^^^^^^^^^^^^^^
@@ -1159,7 +1176,7 @@ LL | #[link_name = "1900"]
    = help: `#[link_name]` can be applied to foreign functions and foreign statics
 
 warning: `#[link_name]` attribute cannot be used on foreign modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:621:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:639:5
    |
 LL |     #[link_name = "1900"]
    |     ^^^^^^^^^^^^^^^^^^^^^
@@ -1168,7 +1185,7 @@ LL |     #[link_name = "1900"]
    = help: `#[link_name]` can be applied to foreign functions and foreign statics
 
 warning: `#[link_name]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:628:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:646:17
    |
 LL |     mod inner { #![link_name="1900"] }
    |                 ^^^^^^^^^^^^^^^^^^^^
@@ -1177,7 +1194,7 @@ LL |     mod inner { #![link_name="1900"] }
    = help: `#[link_name]` can be applied to foreign functions and foreign statics
 
 warning: `#[link_name]` attribute cannot be used on functions
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:634:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:652:5
    |
 LL |     #[link_name = "1900"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^
@@ -1186,7 +1203,7 @@ LL |     #[link_name = "1900"] fn f() { }
    = help: `#[link_name]` can be applied to foreign functions and foreign statics
 
 warning: `#[link_name]` attribute cannot be used on structs
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:640:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:658:5
    |
 LL |     #[link_name = "1900"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^
@@ -1195,7 +1212,7 @@ LL |     #[link_name = "1900"] struct S;
    = help: `#[link_name]` can be applied to foreign functions and foreign statics
 
 warning: `#[link_name]` attribute cannot be used on type aliases
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:646:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:664:5
    |
 LL |     #[link_name = "1900"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^
@@ -1204,7 +1221,7 @@ LL |     #[link_name = "1900"] type T = S;
    = help: `#[link_name]` can be applied to foreign functions and foreign statics
 
 warning: `#[link_name]` attribute cannot be used on inherent impl blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:652:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:670:5
    |
 LL |     #[link_name = "1900"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^
@@ -1213,7 +1230,7 @@ LL |     #[link_name = "1900"] impl S { }
    = help: `#[link_name]` can be applied to foreign functions and foreign statics
 
 warning: `#[link_section]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:659:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:677:1
    |
 LL | #[link_section = "1800"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1222,7 +1239,7 @@ LL | #[link_section = "1800"]
    = help: `#[link_section]` can be applied to statics and functions
 
 warning: `#[link_section]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:665:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:683:17
    |
 LL |     mod inner { #![link_section="1800"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^
@@ -1231,7 +1248,7 @@ LL |     mod inner { #![link_section="1800"] }
    = help: `#[link_section]` can be applied to statics and functions
 
 warning: `#[link_section]` attribute cannot be used on structs
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:673:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:5
    |
 LL |     #[link_section = "1800"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1240,7 +1257,7 @@ LL |     #[link_section = "1800"] struct S;
    = help: `#[link_section]` can be applied to statics and functions
 
 warning: `#[link_section]` attribute cannot be used on type aliases
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:697:5
    |
 LL |     #[link_section = "1800"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1249,7 +1266,7 @@ LL |     #[link_section = "1800"] type T = S;
    = help: `#[link_section]` can be applied to statics and functions
 
 warning: `#[link_section]` attribute cannot be used on inherent impl blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:685:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:5
    |
 LL |     #[link_section = "1800"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1258,7 +1275,7 @@ LL |     #[link_section = "1800"] impl S { }
    = help: `#[link_section]` can be applied to statics and functions
 
 warning: `#[must_use]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:746:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:764:1
    |
 LL | #[must_use]
    | ^^^^^^^^^^^
@@ -1267,7 +1284,7 @@ LL | #[must_use]
    = help: `#[must_use]` can be applied to functions, data types, unions, and traits
 
 warning: `#[must_use]` attribute cannot be used on modules
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:751:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:769:17
    |
 LL |     mod inner { #![must_use] }
    |                 ^^^^^^^^^^^^
@@ -1276,7 +1293,7 @@ LL |     mod inner { #![must_use] }
    = help: `#[must_use]` can be applied to functions, data types, unions, and traits
 
 warning: `#[must_use]` attribute cannot be used on type aliases
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:760:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:778:5
    |
 LL |     #[must_use] type T = S;
    |     ^^^^^^^^^^^
@@ -1285,7 +1302,7 @@ LL |     #[must_use] type T = S;
    = help: `#[must_use]` can be applied to functions, data types, unions, and traits
 
 warning: `#[must_use]` attribute cannot be used on inherent impl blocks
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:765:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:783:5
    |
 LL |     #[must_use] impl S { }
    |     ^^^^^^^^^^^
@@ -1294,13 +1311,13 @@ LL |     #[must_use] impl S { }
    = help: `#[must_use]` can be applied to functions, data types, unions, and traits
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:797:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:815:1
    |
 LL | #[crate_name = "0900"]
    | ^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:799:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:817:1
    |
 LL | / mod crate_name {
 LL | |
@@ -1310,67 +1327,67 @@ LL | | }
    | |_^
 
 warning: the `#![crate_name]` attribute can only be used at the crate root
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:819:17
    |
 LL |     mod inner { #![crate_name="0900"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:804:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:822:5
    |
 LL |     #[crate_name = "0900"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this function
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:804:28
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:822:28
    |
 LL |     #[crate_name = "0900"] fn f() { }
    |                            ^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:808:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:5
    |
 LL |     #[crate_name = "0900"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this struct
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:808:28
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:28
    |
 LL |     #[crate_name = "0900"] struct S;
    |                            ^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:812:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:830:5
    |
 LL |     #[crate_name = "0900"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this type alias
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:812:28
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:830:28
    |
 LL |     #[crate_name = "0900"] type T = S;
    |                            ^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:816:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:834:5
    |
 LL |     #[crate_name = "0900"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this implementation block
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:816:28
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:834:28
    |
 LL |     #[crate_name = "0900"] impl S { }
    |                            ^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:918:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:936:1
    |
 LL | #[recursion_limit="0200"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:920:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:938:1
    |
 LL | / mod recursion_limit {
 LL | |
@@ -1380,67 +1397,67 @@ LL | | }
    | |_^
 
 warning: the `#![recursion_limit]` attribute can only be used at the crate root
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:922:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:940:17
    |
 LL |     mod inner { #![recursion_limit="0200"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:925:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:943:5
    |
 LL |     #[recursion_limit="0200"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this function
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:925:31
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:943:31
    |
 LL |     #[recursion_limit="0200"] fn f() { }
    |                               ^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:929:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:947:5
    |
 LL |     #[recursion_limit="0200"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this struct
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:929:31
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:947:31
    |
 LL |     #[recursion_limit="0200"] struct S;
    |                               ^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:933:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:951:5
    |
 LL |     #[recursion_limit="0200"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this type alias
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:933:31
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:951:31
    |
 LL |     #[recursion_limit="0200"] type T = S;
    |                               ^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:937:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:955:5
    |
 LL |     #[recursion_limit="0200"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this implementation block
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:937:31
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:955:31
    |
 LL |     #[recursion_limit="0200"] impl S { }
    |                               ^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:942:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:960:1
    |
 LL | #[type_length_limit="0100"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this module
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:944:1
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:962:1
    |
 LL | / mod type_length_limit {
 LL | |
@@ -1450,55 +1467,55 @@ LL | | }
    | |_^
 
 warning: the `#![type_length_limit]` attribute can only be used at the crate root
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:946:17
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:964:17
    |
 LL |     mod inner { #![type_length_limit="0100"] }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:949:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:967:5
    |
 LL |     #[type_length_limit="0100"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this function
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:949:33
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:967:33
    |
 LL |     #[type_length_limit="0100"] fn f() { }
    |                                 ^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:953:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:971:5
    |
 LL |     #[type_length_limit="0100"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this struct
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:953:33
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:971:33
    |
 LL |     #[type_length_limit="0100"] struct S;
    |                                 ^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:957:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:975:5
    |
 LL |     #[type_length_limit="0100"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this type alias
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:957:33
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:975:33
    |
 LL |     #[type_length_limit="0100"] type T = S;
    |                                 ^^^^^^^^^^^
 
 warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]`
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:961:5
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:979:5
    |
 LL |     #[type_length_limit="0100"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: This attribute does not have an `!`, which means it is applied to this implementation block
-  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:961:33
+  --> $DIR/issue-43106-gating-of-builtin-attrs.rs:979:33
    |
 LL |     #[type_length_limit="0100"] impl S { }
    |                                 ^^^^^^^^^^
diff --git a/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.rs b/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.rs
index 26d483e43ae..794b51c7a8a 100644
--- a/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.rs
+++ b/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: format-string-proc-macro.rs
+//@ ignore-backends: gcc
 
 extern crate format_string_proc_macro;
 
diff --git a/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.stderr b/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.stderr
index e7ed2a76e6a..c341c6ee4c5 100644
--- a/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.stderr
+++ b/tests/ui/fmt/format-args-capture-from-pm-first-arg-macro.stderr
@@ -1,5 +1,5 @@
 error: there is no argument named `x`
-  --> $DIR/format-args-capture-from-pm-first-arg-macro.rs:6:5
+  --> $DIR/format-args-capture-from-pm-first-arg-macro.rs:7:5
    |
 LL |     format_string_proc_macro::bad_format_args_captures!();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/fn/issue-80179.stderr b/tests/ui/fn/issue-80179.stderr
index f5d6c44db75..95158da3cff 100644
--- a/tests/ui/fn/issue-80179.stderr
+++ b/tests/ui/fn/issue-80179.stderr
@@ -2,21 +2,26 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/issue-80179.rs:10:24
    |
 LL | fn returns_fn_ptr() -> _ {
-   |                        ^
-   |                        |
-   |                        not allowed in type signatures
-   |                        help: replace with the correct return type: `fn() -> i32`
+   |                        ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - fn returns_fn_ptr() -> _ {
+LL + fn returns_fn_ptr() -> fn() -> i32 {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/issue-80179.rs:18:25
    |
 LL | fn returns_closure() -> _ {
-   |                         ^
-   |                         |
-   |                         not allowed in type signatures
-   |                         help: replace with an appropriate return type: `impl Fn() -> i32`
+   |                         ^ not allowed in type signatures
    |
    = note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html
+help: replace with an appropriate return type
+   |
+LL - fn returns_closure() -> _ {
+LL + fn returns_closure() -> impl Fn() -> i32 {
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/fn/suggest-return-closure.stderr b/tests/ui/fn/suggest-return-closure.stderr
index 1860d1ca5d9..0639c23c75a 100644
--- a/tests/ui/fn/suggest-return-closure.stderr
+++ b/tests/ui/fn/suggest-return-closure.stderr
@@ -2,34 +2,40 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/suggest-return-closure.rs:1:17
    |
 LL | fn fn_once() -> _ {
-   |                 ^
-   |                 |
-   |                 not allowed in type signatures
-   |                 help: replace with an appropriate return type: `impl FnOnce()`
+   |                 ^ not allowed in type signatures
    |
    = note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html
+help: replace with an appropriate return type
+   |
+LL - fn fn_once() -> _ {
+LL + fn fn_once() -> impl FnOnce() {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/suggest-return-closure.rs:13:16
    |
 LL | fn fn_mut() -> _ {
-   |                ^
-   |                |
-   |                not allowed in type signatures
-   |                help: replace with an appropriate return type: `impl FnMut(char)`
+   |                ^ not allowed in type signatures
    |
    = note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html
+help: replace with an appropriate return type
+   |
+LL - fn fn_mut() -> _ {
+LL + fn fn_mut() -> impl FnMut(char) {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/suggest-return-closure.rs:33:13
    |
 LL | fn fun() -> _ {
-   |             ^
-   |             |
-   |             not allowed in type signatures
-   |             help: replace with an appropriate return type: `impl Fn() -> i32`
+   |             ^ not allowed in type signatures
    |
    = note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html
+help: replace with an appropriate return type
+   |
+LL - fn fun() -> _ {
+LL + fn fun() -> impl Fn() -> i32 {
+   |
 
 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
   --> $DIR/suggest-return-closure.rs:24:9
diff --git a/tests/ui/fn/suggest-return-future.stderr b/tests/ui/fn/suggest-return-future.stderr
index a4c8b5d8c4b..7c097e50671 100644
--- a/tests/ui/fn/suggest-return-future.stderr
+++ b/tests/ui/fn/suggest-return-future.stderr
@@ -2,19 +2,25 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/suggest-return-future.rs:7:13
    |
 LL | fn foo() -> _ {
-   |             ^
-   |             |
-   |             not allowed in type signatures
-   |             help: replace with an appropriate return type: `impl Future<Output = i32>`
+   |             ^ not allowed in type signatures
+   |
+help: replace with an appropriate return type
+   |
+LL - fn foo() -> _ {
+LL + fn foo() -> impl Future<Output = i32> {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/suggest-return-future.rs:15:13
    |
 LL | fn bar() -> _ {
-   |             ^
-   |             |
-   |             not allowed in type signatures
-   |             help: replace with an appropriate return type: `impl Future<Output = i32>`
+   |             ^ not allowed in type signatures
+   |
+help: replace with an appropriate return type
+   |
+LL - fn bar() -> _ {
+LL + fn bar() -> impl Future<Output = i32> {
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/force-inlining/inherent.rs b/tests/ui/force-inlining/inherent.rs
new file mode 100644
index 00000000000..25c76eaf37a
--- /dev/null
+++ b/tests/ui/force-inlining/inherent.rs
@@ -0,0 +1,21 @@
+//@ check-fail
+#![feature(rustc_attrs)]
+
+struct Foo;
+
+impl Foo {
+    #[rustc_force_inline]
+    //~^ ERROR: `Foo::bar` is incompatible with `#[rustc_force_inline]`
+    #[rustc_no_mir_inline]
+    fn bar() {}
+}
+
+fn bar_caller() {
+    unsafe {
+        Foo::bar();
+    }
+}
+
+fn main() {
+    bar_caller();
+}
diff --git a/tests/ui/force-inlining/inherent.stderr b/tests/ui/force-inlining/inherent.stderr
new file mode 100644
index 00000000000..1ffc78848fe
--- /dev/null
+++ b/tests/ui/force-inlining/inherent.stderr
@@ -0,0 +1,13 @@
+error: `Foo::bar` is incompatible with `#[rustc_force_inline]`
+  --> $DIR/inherent.rs:7:5
+   |
+LL |     #[rustc_force_inline]
+   |     ^^^^^^^^^^^^^^^^^^^^^
+...
+LL |     fn bar() {}
+   |     -------- `Foo::bar` defined here
+   |
+   = note: incompatible due to: #[rustc_no_mir_inline]
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/force-inlining/invalid.rs b/tests/ui/force-inlining/invalid.rs
index 6047739992f..eaacbb50209 100644
--- a/tests/ui/force-inlining/invalid.rs
+++ b/tests/ui/force-inlining/invalid.rs
@@ -114,7 +114,6 @@ trait FooQux = FooBaz;
 //~^ ERROR attribute cannot be used on
 impl<T> Bar<T> {
     #[rustc_force_inline]
-//~^ ERROR attribute cannot be used on
     fn foo() {}
 }
 
diff --git a/tests/ui/force-inlining/invalid.stderr b/tests/ui/force-inlining/invalid.stderr
index 299a3ed4a46..df3b646b6ce 100644
--- a/tests/ui/force-inlining/invalid.stderr
+++ b/tests/ui/force-inlining/invalid.stderr
@@ -1,5 +1,5 @@
 error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
-  --> $DIR/invalid.rs:132:11
+  --> $DIR/invalid.rs:131:11
    |
 LL | fn barqux(#[rustc_force_inline] _x: u32) {}
    |           ^^^^^^^^^^^^^^^^^^^^^
@@ -134,7 +134,7 @@ error: `#[rustc_force_inline]` attribute cannot be used on foreign functions
 LL |     #[rustc_force_inline]
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: `#[rustc_force_inline]` can only be applied to functions
+   = help: `#[rustc_force_inline]` can be applied to functions and inherent methods
 
 error: `#[rustc_force_inline]` attribute cannot be used on type aliases
   --> $DIR/invalid.rs:66:1
@@ -222,7 +222,7 @@ error: `#[rustc_force_inline]` attribute cannot be used on provided trait method
 LL |     #[rustc_force_inline]
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: `#[rustc_force_inline]` can only be applied to functions
+   = help: `#[rustc_force_inline]` can be applied to functions and inherent methods
 
 error: `#[rustc_force_inline]` attribute cannot be used on trait aliases
   --> $DIR/invalid.rs:109:1
@@ -240,16 +240,8 @@ LL | #[rustc_force_inline]
    |
    = help: `#[rustc_force_inline]` can only be applied to functions
 
-error: `#[rustc_force_inline]` attribute cannot be used on inherent methods
-  --> $DIR/invalid.rs:116:5
-   |
-LL |     #[rustc_force_inline]
-   |     ^^^^^^^^^^^^^^^^^^^^^
-   |
-   = help: `#[rustc_force_inline]` can only be applied to functions
-
 error: `#[rustc_force_inline]` attribute cannot be used on trait impl blocks
-  --> $DIR/invalid.rs:121:1
+  --> $DIR/invalid.rs:120:1
    |
 LL | #[rustc_force_inline]
    | ^^^^^^^^^^^^^^^^^^^^^
@@ -257,7 +249,7 @@ LL | #[rustc_force_inline]
    = help: `#[rustc_force_inline]` can only be applied to functions
 
 error: `#[rustc_force_inline]` attribute cannot be used on macro defs
-  --> $DIR/invalid.rs:128:1
+  --> $DIR/invalid.rs:127:1
    |
 LL | #[rustc_force_inline]
    | ^^^^^^^^^^^^^^^^^^^^^
@@ -265,7 +257,7 @@ LL | #[rustc_force_inline]
    = help: `#[rustc_force_inline]` can only be applied to functions
 
 error: `#[rustc_force_inline]` attribute cannot be used on function params
-  --> $DIR/invalid.rs:132:11
+  --> $DIR/invalid.rs:131:11
    |
 LL | fn barqux(#[rustc_force_inline] _x: u32) {}
    |           ^^^^^^^^^^^^^^^^^^^^^
@@ -273,15 +265,15 @@ LL | fn barqux(#[rustc_force_inline] _x: u32) {}
    = help: `#[rustc_force_inline]` can only be applied to functions
 
 error: `#[rustc_force_inline]` attribute cannot be used on closures
-  --> $DIR/invalid.rs:149:14
+  --> $DIR/invalid.rs:148:14
    |
 LL |     let _x = #[rustc_force_inline] || { };
    |              ^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: `#[rustc_force_inline]` can only be applied to functions
+   = help: `#[rustc_force_inline]` can be applied to functions and inherent methods
 
 error: `#[rustc_force_inline]` attribute cannot be used on expressions
-  --> $DIR/invalid.rs:151:14
+  --> $DIR/invalid.rs:150:14
    |
 LL |     let _y = #[rustc_force_inline] 3 + 4;
    |              ^^^^^^^^^^^^^^^^^^^^^
@@ -289,7 +281,7 @@ LL |     let _y = #[rustc_force_inline] 3 + 4;
    = help: `#[rustc_force_inline]` can only be applied to functions
 
 error: `#[rustc_force_inline]` attribute cannot be used on statements
-  --> $DIR/invalid.rs:153:5
+  --> $DIR/invalid.rs:152:5
    |
 LL |     #[rustc_force_inline]
    |     ^^^^^^^^^^^^^^^^^^^^^
@@ -297,7 +289,7 @@ LL |     #[rustc_force_inline]
    = help: `#[rustc_force_inline]` can only be applied to functions
 
 error: `#[rustc_force_inline]` attribute cannot be used on match arms
-  --> $DIR/invalid.rs:158:9
+  --> $DIR/invalid.rs:157:9
    |
 LL |         #[rustc_force_inline]
    |         ^^^^^^^^^^^^^^^^^^^^^
@@ -305,7 +297,7 @@ LL |         #[rustc_force_inline]
    = help: `#[rustc_force_inline]` can only be applied to functions
 
 error: attribute cannot be applied to a `async`, `gen` or `async gen` function
-  --> $DIR/invalid.rs:136:1
+  --> $DIR/invalid.rs:135:1
    |
 LL | #[rustc_force_inline]
    | ^^^^^^^^^^^^^^^^^^^^^
@@ -314,7 +306,7 @@ LL | async fn async_foo() {}
    | -------------------- `async`, `gen` or `async gen` function
 
 error: attribute cannot be applied to a `async`, `gen` or `async gen` function
-  --> $DIR/invalid.rs:140:1
+  --> $DIR/invalid.rs:139:1
    |
 LL | #[rustc_force_inline]
    | ^^^^^^^^^^^^^^^^^^^^^
@@ -323,7 +315,7 @@ LL | gen fn gen_foo() {}
    | ---------------- `async`, `gen` or `async gen` function
 
 error: attribute cannot be applied to a `async`, `gen` or `async gen` function
-  --> $DIR/invalid.rs:144:1
+  --> $DIR/invalid.rs:143:1
    |
 LL | #[rustc_force_inline]
    | ^^^^^^^^^^^^^^^^^^^^^
@@ -331,7 +323,7 @@ LL |
 LL | async gen fn async_gen_foo() {}
    | ---------------------------- `async`, `gen` or `async gen` function
 
-error: aborting due to 37 previous errors
+error: aborting due to 36 previous errors
 
 Some errors have detailed explanations: E0539, E0805.
 For more information about an error, try `rustc --explain E0539`.
diff --git a/tests/ui/frontmatter/proc-macro-observer.rs b/tests/ui/frontmatter/proc-macro-observer.rs
index 6c4c8c57289..5237a0e982a 100644
--- a/tests/ui/frontmatter/proc-macro-observer.rs
+++ b/tests/ui/frontmatter/proc-macro-observer.rs
@@ -1,6 +1,7 @@
 //@ check-pass
 //@ proc-macro: makro.rs
 //@ edition: 2021
+//@ ignore-backends: gcc
 
 // Check that a proc-macro doesn't try to parse frontmatter and instead treats
 // it as a regular Rust token sequence. See `auxiliary/makro.rs` for details.
diff --git a/tests/ui/frontmatter/unclosed-6.rs b/tests/ui/frontmatter/unclosed-6.rs
new file mode 100644
index 00000000000..ea8d4702f63
--- /dev/null
+++ b/tests/ui/frontmatter/unclosed-6.rs
@@ -0,0 +1,12 @@
+---
+//~^ ERROR unclosed frontmatter
+🦀---
+ ---
+
+// This test checks the location of the --- recovered by the parser is not
+// incorrectly tracked during the less fortunate recovery case and multiple
+// candidates are found, as seen with #146847
+
+#![feature(frontmatter)]
+
+fn main() {}
diff --git a/tests/ui/frontmatter/unclosed-6.stderr b/tests/ui/frontmatter/unclosed-6.stderr
new file mode 100644
index 00000000000..01a13e87268
--- /dev/null
+++ b/tests/ui/frontmatter/unclosed-6.stderr
@@ -0,0 +1,19 @@
+error: unclosed frontmatter
+  --> $DIR/unclosed-6.rs:1:1
+   |
+LL | / ---
+LL | |
+LL | | 🦀---
+LL | |  ---
+...  |
+LL | |
+   | |_^
+   |
+note: frontmatter opening here was not closed
+  --> $DIR/unclosed-6.rs:1:1
+   |
+LL | ---
+   | ^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/generic-associated-types/bugs/hrtb-implied-1.stderr b/tests/ui/generic-associated-types/bugs/hrtb-implied-1.stderr
index 8bb72833e30..77a637c470c 100644
--- a/tests/ui/generic-associated-types/bugs/hrtb-implied-1.stderr
+++ b/tests/ui/generic-associated-types/bugs/hrtb-implied-1.stderr
@@ -14,6 +14,11 @@ note: due to a current limitation of the type system, this implies a `'static` l
    |
 LL |     for<'a> I::Item<'a>: Debug,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/hrtb-implied-1.rs:26:26
+   |
+LL |     for<'a> I::Item<'a>: Debug,
+   |                          ^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/issues/issue-56237.rs b/tests/ui/generics/generic-associated-type-deref-target-56237.rs
index 3c0a235f3ec..2050ca377e8 100644
--- a/tests/ui/issues/issue-56237.rs
+++ b/tests/ui/generics/generic-associated-type-deref-target-56237.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/56237
 //@ run-pass
 
 use std::ops::Deref;
diff --git a/tests/ui/higher-ranked/do-not-blame-outlives-static-ice.rs b/tests/ui/higher-ranked/do-not-blame-outlives-static-ice.rs
new file mode 100644
index 00000000000..dfdb816652c
--- /dev/null
+++ b/tests/ui/higher-ranked/do-not-blame-outlives-static-ice.rs
@@ -0,0 +1,12 @@
+//@ compile-flags: -Zdeduplicate-diagnostics=yes
+
+// Regression test for #146467.
+trait Trait { type Assoc; }
+
+impl Trait for fn(&()) { type Assoc = (); }
+
+fn f(_: for<'a> fn(<fn(&'a ()) as Trait>::Assoc)) {}
+//~^ ERROR implementation of `Trait` is not general enough
+//~| ERROR higher-ranked subtype error
+
+fn main() {}
diff --git a/tests/ui/higher-ranked/do-not-blame-outlives-static-ice.stderr b/tests/ui/higher-ranked/do-not-blame-outlives-static-ice.stderr
new file mode 100644
index 00000000000..c75a063e45f
--- /dev/null
+++ b/tests/ui/higher-ranked/do-not-blame-outlives-static-ice.stderr
@@ -0,0 +1,17 @@
+error: implementation of `Trait` is not general enough
+  --> $DIR/do-not-blame-outlives-static-ice.rs:8:9
+   |
+LL | fn f(_: for<'a> fn(<fn(&'a ()) as Trait>::Assoc)) {}
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Trait` is not general enough
+   |
+   = note: `for<'a> fn(&'a ())` must implement `Trait`, for any lifetime `'0`...
+   = note: ...but `Trait` is actually implemented for the type `for<'a> fn(&'a ())`
+
+error: higher-ranked subtype error
+  --> $DIR/do-not-blame-outlives-static-ice.rs:8:1
+   |
+LL | fn f(_: for<'a> fn(<fn(&'a ()) as Trait>::Assoc)) {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/issues/issue-55731.rs b/tests/ui/higher-ranked/hrtb-associated-type-leak-check-55731.rs
index 7b4f4e2cd3b..978abd9fcf5 100644
--- a/tests/ui/issues/issue-55731.rs
+++ b/tests/ui/higher-ranked/hrtb-associated-type-leak-check-55731.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/55731
 use std::marker::PhantomData;
 
 trait DistributedIterator {
diff --git a/tests/ui/issues/issue-55731.stderr b/tests/ui/higher-ranked/hrtb-associated-type-leak-check-55731.stderr
index 2c38041642d..40ac1d9d041 100644
--- a/tests/ui/issues/issue-55731.stderr
+++ b/tests/ui/higher-ranked/hrtb-associated-type-leak-check-55731.stderr
@@ -1,5 +1,5 @@
 error: implementation of `DistributedIteratorMulti` is not general enough
-  --> $DIR/issue-55731.rs:48:5
+  --> $DIR/hrtb-associated-type-leak-check-55731.rs:49:5
    |
 LL | /     multi(Map {
 LL | |         i: Cloned(PhantomData),
diff --git a/tests/ui/higher-ranked/trait-bounds/issue-59311.stderr b/tests/ui/higher-ranked/trait-bounds/issue-59311.stderr
index a26c617dc93..f8f64dcc545 100644
--- a/tests/ui/higher-ranked/trait-bounds/issue-59311.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/issue-59311.stderr
@@ -37,7 +37,7 @@ error: higher-ranked lifetime error
 LL |     v.t(|| {});
    |         ^^^^^
    |
-   = note: could not prove `for<'a> &'a V: 'b`
+   = note: could not prove `for<'a> &'a V: '_`
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/higher-ranked/trait-bounds/trivial-does-not-hold.stderr b/tests/ui/higher-ranked/trait-bounds/trivial-does-not-hold.stderr
index 9e0d7e4b7be..a04c6d770d7 100644
--- a/tests/ui/higher-ranked/trait-bounds/trivial-does-not-hold.stderr
+++ b/tests/ui/higher-ranked/trait-bounds/trivial-does-not-hold.stderr
@@ -4,7 +4,7 @@ error: higher-ranked lifetime error
 LL |     || {};
    |     ^^^^^
    |
-   = note: could not prove `for<'a> &'a (): 'b`
+   = note: could not prove `for<'a> &'a (): '_`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/hygiene/issue-77523-def-site-async-await.rs b/tests/ui/hygiene/issue-77523-def-site-async-await.rs
index ad6bd5e0b78..0a279682b71 100644
--- a/tests/ui/hygiene/issue-77523-def-site-async-await.rs
+++ b/tests/ui/hygiene/issue-77523-def-site-async-await.rs
@@ -1,5 +1,6 @@
 //@ build-pass
 //@ aux-build:def-site-async-await.rs
+//@ ignore-backends: gcc
 
 // Regression test for issue #77523
 // Tests that we don't ICE when an unusual combination
diff --git a/tests/ui/hygiene/panic-location.run.stderr b/tests/ui/hygiene/panic-location.run.stderr
index d28ab864183..bd74e96fd8c 100644
--- a/tests/ui/hygiene/panic-location.run.stderr
+++ b/tests/ui/hygiene/panic-location.run.stderr
@@ -1,4 +1,4 @@
 
-thread 'main' ($TID) panicked at $DIR/panic-location.rs:LL:CC:
+thread 'main' ($TID) panicked at library/alloc/src/raw_vec/mod.rs:LL:CC:
 capacity overflow
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
diff --git a/tests/ui/impl-trait/call_method_ambiguous.next.stderr b/tests/ui/impl-trait/call_method_ambiguous.next.stderr
deleted file mode 100644
index 5251555f574..00000000000
--- a/tests/ui/impl-trait/call_method_ambiguous.next.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0282]: type annotations needed
-  --> $DIR/call_method_ambiguous.rs:26:13
-   |
-LL |         let mut iter = foo(n - 1, m);
-   |             ^^^^^^^^
-LL |
-LL |         assert_eq!(iter.get(), 1);
-   |                    ---- type must be known at this point
-   |
-help: consider giving `iter` an explicit type
-   |
-LL |         let mut iter: /* Type */ = foo(n - 1, m);
-   |                     ++++++++++++
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/impl-trait/call_method_ambiguous.rs b/tests/ui/impl-trait/call_method_ambiguous.rs
index 6bcafc8ce14..021d6c22f79 100644
--- a/tests/ui/impl-trait/call_method_ambiguous.rs
+++ b/tests/ui/impl-trait/call_method_ambiguous.rs
@@ -1,6 +1,6 @@
 //@ revisions: current next
 //@[next] compile-flags: -Znext-solver
-//@[current] run-pass
+//@ run-pass
 
 trait Get {
     fn get(&mut self) -> u32;
@@ -24,7 +24,6 @@ where
 fn foo(n: usize, m: &mut ()) -> impl Get + use<'_> {
     if n > 0 {
         let mut iter = foo(n - 1, m);
-        //[next]~^ ERROR type annotations needed
         assert_eq!(iter.get(), 1);
     }
     m
diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl.next.stderr b/tests/ui/impl-trait/call_method_on_inherent_impl.next.stderr
deleted file mode 100644
index 271051f120a..00000000000
--- a/tests/ui/impl-trait/call_method_on_inherent_impl.next.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0282]: type annotations needed
-  --> $DIR/call_method_on_inherent_impl.rs:18:13
-   |
-LL |         let x = my_foo();
-   |             ^
-LL |
-LL |         x.my_debug();
-   |         - type must be known at this point
-   |
-help: consider giving `x` an explicit type
-   |
-LL |         let x: /* Type */ = my_foo();
-   |              ++++++++++++
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl.rs b/tests/ui/impl-trait/call_method_on_inherent_impl.rs
index 0e333c3260a..1dd38bc6717 100644
--- a/tests/ui/impl-trait/call_method_on_inherent_impl.rs
+++ b/tests/ui/impl-trait/call_method_on_inherent_impl.rs
@@ -1,6 +1,6 @@
 //@ revisions: current next
 //@[next] compile-flags: -Znext-solver
-//@[current] check-pass
+//@ check-pass
 
 trait MyDebug {
     fn my_debug(&self);
@@ -16,7 +16,6 @@ where
 fn my_foo() -> impl std::fmt::Debug {
     if false {
         let x = my_foo();
-        //[next]~^ ERROR type annotations needed
         x.my_debug();
     }
     ()
diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.current.stderr b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.current.stderr
index 6ecb2b05fc5..e7104664470 100644
--- a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.current.stderr
+++ b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.current.stderr
@@ -1,5 +1,5 @@
 error[E0599]: no method named `my_debug` found for reference `&impl Debug` in the current scope
-  --> $DIR/call_method_on_inherent_impl_on_rigid_type.rs:16:11
+  --> $DIR/call_method_on_inherent_impl_on_rigid_type.rs:15:11
    |
 LL |         x.my_debug();
    |           ^^^^^^^^ method not found in `&impl Debug`
diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.next.stderr b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.next.stderr
index 5fb0b8f1d14..de808259d40 100644
--- a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.next.stderr
+++ b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.next.stderr
@@ -1,17 +1,15 @@
-error[E0282]: type annotations needed for `&_`
-  --> $DIR/call_method_on_inherent_impl_on_rigid_type.rs:14:13
+error[E0599]: no method named `my_debug` found for reference `&_` in the current scope
+  --> $DIR/call_method_on_inherent_impl_on_rigid_type.rs:15:11
    |
-LL |         let x = &my_foo();
-   |             ^
-LL |
 LL |         x.my_debug();
-   |           -------- type must be known at this point
+   |           ^^^^^^^^ method not found in `&_`
    |
-help: consider giving `x` an explicit type, where the placeholders `_` are specified
+   = help: items from traits can only be used if the trait is implemented and in scope
+help: trait `MyDebug` which provides `my_debug` is implemented but not in scope; perhaps you want to import it
+   |
+LL + use MyDebug;
    |
-LL |         let x: &_ = &my_foo();
-   |              ++++
 
 error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0282`.
+For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.rs b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.rs
index 7fb2ff3b2bc..0c9909efa1b 100644
--- a/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.rs
+++ b/tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.rs
@@ -12,9 +12,8 @@ impl MyDebug for &() {
 fn my_foo() -> impl std::fmt::Debug {
     if false {
         let x = &my_foo();
-        //[next]~^ ERROR: type annotations needed
         x.my_debug();
-        //[current]~^ ERROR: no method named `my_debug`
+        //~^ ERROR: no method named `my_debug`
     }
     ()
 }
diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl_ref.current.stderr b/tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.current.stderr
index fb51bb7b417..71acbd1497d 100644
--- a/tests/ui/impl-trait/call_method_on_inherent_impl_ref.current.stderr
+++ b/tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.current.stderr
@@ -1,5 +1,5 @@
 error[E0599]: no method named `my_debug` found for opaque type `impl Debug` in the current scope
-  --> $DIR/call_method_on_inherent_impl_ref.rs:19:11
+  --> $DIR/call_method_on_inherent_impl_ref-err.rs:18:11
    |
 LL |     fn my_debug(&self);
    |        -------- the method is available for `&impl Debug` here
@@ -9,7 +9,7 @@ LL |         x.my_debug();
    |
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `MyDebug` defines an item `my_debug`, perhaps you need to implement it
-  --> $DIR/call_method_on_inherent_impl_ref.rs:4:1
+  --> $DIR/call_method_on_inherent_impl_ref-err.rs:4:1
    |
 LL | trait MyDebug {
    | ^^^^^^^^^^^^^
diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.next.stderr b/tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.next.stderr
new file mode 100644
index 00000000000..523505e9802
--- /dev/null
+++ b/tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.next.stderr
@@ -0,0 +1,19 @@
+error[E0599]: no method named `my_debug` found for type `_` in the current scope
+  --> $DIR/call_method_on_inherent_impl_ref-err.rs:18:11
+   |
+LL |     fn my_debug(&self);
+   |        -------- the method is available for `&_` here
+...
+LL |         x.my_debug();
+   |           ^^^^^^^^ method not found in `_`
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+note: `MyDebug` defines an item `my_debug`, perhaps you need to implement it
+  --> $DIR/call_method_on_inherent_impl_ref-err.rs:4:1
+   |
+LL | trait MyDebug {
+   | ^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.rs b/tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.rs
new file mode 100644
index 00000000000..0ed09bc76a4
--- /dev/null
+++ b/tests/ui/impl-trait/call_method_on_inherent_impl_ref-err.rs
@@ -0,0 +1,24 @@
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+
+trait MyDebug {
+    fn my_debug(&self);
+}
+
+impl<T> MyDebug for &T
+where
+    T: std::fmt::Debug,
+{
+    fn my_debug(&self) {}
+}
+
+fn my_foo() -> impl std::fmt::Debug {
+    if false {
+        let x = my_foo();
+        x.my_debug();
+        //~^ ERROR no method named `my_debug` found
+    }
+    ()
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl_ref.rs b/tests/ui/impl-trait/call_method_on_inherent_impl_ref-ok.rs
index 4e4098b37f9..40739d6a0ce 100644
--- a/tests/ui/impl-trait/call_method_on_inherent_impl_ref.rs
+++ b/tests/ui/impl-trait/call_method_on_inherent_impl_ref-ok.rs
@@ -1,5 +1,6 @@
 //@ revisions: current next
 //@[next] compile-flags: -Znext-solver
+//@ check-pass
 
 trait MyDebug {
     fn my_debug(&self);
@@ -12,20 +13,9 @@ where
     fn my_debug(&self) {}
 }
 
-fn my_foo() -> impl std::fmt::Debug {
-    if false {
-        let x = my_foo();
-        //[next]~^ ERROR type annotations needed
-        x.my_debug();
-        //[current]~^ ERROR no method named `my_debug` found
-    }
-    ()
-}
-
 fn my_bar() -> impl std::fmt::Debug {
     if false {
         let x = &my_bar();
-        //[next]~^ ERROR type annotations needed
         x.my_debug();
     }
     ()
diff --git a/tests/ui/impl-trait/call_method_on_inherent_impl_ref.next.stderr b/tests/ui/impl-trait/call_method_on_inherent_impl_ref.next.stderr
deleted file mode 100644
index 7202cb6f90a..00000000000
--- a/tests/ui/impl-trait/call_method_on_inherent_impl_ref.next.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error[E0282]: type annotations needed
-  --> $DIR/call_method_on_inherent_impl_ref.rs:17:13
-   |
-LL |         let x = my_foo();
-   |             ^
-LL |
-LL |         x.my_debug();
-   |         - type must be known at this point
-   |
-help: consider giving `x` an explicit type
-   |
-LL |         let x: /* Type */ = my_foo();
-   |              ++++++++++++
-
-error[E0282]: type annotations needed for `&_`
-  --> $DIR/call_method_on_inherent_impl_ref.rs:27:13
-   |
-LL |         let x = &my_bar();
-   |             ^
-LL |
-LL |         x.my_debug();
-   |           -------- type must be known at this point
-   |
-help: consider giving `x` an explicit type, where the placeholders `_` are specified
-   |
-LL |         let x: &_ = &my_bar();
-   |              ++++
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/impl-trait/diagnostics/highlight-difference-between-expected-trait-and-found-trait.svg b/tests/ui/impl-trait/diagnostics/highlight-difference-between-expected-trait-and-found-trait.svg
index 73acb072ac5..6077dbdc200 100644
--- a/tests/ui/impl-trait/diagnostics/highlight-difference-between-expected-trait-and-found-trait.svg
+++ b/tests/ui/impl-trait/diagnostics/highlight-difference-between-expected-trait-and-found-trait.svg
@@ -1,7 +1,7 @@
-<svg width="1188px" height="398px" xmlns="http://www.w3.org/2000/svg">
+<svg width="1096px" height="398px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
+    .bg { fill: #000000 }
     .fg-ansi256-009 { fill: #FF5555 }
     .fg-ansi256-010 { fill: #55FF55 }
     .fg-ansi256-012 { fill: #5555FF }
diff --git a/tests/ui/impl-trait/hidden-type-is-opaque-2.default.stderr b/tests/ui/impl-trait/hidden-type-is-opaque-2.default.stderr
index dca0a7b0a1a..cb383b2db38 100644
--- a/tests/ui/impl-trait/hidden-type-is-opaque-2.default.stderr
+++ b/tests/ui/impl-trait/hidden-type-is-opaque-2.default.stderr
@@ -5,7 +5,7 @@ LL |     Thunk::new(|mut cont| {
    |                 ^^^^^^^^
 LL |
 LL |         cont.reify_as();
-   |         ---- type must be known at this point
+   |              -------- type must be known at this point
    |
 help: consider giving this closure parameter an explicit type
    |
@@ -19,7 +19,7 @@ LL |     Thunk::new(|mut cont| {
    |                 ^^^^^^^^
 LL |
 LL |         cont.reify_as();
-   |         ---- type must be known at this point
+   |              -------- type must be known at this point
    |
 help: consider giving this closure parameter an explicit type
    |
diff --git a/tests/ui/impl-trait/hidden-type-is-opaque-2.next.stderr b/tests/ui/impl-trait/hidden-type-is-opaque-2.next.stderr
index dca0a7b0a1a..cb383b2db38 100644
--- a/tests/ui/impl-trait/hidden-type-is-opaque-2.next.stderr
+++ b/tests/ui/impl-trait/hidden-type-is-opaque-2.next.stderr
@@ -5,7 +5,7 @@ LL |     Thunk::new(|mut cont| {
    |                 ^^^^^^^^
 LL |
 LL |         cont.reify_as();
-   |         ---- type must be known at this point
+   |              -------- type must be known at this point
    |
 help: consider giving this closure parameter an explicit type
    |
@@ -19,7 +19,7 @@ LL |     Thunk::new(|mut cont| {
    |                 ^^^^^^^^
 LL |
 LL |         cont.reify_as();
-   |         ---- type must be known at this point
+   |              -------- type must be known at this point
    |
 help: consider giving this closure parameter an explicit type
    |
diff --git a/tests/ui/impl-trait/method-resolution4.next.stderr b/tests/ui/impl-trait/method-resolution4.next.stderr
deleted file mode 100644
index 0524f49f98e..00000000000
--- a/tests/ui/impl-trait/method-resolution4.next.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0282]: type annotations needed
-  --> $DIR/method-resolution4.rs:13:9
-   |
-LL |         foo(false).next().unwrap();
-   |         ^^^^^^^^^^ cannot infer type
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/impl-trait/method/broken-deref-chain.current.stderr b/tests/ui/impl-trait/method/broken-deref-chain.current.stderr
new file mode 100644
index 00000000000..726f076b183
--- /dev/null
+++ b/tests/ui/impl-trait/method/broken-deref-chain.current.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+  --> $DIR/broken-deref-chain.rs:41:30
+   |
+LL | fn trait_method() -> impl Trait {
+   |                      ---------- the found opaque type
+...
+LL |         x.trait_method();
+   |         - here the type of `x` is inferred to be `Foo<u32, impl Trait>`
+LL |         let _: Foo<i32, _> = x; // Test that we did not apply the deref step
+   |                -----------   ^ expected `Foo<i32, _>`, found `Foo<u32, impl Trait>`
+   |                |
+   |                expected due to this
+   |
+   = note: expected struct `Foo<i32, _>`
+              found struct `Foo<u32, impl Trait>`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/method/broken-deref-chain.rs b/tests/ui/impl-trait/method/broken-deref-chain.rs
new file mode 100644
index 00000000000..8b45e044f43
--- /dev/null
+++ b/tests/ui/impl-trait/method/broken-deref-chain.rs
@@ -0,0 +1,47 @@
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@[next] check-pass
+
+// An annoying edge case of method selection. While computing the deref-chain
+// constrains `T` to `u32`, the final method candidate does not and instead
+// constrains to `i32`. In this case, we no longer check that the opaque
+// remains unconstrained. Both method calls in this test constrain the opaque
+// to `i32`.
+use std::ops::Deref;
+
+struct Foo<T, U>(T, U);
+impl<U> Deref for Foo<u32, U> {
+    type Target = U;
+    fn deref(&self) -> &Self::Target {
+        &self.1
+    }
+}
+
+impl Foo<i32, i32> {
+    fn method(&self) {}
+}
+fn inherent_method() -> impl Sized {
+    if false {
+        let x = Foo(Default::default(), inherent_method());
+        x.method();
+        let _: Foo<i32, _> = x; // Test that we did not apply the deref step
+    }
+    1i32
+}
+
+trait Trait {
+    fn trait_method(&self) {}
+}
+impl Trait for Foo<i32, i32> {}
+impl Trait for i32 {}
+fn trait_method() -> impl Trait {
+    if false {
+        let x = Foo(Default::default(), trait_method());
+        x.trait_method();
+        let _: Foo<i32, _> = x; // Test that we did not apply the deref step
+        //[current]~^ ERROR mismatched types
+    }
+    1i32
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/method-resolution.rs b/tests/ui/impl-trait/method/method-resolution.rs
index 60fbacd8646..60fbacd8646 100644
--- a/tests/ui/impl-trait/method-resolution.rs
+++ b/tests/ui/impl-trait/method/method-resolution.rs
diff --git a/tests/ui/impl-trait/method-resolution2.next.stderr b/tests/ui/impl-trait/method/method-resolution2.next.stderr
index 223430e1658..223430e1658 100644
--- a/tests/ui/impl-trait/method-resolution2.next.stderr
+++ b/tests/ui/impl-trait/method/method-resolution2.next.stderr
diff --git a/tests/ui/impl-trait/method-resolution2.rs b/tests/ui/impl-trait/method/method-resolution2.rs
index 88d4f3d9896..88d4f3d9896 100644
--- a/tests/ui/impl-trait/method-resolution2.rs
+++ b/tests/ui/impl-trait/method/method-resolution2.rs
diff --git a/tests/ui/impl-trait/method-resolution3.current.stderr b/tests/ui/impl-trait/method/method-resolution3.current.stderr
index 87dd862ef8f..87dd862ef8f 100644
--- a/tests/ui/impl-trait/method-resolution3.current.stderr
+++ b/tests/ui/impl-trait/method/method-resolution3.current.stderr
diff --git a/tests/ui/impl-trait/method-resolution3.next.stderr b/tests/ui/impl-trait/method/method-resolution3.next.stderr
index 87dd862ef8f..87dd862ef8f 100644
--- a/tests/ui/impl-trait/method-resolution3.next.stderr
+++ b/tests/ui/impl-trait/method/method-resolution3.next.stderr
diff --git a/tests/ui/impl-trait/method-resolution3.rs b/tests/ui/impl-trait/method/method-resolution3.rs
index 8c47ef4fc75..8c47ef4fc75 100644
--- a/tests/ui/impl-trait/method-resolution3.rs
+++ b/tests/ui/impl-trait/method/method-resolution3.rs
diff --git a/tests/ui/impl-trait/method-resolution4.rs b/tests/ui/impl-trait/method/method-resolution4.rs
index 90e7850cad5..f90a9309cda 100644
--- a/tests/ui/impl-trait/method-resolution4.rs
+++ b/tests/ui/impl-trait/method/method-resolution4.rs
@@ -6,12 +6,11 @@
 
 //@ revisions: current next
 //@[next] compile-flags: -Znext-solver
-//@[current] check-pass
+//@ check-pass
 
 fn foo(b: bool) -> impl Iterator<Item = ()> {
     if b {
         foo(false).next().unwrap();
-        //[next]~^ ERROR type annotations needed
     }
     std::iter::empty()
 }
diff --git a/tests/ui/impl-trait/method/method-resolution5-deref-no-constrain.current.stderr b/tests/ui/impl-trait/method/method-resolution5-deref-no-constrain.current.stderr
new file mode 100644
index 00000000000..08578de426a
--- /dev/null
+++ b/tests/ui/impl-trait/method/method-resolution5-deref-no-constrain.current.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+  --> $DIR/method-resolution5-deref-no-constrain.rs:20:5
+   |
+LL | fn via_deref() -> impl Deref<Target = Foo> {
+   |                                       --- expected `&Foo` because of return type
+...
+LL |     Box::new(Foo)
+   |     ^^^^^^^^^^^^^ expected `&Foo`, found `Box<Foo>`
+   |
+   = note: expected reference `&Foo`
+                 found struct `Box<Foo>`
+help: consider borrowing here
+   |
+LL |     &Box::new(Foo)
+   |     +
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/method/method-resolution5-deref-no-constrain.rs b/tests/ui/impl-trait/method/method-resolution5-deref-no-constrain.rs
new file mode 100644
index 00000000000..2c41f62b9fd
--- /dev/null
+++ b/tests/ui/impl-trait/method/method-resolution5-deref-no-constrain.rs
@@ -0,0 +1,23 @@
+//! The recursive method call yields the opaque type. We want
+//! to use the impl candidate for `Foo` here without constraining
+//! the opaque to `&Foo`.
+
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@[next] check-pass
+
+use std::ops::Deref;
+struct Foo;
+impl Foo {
+    fn method(&self) {}
+}
+fn via_deref() -> impl Deref<Target = Foo> {
+    // Currently errors on stable, but should not
+    if false {
+        via_deref().method();
+    }
+
+    Box::new(Foo)
+    //[current]~^ ERROR mismatched types
+}
+fn main() {}
diff --git a/tests/ui/impl-trait/method/method-resolution5-deref.rs b/tests/ui/impl-trait/method/method-resolution5-deref.rs
new file mode 100644
index 00000000000..6133a8efe24
--- /dev/null
+++ b/tests/ui/impl-trait/method/method-resolution5-deref.rs
@@ -0,0 +1,30 @@
+//! The recursive method call yields the opaque type. We want
+//! to use the trait candidate for `impl Foo` here while not
+//! applying it for the `impl Deref`.
+
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@ check-pass
+
+use std::ops::Deref;
+trait Foo {
+    fn method(&self) {}
+}
+impl Foo for u32 {}
+fn via_deref() -> impl Deref<Target = impl Foo> {
+    if false {
+        via_deref().method();
+    }
+
+    Box::new(1u32)
+}
+
+fn via_deref_nested() -> Box<impl Deref<Target = impl Foo>> {
+    if false {
+        via_deref_nested().method();
+    }
+
+    Box::new(Box::new(1u32))
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/method/would-constrain-opaque.current.stderr b/tests/ui/impl-trait/method/would-constrain-opaque.current.stderr
new file mode 100644
index 00000000000..60533a39c53
--- /dev/null
+++ b/tests/ui/impl-trait/method/would-constrain-opaque.current.stderr
@@ -0,0 +1,29 @@
+error[E0599]: no method named `method` found for reference `&impl Sized` in the current scope
+  --> $DIR/would-constrain-opaque.rs:28:11
+   |
+LL |         x.method();
+   |           ^^^^^^ method not found in `&impl Sized`
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+note: `Trait` defines an item `method`, perhaps you need to implement it
+  --> $DIR/would-constrain-opaque.rs:15:1
+   |
+LL | trait Trait: Sized {
+   | ^^^^^^^^^^^^^^^^^^
+
+error[E0599]: no method named `method` found for reference `&impl Sized` in the current scope
+  --> $DIR/would-constrain-opaque.rs:30:11
+   |
+LL |         x.method();
+   |           ^^^^^^ method not found in `&impl Sized`
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+note: `Trait` defines an item `method`, perhaps you need to implement it
+  --> $DIR/would-constrain-opaque.rs:15:1
+   |
+LL | trait Trait: Sized {
+   | ^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/impl-trait/method/would-constrain-opaque.next.stderr b/tests/ui/impl-trait/method/would-constrain-opaque.next.stderr
new file mode 100644
index 00000000000..23a4ceb826a
--- /dev/null
+++ b/tests/ui/impl-trait/method/would-constrain-opaque.next.stderr
@@ -0,0 +1,27 @@
+error[E0599]: no method named `method` found for reference `&_` in the current scope
+  --> $DIR/would-constrain-opaque.rs:28:11
+   |
+LL |         x.method();
+   |           ^^^^^^ method not found in `&_`
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+help: trait `Trait` which provides `method` is implemented but not in scope; perhaps you want to import it
+   |
+LL + use Trait;
+   |
+
+error[E0599]: no method named `method` found for reference `&_` in the current scope
+  --> $DIR/would-constrain-opaque.rs:30:11
+   |
+LL |         x.method();
+   |           ^^^^^^ method not found in `&_`
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+help: trait `Trait` which provides `method` is implemented but not in scope; perhaps you want to import it
+   |
+LL + use Trait;
+   |
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/impl-trait/method/would-constrain-opaque.rs b/tests/ui/impl-trait/method/would-constrain-opaque.rs
new file mode 100644
index 00000000000..8dd32282529
--- /dev/null
+++ b/tests/ui/impl-trait/method/would-constrain-opaque.rs
@@ -0,0 +1,39 @@
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+
+// If we don't treat `impl Sized` as rigid, the first call would
+// resolve to the trait method, constraining the opaque, while the
+// second call would resolve to the inherent method.
+//
+// We avoid cases like this by rejecting candidates which constrain
+// opaque types encountered in the autoderef chain.
+//
+// FIXME(-Znext-solver): ideally we would note that the inference variable
+// is an opaque type in the error message and change this to a type annotations
+// needed error.
+
+trait Trait: Sized {
+    fn method(self) {}
+}
+impl Trait for &Foo {}
+
+struct Foo;
+impl Foo {
+    fn method(&self) {}
+}
+
+fn define_opaque(b: bool) -> impl Sized {
+    if b {
+        let x = &define_opaque(false);
+        x.method();
+        //~^ ERROR no method named `method` found for reference
+        x.method();
+        //~^ ERROR no method named `method` found for reference
+    }
+
+    Foo
+}
+
+fn main() {
+    define_opaque(true);
+}
diff --git a/tests/ui/impl-trait/non-defining-uses/ambiguous-ops.current.stderr b/tests/ui/impl-trait/non-defining-uses/ambiguous-ops.current.stderr
new file mode 100644
index 00000000000..c54c1bba028
--- /dev/null
+++ b/tests/ui/impl-trait/non-defining-uses/ambiguous-ops.current.stderr
@@ -0,0 +1,62 @@
+error[E0369]: cannot add `{integer}` to `impl Sized`
+  --> $DIR/ambiguous-ops.rs:17:15
+   |
+LL |         add() + 1
+   |         ----- ^ - {integer}
+   |         |
+   |         impl Sized
+
+error[E0368]: binary assignment operation `*=` cannot be applied to type `impl Sized`
+  --> $DIR/ambiguous-ops.rs:31:9
+   |
+LL |         temp *= 2;
+   |         ----^^^^^
+   |         |
+   |         cannot use `*=` on type `impl Sized`
+
+error[E0614]: type `DerefWrapper<impl Sized>` cannot be dereferenced
+  --> $DIR/ambiguous-ops.rs:57:22
+   |
+LL |         let _rarw = &*explicit_deref();
+   |                      ^^^^^^^^^^^^^^^^^ can't be dereferenced
+
+error[E0614]: type `DerefWrapper<impl Sized>` cannot be dereferenced
+  --> $DIR/ambiguous-ops.rs:69:9
+   |
+LL |         *explicit_deref_mut() = 1;
+   |         ^^^^^^^^^^^^^^^^^^^^^ can't be dereferenced
+
+error[E0277]: the type `impl Sized` cannot be indexed by `_`
+  --> $DIR/ambiguous-ops.rs:94:18
+   |
+LL |         let _y = explicit_index()[0];
+   |                  ^^^^^^^^^^^^^^^^ `impl Sized` cannot be indexed by `_`
+   |
+   = help: the trait `Index<_>` is not implemented for `impl Sized`
+note: required for `IndexWrapper<impl Sized>` to implement `Index<_>`
+  --> $DIR/ambiguous-ops.rs:81:22
+   |
+LL | impl<T: Index<U>, U> Index<U> for IndexWrapper<T> {
+   |         --------     ^^^^^^^^     ^^^^^^^^^^^^^^^
+   |         |
+   |         unsatisfied trait bound introduced here
+
+error[E0277]: the type `impl Sized` cannot be indexed by `_`
+  --> $DIR/ambiguous-ops.rs:106:9
+   |
+LL |         explicit_index_mut()[0] = 1;
+   |         ^^^^^^^^^^^^^^^^^^^^ `impl Sized` cannot be indexed by `_`
+   |
+   = help: the trait `Index<_>` is not implemented for `impl Sized`
+note: required for `IndexWrapper<impl Sized>` to implement `Index<_>`
+  --> $DIR/ambiguous-ops.rs:81:22
+   |
+LL | impl<T: Index<U>, U> Index<U> for IndexWrapper<T> {
+   |         --------     ^^^^^^^^     ^^^^^^^^^^^^^^^
+   |         |
+   |         unsatisfied trait bound introduced here
+
+error: aborting due to 6 previous errors
+
+Some errors have detailed explanations: E0277, E0368, E0369, E0614.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/non-defining-uses/ambiguous-ops.rs b/tests/ui/impl-trait/non-defining-uses/ambiguous-ops.rs
new file mode 100644
index 00000000000..0aa5715339d
--- /dev/null
+++ b/tests/ui/impl-trait/non-defining-uses/ambiguous-ops.rs
@@ -0,0 +1,117 @@
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] check-pass
+
+// Make sure we support non-call operations for opaque types even if
+// its not part of its item bounds.
+
+use std::ops::{Deref, DerefMut, Index, IndexMut};
+
+fn mk<T>() -> T {
+    todo!()
+}
+
+fn add() -> impl Sized {
+    let unconstrained = if false {
+        add() + 1
+        //[current]~^ ERROR cannot add `{integer}` to `impl Sized
+    } else {
+        let with_infer = mk();
+        let _ = with_infer + 1;
+        with_infer
+    };
+    let _: u32 = unconstrained;
+    1u32
+}
+
+fn mul_assign() -> impl Sized {
+    if false {
+        let mut temp = mul_assign();
+        temp *= 2;
+        //[current]~^ ERROR binary assignment operation `*=` cannot be applied to type `impl Sized`
+    }
+
+    let mut with_infer = mk();
+    with_infer *= 2;
+    let _: u32 = with_infer;
+
+    1u32
+}
+
+struct DerefWrapper<T>(T);
+impl<T: Deref> Deref for DerefWrapper<T> {
+    type Target = T::Target;
+    fn deref(&self) -> &Self::Target {
+        &*self.0
+    }
+}
+impl<T: DerefMut> DerefMut for DerefWrapper<T> {
+    fn deref_mut(&mut self) -> &mut Self::Target {
+        &mut *self.0
+    }
+}
+
+fn explicit_deref() -> DerefWrapper<impl Sized> {
+    if false {
+        let _rarw = &*explicit_deref();
+        //[current]~^ ERROR type `DerefWrapper<impl Sized>` cannot be dereferenced
+
+        let mut with_infer = DerefWrapper(mk());
+        let _rarw = &*with_infer;
+        with_infer
+    } else {
+        DerefWrapper(&1u32)
+    }
+}
+fn explicit_deref_mut() -> DerefWrapper<impl Sized> {
+    if false {
+        *explicit_deref_mut() = 1;
+        //[current]~^ ERROR type `DerefWrapper<impl Sized>` cannot be dereferenced
+
+        let mut with_infer = DerefWrapper(Default::default());
+        *with_infer = 1;
+        with_infer
+    } else {
+        DerefWrapper(Box::new(1u32))
+    }
+}
+
+struct IndexWrapper<T>(T);
+impl<T: Index<U>, U> Index<U> for IndexWrapper<T> {
+    type Output = T::Output;
+    fn index(&self, index: U) -> &Self::Output {
+        &self.0[index]
+    }
+}
+impl<T: IndexMut<U>, U> IndexMut<U> for IndexWrapper<T> {
+    fn index_mut(&mut self, index: U) -> &mut Self::Output {
+        &mut self.0[index]
+    }
+}
+fn explicit_index() -> IndexWrapper<impl Sized> {
+    if false {
+        let _y = explicit_index()[0];
+        //[current]~^ ERROR the type `impl Sized` cannot be indexed by `_`
+
+        let with_infer = IndexWrapper(Default::default());
+        let _y = with_infer[0];
+        with_infer
+    } else {
+        IndexWrapper([1u32])
+    }
+}
+fn explicit_index_mut() -> IndexWrapper<impl Sized> {
+    if false {
+        explicit_index_mut()[0] = 1;
+        //[current]~^ ERROR the type `impl Sized` cannot be indexed by `_`
+
+        let mut with_infer = IndexWrapper(Default::default());
+        with_infer[0] = 1;
+        with_infer
+    } else {
+        IndexWrapper([1u32])
+    }
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/non-defining-uses/call-expr-incorrect-choice-diagnostics.current.stderr b/tests/ui/impl-trait/non-defining-uses/call-expr-incorrect-choice-diagnostics.current.stderr
new file mode 100644
index 00000000000..e213dab5d96
--- /dev/null
+++ b/tests/ui/impl-trait/non-defining-uses/call-expr-incorrect-choice-diagnostics.current.stderr
@@ -0,0 +1,53 @@
+error[E0382]: use of moved value: `var`
+  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:14:9
+   |
+LL |         let mut var = item_bound_is_too_weak();
+   |             ------- move occurs because `var` has type `impl FnOnce()`, which does not implement the `Copy` trait
+LL |         var();
+   |         ----- `var` moved due to this call
+LL |         var();
+   |         ^^^ value used here after move
+   |
+note: this value implements `FnOnce`, which causes it to be moved when called
+  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:13:9
+   |
+LL |         var();
+   |         ^^^
+
+error[E0618]: expected function, found `impl Sized`
+  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:24:9
+   |
+LL | fn opaque_type_no_impl_fn() -> impl Sized {
+   | ----------------------------------------- `opaque_type_no_impl_fn` defined here returns `impl Sized`
+LL |     if false {
+LL |         opaque_type_no_impl_fn()();
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^--
+   |         |
+   |         call expression requires function
+
+error[E0618]: expected function, found `impl Sized`
+  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:34:9
+   |
+LL | fn opaque_type_no_impl_fn_incorrect() -> impl Sized {
+   | --------------------------------------------------- `opaque_type_no_impl_fn_incorrect` defined here returns `impl Sized`
+LL |     if false {
+LL |         opaque_type_no_impl_fn_incorrect()();
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--
+   |         |
+   |         call expression requires function
+
+error[E0618]: expected function, found `impl Deref<Target = impl Sized>`
+  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:44:9
+   |
+LL | fn opaque_type_deref_no_impl_fn() -> impl Deref<Target = impl Sized> {
+   | -------------------------------------------------------------------- `opaque_type_deref_no_impl_fn` defined here returns `impl Deref<Target = impl Sized>`
+LL |     if false {
+LL |         opaque_type_deref_no_impl_fn()();
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--
+   |         |
+   |         call expression requires function
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0382, E0618.
+For more information about an error, try `rustc --explain E0382`.
diff --git a/tests/ui/impl-trait/non-defining-uses/call-expr-incorrect-choice-diagnostics.next.stderr b/tests/ui/impl-trait/non-defining-uses/call-expr-incorrect-choice-diagnostics.next.stderr
new file mode 100644
index 00000000000..5678349cad3
--- /dev/null
+++ b/tests/ui/impl-trait/non-defining-uses/call-expr-incorrect-choice-diagnostics.next.stderr
@@ -0,0 +1,57 @@
+error[E0382]: use of moved value: `var`
+  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:14:9
+   |
+LL |         let mut var = item_bound_is_too_weak();
+   |             ------- move occurs because `var` has type `{closure@$DIR/call-expr-incorrect-choice-diagnostics.rs:19:5: 19:12}`, which does not implement the `Copy` trait
+LL |         var();
+   |         ----- `var` moved due to this call
+LL |         var();
+   |         ^^^ value used here after move
+   |
+note: this value implements `FnOnce`, which causes it to be moved when called
+  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:13:9
+   |
+LL |         var();
+   |         ^^^
+help: consider cloning the value if the performance cost is acceptable
+   |
+LL |         var.clone()();
+   |            ++++++++
+
+error[E0618]: expected function, found `_`
+  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:24:9
+   |
+LL | fn opaque_type_no_impl_fn() -> impl Sized {
+   | ----------------------------------------- `opaque_type_no_impl_fn` defined here returns `_`
+LL |     if false {
+LL |         opaque_type_no_impl_fn()();
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^--
+   |         |
+   |         call expression requires function
+
+error[E0618]: expected function, found `_`
+  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:34:9
+   |
+LL | fn opaque_type_no_impl_fn_incorrect() -> impl Sized {
+   | --------------------------------------------------- `opaque_type_no_impl_fn_incorrect` defined here returns `_`
+LL |     if false {
+LL |         opaque_type_no_impl_fn_incorrect()();
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--
+   |         |
+   |         call expression requires function
+
+error[E0618]: expected function, found `_`
+  --> $DIR/call-expr-incorrect-choice-diagnostics.rs:44:9
+   |
+LL | fn opaque_type_deref_no_impl_fn() -> impl Deref<Target = impl Sized> {
+   | -------------------------------------------------------------------- `opaque_type_deref_no_impl_fn` defined here returns `_`
+LL |     if false {
+LL |         opaque_type_deref_no_impl_fn()();
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--
+   |         |
+   |         call expression requires function
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0382, E0618.
+For more information about an error, try `rustc --explain E0382`.
diff --git a/tests/ui/impl-trait/non-defining-uses/call-expr-incorrect-choice-diagnostics.rs b/tests/ui/impl-trait/non-defining-uses/call-expr-incorrect-choice-diagnostics.rs
new file mode 100644
index 00000000000..1d73985f78a
--- /dev/null
+++ b/tests/ui/impl-trait/non-defining-uses/call-expr-incorrect-choice-diagnostics.rs
@@ -0,0 +1,52 @@
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@ ignore-compare-mode-next-solver (explicit revisions)
+
+// Testing the errors in case we've made a wrong choice when
+// calling an opaque.
+
+use std::ops::Deref;
+
+fn item_bound_is_too_weak() -> impl FnOnce() {
+    if false {
+        let mut var = item_bound_is_too_weak();
+        var();
+        var();
+        //~^ ERROR use of moved value: `var`
+    }
+
+    let mut state = String::new();
+    move || state.push('a')
+}
+
+fn opaque_type_no_impl_fn() -> impl Sized {
+    if false {
+        opaque_type_no_impl_fn()();
+        //[current]~^ ERROR expected function, found `impl Sized`
+        //[next]~^^ ERROR expected function, found `_`
+    }
+
+    1
+}
+
+fn opaque_type_no_impl_fn_incorrect() -> impl Sized {
+    if false {
+        opaque_type_no_impl_fn_incorrect()();
+        //[current]~^ ERROR expected function, found `impl Sized`
+        //[next]~^^ ERROR expected function, found `_`
+    }
+
+    || ()
+}
+
+fn opaque_type_deref_no_impl_fn() -> impl Deref<Target = impl Sized> {
+    if false {
+        opaque_type_deref_no_impl_fn()();
+        //[current]~^ ERROR expected function, found `impl Deref<Target = impl Sized>`
+        //[next]~^^ ERROR expected function, found `_`
+    }
+
+    &1
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/non-defining-uses/deref-constrains-self-ty.current.stderr b/tests/ui/impl-trait/non-defining-uses/deref-constrains-self-ty.current.stderr
new file mode 100644
index 00000000000..bbe90e5873d
--- /dev/null
+++ b/tests/ui/impl-trait/non-defining-uses/deref-constrains-self-ty.current.stderr
@@ -0,0 +1,16 @@
+error[E0599]: no method named `len` found for struct `Wrapper<T>` in the current scope
+  --> $DIR/deref-constrains-self-ty.rs:22:32
+   |
+LL | struct Wrapper<T>(T);
+   | ----------------- method `len` not found for this struct
+...
+LL |         let _ = Wrapper(foo()).len();
+   |                                ^^^ method not found in `Wrapper<impl Sized>`
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `len`, perhaps you need to implement it:
+           candidate #1: `ExactSizeIterator`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/impl-trait/non-defining-uses/deref-constrains-self-ty.rs b/tests/ui/impl-trait/non-defining-uses/deref-constrains-self-ty.rs
new file mode 100644
index 00000000000..d143878bc74
--- /dev/null
+++ b/tests/ui/impl-trait/non-defining-uses/deref-constrains-self-ty.rs
@@ -0,0 +1,28 @@
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] check-pass
+
+// A test which shows that autoderef can constrain opaque types even
+// though it's supposed to treat not-yet-defined opaque types as
+// mostly rigid. I don't think this should necessarily compile :shrug:
+use std::ops::Deref;
+
+struct Wrapper<T>(T);
+
+impl<T> Deref for Wrapper<Vec<T>> {
+    type Target = Vec<T>;
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
+}
+
+fn foo() -> impl Sized {
+    if false {
+        let _ = Wrapper(foo()).len();
+        //[current]~^ ERROR no method named `len` found for struct `Wrapper<T>` in the current scope
+    }
+
+    std::iter::once(1).collect()
+}
+fn main() {}
diff --git a/tests/ui/impl-trait/non-defining-uses/double-wrap-with-defining-use.current.stderr b/tests/ui/impl-trait/non-defining-uses/double-wrap-with-defining-use.current.stderr
index 30424ec58f9..bac5b3e0cf4 100644
--- a/tests/ui/impl-trait/non-defining-uses/double-wrap-with-defining-use.current.stderr
+++ b/tests/ui/impl-trait/non-defining-uses/double-wrap-with-defining-use.current.stderr
@@ -1,5 +1,5 @@
 error[E0792]: expected generic type parameter, found `impl Foo`
-  --> $DIR/double-wrap-with-defining-use.rs:12:26
+  --> $DIR/double-wrap-with-defining-use.rs:11:26
    |
 LL | fn a<T: Foo>(x: T) -> impl Foo {
    |      - this generic parameter must be used with a generic type parameter
@@ -7,7 +7,7 @@ LL |     if true { x } else { a(a(x)) }
    |                          ^^^^^^^
 
 error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
-  --> $DIR/double-wrap-with-defining-use.rs:12:26
+  --> $DIR/double-wrap-with-defining-use.rs:11:26
    |
 LL |     if true { x } else { a(a(x)) }
    |                          ^^^^^^^
diff --git a/tests/ui/impl-trait/non-defining-uses/double-wrap-with-defining-use.rs b/tests/ui/impl-trait/non-defining-uses/double-wrap-with-defining-use.rs
index 734b1920772..39b327eff18 100644
--- a/tests/ui/impl-trait/non-defining-uses/double-wrap-with-defining-use.rs
+++ b/tests/ui/impl-trait/non-defining-uses/double-wrap-with-defining-use.rs
@@ -1,7 +1,6 @@
 // Regression test for ICE from issue #140545
 // The error message is confusing and wrong, but that's a different problem (#139350)
 
-//@ edition:2018
 //@ revisions: current next
 //@[next] compile-flags: -Znext-solver
 //@ ignore-compare-mode-next-solver (explicit revisions)
diff --git a/tests/ui/impl-trait/non-defining-uses/function-call-on-infer.rs b/tests/ui/impl-trait/non-defining-uses/function-call-on-infer.rs
new file mode 100644
index 00000000000..9b9156ee4c7
--- /dev/null
+++ b/tests/ui/impl-trait/non-defining-uses/function-call-on-infer.rs
@@ -0,0 +1,73 @@
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@ check-pass
+
+// Regression test for trait-system-refactor-initiative#181. Make sure calling
+// opaque types works.
+
+fn fn_trait() -> impl Fn() {
+    if false {
+        let f = fn_trait();
+        f();
+    }
+
+    || ()
+}
+
+fn fn_trait_ref() -> impl Fn() {
+    if false {
+        let f = &fn_trait();
+        f();
+    }
+    || ()
+}
+
+fn fn_mut() -> impl FnMut() -> usize {
+    if false {
+        let mut f = fn_mut();
+        f();
+    }
+
+    let mut state = 0;
+    move || {
+        state += 1;
+        state
+    }
+}
+
+fn fn_mut_ref() -> impl FnMut() -> usize {
+    if false {
+        let mut f = &mut fn_mut();
+        f();
+    }
+
+    let mut state = 0;
+    move || {
+        state += 1;
+        state
+    }
+}
+
+
+fn fn_once() -> impl FnOnce() {
+    if false {
+        let mut f = fn_once();
+        f();
+    }
+
+    let string = String::new();
+    move || drop(string)
+}
+
+fn fn_once_ref() -> impl FnOnce() {
+    if false {
+        let mut f = Box::new(fn_once_ref());
+        f();
+    }
+
+    let string = String::new();
+    move || drop(string)
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/non-defining-uses/ice-issue-146191.current.stderr b/tests/ui/impl-trait/non-defining-uses/ice-issue-146191.current.stderr
index ccbe2d3593c..5dc66f45465 100644
--- a/tests/ui/impl-trait/non-defining-uses/ice-issue-146191.current.stderr
+++ b/tests/ui/impl-trait/non-defining-uses/ice-issue-146191.current.stderr
@@ -5,7 +5,7 @@ LL | fn create_complex_future() -> impl Future<Output = impl ReturnsSend> {
    |                                                    ^^^^^^^^^^^^^^^^ the trait `ReturnsSend` is not implemented for `()`
    |
 help: this trait has no implementations, consider adding one
-  --> $DIR/ice-issue-146191.rs:14:1
+  --> $DIR/ice-issue-146191.rs:13:1
    |
 LL | trait ReturnsSend {}
    | ^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/impl-trait/non-defining-uses/ice-issue-146191.next.stderr b/tests/ui/impl-trait/non-defining-uses/ice-issue-146191.next.stderr
index e8b551c65fc..4a88359ca96 100644
--- a/tests/ui/impl-trait/non-defining-uses/ice-issue-146191.next.stderr
+++ b/tests/ui/impl-trait/non-defining-uses/ice-issue-146191.next.stderr
@@ -4,14 +4,6 @@ error[E0282]: type annotations needed
 LL |     async { create_complex_future().await }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
 
-error[E0282]: type annotations needed
-  --> $DIR/ice-issue-146191.rs:8:5
-   |
-LL |     async { create_complex_future().await }
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
-   |
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: aborting due to 2 previous errors
+error: aborting due to 1 previous error
 
 For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/impl-trait/non-defining-uses/ice-issue-146191.rs b/tests/ui/impl-trait/non-defining-uses/ice-issue-146191.rs
index 356f7d01eb9..84f139da4e3 100644
--- a/tests/ui/impl-trait/non-defining-uses/ice-issue-146191.rs
+++ b/tests/ui/impl-trait/non-defining-uses/ice-issue-146191.rs
@@ -8,7 +8,6 @@ fn create_complex_future() -> impl Future<Output = impl ReturnsSend> {
     async { create_complex_future().await }
     //[current]~^ ERROR recursion in an async block requires
     //[next]~^^ ERROR type annotations needed
-    //[next]~| ERROR type annotations needed
 }
 
 trait ReturnsSend {}
diff --git a/tests/ui/impl-trait/non-defining-uses/impl-deref-function-call.rs b/tests/ui/impl-trait/non-defining-uses/impl-deref-function-call.rs
new file mode 100644
index 00000000000..5ff0dae55cc
--- /dev/null
+++ b/tests/ui/impl-trait/non-defining-uses/impl-deref-function-call.rs
@@ -0,0 +1,56 @@
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@ check-pass
+
+// Regression test for trait-system-refactor-initiative#181. We want to
+// be able to step through `impl Deref` in its defining scope.
+use std::ops::{Deref, DerefMut};
+fn impl_deref_fn() -> impl Deref<Target = fn(fn(&str) -> usize)> {
+    if false {
+        let func = impl_deref_fn();
+        func(|s| s.len());
+    }
+
+    &((|_| ()) as fn(_))
+}
+
+fn impl_deref_impl_fn() -> impl Deref<Target = impl Fn()> {
+    if false {
+        let func = impl_deref_impl_fn();
+        func();
+    }
+
+    &|| ()
+}
+
+fn impl_deref_impl_deref_impl_fn() -> impl Deref<Target = impl Deref<Target = impl Fn()>> {
+    if false {
+        let func = impl_deref_impl_deref_impl_fn();
+        func();
+    }
+
+    &&|| ()
+}
+
+
+fn impl_deref_mut_impl_fn() -> impl DerefMut<Target = impl Fn()> {
+    if false {
+        let func = impl_deref_impl_fn();
+        func();
+    }
+
+    Box::new(|| ())
+}
+
+
+fn impl_deref_mut_impl_fn_mut() -> impl DerefMut<Target = impl FnMut()> {
+    if false {
+        let mut func = impl_deref_mut_impl_fn_mut();
+        func();
+    }
+
+    let mut state = 0;
+    Box::new(move || state += 1)
+}
+fn main() {}
diff --git a/tests/ui/impl-trait/non-defining-uses/shex_compat-regression-test.rs b/tests/ui/impl-trait/non-defining-uses/shex_compat-regression-test.rs
new file mode 100644
index 00000000000..aa1b51d6906
--- /dev/null
+++ b/tests/ui/impl-trait/non-defining-uses/shex_compat-regression-test.rs
@@ -0,0 +1,19 @@
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@ check-pass
+
+// Regression test for trait-system-refactor-initiative#181.
+
+struct ShExCompactPrinter;
+
+struct TripleExpr;
+
+impl ShExCompactPrinter {
+    fn pp_triple_expr(&self) -> impl Fn(&TripleExpr, &ShExCompactPrinter) + '_ {
+        move |te, printer| {
+            printer.pp_triple_expr()(te, printer);
+        }
+    }
+}
+fn main() {}
diff --git a/tests/ui/impl-trait/precise-capturing/external-macro.rs b/tests/ui/impl-trait/precise-capturing/external-macro.rs
index 9d4d8a1bb11..1342ecd58dc 100644
--- a/tests/ui/impl-trait/precise-capturing/external-macro.rs
+++ b/tests/ui/impl-trait/precise-capturing/external-macro.rs
@@ -6,6 +6,7 @@
 //@ aux-crate: no_use_macro=no-use-macro.rs
 //@ edition: 2024
 //@ check-pass
+//@ ignore-backends: gcc
 
 no_use_pm::pm_rpit!{}
 
diff --git a/tests/ui/impl-trait/precise-capturing/migration-note.rs b/tests/ui/impl-trait/precise-capturing/migration-note.rs
index 7587e89409a..412d8af9884 100644
--- a/tests/ui/impl-trait/precise-capturing/migration-note.rs
+++ b/tests/ui/impl-trait/precise-capturing/migration-note.rs
@@ -32,6 +32,7 @@ fn needs_static() {
     //~| NOTE borrowed value does not live long enoug
 
     fn needs_static(_: impl Sized + 'static) {}
+    //~^ NOTE requirement that the value outlives `'static` introduced here
     needs_static(a);
     //~^ NOTE argument requires that `x` is borrowed for `'static`
 }
@@ -79,6 +80,7 @@ fn needs_static_mut() {
     //~| NOTE borrowed value does not live long enough
 
     fn needs_static(_: impl Sized + 'static) {}
+    //~^ NOTE requirement that the value outlives `'static` introduced here
     needs_static(a);
     //~^ NOTE argument requires that `x` is borrowed for `'static`
 }
diff --git a/tests/ui/impl-trait/precise-capturing/migration-note.stderr b/tests/ui/impl-trait/precise-capturing/migration-note.stderr
index aa0f6400091..880e7878477 100644
--- a/tests/ui/impl-trait/precise-capturing/migration-note.stderr
+++ b/tests/ui/impl-trait/precise-capturing/migration-note.stderr
@@ -1,5 +1,5 @@
 error[E0597]: `x` does not live long enough
-  --> $DIR/migration-note.rs:182:17
+  --> $DIR/migration-note.rs:184:17
    |
 LL |     let x = vec![0];
    |         - binding `x` declared here
@@ -50,6 +50,11 @@ LL |
 LL | }
    | - `x` dropped here while still borrowed
    |
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/migration-note.rs:34:37
+   |
+LL |     fn needs_static(_: impl Sized + 'static) {}
+   |                                     ^^^^^^^
 note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
   --> $DIR/migration-note.rs:29:13
    |
@@ -61,7 +66,7 @@ LL | fn display_len<T>(x: &Vec<T>) -> impl Display + use<T> {
    |                                               ++++++++
 
 error[E0505]: cannot move out of `x` because it is borrowed
-  --> $DIR/migration-note.rs:48:8
+  --> $DIR/migration-note.rs:49:8
    |
 LL |     let x = vec![1];
    |         - binding `x` declared here
@@ -76,7 +81,7 @@ LL | }
    | - borrow might be used here, when `a` is dropped and runs the destructor for type `impl std::fmt::Display`
    |
 note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
-  --> $DIR/migration-note.rs:43:13
+  --> $DIR/migration-note.rs:44:13
    |
 LL |     let a = display_len(&x);
    |             ^^^^^^^^^^^^^^^
@@ -90,7 +95,7 @@ LL |     let a = display_len(&x.clone());
    |                           ++++++++
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time
-  --> $DIR/migration-note.rs:66:5
+  --> $DIR/migration-note.rs:67:5
    |
 LL |     let a = display_len_mut(&mut x);
    |                             ------ first mutable borrow occurs here
@@ -102,7 +107,7 @@ LL |     println!("{a}");
    |                - first borrow later used here
    |
 note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
-  --> $DIR/migration-note.rs:63:13
+  --> $DIR/migration-note.rs:64:13
    |
 LL |     let a = display_len_mut(&mut x);
    |             ^^^^^^^^^^^^^^^^^^^^^^^
@@ -112,7 +117,7 @@ LL | fn display_len_mut<T>(x: &mut Vec<T>) -> impl Display + use<T> {
    |                                                       ++++++++
 
 error[E0597]: `x` does not live long enough
-  --> $DIR/migration-note.rs:76:29
+  --> $DIR/migration-note.rs:77:29
    |
 LL |     let mut x = vec![1];
    |         ----- binding `x` declared here
@@ -126,8 +131,13 @@ LL |
 LL | }
    | - `x` dropped here while still borrowed
    |
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/migration-note.rs:82:37
+   |
+LL |     fn needs_static(_: impl Sized + 'static) {}
+   |                                     ^^^^^^^
 note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
-  --> $DIR/migration-note.rs:76:13
+  --> $DIR/migration-note.rs:77:13
    |
 LL |     let a = display_len_mut(&mut x);
    |             ^^^^^^^^^^^^^^^^^^^^^^^
@@ -137,7 +147,7 @@ LL | fn display_len_mut<T>(x: &mut Vec<T>) -> impl Display + use<T> {
    |                                                       ++++++++
 
 error[E0505]: cannot move out of `x` because it is borrowed
-  --> $DIR/migration-note.rs:95:8
+  --> $DIR/migration-note.rs:97:8
    |
 LL |     let mut x = vec![1];
    |         ----- binding `x` declared here
@@ -152,7 +162,7 @@ LL | }
    | - borrow might be used here, when `a` is dropped and runs the destructor for type `impl std::fmt::Display`
    |
 note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
-  --> $DIR/migration-note.rs:90:13
+  --> $DIR/migration-note.rs:92:13
    |
 LL |     let a = display_len_mut(&mut x);
    |             ^^^^^^^^^^^^^^^^^^^^^^^
@@ -166,7 +176,7 @@ LL |     let a = display_len_mut(&mut x.clone());
    |                                   ++++++++
 
 error[E0506]: cannot assign to `s.f` because it is borrowed
-  --> $DIR/migration-note.rs:115:5
+  --> $DIR/migration-note.rs:117:5
    |
 LL |     let a = display_field(&s.f);
    |                           ---- `s.f` is borrowed here
@@ -178,7 +188,7 @@ LL |     println!("{a}");
    |                - borrow later used here
    |
 note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
-  --> $DIR/migration-note.rs:112:13
+  --> $DIR/migration-note.rs:114:13
    |
 LL |     let a = display_field(&s.f);
    |             ^^^^^^^^^^^^^^^^^^^
@@ -188,7 +198,7 @@ LL | fn display_field<T: Copy + Display>(t: &T) -> impl Display + use<T> {
    |                                                            ++++++++
 
 error[E0506]: cannot assign to `s.f` because it is borrowed
-  --> $DIR/migration-note.rs:131:5
+  --> $DIR/migration-note.rs:133:5
    |
 LL |     let a = display_field(&mut s.f);
    |                           -------- `s.f` is borrowed here
@@ -200,7 +210,7 @@ LL |     println!("{a}");
    |                - borrow later used here
    |
 note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
-  --> $DIR/migration-note.rs:128:13
+  --> $DIR/migration-note.rs:130:13
    |
 LL |     let a = display_field(&mut s.f);
    |             ^^^^^^^^^^^^^^^^^^^^^^^
@@ -210,7 +220,7 @@ LL | fn display_field<T: Copy + Display>(t: &T) -> impl Display + use<T> {
    |                                                            ++++++++
 
 error[E0503]: cannot use `s.f` because it was mutably borrowed
-  --> $DIR/migration-note.rs:143:5
+  --> $DIR/migration-note.rs:145:5
    |
 LL |     let a = display_field(&mut s.f);
    |                           -------- `s.f` is borrowed here
@@ -222,7 +232,7 @@ LL |     println!("{a}");
    |                - borrow later used here
    |
 note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
-  --> $DIR/migration-note.rs:140:13
+  --> $DIR/migration-note.rs:142:13
    |
 LL |     let a = display_field(&mut s.f);
    |             ^^^^^^^^^^^^^^^^^^^^^^^
@@ -232,7 +242,7 @@ LL | fn display_field<T: Copy + Display>(t: &T) -> impl Display + use<T> {
    |                                                            ++++++++
 
 error[E0597]: `z.f` does not live long enough
-  --> $DIR/migration-note.rs:159:25
+  --> $DIR/migration-note.rs:161:25
    |
 LL |         let z = Z { f: vec![1] };
    |             - binding `z` declared here
@@ -248,7 +258,7 @@ LL | }
    |
    = note: values in a scope are dropped in the opposite order they are defined
 note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
-  --> $DIR/migration-note.rs:159:13
+  --> $DIR/migration-note.rs:161:13
    |
 LL |         x = display_len(&z.f);
    |             ^^^^^^^^^^^^^^^^^
@@ -258,7 +268,7 @@ LL | fn display_len<T>(x: &Vec<T>) -> impl Display + use<T> {
    |                                               ++++++++
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/migration-note.rs:170:40
+  --> $DIR/migration-note.rs:172:40
    |
 LL |     let x = { let x = display_len(&mut vec![0]); x };
    |                                        ^^^^^^^ - - borrow later used here
@@ -268,7 +278,7 @@ LL |     let x = { let x = display_len(&mut vec![0]); x };
    |
    = note: consider using a `let` binding to create a longer lived value
 note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
-  --> $DIR/migration-note.rs:170:23
+  --> $DIR/migration-note.rs:172:23
    |
 LL |     let x = { let x = display_len(&mut vec![0]); x };
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -279,7 +289,7 @@ LL | fn display_len<T>(x: &Vec<T>) -> impl Display + use<T> {
    |                                               ++++++++
 
 error[E0505]: cannot move out of `x` because it is borrowed
-  --> $DIR/migration-note.rs:198:10
+  --> $DIR/migration-note.rs:200:10
    |
 LL |     let x = String::new();
    |         - binding `x` declared here
@@ -294,12 +304,12 @@ LL | }
    | - borrow might be used here, when `y` is dropped and runs the destructor for type `impl Sized`
    |
 note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
-  --> $DIR/migration-note.rs:195:13
+  --> $DIR/migration-note.rs:197:13
    |
 LL |     let y = capture_apit(&x);
    |             ^^^^^^^^^^^^^^^^
 note: you could use a `use<...>` bound to explicitly specify captures, but argument-position `impl Trait`s are not nameable
-  --> $DIR/migration-note.rs:189:21
+  --> $DIR/migration-note.rs:191:21
    |
 LL | fn capture_apit(x: &impl Sized) -> impl Sized {}
    |                     ^^^^^^^^^^
diff --git a/tests/ui/impl-trait/recursive-bound-eval.next.stderr b/tests/ui/impl-trait/recursive-bound-eval.next.stderr
deleted file mode 100644
index 4bab290d71c..00000000000
--- a/tests/ui/impl-trait/recursive-bound-eval.next.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0282]: type annotations needed
-  --> $DIR/recursive-bound-eval.rs:20:13
-   |
-LL |     move || recursive_fn().parse()
-   |             ^^^^^^^^^^^^^^ cannot infer type
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/impl-trait/recursive-bound-eval.rs b/tests/ui/impl-trait/recursive-bound-eval.rs
index 7859c8983fc..058b12e5651 100644
--- a/tests/ui/impl-trait/recursive-bound-eval.rs
+++ b/tests/ui/impl-trait/recursive-bound-eval.rs
@@ -1,10 +1,9 @@
 //! Test that we can evaluate nested obligations when invoking methods on recursive calls on
 //! an RPIT.
 
-//@revisions: next current
+//@ revisions: next current
 //@[next] compile-flags: -Znext-solver
-
-//@[current] check-pass
+//@ check-pass
 
 pub trait Parser<E> {
     fn parse(&self) -> E;
@@ -18,7 +17,6 @@ impl<E, T: Fn() -> E> Parser<E> for T {
 
 pub fn recursive_fn<E>() -> impl Parser<E> {
     move || recursive_fn().parse()
-    //[next]~^ ERROR: type annotations needed
 }
 
 fn main() {}
diff --git a/tests/ui/impl-trait/recursive-coroutine-boxed.next.stderr b/tests/ui/impl-trait/recursive-coroutine-boxed.next.stderr
deleted file mode 100644
index 5ce6eb0fc39..00000000000
--- a/tests/ui/impl-trait/recursive-coroutine-boxed.next.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0282]: type annotations needed
-  --> $DIR/recursive-coroutine-boxed.rs:11:23
-   |
-LL |         let mut gen = Box::pin(foo());
-   |                       ^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `Box`
-LL |
-LL |         let mut r = gen.as_mut().resume(());
-   |                         ------ type must be known at this point
-   |
-help: consider specifying the generic argument
-   |
-LL |         let mut gen = Box::<T>::pin(foo());
-   |                          +++++
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/impl-trait/recursive-coroutine-boxed.rs b/tests/ui/impl-trait/recursive-coroutine-boxed.rs
index 306edc3591e..932023d103d 100644
--- a/tests/ui/impl-trait/recursive-coroutine-boxed.rs
+++ b/tests/ui/impl-trait/recursive-coroutine-boxed.rs
@@ -1,7 +1,7 @@
 //@ revisions: current next
 //@ ignore-compare-mode-next-solver (explicit revisions)
-//@[current] check-pass
 //@[next] compile-flags: -Znext-solver
+//@ check-pass
 #![feature(coroutines, coroutine_trait)]
 
 use std::ops::{Coroutine, CoroutineState};
@@ -9,7 +9,6 @@ use std::ops::{Coroutine, CoroutineState};
 fn foo() -> impl Coroutine<Yield = (), Return = ()> {
     #[coroutine] || {
         let mut gen = Box::pin(foo());
-        //[next]~^ ERROR type annotations needed
         let mut r = gen.as_mut().resume(());
         while let CoroutineState::Yielded(v) = r {
             yield v;
diff --git a/tests/ui/impl-trait/two_tait_defining_each_other2.next.stderr b/tests/ui/impl-trait/two_tait_defining_each_other2.next.stderr
index 785e5fdeb64..9b18a9715f2 100644
--- a/tests/ui/impl-trait/two_tait_defining_each_other2.next.stderr
+++ b/tests/ui/impl-trait/two_tait_defining_each_other2.next.stderr
@@ -4,12 +4,6 @@ error[E0282]: type annotations needed
 LL | fn muh(x: A) -> B {
    |        ^ cannot infer type
 
-error[E0282]: type annotations needed
-  --> $DIR/two_tait_defining_each_other2.rs:14:5
-   |
-LL |     x // B's hidden type is A (opaquely)
-   |     ^ cannot infer type
-
-error: aborting due to 2 previous errors
+error: aborting due to 1 previous error
 
 For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/impl-trait/two_tait_defining_each_other2.rs b/tests/ui/impl-trait/two_tait_defining_each_other2.rs
index 99262f4bc4b..ec2963249f9 100644
--- a/tests/ui/impl-trait/two_tait_defining_each_other2.rs
+++ b/tests/ui/impl-trait/two_tait_defining_each_other2.rs
@@ -12,8 +12,7 @@ trait Foo {}
 fn muh(x: A) -> B {
     //[next]~^ ERROR: type annotations needed
     x // B's hidden type is A (opaquely)
-    //[next]~^ ERROR: type annotations needed
-    //[current]~^^ ERROR opaque type's hidden type cannot be another opaque type
+    //[current]~^ ERROR opaque type's hidden type cannot be another opaque type
 }
 
 struct Bar;
diff --git a/tests/ui/impl-trait/where-allowed.stderr b/tests/ui/impl-trait/where-allowed.stderr
index 08caff326c4..4d8f23bf7ca 100644
--- a/tests/ui/impl-trait/where-allowed.stderr
+++ b/tests/ui/impl-trait/where-allowed.stderr
@@ -387,6 +387,8 @@ LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { pani
              where A: Tuple, F: Fn<A>, F: ?Sized;
            - impl<Args, F, A> Fn<Args> for Box<F, A>
              where Args: Tuple, F: Fn<Args>, A: Allocator, F: ?Sized;
+           - impl<F, Args> Fn<Args> for Exclusive<F>
+             where F: Sync, F: Fn<Args>, Args: Tuple;
 
 error[E0118]: no nominal type found for inherent implementation
   --> $DIR/where-allowed.rs:240:1
diff --git a/tests/ui/implied-bounds/bevy_world_query.rs b/tests/ui/implied-bounds/bevy_world_query.rs
index 6548c03d1b0..e2750bcf957 100644
--- a/tests/ui/implied-bounds/bevy_world_query.rs
+++ b/tests/ui/implied-bounds/bevy_world_query.rs
@@ -1,6 +1,8 @@
-#![crate_name = "bevy_ecs"]
-
 //@ check-pass
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
+#![crate_name = "bevy_ecs"]
 
 // We currently special case bevy from erroring on incorrect implied bounds
 // from normalization (issue #109628).
diff --git a/tests/ui/imports/auxiliary/reexported-trait-56175.rs b/tests/ui/imports/auxiliary/reexported-trait-56175.rs
new file mode 100644
index 00000000000..51a991bef59
--- /dev/null
+++ b/tests/ui/imports/auxiliary/reexported-trait-56175.rs
@@ -0,0 +1,17 @@
+mod private {
+    pub trait Trait {
+        fn trait_method(&self) {
+        }
+    }
+    pub trait TraitB {
+        fn trait_method_b(&self) {
+        }
+    }
+}
+
+pub struct FooStruct;
+pub use crate::private::Trait;
+impl crate::private::Trait for FooStruct {}
+
+pub use crate::private::TraitB as TraitBRename;
+impl crate::private::TraitB for FooStruct {}
diff --git a/tests/ui/imports/auxiliary/same-res-ambigious-extern-fail.rs b/tests/ui/imports/auxiliary/same-res-ambigious-extern-fail.rs
new file mode 100644
index 00000000000..61a8d8f0054
--- /dev/null
+++ b/tests/ui/imports/auxiliary/same-res-ambigious-extern-fail.rs
@@ -0,0 +1,16 @@
+//@ edition:2018
+//@ proc-macro: same-res-ambigious-extern-macro.rs
+
+macro_rules! globbing{
+    () => {
+        pub use same_res_ambigious_extern_macro::*;
+    }
+}
+
+#[macro_use] // this imports the `RustEmbed` macro with `pub(crate)` visibility
+extern crate same_res_ambigious_extern_macro;
+globbing! {} // this imports the same `RustEmbed` macro with `pub` visibility
+
+pub trait RustEmbed {}
+
+pub use RustEmbed as Embed;
diff --git a/tests/ui/imports/auxiliary/same-res-ambigious-extern-macro.rs b/tests/ui/imports/auxiliary/same-res-ambigious-extern-macro.rs
new file mode 100644
index 00000000000..4e9b8427092
--- /dev/null
+++ b/tests/ui/imports/auxiliary/same-res-ambigious-extern-macro.rs
@@ -0,0 +1,8 @@
+//@ edition: 2018
+extern crate proc_macro;
+use proc_macro::TokenStream;
+
+#[proc_macro_derive(RustEmbed)]
+pub fn rust_embed_derive(_input: TokenStream) -> TokenStream {
+    TokenStream::new()
+}
diff --git a/tests/ui/imports/auxiliary/same-res-ambigious-extern.rs b/tests/ui/imports/auxiliary/same-res-ambigious-extern.rs
new file mode 100644
index 00000000000..5269dcd0b17
--- /dev/null
+++ b/tests/ui/imports/auxiliary/same-res-ambigious-extern.rs
@@ -0,0 +1,11 @@
+//@ edition:2018
+//@ proc-macro: same-res-ambigious-extern-macro.rs
+
+#[macro_use] // this imports the `RustEmbed` macro with `pub(crate)` visibility
+extern crate same_res_ambigious_extern_macro;
+// this imports the same `RustEmbed` macro with `pub` visibility
+pub use same_res_ambigious_extern_macro::*;
+
+pub trait RustEmbed {}
+
+pub use RustEmbed as Embed;
diff --git a/tests/ui/issues/issue-56175.rs b/tests/ui/imports/private-types-suggested-without-extern-crate-56175.rs
index daffe806a90..ce001edad1b 100644
--- a/tests/ui/issues/issue-56175.rs
+++ b/tests/ui/imports/private-types-suggested-without-extern-crate-56175.rs
@@ -1,5 +1,6 @@
+// https://github.com/rust-lang/rust/issues/56175
 //@ edition:2018
-//@ aux-crate:reexported_trait=reexported-trait.rs
+//@ aux-crate:reexported_trait=reexported-trait-56175.rs
 
 fn main() {
     reexported_trait::FooStruct.trait_method();
diff --git a/tests/ui/issues/issue-56175.stderr b/tests/ui/imports/private-types-suggested-without-extern-crate-56175.stderr
index df4cd6ce8a7..1e8285c80ac 100644
--- a/tests/ui/issues/issue-56175.stderr
+++ b/tests/ui/imports/private-types-suggested-without-extern-crate-56175.stderr
@@ -1,10 +1,10 @@
 error[E0599]: no method named `trait_method` found for struct `FooStruct` in the current scope
-  --> $DIR/issue-56175.rs:5:33
+  --> $DIR/private-types-suggested-without-extern-crate-56175.rs:6:33
    |
 LL |     reexported_trait::FooStruct.trait_method();
    |                                 ^^^^^^^^^^^^
    |
-  ::: $DIR/auxiliary/reexported-trait.rs:3:12
+  ::: $DIR/auxiliary/reexported-trait-56175.rs:3:12
    |
 LL |         fn trait_method(&self) {
    |            ------------ the method is available for `FooStruct` here
@@ -12,7 +12,7 @@ LL |         fn trait_method(&self) {
    = help: items from traits can only be used if the trait is in scope
 help: trait `Trait` which provides `trait_method` is implemented but not in scope; perhaps you want to import it
    |
-LL + use reexported_trait::Trait;
+LL + use reexported_trait_56175::Trait;
    |
 help: there is a method `trait_method_b` with a similar name
    |
@@ -20,12 +20,12 @@ LL |     reexported_trait::FooStruct.trait_method_b();
    |                                             ++
 
 error[E0599]: no method named `trait_method_b` found for struct `FooStruct` in the current scope
-  --> $DIR/issue-56175.rs:7:33
+  --> $DIR/private-types-suggested-without-extern-crate-56175.rs:8:33
    |
 LL |     reexported_trait::FooStruct.trait_method_b();
    |                                 ^^^^^^^^^^^^^^
    |
-  ::: $DIR/auxiliary/reexported-trait.rs:7:12
+  ::: $DIR/auxiliary/reexported-trait-56175.rs:7:12
    |
 LL |         fn trait_method_b(&self) {
    |            -------------- the method is available for `FooStruct` here
@@ -33,7 +33,7 @@ LL |         fn trait_method_b(&self) {
    = help: items from traits can only be used if the trait is in scope
 help: trait `TraitB` which provides `trait_method_b` is implemented but not in scope; perhaps you want to import it
    |
-LL + use reexported_trait::TraitBRename;
+LL + use reexported_trait_56175::TraitBRename;
    |
 help: there is a method `trait_method` with a similar name
    |
diff --git a/tests/ui/imports/same-res-ambigious.fail.stderr b/tests/ui/imports/same-res-ambigious.fail.stderr
new file mode 100644
index 00000000000..dfd7c5a5f94
--- /dev/null
+++ b/tests/ui/imports/same-res-ambigious.fail.stderr
@@ -0,0 +1,20 @@
+error[E0603]: derive macro `Embed` is private
+  --> $DIR/same-res-ambigious.rs:8:28
+   |
+LL | #[derive(ambigious_extern::Embed)]
+   |                            ^^^^^ private derive macro
+   |
+note: the derive macro `Embed` is defined here
+  --> $DIR/auxiliary/same-res-ambigious-extern-fail.rs:16:9
+   |
+LL | pub use RustEmbed as Embed;
+   |         ^^^^^^^^^
+help: import `Embed` directly
+   |
+LL - #[derive(ambigious_extern::Embed)]
+LL + #[derive(same_res_ambigious_extern_macro::RustEmbed)]
+   |
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0603`.
diff --git a/tests/ui/imports/same-res-ambigious.nightly-fail.stderr b/tests/ui/imports/same-res-ambigious.nightly-fail.stderr
new file mode 100644
index 00000000000..dfd7c5a5f94
--- /dev/null
+++ b/tests/ui/imports/same-res-ambigious.nightly-fail.stderr
@@ -0,0 +1,20 @@
+error[E0603]: derive macro `Embed` is private
+  --> $DIR/same-res-ambigious.rs:8:28
+   |
+LL | #[derive(ambigious_extern::Embed)]
+   |                            ^^^^^ private derive macro
+   |
+note: the derive macro `Embed` is defined here
+  --> $DIR/auxiliary/same-res-ambigious-extern-fail.rs:16:9
+   |
+LL | pub use RustEmbed as Embed;
+   |         ^^^^^^^^^
+help: import `Embed` directly
+   |
+LL - #[derive(ambigious_extern::Embed)]
+LL + #[derive(same_res_ambigious_extern_macro::RustEmbed)]
+   |
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0603`.
diff --git a/tests/ui/imports/same-res-ambigious.rs b/tests/ui/imports/same-res-ambigious.rs
new file mode 100644
index 00000000000..b5c13a15b7c
--- /dev/null
+++ b/tests/ui/imports/same-res-ambigious.rs
@@ -0,0 +1,11 @@
+//@ edition: 2018
+//@ revisions: fail pass
+//@[pass] check-pass
+//@[pass] aux-crate: ambigious_extern=same-res-ambigious-extern.rs
+//@[fail] aux-crate: ambigious_extern=same-res-ambigious-extern-fail.rs
+// see https://github.com/rust-lang/rust/pull/147196
+
+#[derive(ambigious_extern::Embed)] //[fail]~ ERROR: derive macro `Embed` is private
+struct Foo{}
+
+fn main(){}
diff --git a/tests/ui/indexing/ambiguity-after-deref-step.rs b/tests/ui/indexing/ambiguity-after-deref-step.rs
new file mode 100644
index 00000000000..2dd95eed097
--- /dev/null
+++ b/tests/ui/indexing/ambiguity-after-deref-step.rs
@@ -0,0 +1,9 @@
+// Regression test making sure that indexing fails with an ambiguity
+// error if one of the deref-steps encounters an inference variable.
+
+fn main() {
+    let x = &Default::default();
+    //~^ ERROR type annotations needed for `&_`
+    x[1];
+    let _: &Vec<()> = x;
+}
diff --git a/tests/ui/indexing/ambiguity-after-deref-step.stderr b/tests/ui/indexing/ambiguity-after-deref-step.stderr
new file mode 100644
index 00000000000..c7ddd4731c7
--- /dev/null
+++ b/tests/ui/indexing/ambiguity-after-deref-step.stderr
@@ -0,0 +1,17 @@
+error[E0282]: type annotations needed for `&_`
+  --> $DIR/ambiguity-after-deref-step.rs:5:9
+   |
+LL |     let x = &Default::default();
+   |         ^
+LL |
+LL |     x[1];
+   |     - type must be known at this point
+   |
+help: consider giving `x` an explicit type, where the placeholders `_` are specified
+   |
+LL |     let x: &_ = &Default::default();
+   |          ++++
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/indexing/index_message.stderr b/tests/ui/indexing/index_message.stderr
index 6affb1ed962..b6f61379f2a 100644
--- a/tests/ui/indexing/index_message.stderr
+++ b/tests/ui/indexing/index_message.stderr
@@ -2,7 +2,9 @@ error[E0608]: cannot index into a value of type `({integer},)`
   --> $DIR/index_message.rs:3:14
    |
 LL |     let _ = z[0];
-   |              ^^^ help: to access tuple elements, use: `.0`
+   |              ^^^ help: to access tuple element `0`, use: `.0`
+   |
+   = help: tuples are indexed with a dot and a literal index: `tuple.0`, `tuple.1`, etc.
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/inference/issue-72616.rs b/tests/ui/inference/issue-72616.rs
index 71e095cc6fc..ba18575a571 100644
--- a/tests/ui/inference/issue-72616.rs
+++ b/tests/ui/inference/issue-72616.rs
@@ -21,7 +21,6 @@ pub fn main() {
     {
         if String::from("a") == "a".try_into().unwrap() {}
         //~^ ERROR type annotations needed
-        //~| ERROR type annotations needed
     }
     {
         let _: String = match "_".try_into() {
diff --git a/tests/ui/inference/issue-72616.stderr b/tests/ui/inference/issue-72616.stderr
index a271639996f..6b47d568811 100644
--- a/tests/ui/inference/issue-72616.stderr
+++ b/tests/ui/inference/issue-72616.stderr
@@ -16,23 +16,6 @@ LL -         if String::from("a") == "a".try_into().unwrap() {}
 LL +         if String::from("a") == <&str as TryInto<T>>::try_into("a").unwrap() {}
    |
 
-error[E0283]: type annotations needed
-  --> $DIR/issue-72616.rs:22:37
-   |
-LL |         if String::from("a") == "a".try_into().unwrap() {}
-   |                                     ^^^^^^^^
-   |
-   = note: multiple `impl`s satisfying `_: TryFrom<&str>` found in the following crates: `core`, `std`:
-           - impl TryFrom<&str> for std::sys::net::connection::socket::LookupHost;
-           - impl<T, U> TryFrom<U> for T
-             where U: Into<T>;
-   = note: required for `&str` to implement `TryInto<_>`
-help: try using a fully qualified path to specify the expected types
-   |
-LL -         if String::from("a") == "a".try_into().unwrap() {}
-LL +         if String::from("a") == <&str as TryInto<T>>::try_into("a").unwrap() {}
-   |
-
-error: aborting due to 2 previous errors
+error: aborting due to 1 previous error
 
 For more information about this error, try `rustc --explain E0283`.
diff --git a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.stderr b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.stderr
index 10056bdf3d4..ba1c81c4518 100644
--- a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.stderr
+++ b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.stderr
@@ -2,7 +2,7 @@ error[E0282]: type annotations needed
   --> $DIR/incompat-call-after-qualified-path-0.rs:21:6
    |
 LL |   f(|a, b| a.cmp(b));
-   |      ^     - type must be known at this point
+   |      ^       --- type must be known at this point
    |
 help: consider giving this closure parameter an explicit type
    |
diff --git a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.stderr b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.stderr
index 632a9b99f84..93bba3625b5 100644
--- a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.stderr
+++ b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.stderr
@@ -2,7 +2,7 @@ error[E0282]: type annotations needed
   --> $DIR/incompat-call-after-qualified-path-1.rs:25:6
    |
 LL |   f(|a, b| a.cmp(b));
-   |      ^     - type must be known at this point
+   |      ^       --- type must be known at this point
    |
 help: consider giving this closure parameter an explicit type
    |
diff --git a/tests/ui/inference/return-block-type-inference-15965.stderr b/tests/ui/inference/return-block-type-inference-15965.stderr
index fc4f2defe7f..bfee9041922 100644
--- a/tests/ui/inference/return-block-type-inference-15965.stderr
+++ b/tests/ui/inference/return-block-type-inference-15965.stderr
@@ -1,10 +1,8 @@
 error[E0282]: type annotations needed
   --> $DIR/return-block-type-inference-15965.rs:5:9
    |
-LL | /         { return () }
-LL | |
-LL | |     ()
-   | |______^ cannot infer type
+LL |         { return () }
+   |         ^^^^^^^^^^^^^ cannot infer type
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/issues/auxiliary/issue-57271-lib.rs b/tests/ui/infinite/auxiliary/aux-57271-lib.rs
index ff625668a9d..ff625668a9d 100644
--- a/tests/ui/issues/auxiliary/issue-57271-lib.rs
+++ b/tests/ui/infinite/auxiliary/aux-57271-lib.rs
diff --git a/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.rs b/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.rs
index f7117368ece..b8ea353df93 100644
--- a/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.rs
+++ b/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.rs
@@ -1,4 +1,17 @@
-//~ ERROR reached the recursion limit while instantiating `<VirtualWrapper<
+//~ ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
+//~| ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
+//~| ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
+//~| ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
+//~| ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
+//~| ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
+//~| ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
+//~| ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
+//~| ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
+//~| ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
+//~| ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
+//~| ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
+//~| ERROR reached the recursion limit while instantiating `<VirtualWrapper<..., 1> as MyTrait>::virtualize`
+
 //@ build-fail
 //@ compile-flags: --diagnostic-width=100 -Zwrite-long-types-to-disk=yes
 
@@ -72,16 +85,3 @@ fn main() {
     let test = SomeData([0; 256]);
     test.virtualize();
 }
-
-//~? ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
-//~? ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
-//~? ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
-//~? ERROR reached the recursion limit finding the struct tail for `[u8; 256]`
-//~? ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
-//~? ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
-//~? ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
-//~? ERROR reached the recursion limit finding the struct tail for `SomeData<256>`
-//~? ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
-//~? ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
-//~? ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
-//~? ERROR reached the recursion limit finding the struct tail for `VirtualWrapper<SomeData<256>, 0>`
diff --git a/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.stderr b/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.stderr
index faf9cbe2318..deccc88e64f 100644
--- a/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.stderr
+++ b/tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.stderr
@@ -18,7 +18,7 @@ error: reached the recursion limit finding the struct tail for `[u8; 256]`
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: the above error was encountered while instantiating `fn virtualize_my_trait::<VirtualWrapper<..., 1>>`
-  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:25:18
+  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:38:18
    |
 LL |         unsafe { virtualize_my_trait(L, self) }
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -46,7 +46,7 @@ error: reached the recursion limit finding the struct tail for `SomeData<256>`
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: the above error was encountered while instantiating `fn virtualize_my_trait::<VirtualWrapper<..., 1>>`
-  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:25:18
+  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:38:18
    |
 LL |         unsafe { virtualize_my_trait(L, self) }
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -74,7 +74,7 @@ error: reached the recursion limit finding the struct tail for `VirtualWrapper<S
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: the above error was encountered while instantiating `fn virtualize_my_trait::<VirtualWrapper<..., 1>>`
-  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:25:18
+  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:38:18
    |
 LL |         unsafe { virtualize_my_trait(L, self) }
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -85,7 +85,7 @@ LL |         unsafe { virtualize_my_trait(L, self) }
 error: reached the recursion limit while instantiating `<VirtualWrapper<..., 1> as MyTrait>::virtualize`
    |
 note: `<VirtualWrapper<T, L> as MyTrait>::virtualize` defined here
-  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:24:5
+  --> $DIR/infinite-instantiation-struct-tail-ice-114484.rs:37:5
    |
 LL |     fn virtualize(&self) -> &dyn MyTrait {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/infinite/infinite-struct.rs b/tests/ui/infinite/infinite-struct.rs
index fd47a4ec9cc..d7844558246 100644
--- a/tests/ui/infinite/infinite-struct.rs
+++ b/tests/ui/infinite/infinite-struct.rs
@@ -1,6 +1,7 @@
 struct Take(Take);
 //~^ ERROR has infinite size
 //~| ERROR cycle
+//~| ERROR reached the recursion limit finding the struct tail for `Take`
 
 // check that we don't hang trying to find the tail of a recursive struct (#79437)
 fn foo() -> Take {
@@ -15,5 +16,3 @@ struct Foo { //~ ERROR has infinite size
 struct Bar<T>([T; 1]);
 
 fn main() {}
-
-//~? ERROR reached the recursion limit finding the struct tail for `Take`
diff --git a/tests/ui/infinite/infinite-struct.stderr b/tests/ui/infinite/infinite-struct.stderr
index 5896aec399d..0d1ec4989aa 100644
--- a/tests/ui/infinite/infinite-struct.stderr
+++ b/tests/ui/infinite/infinite-struct.stderr
@@ -10,7 +10,7 @@ LL | struct Take(Box<Take>);
    |             ++++    +
 
 error[E0072]: recursive type `Foo` has infinite size
-  --> $DIR/infinite-struct.rs:11:1
+  --> $DIR/infinite-struct.rs:12:1
    |
 LL | struct Foo {
    | ^^^^^^^^^^
@@ -23,6 +23,10 @@ LL |     x: Bar<Box<Foo>>,
    |            ++++   +
 
 error: reached the recursion limit finding the struct tail for `Take`
+  --> $DIR/infinite-struct.rs:1:1
+   |
+LL | struct Take(Take);
+   | ^^^^^^^^^^^
    |
    = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]`
 
diff --git a/tests/ui/issues/issue-57271.rs b/tests/ui/infinite/mutually-recursive-infinite-types-57271.rs
index 20d081ecb3c..cb20770b486 100644
--- a/tests/ui/issues/issue-57271.rs
+++ b/tests/ui/infinite/mutually-recursive-infinite-types-57271.rs
@@ -1,8 +1,9 @@
-//@ aux-build:issue-57271-lib.rs
+// https://github.com/rust-lang/rust/issues/57271
+//@ aux-build:aux-57271-lib.rs
 
-extern crate issue_57271_lib;
+extern crate aux_57271_lib;
 
-use issue_57271_lib::BaseType;
+use aux_57271_lib::BaseType;
 
 pub enum ObjectType { //~ ERROR recursive types `ObjectType` and `TypeSignature` have infinite size
     Class(ClassTypeSignature),
diff --git a/tests/ui/issues/issue-57271.stderr b/tests/ui/infinite/mutually-recursive-infinite-types-57271.stderr
index a61419c61d7..8bf1b470062 100644
--- a/tests/ui/issues/issue-57271.stderr
+++ b/tests/ui/infinite/mutually-recursive-infinite-types-57271.stderr
@@ -1,5 +1,5 @@
 error[E0072]: recursive types `ObjectType` and `TypeSignature` have infinite size
-  --> $DIR/issue-57271.rs:7:1
+  --> $DIR/mutually-recursive-infinite-types-57271.rs:8:1
    |
 LL | pub enum ObjectType {
    | ^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/intrinsics/intrinsic-fmuladd.rs b/tests/ui/intrinsics/intrinsic-fmuladd.rs
index d03297884f7..ab4285590cb 100644
--- a/tests/ui/intrinsics/intrinsic-fmuladd.rs
+++ b/tests/ui/intrinsics/intrinsic-fmuladd.rs
@@ -11,7 +11,7 @@ macro_rules! assert_approx_eq {
 }
 
 fn main() {
-    unsafe {
+    {
         let nan: f32 = f32::NAN;
         let inf: f32 = f32::INFINITY;
         let neg_inf: f32 = f32::NEG_INFINITY;
@@ -25,7 +25,7 @@ fn main() {
         assert_eq!(fmuladdf32(8.9, inf, 3.2), inf);
         assert_eq!(fmuladdf32(-3.2, 2.4, neg_inf), neg_inf);
     }
-    unsafe {
+    {
         let nan: f64 = f64::NAN;
         let inf: f64 = f64::INFINITY;
         let neg_inf: f64 = f64::NEG_INFINITY;
diff --git a/tests/ui/intrinsics/reify-intrinsic.stderr b/tests/ui/intrinsics/reify-intrinsic.stderr
index aea6f838e0d..1307a85c8b6 100644
--- a/tests/ui/intrinsics/reify-intrinsic.stderr
+++ b/tests/ui/intrinsics/reify-intrinsic.stderr
@@ -22,7 +22,7 @@ LL |         std::intrinsics::floorf32,
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers
    |
    = note: expected fn pointer `unsafe fn(_) -> _`
-                 found fn item `unsafe fn(_) -> _ {floorf32}`
+                 found fn item `fn(_) -> _ {floorf32}`
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADFLAGS.stderr b/tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADFLAGS.stderr
index dae08119dbc..277111a41f2 100644
--- a/tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADFLAGS.stderr
+++ b/tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADFLAGS.stderr
@@ -1,2 +1,2 @@
-error: incorrect value `leaf` for unstable option `branch-protection` - a `,` separated combination of `bti`, `pac-ret`, followed by a combination of `pc`, `b-key`, or `leaf` was expected
+error: incorrect value `leaf` for unstable option `branch-protection` - a `,` separated combination of `bti`, `gcs`, `pac-ret`, (optionally with `pc`, `b-key`, `leaf` if `pac-ret` is set) was expected
 
diff --git a/tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADFLAGSPC.stderr b/tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADFLAGSPC.stderr
index 13f79e94674..e1ade01d2fe 100644
--- a/tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADFLAGSPC.stderr
+++ b/tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADFLAGSPC.stderr
@@ -1,2 +1,2 @@
-error: incorrect value `pc` for unstable option `branch-protection` - a `,` separated combination of `bti`, `pac-ret`, followed by a combination of `pc`, `b-key`, or `leaf` was expected
+error: incorrect value `pc` for unstable option `branch-protection` - a `,` separated combination of `bti`, `gcs`, `pac-ret`, (optionally with `pc`, `b-key`, `leaf` if `pac-ret` is set) was expected
 
diff --git a/tests/ui/invalid-compile-flags/invalid-llvm-passes.rs b/tests/ui/invalid-compile-flags/invalid-llvm-passes.rs
index 832821c9c88..2ed0014f8b0 100644
--- a/tests/ui/invalid-compile-flags/invalid-llvm-passes.rs
+++ b/tests/ui/invalid-compile-flags/invalid-llvm-passes.rs
@@ -1,5 +1,6 @@
 //@ build-fail
 //@ compile-flags: -Cpasses=unknown-pass
+//@ ignore-backends: gcc
 
 fn main() {}
 
diff --git a/tests/ui/invalid-compile-flags/print-without-arg.stderr b/tests/ui/invalid-compile-flags/print-without-arg.stderr
index 3048a59d0d0..4163d4e0602 100644
--- a/tests/ui/invalid-compile-flags/print-without-arg.stderr
+++ b/tests/ui/invalid-compile-flags/print-without-arg.stderr
@@ -3,5 +3,5 @@ error: Argument to option 'print' missing
            --print <INFO>[=<FILE>]
                                Compiler information to print on stdout (or to a file)
                                INFO may be one of
-                               <all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|tls-models>.
+                               <all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|target-spec-json-schema|tls-models>.
 
diff --git a/tests/ui/invalid-compile-flags/print.stderr b/tests/ui/invalid-compile-flags/print.stderr
index e3374eb1e6e..e8adbfd87d7 100644
--- a/tests/ui/invalid-compile-flags/print.stderr
+++ b/tests/ui/invalid-compile-flags/print.stderr
@@ -1,5 +1,5 @@
 error: unknown print request: `yyyy`
   |
-  = help: valid print requests are: `all-target-specs-json`, `calling-conventions`, `cfg`, `check-cfg`, `code-models`, `crate-name`, `crate-root-lint-levels`, `deployment-target`, `file-names`, `host-tuple`, `link-args`, `native-static-libs`, `relocation-models`, `split-debuginfo`, `stack-protector-strategies`, `supported-crate-types`, `sysroot`, `target-cpus`, `target-features`, `target-libdir`, `target-list`, `target-spec-json`, `tls-models`
+  = help: valid print requests are: `all-target-specs-json`, `calling-conventions`, `cfg`, `check-cfg`, `code-models`, `crate-name`, `crate-root-lint-levels`, `deployment-target`, `file-names`, `host-tuple`, `link-args`, `native-static-libs`, `relocation-models`, `split-debuginfo`, `stack-protector-strategies`, `supported-crate-types`, `sysroot`, `target-cpus`, `target-features`, `target-libdir`, `target-list`, `target-spec-json`, `target-spec-json-schema`, `tls-models`
   = help: for more information, see the rustc book: https://doc.rust-lang.org/rustc/command-line-arguments.html#--print-print-compiler-information
 
diff --git a/tests/ui/invalid/invalid-debugger-visualizer-option.rs b/tests/ui/invalid/invalid-debugger-visualizer-option.rs
index 0f1cf15a687..166962866dc 100644
--- a/tests/ui/invalid/invalid-debugger-visualizer-option.rs
+++ b/tests/ui/invalid/invalid-debugger-visualizer-option.rs
@@ -1,6 +1,6 @@
 //@ normalize-stderr: "foo.random:.*\(" -> "foo.random: $$FILE_NOT_FOUND_MSG ("
 //@ normalize-stderr: "os error \d+" -> "os error $$FILE_NOT_FOUND_CODE"
 
-#![debugger_visualizer(random_file = "../foo.random")] //~ ERROR invalid argument
+#![debugger_visualizer(random_file = "../foo.random")] //~ ERROR malformed `debugger_visualizer` attribute input
 #![debugger_visualizer(natvis_file = "../foo.random")] //~ ERROR
 fn main() {}
diff --git a/tests/ui/invalid/invalid-debugger-visualizer-option.stderr b/tests/ui/invalid/invalid-debugger-visualizer-option.stderr
index 6fbb4d641e6..e877e39d8f1 100644
--- a/tests/ui/invalid/invalid-debugger-visualizer-option.stderr
+++ b/tests/ui/invalid/invalid-debugger-visualizer-option.stderr
@@ -1,18 +1,20 @@
-error: invalid argument
-  --> $DIR/invalid-debugger-visualizer-option.rs:4:24
-   |
-LL | #![debugger_visualizer(random_file = "../foo.random")]
-   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: expected: `natvis_file = "..."`
-   = note: OR
-   = note: expected: `gdb_script_file = "..."`
-
 error: couldn't read $DIR/../foo.random: $FILE_NOT_FOUND_MSG (os error $FILE_NOT_FOUND_CODE)
   --> $DIR/invalid-debugger-visualizer-option.rs:5:24
    |
 LL | #![debugger_visualizer(natvis_file = "../foo.random")]
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+error[E0539]: malformed `debugger_visualizer` attribute input
+  --> $DIR/invalid-debugger-visualizer-option.rs:4:1
+   |
+LL | #![debugger_visualizer(random_file = "../foo.random")]
+   | ^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^^^^^^^^^^^^^^^^^
+   | |                      |
+   | |                      valid arguments are `natvis_file` or `gdb_script_file`
+   | help: must be of the form: `#![debugger_visualizer(natvis_file = "...", gdb_script_file = "...")]`
+   |
+   = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/debugger.html#the-debugger_visualizer-attribute>
+
 error: aborting due to 2 previous errors
 
+For more information about this error, try `rustc --explain E0539`.
diff --git a/tests/ui/invalid/invalid-debugger-visualizer-target.rs b/tests/ui/invalid/invalid-debugger-visualizer-target.rs
index 1efb9555c24..48b04153214 100644
--- a/tests/ui/invalid/invalid-debugger-visualizer-target.rs
+++ b/tests/ui/invalid/invalid-debugger-visualizer-target.rs
@@ -1,2 +1,3 @@
-#[debugger_visualizer(natvis_file = "./foo.natvis.xml")] //~ ERROR attribute should be applied to a module
+#[debugger_visualizer(natvis_file = "./foo.natvis.xml")]
+//~^ ERROR `#[debugger_visualizer]` attribute cannot be used on functions
 fn main() {}
diff --git a/tests/ui/invalid/invalid-debugger-visualizer-target.stderr b/tests/ui/invalid/invalid-debugger-visualizer-target.stderr
index 1df34532533..629af94c5ef 100644
--- a/tests/ui/invalid/invalid-debugger-visualizer-target.stderr
+++ b/tests/ui/invalid/invalid-debugger-visualizer-target.stderr
@@ -1,8 +1,10 @@
-error: attribute should be applied to a module
+error: `#[debugger_visualizer]` attribute cannot be used on functions
   --> $DIR/invalid-debugger-visualizer-target.rs:1:1
    |
 LL | #[debugger_visualizer(natvis_file = "./foo.natvis.xml")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: `#[debugger_visualizer]` can be applied to modules and crates
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/invalid/issue-114435-layout-type-err.rs b/tests/ui/invalid/issue-114435-layout-type-err.rs
index 07f310478d3..ae04759af5d 100644
--- a/tests/ui/invalid/issue-114435-layout-type-err.rs
+++ b/tests/ui/invalid/issue-114435-layout-type-err.rs
@@ -1,3 +1,4 @@
+//~ ERROR reached the recursion limit finding the struct tail for `Bottom`
 //@ check-fail
 //@ compile-flags: --crate-type lib -Cdebuginfo=2
 
@@ -40,5 +41,3 @@ link!(J, K);
 link!(K, Bottom);
 
 fn main() {}
-
-//~? ERROR reached the recursion limit finding the struct tail for `Bottom`
diff --git a/tests/ui/issues/issue-18088.rs b/tests/ui/issues/issue-18088.rs
deleted file mode 100644
index ba198884c63..00000000000
--- a/tests/ui/issues/issue-18088.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-//@ check-pass
-
-pub trait Indexable<T>: std::ops::Index<usize, Output = T> {
-    fn index2(&self, i: usize) -> &T {
-        &self[i]
-    }
-}
-fn main() {}
diff --git a/tests/ui/issues/issue-2151.stderr b/tests/ui/issues/issue-2151.stderr
index b130f162414..59fef42eb5e 100644
--- a/tests/ui/issues/issue-2151.stderr
+++ b/tests/ui/issues/issue-2151.stderr
@@ -4,7 +4,7 @@ error[E0282]: type annotations needed
 LL |     let x = panic!();
    |         ^
 LL |     x.clone();
-   |     - type must be known at this point
+   |       ----- type must be known at this point
    |
 help: consider giving `x` an explicit type
    |
diff --git a/tests/ui/issues/issue-21950.rs b/tests/ui/issues/issue-21950.rs
deleted file mode 100644
index 7a85ac91bca..00000000000
--- a/tests/ui/issues/issue-21950.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-trait Add<Rhs=Self> {
-    type Output;
-}
-
-impl Add for i32 {
-    type Output = i32;
-}
-
-fn main() {
-    let x = &10 as &dyn Add;
-    //~^ ERROR E0191
-}
diff --git a/tests/ui/issues/issue-2284.rs b/tests/ui/issues/issue-2284.rs
deleted file mode 100644
index 358331ecd9a..00000000000
--- a/tests/ui/issues/issue-2284.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-//@ run-pass
-#![allow(dead_code)]
-
-trait Send {
-    fn f(&self);
-}
-
-fn f<T:Send>(t: T) {
-    t.f();
-}
-
-pub fn main() {
-}
diff --git a/tests/ui/issues/issue-25089.rs b/tests/ui/issues/issue-25089.rs
index 929738c3e79..63fdf64cea9 100644
--- a/tests/ui/issues/issue-25089.rs
+++ b/tests/ui/issues/issue-25089.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 
 use std::thread;
 
diff --git a/tests/ui/issues/issue-26655.rs b/tests/ui/issues/issue-26655.rs
index 416472b0b26..32c4b33a8c9 100644
--- a/tests/ui/issues/issue-26655.rs
+++ b/tests/ui/issues/issue-26655.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 
 // Check that the destructors of simple enums are run on unwinding
 
diff --git a/tests/ui/issues/issue-27592.stderr b/tests/ui/issues/issue-27592.stderr
index c8649d82d74..f1de7b9e569 100644
--- a/tests/ui/issues/issue-27592.stderr
+++ b/tests/ui/issues/issue-27592.stderr
@@ -1,3 +1,9 @@
+error[E0515]: cannot return reference to temporary value
+  --> $DIR/issue-27592.rs:16:14
+   |
+LL |     write(|| format_args!("{}", String::from("Hello world")));
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returns a reference to data owned by the current function
+
 error[E0515]: cannot return value referencing temporary value
   --> $DIR/issue-27592.rs:16:14
    |
@@ -7,12 +13,6 @@ LL |     write(|| format_args!("{}", String::from("Hello world")));
    |              |                  temporary value created here
    |              returns a value referencing data owned by the current function
 
-error[E0515]: cannot return reference to temporary value
-  --> $DIR/issue-27592.rs:16:14
-   |
-LL |     write(|| format_args!("{}", String::from("Hello world")));
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returns a reference to data owned by the current function
-
 error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0515`.
diff --git a/tests/ui/issues/issue-27842.stderr b/tests/ui/issues/issue-27842.stderr
index b18fe1512b5..f388fdf85cd 100644
--- a/tests/ui/issues/issue-27842.stderr
+++ b/tests/ui/issues/issue-27842.stderr
@@ -2,17 +2,17 @@ error[E0608]: cannot index into a value of type `({integer}, {integer}, {integer
   --> $DIR/issue-27842.rs:4:16
    |
 LL |     let _ = tup[0];
-   |                ^^^ help: to access tuple elements, use: `.0`
+   |                ^^^ help: to access tuple element `0`, use: `.0`
+   |
+   = help: tuples are indexed with a dot and a literal index: `tuple.0`, `tuple.1`, etc.
 
 error[E0608]: cannot index into a value of type `({integer}, {integer}, {integer})`
   --> $DIR/issue-27842.rs:9:16
    |
 LL |     let _ = tup[i];
-   |                ^-^
-   |                 |
-   |                 cannot access tuple elements at a variable index
+   |                ^^^
    |
-   = help: to access tuple elements, use tuple indexing syntax (e.g., `tuple.0`)
+   = help: tuples are indexed with a dot and a literal index: `tuple.0`, `tuple.1`, etc.
 
 error[E0608]: cannot index into a value of type `({integer},)`
   --> $DIR/issue-27842.rs:14:16
@@ -20,7 +20,7 @@ error[E0608]: cannot index into a value of type `({integer},)`
 LL |     let _ = tup[3];
    |                ^^^
    |
-   = help: to access tuple elements, use tuple indexing syntax (e.g., `tuple.0`)
+   = help: tuples are indexed with a dot and a literal index: `tuple.0`, `tuple.1`, etc.
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/issues/issue-29485.rs b/tests/ui/issues/issue-29485.rs
index a44bcd49c6a..8e6436cb11e 100644
--- a/tests/ui/issues/issue-29485.rs
+++ b/tests/ui/issues/issue-29485.rs
@@ -3,6 +3,7 @@
 //@ aux-build:issue-29485.rs
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 
 #[feature(recover)]
 
diff --git a/tests/ui/issues/issue-30018-panic.rs b/tests/ui/issues/issue-30018-panic.rs
index 591848b6f7b..09b832bb59d 100644
--- a/tests/ui/issues/issue-30018-panic.rs
+++ b/tests/ui/issues/issue-30018-panic.rs
@@ -6,6 +6,7 @@
 
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 
 struct Foo;
 
diff --git a/tests/ui/issues/issue-44056.rs b/tests/ui/issues/issue-44056.rs
index 12e4f018466..37d7b00cf7f 100644
--- a/tests/ui/issues/issue-44056.rs
+++ b/tests/ui/issues/issue-44056.rs
@@ -2,5 +2,6 @@
 //@ only-x86_64
 //@ no-prefer-dynamic
 //@ compile-flags: -Ctarget-feature=+avx -Clto
+//@ ignore-backends: gcc
 
 fn main() {}
diff --git a/tests/ui/issues/issue-45731.rs b/tests/ui/issues/issue-45731.rs
index 49335362dd0..db11d1dbef1 100644
--- a/tests/ui/issues/issue-45731.rs
+++ b/tests/ui/issues/issue-45731.rs
@@ -1,6 +1,10 @@
 //@ run-pass
 #![allow(unused_variables)]
 //@ compile-flags:--test -g
+//@ ignore-ios needs the `.dSYM` files to be moved to the device
+//@ ignore-tvos needs the `.dSYM` files to be moved to the device
+//@ ignore-watchos needs the `.dSYM` files to be moved to the device
+//@ ignore-visionos needs the `.dSYM` files to be moved to the device
 
 #[cfg(target_vendor = "apple")]
 #[test]
diff --git a/tests/ui/issues/issue-56943.rs b/tests/ui/issues/issue-56943.rs
deleted file mode 100644
index 9664567ec9e..00000000000
--- a/tests/ui/issues/issue-56943.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-//@ aux-build:issue-56943.rs
-
-extern crate issue_56943;
-
-fn main() {
-    let _: issue_56943::S = issue_56943::S2;
-    //~^ ERROR mismatched types [E0308]
-}
diff --git a/tests/ui/issues/issue-68696-catch-during-unwind.rs b/tests/ui/issues/issue-68696-catch-during-unwind.rs
index 80d63b0cde7..655879e1869 100644
--- a/tests/ui/issues/issue-68696-catch-during-unwind.rs
+++ b/tests/ui/issues/issue-68696-catch-during-unwind.rs
@@ -4,6 +4,7 @@
 // entering the catch_unwind.
 //
 //@ run-pass
+//@ ignore-backends: gcc
 
 use std::panic::catch_unwind;
 
diff --git a/tests/ui/iterators/issue-58952-filter-type-length.rs b/tests/ui/iterators/issue-58952-filter-type-length.rs
index 6730865b6c7..525a2e39a91 100644
--- a/tests/ui/iterators/issue-58952-filter-type-length.rs
+++ b/tests/ui/iterators/issue-58952-filter-type-length.rs
@@ -2,7 +2,7 @@
 
 //! This snippet causes the type length to blowup exponentially,
 //! so check that we don't accidentally exceed the type length limit.
-// FIXME: Once the size of iterator adaptors is further reduced,
+// FIXME: Once the size of iterator adapters is further reduced,
 // increase the complexity of this test.
 use std::collections::VecDeque;
 
diff --git a/tests/ui/issues/issue-57198-pass.rs b/tests/ui/keyword/raw-identifier-for-function-57198.rs
index 06f30603c31..41a0cbf4619 100644
--- a/tests/ui/issues/issue-57198-pass.rs
+++ b/tests/ui/keyword/raw-identifier-for-function-57198.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/57198
 //@ run-pass
 
 mod m {
diff --git a/tests/ui/keyword/soup.rs b/tests/ui/keyword/soup.rs
new file mode 100644
index 00000000000..c4dbe3fb483
--- /dev/null
+++ b/tests/ui/keyword/soup.rs
@@ -0,0 +1,30 @@
+//@ edition:2024
+//@ check-pass
+
+#![allow(unused_imports)]
+#![allow(missing_abi)]
+#![allow(unused_macros)]
+#![allow(non_camel_case_types)]
+#![allow(unreachable_code)]
+#![allow(unused_variables)]
+#![allow(dead_code)]
+#![allow(unused_must_use)]
+
+// all 48 keywords in 300 characters
+mod x {
+    pub(super) struct X;
+    use Ok;
+    impl X {
+        pub(in crate) async fn x(self: Self, x: &'static &'_ dyn for<> Fn()) where {
+            unsafe extern { safe fn x(); }
+            macro_rules! x { () => {}; }
+            if 'x: loop {
+                return match while let true = break 'x false { continue } {
+                    ref x => { &raw mut x; async { const { enum A {} } }.await as () },
+                };
+            } { type x = X; } else { move || { trait x { } union B { x: () } }; }
+        }
+    }
+}
+
+fn main() {}
diff --git a/tests/ui/lang-items/missing-copy-lang-item-issue-19660.rs b/tests/ui/lang-items/missing-copy-lang-item-issue-19660.rs
deleted file mode 100644
index 35d5d079c68..00000000000
--- a/tests/ui/lang-items/missing-copy-lang-item-issue-19660.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-#![feature(lang_items, no_core)]
-#![no_core]
-#![no_main]
-
-#[lang = "pointee_sized"]
-pub trait PointeeSized {}
-
-#[lang = "meta_sized"]
-pub trait MetaSized: PointeeSized {}
-
-#[lang = "sized"]
-trait Sized: MetaSized { }
-
-struct S;
-
-#[no_mangle]
-extern "C" fn main(argc: i32, _argv: *const *const u8) -> i32 {
-    argc //~ ERROR requires `copy` lang_item
-}
diff --git a/tests/ui/lang-items/missing-copy-lang-item-issue-19660.stderr b/tests/ui/lang-items/missing-copy-lang-item-issue-19660.stderr
deleted file mode 100644
index 7b9541f734f..00000000000
--- a/tests/ui/lang-items/missing-copy-lang-item-issue-19660.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: requires `copy` lang_item
-  --> $DIR/missing-copy-lang-item-issue-19660.rs:18:5
-   |
-LL |     argc
-   |     ^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/layout/thaw-transmute-invalid-enum.rs b/tests/ui/layout/thaw-transmute-invalid-enum.rs
index a7c2e1a86de..20fc8d46359 100644
--- a/tests/ui/layout/thaw-transmute-invalid-enum.rs
+++ b/tests/ui/layout/thaw-transmute-invalid-enum.rs
@@ -9,6 +9,7 @@ mod assert {
     where
         Dst: TransmuteFrom<Src>,
         //~^ ERROR: use of unstable library feature `transmutability`
+        //~^^ ERROR: use of unstable library feature `transmutability`
     {
     }
 }
diff --git a/tests/ui/layout/thaw-transmute-invalid-enum.stderr b/tests/ui/layout/thaw-transmute-invalid-enum.stderr
index d12fc4694e0..2b89159c263 100644
--- a/tests/ui/layout/thaw-transmute-invalid-enum.stderr
+++ b/tests/ui/layout/thaw-transmute-invalid-enum.stderr
@@ -1,5 +1,5 @@
 error[E0412]: cannot find type `Subset` in this scope
-  --> $DIR/thaw-transmute-invalid-enum.rs:34:41
+  --> $DIR/thaw-transmute-invalid-enum.rs:35:41
    |
 LL |     assert::is_transmutable::<Superset, Subset>();
    |                                         ^^^^^^ not found in this scope
@@ -10,7 +10,7 @@ LL | fn test<Subset>() {
    |        ++++++++
 
 error[E0517]: attribute should be applied to a struct or union
-  --> $DIR/thaw-transmute-invalid-enum.rs:21:11
+  --> $DIR/thaw-transmute-invalid-enum.rs:22:11
    |
 LL |   #[repr(C, packed(2))]
    |             ^^^^^^^^^
@@ -50,8 +50,19 @@ LL |         Dst: TransmuteFrom<Src>,
    = help: add `#![feature(transmutability)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
+error[E0658]: use of unstable library feature `transmutability`
+  --> $DIR/thaw-transmute-invalid-enum.rs:10:14
+   |
+LL |         Dst: TransmuteFrom<Src>,
+   |              ^^^^^^^^^^^^^^^^^^
+   |
+   = help: add `#![feature(transmutability)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+note: required by a bound in `TransmuteFrom`
+  --> $SRC_DIR/core/src/mem/transmutability.rs:LL:COL
+
 error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
-  --> $DIR/thaw-transmute-invalid-enum.rs:29:9
+  --> $DIR/thaw-transmute-invalid-enum.rs:30:9
    |
 LL |         a: Ox00,
    |         ^^^^^^^
@@ -62,7 +73,7 @@ help: wrap the field type in `ManuallyDrop<...>`
 LL |         a: std::mem::ManuallyDrop<Ox00>,
    |            +++++++++++++++++++++++    +
 
-error: aborting due to 6 previous errors
+error: aborting due to 7 previous errors
 
 Some errors have detailed explanations: E0412, E0517, E0658, E0740.
 For more information about an error, try `rustc --explain E0412`.
diff --git a/tests/ui/lazy-type-alias-impl-trait/branches3.stderr b/tests/ui/lazy-type-alias-impl-trait/branches3.stderr
index 117d189867b..539673bc343 100644
--- a/tests/ui/lazy-type-alias-impl-trait/branches3.stderr
+++ b/tests/ui/lazy-type-alias-impl-trait/branches3.stderr
@@ -2,7 +2,7 @@ error[E0282]: type annotations needed
   --> $DIR/branches3.rs:9:10
    |
 LL |         |s| s.len()
-   |          ^  - type must be known at this point
+   |          ^    --- type must be known at this point
    |
 help: consider giving this closure parameter an explicit type
    |
@@ -13,7 +13,7 @@ error[E0282]: type annotations needed
   --> $DIR/branches3.rs:18:10
    |
 LL |         |s| s.len()
-   |          ^  - type must be known at this point
+   |          ^    --- type must be known at this point
    |
 help: consider giving this closure parameter an explicit type
    |
@@ -24,7 +24,7 @@ error[E0282]: type annotations needed
   --> $DIR/branches3.rs:26:10
    |
 LL |         |s| s.len()
-   |          ^  - type must be known at this point
+   |          ^    --- type must be known at this point
    |
 help: consider giving this closure parameter an explicit type
    |
@@ -35,7 +35,7 @@ error[E0282]: type annotations needed
   --> $DIR/branches3.rs:33:10
    |
 LL |         |s| s.len()
-   |          ^  - type must be known at this point
+   |          ^    --- type must be known at this point
    |
 help: consider giving this closure parameter an explicit type
    |
diff --git a/tests/ui/lifetimes/issue-105507.fixed b/tests/ui/lifetimes/issue-105507.fixed
index 46d4f14a245..a3c4e5784b8 100644
--- a/tests/ui/lifetimes/issue-105507.fixed
+++ b/tests/ui/lifetimes/issue-105507.fixed
@@ -31,7 +31,7 @@ impl<T> ProjectedMyTrait for T
 
 fn require_trait<T: MyTrait>(_: T) {}
 
-fn foo<T : MyTrait + 'static + 'static, U : MyTrait + 'static + 'static>(wrap: Wrapper<'_, Option<T>>, wrap1: Wrapper<'_, Option<U>>) {
+fn foo<T : MyTrait + 'static, U : MyTrait + 'static>(wrap: Wrapper<'_, Option<T>>, wrap1: Wrapper<'_, Option<U>>) {
     //~^ HELP consider restricting the type parameter to the `'static` lifetime
     //~| HELP consider restricting the type parameter to the `'static` lifetime
     require_trait(wrap);
diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.rs b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.rs
new file mode 100644
index 00000000000..16039f177b4
--- /dev/null
+++ b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.rs
@@ -0,0 +1,13 @@
+// Regression test for #91831
+
+struct Foo<'a>(&'a i32);
+
+impl<'a> Foo<'a> {
+    fn modify(&'a mut self) {}
+}
+
+fn bar(foo: &mut Foo) {
+    foo.modify(); //~ ERROR lifetime may not live long enough
+}
+
+fn main() {}
diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.stderr b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.stderr
new file mode 100644
index 00000000000..f02b65230b6
--- /dev/null
+++ b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.stderr
@@ -0,0 +1,20 @@
+error: lifetime may not live long enough
+  --> $DIR/ex3-both-anon-regions-one-is-struct-5.rs:10:5
+   |
+LL | fn bar(foo: &mut Foo) {
+   |        ---  - let's call the lifetime of this reference `'1`
+   |        |
+   |        has type `&mut Foo<'2>`
+LL |     foo.modify();
+   |     ^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
+   |
+   = note: requirement occurs because of a mutable reference to `Foo<'_>`
+   = note: mutable references are invariant over their type parameter
+   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
+help: consider introducing a named lifetime parameter
+   |
+LL | fn bar<'a>(foo: &'a mut Foo<'a>) {
+   |       ++++       ++        ++++
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/lifetimes/re-empty-in-error.stderr b/tests/ui/lifetimes/re-empty-in-error.stderr
index 554bcb5451f..b3b6d3d269c 100644
--- a/tests/ui/lifetimes/re-empty-in-error.stderr
+++ b/tests/ui/lifetimes/re-empty-in-error.stderr
@@ -4,7 +4,7 @@ error: higher-ranked lifetime error
 LL |     foo(&10);
    |     ^^^^^^^^
    |
-   = note: could not prove `for<'b> &'b (): 'a`
+   = note: could not prove `for<'b> &'b (): '_`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs b/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs
index bb537f855a4..7de786dff3b 100644
--- a/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs
+++ b/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs
@@ -1,4 +1,4 @@
-//@ edition:2024
+//@ reference: destructors.scope.lifetime-extension.exprs
 
 fn temp() -> String {
     String::from("Hello")
@@ -22,7 +22,7 @@ fn main() {
     let a = &temp();
     let b = Some(&temp());
     let c = Option::Some::<&String>(&temp());
-    use Option::Some as S;
+    use std::option::Option::Some as S;
     let d = S(&temp());
     let e = X(&temp());
     let f = Some(Ok::<_, ()>(std::borrow::Cow::Borrowed(if true {
@@ -31,6 +31,6 @@ fn main() {
         panic!()
     })));
     let some = Some; // Turn the ctor into a regular function.
-    let g = some(&temp()); //~ERROR temporary value dropped while borrowe
+    let g = some(&temp()); //~ERROR temporary value dropped while borrowed
     println!("{a:?} {b:?} {c:?} {d:?} {e:?} {f:?} {g:?}");
 }
diff --git a/tests/ui/linkage-attr/common-linkage-non-zero-init.rs b/tests/ui/linkage-attr/common-linkage-non-zero-init.rs
index e5de08a7a28..512616251c2 100644
--- a/tests/ui/linkage-attr/common-linkage-non-zero-init.rs
+++ b/tests/ui/linkage-attr/common-linkage-non-zero-init.rs
@@ -3,6 +3,7 @@
 //@ known-bug: #109681
 //@ ignore-wasm32 this appears to SIGABRT on wasm, not fail cleanly
 //@ compile-flags: -Z verify-llvm-ir
+//@ ignore-backends: gcc
 
 // This test verifies that we continue to hit the LLVM error for common linkage with non-zero
 // initializers, since it generates invalid LLVM IR.
diff --git a/tests/ui/linkage-attr/raw-dylib/elf/glibc-x86_64.rs b/tests/ui/linkage-attr/raw-dylib/elf/glibc-x86_64.rs
index 57492ed2d0e..62d352facd1 100644
--- a/tests/ui/linkage-attr/raw-dylib/elf/glibc-x86_64.rs
+++ b/tests/ui/linkage-attr/raw-dylib/elf/glibc-x86_64.rs
@@ -3,6 +3,7 @@
 //@ run-pass
 //@ compile-flags: -Cpanic=abort
 //@ edition: 2024
+//@ ignore-backends: gcc
 
 #![allow(incomplete_features)]
 #![feature(raw_dylib_elf)]
diff --git a/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.rs b/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.rs
index 92cb60bb16d..dac878c1cd9 100644
--- a/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.rs
+++ b/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.rs
@@ -20,4 +20,4 @@ pub fn lib_main() {
     unsafe { f(42); }
 }
 
-//~? ERROR Dlltool could not create import library with
+//~? ERROR dlltool could not create import library with
diff --git a/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.stderr b/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.stderr
index 90cca83d1c1..5f3c29c3a21 100644
--- a/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.stderr
+++ b/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.stderr
@@ -1,4 +1,4 @@
-error: Dlltool could not create import library with $DLLTOOL -d $DEF_FILE -D foo.dll -l $LIB_FILE $TARGET_MACHINE $ASM_FLAGS --no-leading-underscore $TEMP_PREFIX:
+error: dlltool could not create import library with $DLLTOOL -d $DEF_FILE -D foo.dll -l $LIB_FILE $TARGET_MACHINE $ASM_FLAGS --no-leading-underscore $TEMP_PREFIX:
        
        $DLLTOOL: Syntax error in def file $DEF_FILE:1␍
 
diff --git a/tests/ui/linking/no-gc-encapsulation-symbols.rs b/tests/ui/linking/no-gc-encapsulation-symbols.rs
index 36d69969199..c60f35b55eb 100644
--- a/tests/ui/linking/no-gc-encapsulation-symbols.rs
+++ b/tests/ui/linking/no-gc-encapsulation-symbols.rs
@@ -5,6 +5,7 @@
 //
 //@ build-pass
 //@ only-x86_64-unknown-linux-gnu
+//@ ignore-backends: gcc
 
 unsafe extern "Rust" {
     // The __start_ section name is magical for the linker,
diff --git a/tests/ui/lint/unused-qualification-in-derive-expansion.rs b/tests/ui/lint/unused-qualification-in-derive-expansion.rs
index b2067e22c44..bf095c6449d 100644
--- a/tests/ui/lint/unused-qualification-in-derive-expansion.rs
+++ b/tests/ui/lint/unused-qualification-in-derive-expansion.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ proc-macro: add-impl.rs
+//@ ignore-backends: gcc
 
 #![forbid(unused_qualifications)]
 
diff --git a/tests/ui/lint/unused/unused-attr-duplicate.stderr b/tests/ui/lint/unused/unused-attr-duplicate.stderr
index 3a3b450f3c5..fa2c9e59a41 100644
--- a/tests/ui/lint/unused/unused-attr-duplicate.stderr
+++ b/tests/ui/lint/unused/unused-attr-duplicate.stderr
@@ -54,18 +54,6 @@ LL | #![no_builtins]
    | ^^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr-duplicate.rs:44:5
-   |
-LL |     #[macro_export]
-   |     ^^^^^^^^^^^^^^^ help: remove this attribute
-   |
-note: attribute also specified here
-  --> $DIR/unused-attr-duplicate.rs:43:5
-   |
-LL |     #[macro_export]
-   |     ^^^^^^^^^^^^^^^
-
-error: unused attribute
   --> $DIR/unused-attr-duplicate.rs:41:1
    |
 LL | #[macro_use]
@@ -78,6 +66,18 @@ LL | #[macro_use]
    | ^^^^^^^^^^^^
 
 error: unused attribute
+  --> $DIR/unused-attr-duplicate.rs:44:5
+   |
+LL |     #[macro_export]
+   |     ^^^^^^^^^^^^^^^ help: remove this attribute
+   |
+note: attribute also specified here
+  --> $DIR/unused-attr-duplicate.rs:43:5
+   |
+LL |     #[macro_export]
+   |     ^^^^^^^^^^^^^^^
+
+error: unused attribute
   --> $DIR/unused-attr-duplicate.rs:51:1
    |
 LL | #[path = "bar.rs"]
diff --git a/tests/ui/lint/unused_parens_follow_ident.fixed b/tests/ui/lint/unused_parens_follow_ident.fixed
new file mode 100644
index 00000000000..e61b287e5a6
--- /dev/null
+++ b/tests/ui/lint/unused_parens_follow_ident.fixed
@@ -0,0 +1,17 @@
+//@ run-rustfix
+
+#![deny(unused_parens)]
+
+macro_rules! wrap {
+    ($name:ident $arg:expr) => {
+        $name($arg);
+    };
+}
+
+fn main() {
+    wrap!(unary routine()); //~ ERROR unnecessary parentheses around function argument
+    wrap!(unary routine()); //~ ERROR unnecessary parentheses around function argument
+}
+
+fn unary(_: ()) {}
+fn routine() {}
diff --git a/tests/ui/lint/unused_parens_follow_ident.rs b/tests/ui/lint/unused_parens_follow_ident.rs
new file mode 100644
index 00000000000..32a163345b2
--- /dev/null
+++ b/tests/ui/lint/unused_parens_follow_ident.rs
@@ -0,0 +1,17 @@
+//@ run-rustfix
+
+#![deny(unused_parens)]
+
+macro_rules! wrap {
+    ($name:ident $arg:expr) => {
+        $name($arg);
+    };
+}
+
+fn main() {
+    wrap!(unary(routine())); //~ ERROR unnecessary parentheses around function argument
+    wrap!(unary (routine())); //~ ERROR unnecessary parentheses around function argument
+}
+
+fn unary(_: ()) {}
+fn routine() {}
diff --git a/tests/ui/lint/unused_parens_follow_ident.stderr b/tests/ui/lint/unused_parens_follow_ident.stderr
new file mode 100644
index 00000000000..ce7bb26778c
--- /dev/null
+++ b/tests/ui/lint/unused_parens_follow_ident.stderr
@@ -0,0 +1,31 @@
+error: unnecessary parentheses around function argument
+  --> $DIR/unused_parens_follow_ident.rs:12:16
+   |
+LL |     wrap!(unary(routine()));
+   |                ^         ^
+   |
+note: the lint level is defined here
+  --> $DIR/unused_parens_follow_ident.rs:3:9
+   |
+LL | #![deny(unused_parens)]
+   |         ^^^^^^^^^^^^^
+help: remove these parentheses
+   |
+LL -     wrap!(unary(routine()));
+LL +     wrap!(unary routine());
+   |
+
+error: unnecessary parentheses around function argument
+  --> $DIR/unused_parens_follow_ident.rs:13:17
+   |
+LL |     wrap!(unary (routine()));
+   |                 ^         ^
+   |
+help: remove these parentheses
+   |
+LL -     wrap!(unary (routine()));
+LL +     wrap!(unary routine());
+   |
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/lto/debuginfo-lto-alloc.rs b/tests/ui/lto/debuginfo-lto-alloc.rs
index d6855f8760d..7c82d978a07 100644
--- a/tests/ui/lto/debuginfo-lto-alloc.rs
+++ b/tests/ui/lto/debuginfo-lto-alloc.rs
@@ -12,6 +12,7 @@
 //@ compile-flags: --test -C debuginfo=2 -C lto=fat
 //@ no-prefer-dynamic
 //@ incremental
+//@ ignore-backends: gcc
 
 extern crate alloc;
 
diff --git a/tests/ui/lto/debuginfo-lto.rs b/tests/ui/lto/debuginfo-lto.rs
index f189a1df056..6d8b836235c 100644
--- a/tests/ui/lto/debuginfo-lto.rs
+++ b/tests/ui/lto/debuginfo-lto.rs
@@ -7,6 +7,7 @@
 //@ aux-build:debuginfo-lto-aux.rs
 //@ compile-flags: -C lto -g
 //@ no-prefer-dynamic
+//@ ignore-backends: gcc
 
 extern crate debuginfo_lto_aux;
 
diff --git a/tests/ui/lto/dwarf-mixed-versions-lto.rs b/tests/ui/lto/dwarf-mixed-versions-lto.rs
index 900274eb22f..8ed3afa5e33 100644
--- a/tests/ui/lto/dwarf-mixed-versions-lto.rs
+++ b/tests/ui/lto/dwarf-mixed-versions-lto.rs
@@ -7,6 +7,7 @@
 //@ compile-flags: -C lto -g -Cdwarf-version=5
 //@ no-prefer-dynamic
 //@ build-pass
+//@ ignore-backends: gcc
 
 extern crate dwarf_mixed_versions_lto_aux;
 
diff --git a/tests/ui/lto/fat-lto.rs b/tests/ui/lto/fat-lto.rs
index 73d6801a25a..fe00d7feb37 100644
--- a/tests/ui/lto/fat-lto.rs
+++ b/tests/ui/lto/fat-lto.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ compile-flags: -Clto=fat
 //@ no-prefer-dynamic
+//@ ignore-backends: gcc
 
 fn main() {
     println!("hello!");
diff --git a/tests/ui/lto/issue-100772.rs b/tests/ui/lto/issue-100772.rs
index 9468e20894a..e07d44e3be8 100644
--- a/tests/ui/lto/issue-100772.rs
+++ b/tests/ui/lto/issue-100772.rs
@@ -3,6 +3,7 @@
 //@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi -C unsafe-allow-abi-mismatch=sanitizer
 //@ no-prefer-dynamic
 //@ only-x86_64-unknown-linux-gnu
+//@ ignore-backends: gcc
 
 #![feature(allocator_api)]
 
diff --git a/tests/ui/lto/lto-duplicate-symbols.rs b/tests/ui/lto/lto-duplicate-symbols.rs
index a62ab2e2217..08465eb0fb2 100644
--- a/tests/ui/lto/lto-duplicate-symbols.rs
+++ b/tests/ui/lto/lto-duplicate-symbols.rs
@@ -4,6 +4,7 @@
 //@ compile-flags: -C lto
 //@ no-prefer-dynamic
 //@ normalize-stderr: "lto-duplicate-symbols2\.lto_duplicate_symbols2\.[0-9a-zA-Z]+-cgu" -> "lto-duplicate-symbols2.lto_duplicate_symbols2.HASH-cgu"
+//@ ignore-backends: gcc
 extern crate lto_duplicate_symbols1;
 extern crate lto_duplicate_symbols2;
 
diff --git a/tests/ui/lto/lto-many-codegen-units.rs b/tests/ui/lto/lto-many-codegen-units.rs
index fb6636fb815..6761510e427 100644
--- a/tests/ui/lto/lto-many-codegen-units.rs
+++ b/tests/ui/lto/lto-many-codegen-units.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ compile-flags: -C lto -C codegen-units=8
 //@ no-prefer-dynamic
+//@ ignore-backends: gcc
 
 fn main() {
 }
diff --git a/tests/ui/lto/lto-rustc-loads-linker-plugin.rs b/tests/ui/lto/lto-rustc-loads-linker-plugin.rs
index 18e937cb29a..2be320f0bff 100644
--- a/tests/ui/lto/lto-rustc-loads-linker-plugin.rs
+++ b/tests/ui/lto/lto-rustc-loads-linker-plugin.rs
@@ -2,6 +2,7 @@
 //@ aux-build:lto-rustc-loads-linker-plugin.rs
 //@ run-pass
 //@ no-prefer-dynamic
+//@ ignore-backends: gcc
 
 // This test ensures that if a dependency was compiled with
 // `-Clinker-plugin-lto` then we can compile with `-Clto` and still link against
diff --git a/tests/ui/lto/lto-still-runs-thread-dtors.rs b/tests/ui/lto/lto-still-runs-thread-dtors.rs
index 900368496eb..9a97677773c 100644
--- a/tests/ui/lto/lto-still-runs-thread-dtors.rs
+++ b/tests/ui/lto/lto-still-runs-thread-dtors.rs
@@ -2,6 +2,7 @@
 //@ compile-flags: -C lto
 //@ no-prefer-dynamic
 //@ needs-threads
+//@ ignore-backends: gcc
 
 // FIXME(static_mut_refs): this could use an atomic
 #![allow(static_mut_refs)]
diff --git a/tests/ui/macros/issue-61053-duplicate-binder.stderr b/tests/ui/macros/issue-61053-duplicate-binder.stderr
index 7c7cb26b407..1ecbc3f86d0 100644
--- a/tests/ui/macros/issue-61053-duplicate-binder.stderr
+++ b/tests/ui/macros/issue-61053-duplicate-binder.stderr
@@ -2,9 +2,9 @@ error: duplicate matcher binding
   --> $DIR/issue-61053-duplicate-binder.rs:7:20
    |
 LL |             ($x:tt $x:tt) => { $x };
-   |              --    ^^
+   |              --    ^^ duplicate binding
    |              |
-   |              previous declaration
+   |              previous binding
    |
 note: the lint level is defined here
   --> $DIR/issue-61053-duplicate-binder.rs:1:9
diff --git a/tests/ui/macros/macro-local-data-key-priv.stderr b/tests/ui/macros/macro-local-data-key-priv.stderr
index e93bd11046d..8df1aec140d 100644
--- a/tests/ui/macros/macro-local-data-key-priv.stderr
+++ b/tests/ui/macros/macro-local-data-key-priv.stderr
@@ -9,7 +9,7 @@ note: the constant `baz` is defined here
    |
 LL |     thread_local!(static baz: f64 = 0.0);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: this error originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::thread::local_impl::thread_local_process_attrs` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/macros/macro-rules-attr-error.rs b/tests/ui/macros/macro-rules-attr-error.rs
index 81eadb6692f..60290b883cb 100644
--- a/tests/ui/macros/macro-rules-attr-error.rs
+++ b/tests/ui/macros/macro-rules-attr-error.rs
@@ -50,3 +50,22 @@ macro_rules! forward_referenced_attr {
 macro_rules! cyclic_attr {
     attr() {} => {}
 }
+
+macro_rules! attr_with_safety {
+    unsafe attr() { struct RequiresUnsafe; } => {};
+    attr() { struct SafeInvocation; } => {};
+}
+
+#[attr_with_safety]
+struct SafeInvocation;
+
+//~v ERROR: unnecessary `unsafe` on safe attribute invocation
+#[unsafe(attr_with_safety)]
+struct SafeInvocation;
+
+//~v ERROR: unsafe attribute invocation requires `unsafe`
+#[attr_with_safety]
+struct RequiresUnsafe;
+
+#[unsafe(attr_with_safety)]
+struct RequiresUnsafe;
diff --git a/tests/ui/macros/macro-rules-attr-error.stderr b/tests/ui/macros/macro-rules-attr-error.stderr
index 674d35091b6..27527a2da7e 100644
--- a/tests/ui/macros/macro-rules-attr-error.stderr
+++ b/tests/ui/macros/macro-rules-attr-error.stderr
@@ -9,6 +9,18 @@ LL |     #[local_attr]
    |
    = note: this error originates in the attribute macro `local_attr` (in Nightly builds, run with -Z macro-backtrace for more info)
 
+error: unnecessary `unsafe` on safe attribute invocation
+  --> $DIR/macro-rules-attr-error.rs:63:3
+   |
+LL | #[unsafe(attr_with_safety)]
+   |   ^^^^^^
+
+error: unsafe attribute invocation requires `unsafe`
+  --> $DIR/macro-rules-attr-error.rs:67:1
+   |
+LL | #[attr_with_safety]
+   | ^^^^^^^^^^^^^^^^^^^
+
 error: cannot find macro `local_attr` in this scope
   --> $DIR/macro-rules-attr-error.rs:27:5
    |
@@ -59,5 +71,5 @@ note: a macro with the same name exists, but it appears later
 LL | macro_rules! cyclic_attr {
    |              ^^^^^^^^^^^
 
-error: aborting due to 6 previous errors
+error: aborting due to 8 previous errors
 
diff --git a/tests/ui/macros/macro-use-all-and-none.stderr b/tests/ui/macros/macro-use-all-and-none.stderr
index a5efb065a21..b4c05adcb33 100644
--- a/tests/ui/macros/macro-use-all-and-none.stderr
+++ b/tests/ui/macros/macro-use-all-and-none.stderr
@@ -2,8 +2,9 @@ warning: unused attribute
   --> $DIR/macro-use-all-and-none.rs:7:12
    |
 LL | #[macro_use()]
-   |            ^^ help: remove this attribute
+   |            ^^ help: remove these parentheses
    |
+   = note: using `macro_use` with an empty list is equivalent to not using a list at all
 note: the lint level is defined here
   --> $DIR/macro-use-all-and-none.rs:4:9
    |
diff --git a/tests/ui/macros/same-sequence-span.rs b/tests/ui/macros/same-sequence-span.rs
index dfaf669a769..9fae847a4e2 100644
--- a/tests/ui/macros/same-sequence-span.rs
+++ b/tests/ui/macros/same-sequence-span.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: proc_macro_sequence.rs
+//@ ignore-backends: gcc
 
 // Regression test for issue #62831: Check that multiple sequences with the same span in the
 // left-hand side of a macro definition behave as if they had unique spans, and in particular that
diff --git a/tests/ui/macros/same-sequence-span.stderr b/tests/ui/macros/same-sequence-span.stderr
index 34df201f5a5..1ca89b6b595 100644
--- a/tests/ui/macros/same-sequence-span.stderr
+++ b/tests/ui/macros/same-sequence-span.stderr
@@ -1,5 +1,5 @@
 error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fragments
-  --> $DIR/same-sequence-span.rs:14:18
+  --> $DIR/same-sequence-span.rs:15:18
    |
 LL |     (1 $x:expr $($y:tt,)*
    |                  ^^^^^ not allowed after `expr` fragments
@@ -7,7 +7,7 @@ LL |     (1 $x:expr $($y:tt,)*
    = note: allowed there are: `=>`, `,` or `;`
 
 error: `$x:expr` may be followed by `=`, which is not allowed for `expr` fragments
-  --> $DIR/same-sequence-span.rs:15:18
+  --> $DIR/same-sequence-span.rs:16:18
    |
 LL |                $(= $z:tt)*
    |                  ^ not allowed after `expr` fragments
@@ -15,10 +15,10 @@ LL |                $(= $z:tt)*
    = note: allowed there are: `=>`, `,` or `;`
 
 error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fragments
-  --> $DIR/same-sequence-span.rs:19:1
+  --> $DIR/same-sequence-span.rs:20:1
    |
-LL | | macro_rules! manual_foo {
-   | |__________________________^not allowed after `expr` fragments
+LL | | // `proc_macro_sequence.rs`.
+   | |_____________________________^not allowed after `expr` fragments
 ...
 LL |   proc_macro_sequence::make_foo!();
    |   ^-------------------------------
@@ -30,7 +30,7 @@ LL |   proc_macro_sequence::make_foo!();
    = note: this error originates in the macro `proc_macro_sequence::make_foo` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `$x:expr` may be followed by `=`, which is not allowed for `expr` fragments
-  --> $DIR/same-sequence-span.rs:19:1
+  --> $DIR/same-sequence-span.rs:20:1
    |
 LL | proc_macro_sequence::make_foo!();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not allowed after `expr` fragments
diff --git a/tests/ui/methods/overflow-if-subtyping.rs b/tests/ui/methods/overflow-if-subtyping.rs
new file mode 100644
index 00000000000..a97f29f1f6d
--- /dev/null
+++ b/tests/ui/methods/overflow-if-subtyping.rs
@@ -0,0 +1,30 @@
+//@ check-pass
+
+// Regression test for #128887.
+#![allow(unconditional_recursion)]
+trait Mappable<T> {
+    type Output;
+}
+
+trait Bound<T> {}
+// Deleting this impl made it compile on beta
+impl<T> Bound<T> for T {}
+
+trait Generic<M> {}
+
+// Deleting the `: Mappable<T>` already made it error on stable.
+struct IndexWithIter<I, M: Mappable<T>, T>(I, M, T);
+
+impl<I, M, T> IndexWithIter<I, M, T>
+where
+    <M as Mappable<T>>::Output: Bound<T>,
+    // Flipping these where bounds causes this to succeed, even when removing
+    // the where-clause on the struct definition.
+    M: Mappable<T>,
+    I: Generic<M>,
+{
+    fn new(x: I) {
+        IndexWithIter::<_, _, _>::new(x);
+    }
+}
+fn main() {}
diff --git a/tests/ui/mir/lint/assignment-overlap.rs b/tests/ui/mir/lint/assignment-overlap.rs
index bbc14090467..5d1213a7758 100644
--- a/tests/ui/mir/lint/assignment-overlap.rs
+++ b/tests/ui/mir/lint/assignment-overlap.rs
@@ -13,7 +13,7 @@ pub fn main() {
         let a: [u8; 1024];
         {
             a = a; //~ ERROR broken MIR
-                   //~^ ERROR encountered `Assign` statement with overlapping memory
+                   //~^ ERROR encountered `_1 = copy _1` statement with overlapping memory
             Return()
         }
     }
diff --git a/tests/ui/issues/auxiliary/issue-56943.rs b/tests/ui/mismatched_types/auxiliary/aux-56943.rs
index 65b9beb91f9..65b9beb91f9 100644
--- a/tests/ui/issues/auxiliary/issue-56943.rs
+++ b/tests/ui/mismatched_types/auxiliary/aux-56943.rs
diff --git a/tests/ui/mismatched_types/type-mismatch-in-extern-crate-56943.rs b/tests/ui/mismatched_types/type-mismatch-in-extern-crate-56943.rs
new file mode 100644
index 00000000000..9970b27c847
--- /dev/null
+++ b/tests/ui/mismatched_types/type-mismatch-in-extern-crate-56943.rs
@@ -0,0 +1,9 @@
+// https://github.com/rust-lang/rust/issues/56943
+//@ aux-build:aux-56943.rs
+
+extern crate aux_56943;
+
+fn main() {
+    let _: aux_56943::S = aux_56943::S2;
+    //~^ ERROR mismatched types [E0308]
+}
diff --git a/tests/ui/issues/issue-56943.stderr b/tests/ui/mismatched_types/type-mismatch-in-extern-crate-56943.stderr
index 60a2e92dc71..2315267701d 100644
--- a/tests/ui/issues/issue-56943.stderr
+++ b/tests/ui/mismatched_types/type-mismatch-in-extern-crate-56943.stderr
@@ -1,8 +1,8 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-56943.rs:6:29
+  --> $DIR/type-mismatch-in-extern-crate-56943.rs:7:27
    |
-LL |     let _: issue_56943::S = issue_56943::S2;
-   |            --------------   ^^^^^^^^^^^^^^^ expected `S`, found `S2`
+LL |     let _: aux_56943::S = aux_56943::S2;
+   |            ------------   ^^^^^^^^^^^^^ expected `S`, found `S2`
    |            |
    |            expected due to this
 
diff --git a/tests/ui/issues/issue-56128.rs b/tests/ui/modules/pub-use-handling-in-modules-56128.rs
index cc170f60250..cc170f60250 100644
--- a/tests/ui/issues/issue-56128.rs
+++ b/tests/ui/modules/pub-use-handling-in-modules-56128.rs
diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
index e13653f3423..af07745a00a 100644
--- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
@@ -69,6 +69,12 @@ LL |         cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static ->
 LL |     })
 LL | }
    | - `a` dropped here while still borrowed
+   |
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:13:8
+   |
+LL |     F: for<'x> FnOnce(Cell<&'a u32>, Cell<&'x u32>),
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/nll/closure-requirements/propagate-multiple-requirements.stderr b/tests/ui/nll/closure-requirements/propagate-multiple-requirements.stderr
index 15f48d88c37..4136ac418de 100644
--- a/tests/ui/nll/closure-requirements/propagate-multiple-requirements.stderr
+++ b/tests/ui/nll/closure-requirements/propagate-multiple-requirements.stderr
@@ -13,6 +13,12 @@ LL |         z = &local_arr;
 ...
 LL | }
    | - `local_arr` dropped here while still borrowed
+   |
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/propagate-multiple-requirements.rs:4:21
+   |
+LL | fn once<S, T, U, F: FnOnce(S, T) -> U>(f: F, s: S, t: T) -> U {
+   |                     ^^^^^^^^^^^^^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/nll/local-outlives-static-via-hrtb.stderr b/tests/ui/nll/local-outlives-static-via-hrtb.stderr
index a98f11ce513..263d271b6b3 100644
--- a/tests/ui/nll/local-outlives-static-via-hrtb.stderr
+++ b/tests/ui/nll/local-outlives-static-via-hrtb.stderr
@@ -17,6 +17,11 @@ note: due to a current limitation of the type system, this implies a `'static` l
    |
 LL | fn assert_static_via_hrtb<G>(_: G) where for<'a> G: Outlives<'a> {}
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/local-outlives-static-via-hrtb.rs:15:53
+   |
+LL | fn assert_static_via_hrtb<G>(_: G) where for<'a> G: Outlives<'a> {}
+   |                                                     ^^^^^^^^^^^^
 
 error[E0597]: `local` does not live long enough
   --> $DIR/local-outlives-static-via-hrtb.rs:25:45
@@ -37,6 +42,11 @@ note: due to a current limitation of the type system, this implies a `'static` l
    |
 LL |     for<'a> &'a T: Reference<AssociatedType = &'a ()>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/local-outlives-static-via-hrtb.rs:19:30
+   |
+LL |     for<'a> &'a T: Reference<AssociatedType = &'a ()>,
+   |                              ^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/nll/polonius/location-insensitive-scopes-issue-117146.nll.stderr b/tests/ui/nll/polonius/location-insensitive-scopes-issue-117146.nll.stderr
index 6e47b8e59f5..804b3f00a26 100644
--- a/tests/ui/nll/polonius/location-insensitive-scopes-issue-117146.nll.stderr
+++ b/tests/ui/nll/polonius/location-insensitive-scopes-issue-117146.nll.stderr
@@ -18,6 +18,11 @@ note: due to a current limitation of the type system, this implies a `'static` l
    |
 LL | fn bad<F: Fn(&()) -> &()>(_: F) {}
    |           ^^^^^^^^^^^^^^
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/location-insensitive-scopes-issue-117146.rs:20:22
+   |
+LL | fn bad<F: Fn(&()) -> &()>(_: F) {}
+   |                      ^^^
 
 error: implementation of `Fn` is not general enough
   --> $DIR/location-insensitive-scopes-issue-117146.rs:13:5
diff --git a/tests/ui/nll/polonius/location-insensitive-scopes-issue-117146.polonius.stderr b/tests/ui/nll/polonius/location-insensitive-scopes-issue-117146.polonius.stderr
index 6e47b8e59f5..804b3f00a26 100644
--- a/tests/ui/nll/polonius/location-insensitive-scopes-issue-117146.polonius.stderr
+++ b/tests/ui/nll/polonius/location-insensitive-scopes-issue-117146.polonius.stderr
@@ -18,6 +18,11 @@ note: due to a current limitation of the type system, this implies a `'static` l
    |
 LL | fn bad<F: Fn(&()) -> &()>(_: F) {}
    |           ^^^^^^^^^^^^^^
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/location-insensitive-scopes-issue-117146.rs:20:22
+   |
+LL | fn bad<F: Fn(&()) -> &()>(_: F) {}
+   |                      ^^^
 
 error: implementation of `Fn` is not general enough
   --> $DIR/location-insensitive-scopes-issue-117146.rs:13:5
diff --git a/tests/ui/nll/user-annotations/dump-fn-method.rs b/tests/ui/nll/user-annotations/dump-fn-method.rs
index 26714b6ffe3..ec349e36839 100644
--- a/tests/ui/nll/user-annotations/dump-fn-method.rs
+++ b/tests/ui/nll/user-annotations/dump-fn-method.rs
@@ -31,7 +31,7 @@ fn main() {
     // Here: we only want the `T` to be given, the rest should be variables.
     //
     // (`T` refers to the declaration of `Bazoom`)
-    let x = <_ as Bazoom<u32>>::method::<_>; //~ ERROR [^0, u32, ^1]
+    let x = <_ as Bazoom<u32>>::method::<_>; //~ ERROR [^c_0, u32, ^c_1]
     x(&22, 44, 66);
 
     // Here: all are given and definitely contain no lifetimes, so we
@@ -48,7 +48,7 @@ fn main() {
     //
     // (`U` refers to the declaration of `Bazoom`)
     let y = 22_u32;
-    y.method::<u32>(44, 66); //~ ERROR [^0, ^1, u32]
+    y.method::<u32>(44, 66); //~ ERROR [^c_0, ^c_1, u32]
 
     // Here: nothing is given, so we don't have any annotation.
     let y = 22_u32;
diff --git a/tests/ui/nll/user-annotations/dump-fn-method.stderr b/tests/ui/nll/user-annotations/dump-fn-method.stderr
index 8e847b464e1..f00fb0013df 100644
--- a/tests/ui/nll/user-annotations/dump-fn-method.stderr
+++ b/tests/ui/nll/user-annotations/dump-fn-method.stderr
@@ -4,7 +4,7 @@ error: user args: UserArgs { args: [&'static u32], user_self_ty: None }
 LL |     let x = foo::<&'static u32>;
    |             ^^^^^^^^^^^^^^^^^^^
 
-error: user args: UserArgs { args: [^0, u32, ^1], user_self_ty: None }
+error: user args: UserArgs { args: [^c_0, u32, ^c_1], user_self_ty: None }
   --> $DIR/dump-fn-method.rs:34:13
    |
 LL |     let x = <_ as Bazoom<u32>>::method::<_>;
@@ -16,7 +16,7 @@ error: user args: UserArgs { args: [u8, &'static u16, u32], user_self_ty: None }
 LL |     let x = <u8 as Bazoom<&'static u16>>::method::<u32>;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: user args: UserArgs { args: [^0, ^1, u32], user_self_ty: None }
+error: user args: UserArgs { args: [^c_0, ^c_1, u32], user_self_ty: None }
   --> $DIR/dump-fn-method.rs:51:5
    |
 LL |     y.method::<u32>(44, 66);
diff --git a/tests/ui/numbers-arithmetic/int-abs-overflow.rs b/tests/ui/numbers-arithmetic/int-abs-overflow.rs
index 6397f62d065..fd4a5a6052b 100644
--- a/tests/ui/numbers-arithmetic/int-abs-overflow.rs
+++ b/tests/ui/numbers-arithmetic/int-abs-overflow.rs
@@ -2,6 +2,7 @@
 //@ compile-flags: -C overflow-checks=on
 //@ needs-threads
 //@ needs-unwind
+//@ ignore-backends: gcc
 
 use std::thread;
 
diff --git a/tests/ui/numbers-arithmetic/issue-8460.rs b/tests/ui/numbers-arithmetic/issue-8460.rs
index 87867fdc93e..52df432669f 100644
--- a/tests/ui/numbers-arithmetic/issue-8460.rs
+++ b/tests/ui/numbers-arithmetic/issue-8460.rs
@@ -2,6 +2,7 @@
 #![allow(unused_must_use)]
 //@ needs-threads
 //@ needs-unwind
+//@ ignore-backends: gcc
 #![feature(rustc_attrs)]
 
 use std::thread;
diff --git a/tests/ui/panic-runtime/auxiliary/needs-abort.rs b/tests/ui/panic-runtime/auxiliary/needs-abort.rs
index 21f862e4b43..cba4907dbb6 100644
--- a/tests/ui/panic-runtime/auxiliary/needs-abort.rs
+++ b/tests/ui/panic-runtime/auxiliary/needs-abort.rs
@@ -1,5 +1,7 @@
 //@ compile-flags:-C panic=abort
 //@ no-prefer-dynamic
 
+#![feature(no_core)]
 #![crate_type = "rlib"]
 #![no_std]
+#![no_core]
diff --git a/tests/ui/panic-runtime/auxiliary/needs-immediate-abort.rs b/tests/ui/panic-runtime/auxiliary/needs-immediate-abort.rs
new file mode 100644
index 00000000000..4a41d16faa0
--- /dev/null
+++ b/tests/ui/panic-runtime/auxiliary/needs-immediate-abort.rs
@@ -0,0 +1,7 @@
+//@ compile-flags:-C panic=immediate-abort -Zunstable-options
+//@ no-prefer-dynamic
+
+#![feature(no_core)]
+#![crate_type = "rlib"]
+#![no_std]
+#![no_core]
diff --git a/tests/ui/panic-runtime/auxiliary/needs-unwind-immediate-abort.rs b/tests/ui/panic-runtime/auxiliary/needs-unwind-immediate-abort.rs
new file mode 100644
index 00000000000..295876fec52
--- /dev/null
+++ b/tests/ui/panic-runtime/auxiliary/needs-unwind-immediate-abort.rs
@@ -0,0 +1,18 @@
+//@ compile-flags:-C panic=unwind
+//@ no-prefer-dynamic
+//@ add-core-stubs
+
+#![crate_type = "rlib"]
+#![feature(no_core)]
+#![no_std]
+#![no_core]
+
+extern crate minicore;
+
+extern "C-unwind" fn foo() {}
+
+#[inline]
+fn bar() {
+    let ptr: extern "C-unwind" fn() = foo;
+    ptr();
+}
diff --git a/tests/ui/panic-runtime/bad-panic-flag1.rs b/tests/ui/panic-runtime/bad-panic-flag1.rs
index 117935847cb..575e30f785c 100644
--- a/tests/ui/panic-runtime/bad-panic-flag1.rs
+++ b/tests/ui/panic-runtime/bad-panic-flag1.rs
@@ -2,4 +2,4 @@
 
 fn main() {}
 
-//~? ERROR incorrect value `foo` for codegen option `panic` - either `unwind` or `abort` was expected
+//~? ERROR incorrect value `foo` for codegen option `panic` - either `unwind`, `abort`, or `immediate-abort` was expected
diff --git a/tests/ui/panic-runtime/bad-panic-flag1.stderr b/tests/ui/panic-runtime/bad-panic-flag1.stderr
index 013373c6f93..c30598bba53 100644
--- a/tests/ui/panic-runtime/bad-panic-flag1.stderr
+++ b/tests/ui/panic-runtime/bad-panic-flag1.stderr
@@ -1,2 +1,2 @@
-error: incorrect value `foo` for codegen option `panic` - either `unwind` or `abort` was expected
+error: incorrect value `foo` for codegen option `panic` - either `unwind`, `abort`, or `immediate-abort` was expected
 
diff --git a/tests/ui/panic-runtime/bad-panic-flag2.rs b/tests/ui/panic-runtime/bad-panic-flag2.rs
index b5d0442a033..4e34da217d7 100644
--- a/tests/ui/panic-runtime/bad-panic-flag2.rs
+++ b/tests/ui/panic-runtime/bad-panic-flag2.rs
@@ -2,4 +2,4 @@
 
 fn main() {}
 
-//~? ERROR codegen option `panic` requires either `unwind` or `abort`
+//~? ERROR codegen option `panic` requires either `unwind`, `abort`, or `immediate-abort`
diff --git a/tests/ui/panic-runtime/bad-panic-flag2.stderr b/tests/ui/panic-runtime/bad-panic-flag2.stderr
index 6ab94ea704d..c8d12749c5d 100644
--- a/tests/ui/panic-runtime/bad-panic-flag2.stderr
+++ b/tests/ui/panic-runtime/bad-panic-flag2.stderr
@@ -1,2 +1,2 @@
-error: codegen option `panic` requires either `unwind` or `abort` (C panic=<value>)
+error: codegen option `panic` requires either `unwind`, `abort`, or `immediate-abort` (C panic=<value>)
 
diff --git a/tests/ui/panic-runtime/immediate-abort-default-sysroot.rs b/tests/ui/panic-runtime/immediate-abort-default-sysroot.rs
new file mode 100644
index 00000000000..94dc7c5671e
--- /dev/null
+++ b/tests/ui/panic-runtime/immediate-abort-default-sysroot.rs
@@ -0,0 +1,15 @@
+//@ build-fail
+//@ aux-build:needs-unwind.rs
+//@ compile-flags:-C panic=immediate-abort -Zunstable-options
+//@ no-prefer-dynamic
+
+extern crate needs_unwind;
+
+// immediate-abort does not require any panic runtime, so trying to build a binary crate with
+// panic=immediate-abort and the precompiled sysroot will fail to link, because no panic runtime
+// provides the panic entrypoints used by sysroot crates.
+// This test ensures that we get a clean compile error instead of a linker error.
+
+fn main() {}
+
+//~? ERROR the crate `core` was compiled with a panic strategy which is incompatible with `immediate-abort`
diff --git a/tests/ui/panic-runtime/immediate-abort-default-sysroot.stderr b/tests/ui/panic-runtime/immediate-abort-default-sysroot.stderr
new file mode 100644
index 00000000000..bd6bdd8b667
--- /dev/null
+++ b/tests/ui/panic-runtime/immediate-abort-default-sysroot.stderr
@@ -0,0 +1,4 @@
+error: the crate `core` was compiled with a panic strategy which is incompatible with `immediate-abort`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/panic-runtime/lto-unwind.rs b/tests/ui/panic-runtime/lto-unwind.rs
index 93275052f85..bafc6d5aaa5 100644
--- a/tests/ui/panic-runtime/lto-unwind.rs
+++ b/tests/ui/panic-runtime/lto-unwind.rs
@@ -3,6 +3,7 @@
 //@ needs-unwind
 //@ no-prefer-dynamic
 //@ needs-subprocess
+//@ ignore-backends: gcc
 
 use std::process::Command;
 use std::env;
diff --git a/tests/ui/panic-runtime/need-abort-got-immediate-abort.rs b/tests/ui/panic-runtime/need-abort-got-immediate-abort.rs
new file mode 100644
index 00000000000..78977c60be9
--- /dev/null
+++ b/tests/ui/panic-runtime/need-abort-got-immediate-abort.rs
@@ -0,0 +1,21 @@
+//@ build-fail
+//@ aux-build:needs-abort.rs
+//@ compile-flags:-Cpanic=immediate-abort -Zunstable-options
+//@ no-prefer-dynamic
+//@ add-core-stubs
+//@ core-stubs-compile-flags: -Cpanic=immediate-abort -Zunstable-options
+
+#![feature(no_core)]
+#![no_std]
+#![no_main]
+#![no_core]
+
+extern crate minicore;
+extern crate needs_abort;
+
+#[no_mangle]
+extern "C" fn main(_argc: i32, _argv: *const *const u8) -> i32 {
+    0
+}
+
+//~? ERROR the crate `needs_abort` was compiled with a panic strategy which is incompatible with `immediate-abort`
diff --git a/tests/ui/panic-runtime/need-abort-got-immediate-abort.stderr b/tests/ui/panic-runtime/need-abort-got-immediate-abort.stderr
new file mode 100644
index 00000000000..65a26b676b9
--- /dev/null
+++ b/tests/ui/panic-runtime/need-abort-got-immediate-abort.stderr
@@ -0,0 +1,4 @@
+error: the crate `needs_abort` was compiled with a panic strategy which is incompatible with `immediate-abort`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/panic-runtime/need-immediate-abort-got-abort.rs b/tests/ui/panic-runtime/need-immediate-abort-got-abort.rs
new file mode 100644
index 00000000000..1c5f597a3f9
--- /dev/null
+++ b/tests/ui/panic-runtime/need-immediate-abort-got-abort.rs
@@ -0,0 +1,20 @@
+//@ build-fail
+//@ aux-build:needs-immediate-abort.rs
+//@ compile-flags:-C panic=abort
+//@ no-prefer-dynamic
+//@ add-core-stubs
+//@ core-stubs-compile-flags: -Zunstable-options -Cpanic=immediate-abort
+
+#![feature(no_core)]
+#![no_std]
+#![no_main]
+#![no_core]
+
+extern crate minicore;
+extern crate needs_immediate_abort;
+
+extern "C" fn main(argc: i32, argv: *const *const u8) -> i32 {
+    0
+}
+
+//~? ERROR the crate `need_immediate_abort_got_abort` was compiled with a panic strategy which is incompatible with `immediate-abort`
diff --git a/tests/ui/panic-runtime/need-immediate-abort-got-abort.stderr b/tests/ui/panic-runtime/need-immediate-abort-got-abort.stderr
new file mode 100644
index 00000000000..8dcf120cb9f
--- /dev/null
+++ b/tests/ui/panic-runtime/need-immediate-abort-got-abort.stderr
@@ -0,0 +1,4 @@
+error: the crate `need_immediate_abort_got_abort` was compiled with a panic strategy which is incompatible with `immediate-abort`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/panic-runtime/need-immediate-abort-got-unwind.rs b/tests/ui/panic-runtime/need-immediate-abort-got-unwind.rs
new file mode 100644
index 00000000000..24d521230d4
--- /dev/null
+++ b/tests/ui/panic-runtime/need-immediate-abort-got-unwind.rs
@@ -0,0 +1,20 @@
+//@ build-fail
+//@ needs-unwind
+//@ aux-build:needs-immediate-abort.rs
+//@ no-prefer-dynamic
+//@ add-core-stubs
+//@ core-stubs-compile-flags: -Zunstable-options -Cpanic=immediate-abort
+
+#![feature(no_core)]
+#![no_std]
+#![no_main]
+#![no_core]
+
+extern crate minicore;
+extern crate needs_immediate_abort;
+
+extern "C" fn main(argc: i32, argv: *const *const u8) -> i32 {
+    0
+}
+
+//~? ERROR the crate `need_immediate_abort_got_unwind` was compiled with a panic strategy which is incompatible with `immediate-abort`
diff --git a/tests/ui/panic-runtime/need-immediate-abort-got-unwind.stderr b/tests/ui/panic-runtime/need-immediate-abort-got-unwind.stderr
new file mode 100644
index 00000000000..740fc80a77d
--- /dev/null
+++ b/tests/ui/panic-runtime/need-immediate-abort-got-unwind.stderr
@@ -0,0 +1,4 @@
+error: the crate `need_immediate_abort_got_unwind` was compiled with a panic strategy which is incompatible with `immediate-abort`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/panic-runtime/need-unwind-got-immediate-abort.rs b/tests/ui/panic-runtime/need-unwind-got-immediate-abort.rs
new file mode 100644
index 00000000000..5aec028a46c
--- /dev/null
+++ b/tests/ui/panic-runtime/need-unwind-got-immediate-abort.rs
@@ -0,0 +1,21 @@
+//@ build-fail
+//@ aux-build:needs-unwind-immediate-abort.rs
+//@ compile-flags:-C panic=immediate-abort -Zunstable-options
+//@ no-prefer-dynamic
+//@ add-core-stubs
+//@ core-stubs-compile-flags: -Zunstable-options -Cpanic=immediate-abort
+
+#![feature(no_core)]
+#![no_std]
+#![no_main]
+#![no_core]
+
+extern crate minicore;
+extern crate needs_unwind_immediate_abort;
+
+#[no_mangle]
+extern "C" fn main(_argc: i32, _argv: *const *const u8) -> i32 {
+    0
+}
+
+//~? ERROR the crate `needs_unwind_immediate_abort` was compiled with a panic strategy which is incompatible with `immediate-abort`
diff --git a/tests/ui/panic-runtime/need-unwind-got-immediate-abort.stderr b/tests/ui/panic-runtime/need-unwind-got-immediate-abort.stderr
new file mode 100644
index 00000000000..8b3747d644f
--- /dev/null
+++ b/tests/ui/panic-runtime/need-unwind-got-immediate-abort.stderr
@@ -0,0 +1,4 @@
+error: the crate `needs_unwind_immediate_abort` was compiled with a panic strategy which is incompatible with `immediate-abort`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/panics/oom-panic-unwind.rs b/tests/ui/panics/oom-panic-unwind.rs
index 5974ad91406..4f7939ce60b 100644
--- a/tests/ui/panics/oom-panic-unwind.rs
+++ b/tests/ui/panics/oom-panic-unwind.rs
@@ -5,6 +5,7 @@
 //@ no-prefer-dynamic
 //@ needs-unwind
 //@ only-linux
+//@ ignore-backends: gcc
 
 use std::hint::black_box;
 use std::mem::forget;
diff --git a/tests/ui/panics/panic-abort-backtrace-without-debuginfo.rs b/tests/ui/panics/panic-abort-backtrace-without-debuginfo.rs
new file mode 100644
index 00000000000..a29afd68523
--- /dev/null
+++ b/tests/ui/panics/panic-abort-backtrace-without-debuginfo.rs
@@ -0,0 +1,57 @@
+//! Test that with `-C panic=abort` the backtrace is not cut off by default
+//! (i.e. without using `-C force-unwind-tables=yes`) by ensuring that our own
+//! functions are in the backtrace. If we just check one function it might be
+//! the last function, so make sure the backtrace can continue by checking for
+//! two functions. Regression test for
+//! <https://github.com/rust-lang/rust/issues/81902>.
+
+//@ run-pass
+//@ needs-subprocess
+// We want to test if unwind tables are emitted by default. We must make sure
+// to disable debuginfo to test that, because enabling debuginfo also means that
+// unwind tables are emitted, which prevents us from testing what we want.
+// We also need to set opt-level=0 to avoid optimizing away our functions.
+//@ compile-flags: -C panic=abort -C opt-level=0 -C debuginfo=0
+//@ no-prefer-dynamic
+//@ ignore-apple
+//@ ignore-arm-unknown-linux-gnueabihf FIXME(#146996) Try removing this once #146996 has been fixed.
+//@ ignore-msvc Backtraces on Windows requires debuginfo which we can't use here
+
+static FN_1: &str = "this_function_must_be_in_the_backtrace";
+fn this_function_must_be_in_the_backtrace() {
+    and_this_function_too();
+}
+
+static FN_2: &str = "and_this_function_too";
+fn and_this_function_too() {
+    panic!("generate panic backtrace");
+}
+
+fn run_test() {
+    let output = std::process::Command::new(std::env::current_exe().unwrap())
+        .arg("whatever")
+        .env("RUST_BACKTRACE", "full")
+        .output()
+        .unwrap();
+    let backtrace = std::str::from_utf8(&output.stderr).unwrap();
+
+    fn assert(function_name: &str, backtrace: &str) {
+        assert!(
+            backtrace.contains(function_name),
+            "ERROR: no `{}` in stderr! actual stderr: {}",
+            function_name,
+            backtrace
+        );
+    }
+    assert(FN_1, backtrace);
+    assert(FN_2, backtrace);
+}
+
+fn main() {
+    let args: Vec<String> = std::env::args().collect();
+    if args.len() == 1 {
+        run_test();
+    } else {
+        this_function_must_be_in_the_backtrace();
+    }
+}
diff --git a/tests/ui/panics/panic-handler-chain-update-hook.rs b/tests/ui/panics/panic-handler-chain-update-hook.rs
index 662ea9e978f..2ae79ad236e 100644
--- a/tests/ui/panics/panic-handler-chain-update-hook.rs
+++ b/tests/ui/panics/panic-handler-chain-update-hook.rs
@@ -3,6 +3,7 @@
 #![allow(stable_features)]
 
 //@ needs-threads
+//@ ignore-backends: gcc
 
 #![feature(std_panic)]
 #![feature(panic_update_hook)]
diff --git a/tests/ui/panics/panic-handler-chain.rs b/tests/ui/panics/panic-handler-chain.rs
index fea71ad9ec4..cc591c1d999 100644
--- a/tests/ui/panics/panic-handler-chain.rs
+++ b/tests/ui/panics/panic-handler-chain.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 #![allow(stable_features)]
 
 #![feature(std_panic)]
diff --git a/tests/ui/panics/panic-handler-flail-wildly.rs b/tests/ui/panics/panic-handler-flail-wildly.rs
index d42dfd68d9c..d5f5195d381 100644
--- a/tests/ui/panics/panic-handler-flail-wildly.rs
+++ b/tests/ui/panics/panic-handler-flail-wildly.rs
@@ -5,6 +5,7 @@
 #![allow(unused_must_use)]
 
 //@ needs-threads
+//@ ignore-backends: gcc
 
 #![feature(std_panic)]
 
diff --git a/tests/ui/panics/panic-handler-set-twice.rs b/tests/ui/panics/panic-handler-set-twice.rs
index 5f670d5f492..ca4ed65f568 100644
--- a/tests/ui/panics/panic-handler-set-twice.rs
+++ b/tests/ui/panics/panic-handler-set-twice.rs
@@ -6,6 +6,7 @@
 #![feature(std_panic)]
 
 //@ needs-threads
+//@ ignore-backends: gcc
 
 use std::sync::atomic::{AtomicUsize, Ordering};
 use std::panic;
diff --git a/tests/ui/panics/panic-in-dtor-drops-fields.rs b/tests/ui/panics/panic-in-dtor-drops-fields.rs
index 38eb6d0acfb..db079234337 100644
--- a/tests/ui/panics/panic-in-dtor-drops-fields.rs
+++ b/tests/ui/panics/panic-in-dtor-drops-fields.rs
@@ -4,6 +4,7 @@
 #![allow(non_upper_case_globals)]
 
 //@ needs-threads
+//@ ignore-backends: gcc
 
 use std::thread;
 
diff --git a/tests/ui/panics/panic-recover-propagate.rs b/tests/ui/panics/panic-recover-propagate.rs
index ef6ae4fd788..36ca279bdbd 100644
--- a/tests/ui/panics/panic-recover-propagate.rs
+++ b/tests/ui/panics/panic-recover-propagate.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 
 use std::sync::atomic::{AtomicUsize, Ordering};
 use std::panic;
diff --git a/tests/ui/panics/rvalue-cleanup-during-box-panic.rs b/tests/ui/panics/rvalue-cleanup-during-box-panic.rs
index 84c5d85d7e0..03571f111aa 100644
--- a/tests/ui/panics/rvalue-cleanup-during-box-panic.rs
+++ b/tests/ui/panics/rvalue-cleanup-during-box-panic.rs
@@ -21,6 +21,7 @@
 // scenario worth testing.
 
 //@ needs-threads
+//@ ignore-backends: gcc
 
 use std::thread;
 
diff --git a/tests/ui/panics/unwind-force-no-unwind-tables.rs b/tests/ui/panics/unwind-force-no-unwind-tables.rs
index 2226e4dd03e..715f288fff1 100644
--- a/tests/ui/panics/unwind-force-no-unwind-tables.rs
+++ b/tests/ui/panics/unwind-force-no-unwind-tables.rs
@@ -6,6 +6,7 @@
 //@ needs-unwind
 //@ ignore-windows target requires uwtable
 //@ compile-flags: -C panic=unwind -C force-unwind-tables=n
+//@ ignore-backends: gcc
 
 use std::panic::{self, AssertUnwindSafe};
 
diff --git a/tests/ui/parser/expr-as-stmt.fixed b/tests/ui/parser/expr-as-stmt.fixed
index bfae55047ed..b3a491200ed 100644
--- a/tests/ui/parser/expr-as-stmt.fixed
+++ b/tests/ui/parser/expr-as-stmt.fixed
@@ -66,7 +66,7 @@ fn asteroids() -> impl FnOnce() -> bool {
 
 // https://github.com/rust-lang/rust/issues/105179
 fn r#match() -> i32 {
-    ((match () { () => 1 })) + match () { () => 1 } //~ ERROR expected expression, found `+`
+    (match () { () => 1 }) + match () { () => 1 } //~ ERROR expected expression, found `+`
     //~^ ERROR mismatched types
 }
 
@@ -82,7 +82,7 @@ fn matches() -> bool {
     (match () { _ => true }) && match () { _ => true }; //~ ERROR mismatched types
     //~^ ERROR expected `;`, found keyword `match`
     (match () { _ => true }) && true; //~ ERROR mismatched types
-    ((match () { _ => true })) && true //~ ERROR mismatched types
+    (match () { _ => true }) && true //~ ERROR mismatched types
     //~^ ERROR mismatched types
 }
 fn main() {}
diff --git a/tests/ui/issues/issue-55587.rs b/tests/ui/parser/invalid-variable-definition-55587.rs
index d9100cf555b..f2c7c0a8e6c 100644
--- a/tests/ui/issues/issue-55587.rs
+++ b/tests/ui/parser/invalid-variable-definition-55587.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/55587
 use std::path::Path;
 
 fn main() {
diff --git a/tests/ui/issues/issue-55587.stderr b/tests/ui/parser/invalid-variable-definition-55587.stderr
index 7a5d0e28100..08c951582e3 100644
--- a/tests/ui/issues/issue-55587.stderr
+++ b/tests/ui/parser/invalid-variable-definition-55587.stderr
@@ -1,5 +1,5 @@
 error[E0164]: expected tuple struct or tuple variant, found associated function `Path::new`
-  --> $DIR/issue-55587.rs:4:9
+  --> $DIR/invalid-variable-definition-55587.rs:5:9
    |
 LL |     let Path::new();
    |         ^^^^^^^^^^^ `fn` calls are not allowed in patterns
diff --git a/tests/ui/parser/issues/issue-87086-colon-path-sep.rs b/tests/ui/parser/issues/issue-87086-colon-path-sep.rs
index d081c06044f..e1ea38f2795 100644
--- a/tests/ui/parser/issues/issue-87086-colon-path-sep.rs
+++ b/tests/ui/parser/issues/issue-87086-colon-path-sep.rs
@@ -37,10 +37,9 @@ fn g1() {
         //~| HELP: maybe write a path separator here
         _ => {}
     }
-    if let Foo:Bar = f() { //~ WARN: irrefutable `if let` pattern
+    if let Foo:Bar = f() {
     //~^ ERROR: expected one of
     //~| HELP: maybe write a path separator here
-    //~| HELP: consider replacing the `if let` with a `let`
     }
 }
 
diff --git a/tests/ui/parser/issues/issue-87086-colon-path-sep.stderr b/tests/ui/parser/issues/issue-87086-colon-path-sep.stderr
index a9bad96f9af..061586882e0 100644
--- a/tests/ui/parser/issues/issue-87086-colon-path-sep.stderr
+++ b/tests/ui/parser/issues/issue-87086-colon-path-sep.stderr
@@ -64,7 +64,7 @@ LL |     if let Foo::Bar = f() {
    |                +
 
 error: expected one of `@` or `|`, found `:`
-  --> $DIR/issue-87086-colon-path-sep.rs:49:16
+  --> $DIR/issue-87086-colon-path-sep.rs:48:16
    |
 LL |         ref qux: Foo::Baz => {}
    |                ^ -------- specifying the type of a pattern isn't supported
@@ -77,7 +77,7 @@ LL |         ref qux::Foo::Baz => {}
    |                ~~
 
 error: expected one of `@` or `|`, found `:`
-  --> $DIR/issue-87086-colon-path-sep.rs:58:16
+  --> $DIR/issue-87086-colon-path-sep.rs:57:16
    |
 LL |         mut qux: Foo::Baz => {}
    |                ^ -------- specifying the type of a pattern isn't supported
@@ -90,7 +90,7 @@ LL |         mut qux::Foo::Baz => {}
    |                ~~
 
 error: expected one of `@` or `|`, found `:`
-  --> $DIR/issue-87086-colon-path-sep.rs:69:12
+  --> $DIR/issue-87086-colon-path-sep.rs:68:12
    |
 LL |         Foo:Bar::Baz => {}
    |            ^-------- specifying the type of a pattern isn't supported
@@ -103,7 +103,7 @@ LL |         Foo::Bar::Baz => {}
    |             +
 
 error: expected one of `@` or `|`, found `:`
-  --> $DIR/issue-87086-colon-path-sep.rs:75:12
+  --> $DIR/issue-87086-colon-path-sep.rs:74:12
    |
 LL |         Foo:Bar => {}
    |            ^--- specifying the type of a pattern isn't supported
@@ -115,15 +115,5 @@ help: maybe write a path separator here
 LL |         Foo::Bar => {}
    |             +
 
-warning: irrefutable `if let` pattern
-  --> $DIR/issue-87086-colon-path-sep.rs:40:8
-   |
-LL |     if let Foo:Bar = f() {
-   |        ^^^^^^^^^^^^^^^^^
-   |
-   = note: this pattern will always match, so the `if let` is useless
-   = help: consider replacing the `if let` with a `let`
-   = note: `#[warn(irrefutable_let_patterns)]` on by default
-
-error: aborting due to 9 previous errors; 1 warning emitted
+error: aborting due to 9 previous errors
 
diff --git a/tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.rs b/tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.rs
index 461890e63e3..c82efe79e4d 100644
--- a/tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.rs
+++ b/tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: issue-89971-outer-attr-following-inner-attr-ice.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate issue_89971_outer_attr_following_inner_attr_ice;
diff --git a/tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.stderr b/tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.stderr
index 51df17c7cc6..392e7d0321f 100644
--- a/tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.stderr
+++ b/tests/ui/parser/issues/issue-89971-outer-attr-following-inner-attr-ice.stderr
@@ -1,5 +1,5 @@
 error: an inner attribute is not permitted in this context
-  --> $DIR/issue-89971-outer-attr-following-inner-attr-ice.rs:11:1
+  --> $DIR/issue-89971-outer-attr-following-inner-attr-ice.rs:12:1
    |
 LL | #![deny(missing_docs)]
    | ^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/parser/macro/bad-macro-definition.rs b/tests/ui/parser/macro/bad-macro-definition.rs
index 3c5c93ea3b3..12df6e64bd2 100644
--- a/tests/ui/parser/macro/bad-macro-definition.rs
+++ b/tests/ui/parser/macro/bad-macro-definition.rs
@@ -20,3 +20,6 @@ macro_rules! e { {} }
 
 macro_rules! f {}
 //~^ ERROR: macros must contain at least one rule
+
+macro_rules! g { unsafe {} => {} }
+//~^ ERROR: `unsafe` is only supported on `attr` rules
diff --git a/tests/ui/parser/macro/bad-macro-definition.stderr b/tests/ui/parser/macro/bad-macro-definition.stderr
index de6d9d6a38b..d15f33f708d 100644
--- a/tests/ui/parser/macro/bad-macro-definition.stderr
+++ b/tests/ui/parser/macro/bad-macro-definition.stderr
@@ -52,5 +52,11 @@ error: macros must contain at least one rule
 LL | macro_rules! f {}
    | ^^^^^^^^^^^^^^^^^
 
-error: aborting due to 9 previous errors
+error: `unsafe` is only supported on `attr` rules
+  --> $DIR/bad-macro-definition.rs:24:18
+   |
+LL | macro_rules! g { unsafe {} => {} }
+   |                  ^^^^^^
+
+error: aborting due to 10 previous errors
 
diff --git a/tests/ui/parser/macro/macro-attr-bad.rs b/tests/ui/parser/macro/macro-attr-bad.rs
index 9f50b057a7a..0ac46c8b768 100644
--- a/tests/ui/parser/macro/macro-attr-bad.rs
+++ b/tests/ui/parser/macro/macro-attr-bad.rs
@@ -13,6 +13,12 @@ macro_rules! attr_incomplete_3 { attr() {} }
 macro_rules! attr_incomplete_4 { attr() {} => }
 //~^ ERROR macro definition ended unexpectedly
 
+macro_rules! attr_incomplete_5 { unsafe }
+//~^ ERROR macro definition ended unexpectedly
+
+macro_rules! attr_incomplete_6 { unsafe attr }
+//~^ ERROR macro definition ended unexpectedly
+
 macro_rules! attr_noparens_1 { attr{} {} => {} }
 //~^ ERROR `attr` rule argument matchers require parentheses
 
diff --git a/tests/ui/parser/macro/macro-attr-bad.stderr b/tests/ui/parser/macro/macro-attr-bad.stderr
index bf0ed13cd55..481ef8118ae 100644
--- a/tests/ui/parser/macro/macro-attr-bad.stderr
+++ b/tests/ui/parser/macro/macro-attr-bad.stderr
@@ -22,8 +22,20 @@ error: macro definition ended unexpectedly
 LL | macro_rules! attr_incomplete_4 { attr() {} => }
    |                                              ^ expected right-hand side of macro rule
 
+error: macro definition ended unexpectedly
+  --> $DIR/macro-attr-bad.rs:16:40
+   |
+LL | macro_rules! attr_incomplete_5 { unsafe }
+   |                                        ^ expected `attr`
+
+error: macro definition ended unexpectedly
+  --> $DIR/macro-attr-bad.rs:19:45
+   |
+LL | macro_rules! attr_incomplete_6 { unsafe attr }
+   |                                             ^ expected macro attr args
+
 error: `attr` rule argument matchers require parentheses
-  --> $DIR/macro-attr-bad.rs:16:36
+  --> $DIR/macro-attr-bad.rs:22:36
    |
 LL | macro_rules! attr_noparens_1 { attr{} {} => {} }
    |                                    ^^
@@ -35,7 +47,7 @@ LL + macro_rules! attr_noparens_1 { attr() {} => {} }
    |
 
 error: `attr` rule argument matchers require parentheses
-  --> $DIR/macro-attr-bad.rs:19:36
+  --> $DIR/macro-attr-bad.rs:25:36
    |
 LL | macro_rules! attr_noparens_2 { attr[] {} => {} }
    |                                    ^^
@@ -47,13 +59,13 @@ LL + macro_rules! attr_noparens_2 { attr() {} => {} }
    |
 
 error: invalid macro matcher; matchers must be contained in balanced delimiters
-  --> $DIR/macro-attr-bad.rs:22:37
+  --> $DIR/macro-attr-bad.rs:28:37
    |
 LL | macro_rules! attr_noparens_3 { attr _ {} => {} }
    |                                     ^
 
 error: duplicate matcher binding
-  --> $DIR/macro-attr-bad.rs:25:52
+  --> $DIR/macro-attr-bad.rs:31:52
    |
 LL | macro_rules! attr_dup_matcher_1 { attr() {$x:ident $x:ident} => {} }
    |                                           -------- ^^^^^^^^ duplicate binding
@@ -61,7 +73,7 @@ LL | macro_rules! attr_dup_matcher_1 { attr() {$x:ident $x:ident} => {} }
    |                                           previous binding
 
 error: duplicate matcher binding
-  --> $DIR/macro-attr-bad.rs:28:49
+  --> $DIR/macro-attr-bad.rs:34:49
    |
 LL | macro_rules! attr_dup_matcher_2 { attr($x:ident $x:ident) {} => {} }
    |                                        -------- ^^^^^^^^ duplicate binding
@@ -69,12 +81,12 @@ LL | macro_rules! attr_dup_matcher_2 { attr($x:ident $x:ident) {} => {} }
    |                                        previous binding
 
 error: duplicate matcher binding
-  --> $DIR/macro-attr-bad.rs:31:51
+  --> $DIR/macro-attr-bad.rs:37:51
    |
 LL | macro_rules! attr_dup_matcher_3 { attr($x:ident) {$x:ident} => {} }
    |                                        --------   ^^^^^^^^ duplicate binding
    |                                        |
    |                                        previous binding
 
-error: aborting due to 10 previous errors
+error: aborting due to 12 previous errors
 
diff --git a/tests/ui/parser/macro/macro-derive-bad.rs b/tests/ui/parser/macro/macro-derive-bad.rs
index 79b9eb8c113..74e7d9acdaf 100644
--- a/tests/ui/parser/macro/macro-derive-bad.rs
+++ b/tests/ui/parser/macro/macro-derive-bad.rs
@@ -41,3 +41,6 @@ macro_rules! derive_dup_matcher { derive() {$x:ident $x:ident} => {} }
 //~^ ERROR duplicate matcher binding
 //~| NOTE duplicate binding
 //~| NOTE previous binding
+
+macro_rules! derive_unsafe { unsafe derive() {} => {} }
+//~^ ERROR `unsafe` is only supported on `attr` rules
diff --git a/tests/ui/parser/macro/macro-derive-bad.stderr b/tests/ui/parser/macro/macro-derive-bad.stderr
index ec750c9ac82..c98535f4031 100644
--- a/tests/ui/parser/macro/macro-derive-bad.stderr
+++ b/tests/ui/parser/macro/macro-derive-bad.stderr
@@ -86,5 +86,11 @@ LL | macro_rules! derive_dup_matcher { derive() {$x:ident $x:ident} => {} }
    |                                             |
    |                                             previous binding
 
-error: aborting due to 12 previous errors
+error: `unsafe` is only supported on `attr` rules
+  --> $DIR/macro-derive-bad.rs:45:30
+   |
+LL | macro_rules! derive_unsafe { unsafe derive() {} => {} }
+   |                              ^^^^^^
+
+error: aborting due to 13 previous errors
 
diff --git a/tests/ui/parser/macro/unicode-control-codepoints-macros.rs b/tests/ui/parser/macro/unicode-control-codepoints-macros.rs
index 775c5077976..701e7dfa30a 100644
--- a/tests/ui/parser/macro/unicode-control-codepoints-macros.rs
+++ b/tests/ui/parser/macro/unicode-control-codepoints-macros.rs
@@ -1,6 +1,7 @@
 // Regression test for #140281
 //@ edition: 2021
 //@ proc-macro: unicode-control.rs
+//@ ignore-backends: gcc
 
 extern crate unicode_control;
 use unicode_control::*;
diff --git a/tests/ui/parser/macro/unicode-control-codepoints-macros.stderr b/tests/ui/parser/macro/unicode-control-codepoints-macros.stderr
index ca813399eac..22fb1b945c6 100644
--- a/tests/ui/parser/macro/unicode-control-codepoints-macros.stderr
+++ b/tests/ui/parser/macro/unicode-control-codepoints-macros.stderr
@@ -1,5 +1,5 @@
 error: unicode codepoint changing visible direction of text present in doc comment
-  --> $DIR/unicode-control-codepoints-macros.rs:20:9
+  --> $DIR/unicode-control-codepoints-macros.rs:21:9
    |
 LL |         /// �test� RTL in doc in vec
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this doc comment contains invisible unicode text flow control codepoints
@@ -10,7 +10,7 @@ LL |         /// �test� RTL in doc in vec
    = note: `#[deny(text_direction_codepoint_in_literal)]` on by default
 
 error: unicode codepoint changing visible direction of text present in doc comment
-  --> $DIR/unicode-control-codepoints-macros.rs:25:9
+  --> $DIR/unicode-control-codepoints-macros.rs:26:9
    |
 LL | /         /**
 LL | |          * �test� RTL in doc in macro
@@ -22,7 +22,7 @@ LL | |          */
    = note: if you want to keep them but make them visible in your source code, you can escape them: '\u{202e}', '\u{2066}'
 
 error: unicode codepoint changing visible direction of text present in doc comment
-  --> $DIR/unicode-control-codepoints-macros.rs:32:9
+  --> $DIR/unicode-control-codepoints-macros.rs:33:9
    |
 LL | /         /**
 LL | |          * �test� RTL in doc in macro
@@ -34,7 +34,7 @@ LL | |          */
    = note: if you want to keep them but make them visible in your source code, you can escape them: '\u{202e}', '\u{2066}'
 
 error: unicode codepoint changing visible direction of text present in doc comment
-  --> $DIR/unicode-control-codepoints-macros.rs:40:9
+  --> $DIR/unicode-control-codepoints-macros.rs:41:9
    |
 LL |         /// �test� RTL in doc in proc macro
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this doc comment contains invisible unicode text flow control codepoints
@@ -44,7 +44,7 @@ LL |         /// �test� RTL in doc in proc macro
    = note: if you want to keep them but make them visible in your source code, you can escape them: '\u{202e}', '\u{2066}'
 
 error: unicode codepoint changing visible direction of text present in doc comment
-  --> $DIR/unicode-control-codepoints-macros.rs:45:9
+  --> $DIR/unicode-control-codepoints-macros.rs:46:9
    |
 LL |         /// �test� RTL in doc in proc macro
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this doc comment contains invisible unicode text flow control codepoints
diff --git a/tests/ui/parser/match-arm-without-body.rs b/tests/ui/parser/match-arm-without-body.rs
index 4723abff8b6..7fe5b6d2539 100644
--- a/tests/ui/parser/match-arm-without-body.rs
+++ b/tests/ui/parser/match-arm-without-body.rs
@@ -17,13 +17,13 @@ fn main() {
         Some(_),
         //~^ ERROR unexpected `,` in pattern
         //~| HELP try adding parentheses to match on a tuple
-        //~| HELP or a vertical bar to match on multiple alternatives
+        //~| HELP or a vertical bar to match on alternative
     }
     match Some(false) {
         Some(_),
         //~^ ERROR unexpected `,` in pattern
         //~| HELP try adding parentheses to match on a tuple
-        //~| HELP or a vertical bar to match on multiple alternatives
+        //~| HELP or a vertical bar to match on alternative
         _ => {}
     }
     match Some(false) {
diff --git a/tests/ui/parser/match-arm-without-body.stderr b/tests/ui/parser/match-arm-without-body.stderr
index a65875b787a..59a323f2cc1 100644
--- a/tests/ui/parser/match-arm-without-body.stderr
+++ b/tests/ui/parser/match-arm-without-body.stderr
@@ -16,7 +16,7 @@ help: try adding parentheses to match on a tuple...
    |
 LL |         (Some(_),)
    |         +        +
-help: ...or a vertical bar to match on multiple alternatives
+help: ...or a vertical bar to match on alternatives
    |
 LL -         Some(_),
 LL +         Some(_) |
@@ -36,13 +36,10 @@ LL |
 LL |
 LL ~         _) => {}
    |
-help: ...or a vertical bar to match on multiple alternatives
+help: ...or a vertical bar to match on alternatives
    |
-LL ~         Some(_) |
-LL +
-LL +
-LL +
-LL ~         _ => {}
+LL -         Some(_),
+LL +         Some(_) |
    |
 
 error: expected one of `.`, `=>`, `?`, or an operator, found reserved identifier `_`
diff --git a/tests/ui/parser/tuple-index-suffix-proc-macro.rs b/tests/ui/parser/tuple-index-suffix-proc-macro.rs
index 557c67738d3..2463897381e 100644
--- a/tests/ui/parser/tuple-index-suffix-proc-macro.rs
+++ b/tests/ui/parser/tuple-index-suffix-proc-macro.rs
@@ -3,6 +3,7 @@
 //! Like `tuple-index-suffix.rs`, but exercises the proc-macro interaction.
 
 //@ proc-macro: tuple-index-suffix-proc-macro-aux.rs
+//@ ignore-backends: gcc
 
 extern crate tuple_index_suffix_proc_macro_aux;
 use tuple_index_suffix_proc_macro_aux as aux;
diff --git a/tests/ui/parser/tuple-index-suffix-proc-macro.stderr b/tests/ui/parser/tuple-index-suffix-proc-macro.stderr
index 47d179d3555..a242af5a789 100644
--- a/tests/ui/parser/tuple-index-suffix-proc-macro.stderr
+++ b/tests/ui/parser/tuple-index-suffix-proc-macro.stderr
@@ -1,23 +1,23 @@
 error: suffixes on a tuple index are invalid
-  --> $DIR/tuple-index-suffix-proc-macro.rs:17:28
+  --> $DIR/tuple-index-suffix-proc-macro.rs:18:28
    |
 LL |     aux::bad_tup_indexing!(0usize);
    |                            ^^^^^^ invalid suffix `usize`
 
 error: suffixes on a tuple index are invalid
-  --> $DIR/tuple-index-suffix-proc-macro.rs:19:47
+  --> $DIR/tuple-index-suffix-proc-macro.rs:20:47
    |
 LL |     aux::bad_tup_struct_indexing!(tup_struct, 0isize);
    |                                               ^^^^^^ invalid suffix `isize`
 
 error: suffixes on a tuple index are invalid
-  --> $DIR/tuple-index-suffix-proc-macro.rs:24:28
+  --> $DIR/tuple-index-suffix-proc-macro.rs:25:28
    |
 LL |     aux::bad_tup_indexing!(0u8);
    |                            ^^^ invalid suffix `u8`
 
 error: suffixes on a tuple index are invalid
-  --> $DIR/tuple-index-suffix-proc-macro.rs:26:47
+  --> $DIR/tuple-index-suffix-proc-macro.rs:27:47
    |
 LL |     aux::bad_tup_struct_indexing!(tup_struct, 0u64);
    |                                               ^^^^ invalid suffix `u64`
diff --git a/tests/ui/parser/type-ascription-in-pattern.rs b/tests/ui/parser/type-ascription-in-pattern.rs
index 18d7061d69c..75059d33db6 100644
--- a/tests/ui/parser/type-ascription-in-pattern.rs
+++ b/tests/ui/parser/type-ascription-in-pattern.rs
@@ -1,15 +1,16 @@
 fn foo(x: bool) -> i32 {
-    match x { //~ ERROR struct literals are not allowed here
-        x: i32 => x, //~ ERROR expected
-        true => 42., //~ ERROR expected identifier
-        false => 0.333, //~ ERROR expected identifier
+    match x {
+        x: i32 => x, //~ ERROR: expected
+        //~^ ERROR: mismatched types
+        true => 42.,
+        false => 0.333,
     }
-} //~ ERROR expected one of
+}
 
 fn main() {
     match foo(true) {
-        42: i32 => (), //~ ERROR expected
-        _: f64 => (), //~ ERROR expected
-        x: i32 => (), //~ ERROR expected
+        42: i32 => (), //~ ERROR: expected
+        _: f64 => (), //~ ERROR: expected
+        x: i32 => (), //~ ERROR: expected
     }
 }
diff --git a/tests/ui/parser/type-ascription-in-pattern.stderr b/tests/ui/parser/type-ascription-in-pattern.stderr
index 135879f208b..09190754993 100644
--- a/tests/ui/parser/type-ascription-in-pattern.stderr
+++ b/tests/ui/parser/type-ascription-in-pattern.stderr
@@ -1,64 +1,18 @@
-error: expected one of `!`, `,`, `.`, `::`, `?`, `{`, `}`, or an operator, found `=>`
-  --> $DIR/type-ascription-in-pattern.rs:3:16
-   |
-LL |     match x {
-   |           - while parsing this struct
-LL |         x: i32 => x,
-   |               -^^ expected one of 8 possible tokens
-   |               |
-   |               help: try adding a comma: `,`
-
-error: expected identifier, found keyword `true`
-  --> $DIR/type-ascription-in-pattern.rs:4:9
-   |
-LL |     match x {
-   |           - while parsing this struct
-LL |         x: i32 => x,
-LL |         true => 42.,
-   |         ^^^^ expected identifier, found keyword
-
-error: expected identifier, found keyword `false`
-  --> $DIR/type-ascription-in-pattern.rs:5:9
-   |
-LL |     match x {
-   |           - while parsing this struct
-...
-LL |         false => 0.333,
-   |         ^^^^^ expected identifier, found keyword
-
-error: struct literals are not allowed here
-  --> $DIR/type-ascription-in-pattern.rs:2:11
-   |
-LL |       match x {
-   |  ___________^
-LL | |         x: i32 => x,
-LL | |         true => 42.,
-LL | |         false => 0.333,
-LL | |     }
-   | |_____^
-   |
-help: surround the struct literal with parentheses
+error: expected one of `@` or `|`, found `:`
+  --> $DIR/type-ascription-in-pattern.rs:3:10
    |
-LL ~     match (x {
 LL |         x: i32 => x,
-LL |         true => 42.,
-LL |         false => 0.333,
-LL ~     })
+   |          ^ --- specifying the type of a pattern isn't supported
+   |          |
+   |          expected one of `@` or `|`
    |
-
-error: expected one of `.`, `?`, `{`, or an operator, found `}`
-  --> $DIR/type-ascription-in-pattern.rs:7:1
+help: maybe write a path separator here
    |
-LL |     match x {
-   |     ----- while parsing this `match` expression
-...
-LL |     }
-   |      - expected one of `.`, `?`, `{`, or an operator
-LL | }
-   | ^ unexpected token
+LL |         x::i32 => x,
+   |          ~~
 
 error: expected one of `...`, `..=`, `..`, or `|`, found `:`
-  --> $DIR/type-ascription-in-pattern.rs:11:11
+  --> $DIR/type-ascription-in-pattern.rs:12:11
    |
 LL |         42: i32 => (),
    |           ^ --- specifying the type of a pattern isn't supported
@@ -66,7 +20,7 @@ LL |         42: i32 => (),
    |           expected one of `...`, `..=`, `..`, or `|`
 
 error: expected `|`, found `:`
-  --> $DIR/type-ascription-in-pattern.rs:12:10
+  --> $DIR/type-ascription-in-pattern.rs:13:10
    |
 LL |         _: f64 => (),
    |          ^ --- specifying the type of a pattern isn't supported
@@ -74,7 +28,7 @@ LL |         _: f64 => (),
    |          expected `|`
 
 error: expected one of `@` or `|`, found `:`
-  --> $DIR/type-ascription-in-pattern.rs:13:10
+  --> $DIR/type-ascription-in-pattern.rs:14:10
    |
 LL |         x: i32 => (),
    |          ^ --- specifying the type of a pattern isn't supported
@@ -86,5 +40,15 @@ help: maybe write a path separator here
 LL |         x::i32 => (),
    |          ~~
 
-error: aborting due to 8 previous errors
+error[E0308]: mismatched types
+  --> $DIR/type-ascription-in-pattern.rs:3:19
+   |
+LL | fn foo(x: bool) -> i32 {
+   |                    --- expected `i32` because of return type
+LL |     match x {
+LL |         x: i32 => x,
+   |                   ^ expected `i32`, found `bool`
+
+error: aborting due to 5 previous errors
 
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/parser/variadic-ffi-semantic-restrictions.rs b/tests/ui/parser/variadic-ffi-semantic-restrictions.rs
index 4db056f15a5..415472176d9 100644
--- a/tests/ui/parser/variadic-ffi-semantic-restrictions.rs
+++ b/tests/ui/parser/variadic-ffi-semantic-restrictions.rs
@@ -53,30 +53,30 @@ struct X;
 
 impl X {
     fn i_f1(x: isize, ...) {}
-    //~^ ERROR associated functions cannot have a C variable argument list
+    //~^ ERROR `...` is not supported for non-extern functions
     fn i_f2(...) {}
-    //~^ ERROR associated functions cannot have a C variable argument list
+    //~^ ERROR `...` is not supported for non-extern functions
     fn i_f3(..., x: isize, ...) {}
-    //~^ ERROR associated functions cannot have a C variable argument list
+    //~^ ERROR `...` is not supported for non-extern functions
     //~| ERROR `...` must be the last argument of a C-variadic function
     fn i_f4(..., x: isize, ...) {}
-    //~^ ERROR associated functions cannot have a C variable argument list
+    //~^ ERROR `...` is not supported for non-extern functions
     //~| ERROR `...` must be the last argument of a C-variadic function
     const fn i_f5(x: isize, ...) {}
-    //~^ ERROR associated functions cannot have a C variable argument list
+    //~^ ERROR `...` is not supported for non-extern functions
     //~| ERROR functions cannot be both `const` and C-variadic
     //~| ERROR destructor of `VaListImpl<'_>` cannot be evaluated at compile-time
 }
 
 trait T {
     fn t_f1(x: isize, ...) {}
-    //~^ ERROR associated functions cannot have a C variable argument list
+    //~^ ERROR `...` is not supported for non-extern functions
     fn t_f2(x: isize, ...);
-    //~^ ERROR associated functions cannot have a C variable argument list
+    //~^ ERROR `...` is not supported for non-extern functions
     fn t_f3(...) {}
-    //~^ ERROR associated functions cannot have a C variable argument list
+    //~^ ERROR `...` is not supported for non-extern functions
     fn t_f4(...);
-    //~^ ERROR associated functions cannot have a C variable argument list
+    //~^ ERROR `...` is not supported for non-extern functions
     fn t_f5(..., x: isize) {}
     //~^ ERROR `...` must be the last argument of a C-variadic function
     fn t_f6(..., x: isize);
diff --git a/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr b/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr
index 0cd78318de6..da9c9b0f760 100644
--- a/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr
+++ b/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr
@@ -132,17 +132,21 @@ error: `...` must be the last argument of a C-variadic function
 LL |     fn e_f2(..., x: isize);
    |             ^^^
 
-error: associated functions cannot have a C variable argument list
+error: `...` is not supported for non-extern functions
   --> $DIR/variadic-ffi-semantic-restrictions.rs:55:23
    |
 LL |     fn i_f1(x: isize, ...) {}
    |                       ^^^
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
-error: associated functions cannot have a C variable argument list
+error: `...` is not supported for non-extern functions
   --> $DIR/variadic-ffi-semantic-restrictions.rs:57:13
    |
 LL |     fn i_f2(...) {}
    |             ^^^
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
 error: `...` must be the last argument of a C-variadic function
   --> $DIR/variadic-ffi-semantic-restrictions.rs:59:13
@@ -150,11 +154,13 @@ error: `...` must be the last argument of a C-variadic function
 LL |     fn i_f3(..., x: isize, ...) {}
    |             ^^^
 
-error: associated functions cannot have a C variable argument list
+error: `...` is not supported for non-extern functions
   --> $DIR/variadic-ffi-semantic-restrictions.rs:59:28
    |
 LL |     fn i_f3(..., x: isize, ...) {}
    |                            ^^^
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
 error: `...` must be the last argument of a C-variadic function
   --> $DIR/variadic-ffi-semantic-restrictions.rs:62:13
@@ -162,11 +168,13 @@ error: `...` must be the last argument of a C-variadic function
 LL |     fn i_f4(..., x: isize, ...) {}
    |             ^^^
 
-error: associated functions cannot have a C variable argument list
+error: `...` is not supported for non-extern functions
   --> $DIR/variadic-ffi-semantic-restrictions.rs:62:28
    |
 LL |     fn i_f4(..., x: isize, ...) {}
    |                            ^^^
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
 error: functions cannot be both `const` and C-variadic
   --> $DIR/variadic-ffi-semantic-restrictions.rs:65:5
@@ -176,35 +184,45 @@ LL |     const fn i_f5(x: isize, ...) {}
    |     |
    |     `const` because of this
 
-error: associated functions cannot have a C variable argument list
+error: `...` is not supported for non-extern functions
   --> $DIR/variadic-ffi-semantic-restrictions.rs:65:29
    |
 LL |     const fn i_f5(x: isize, ...) {}
    |                             ^^^
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
-error: associated functions cannot have a C variable argument list
+error: `...` is not supported for non-extern functions
   --> $DIR/variadic-ffi-semantic-restrictions.rs:72:23
    |
 LL |     fn t_f1(x: isize, ...) {}
    |                       ^^^
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
-error: associated functions cannot have a C variable argument list
+error: `...` is not supported for non-extern functions
   --> $DIR/variadic-ffi-semantic-restrictions.rs:74:23
    |
 LL |     fn t_f2(x: isize, ...);
    |                       ^^^
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
-error: associated functions cannot have a C variable argument list
+error: `...` is not supported for non-extern functions
   --> $DIR/variadic-ffi-semantic-restrictions.rs:76:13
    |
 LL |     fn t_f3(...) {}
    |             ^^^
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
-error: associated functions cannot have a C variable argument list
+error: `...` is not supported for non-extern functions
   --> $DIR/variadic-ffi-semantic-restrictions.rs:78:13
    |
 LL |     fn t_f4(...);
    |             ^^^
+   |
+   = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
 
 error: `...` must be the last argument of a C-variadic function
   --> $DIR/variadic-ffi-semantic-restrictions.rs:80:13
diff --git a/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr
index 7caee64a33f..099d6e86243 100644
--- a/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr
+++ b/tests/ui/pattern/usefulness/integer-ranges/pointer-sized-int.deny.stderr
@@ -5,7 +5,7 @@ LL |     match 0usize {
    |           ^^^^^^ pattern `usize::MAX..` not covered
    |
    = note: the matched value is of type `usize`
-   = note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
+   = note: `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
 LL ~         0..=usize::MAX => {},
@@ -19,7 +19,7 @@ LL |     match 0isize {
    |           ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
    |
    = note: the matched value is of type `isize`
-   = note: `isize` does not have fixed minimum and maximum values, so half-open ranges are necessary to match exhaustively
+   = note: `isize::MIN` and `isize::MAX` are not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
    |
 LL ~         isize::MIN..=isize::MAX => {},
@@ -33,7 +33,7 @@ LL |     m!(0usize, 0..=usize::MAX);
    |        ^^^^^^ pattern `usize::MAX..` not covered
    |
    = note: the matched value is of type `usize`
-   = note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
+   = note: `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
 LL |         match $s { $($t)+ => {}, usize::MAX.. => todo!() }
@@ -46,7 +46,7 @@ LL |     m!(0usize, 0..5 | 5..=usize::MAX);
    |        ^^^^^^ pattern `usize::MAX..` not covered
    |
    = note: the matched value is of type `usize`
-   = note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
+   = note: `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
 LL |         match $s { $($t)+ => {}, usize::MAX.. => todo!() }
@@ -59,7 +59,7 @@ LL |     m!(0usize, 0..usize::MAX | usize::MAX);
    |        ^^^^^^ pattern `usize::MAX..` not covered
    |
    = note: the matched value is of type `usize`
-   = note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
+   = note: `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
 LL |         match $s { $($t)+ => {}, usize::MAX.. => todo!() }
@@ -72,7 +72,7 @@ LL |     m!((0usize, true), (0..5, true) | (5..=usize::MAX, true) | (0..=usize::
    |        ^^^^^^^^^^^^^^ pattern `(usize::MAX.., _)` not covered
    |
    = note: the matched value is of type `(usize, bool)`
-   = note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
+   = note: `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
 LL |         match $s { $($t)+ => {}, (usize::MAX.., _) => todo!() }
@@ -85,7 +85,7 @@ LL |     m!(0isize, isize::MIN..=isize::MAX);
    |        ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
    |
    = note: the matched value is of type `isize`
-   = note: `isize` does not have fixed minimum and maximum values, so half-open ranges are necessary to match exhaustively
+   = note: `isize::MIN` and `isize::MAX` are not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
    |
 LL |         match $s { $($t)+ => {}, ..isize::MIN | isize::MAX.. => todo!() }
@@ -98,7 +98,7 @@ LL |     m!(0isize, isize::MIN..5 | 5..=isize::MAX);
    |        ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
    |
    = note: the matched value is of type `isize`
-   = note: `isize` does not have fixed minimum and maximum values, so half-open ranges are necessary to match exhaustively
+   = note: `isize::MIN` and `isize::MAX` are not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
    |
 LL |         match $s { $($t)+ => {}, ..isize::MIN | isize::MAX.. => todo!() }
@@ -111,7 +111,7 @@ LL |     m!(0isize, isize::MIN..=-1 | 0 | 1..=isize::MAX);
    |        ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
    |
    = note: the matched value is of type `isize`
-   = note: `isize` does not have fixed minimum and maximum values, so half-open ranges are necessary to match exhaustively
+   = note: `isize::MIN` and `isize::MAX` are not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
    |
 LL |         match $s { $($t)+ => {}, ..isize::MIN | isize::MAX.. => todo!() }
@@ -124,7 +124,7 @@ LL |     m!(0isize, isize::MIN..isize::MAX | isize::MAX);
    |        ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
    |
    = note: the matched value is of type `isize`
-   = note: `isize` does not have fixed minimum and maximum values, so half-open ranges are necessary to match exhaustively
+   = note: `isize::MIN` and `isize::MAX` are not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
    |
 LL |         match $s { $($t)+ => {}, ..isize::MIN | isize::MAX.. => todo!() }
@@ -137,7 +137,7 @@ LL |         (0isize, true),
    |         ^^^^^^^^^^^^^^ patterns `(..isize::MIN, _)` and `(isize::MAX.., _)` not covered
    |
    = note: the matched value is of type `(isize, bool)`
-   = note: `isize` does not have fixed minimum and maximum values, so half-open ranges are necessary to match exhaustively
+   = note: `isize::MIN` and `isize::MAX` are not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
    |
 LL |         match $s { $($t)+ => {}, (..isize::MIN, _) | (isize::MAX.., _) => todo!() }
diff --git a/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.rs b/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.rs
index d60f479c0d1..6a0106134b5 100644
--- a/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.rs
+++ b/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.rs
@@ -4,7 +4,7 @@ fn main() {
         //~^ ERROR non-exhaustive patterns: `usize::MAX..` not covered
         //~| NOTE pattern `usize::MAX..` not covered
         //~| NOTE the matched value is of type `usize`
-        //~| NOTE `usize` does not have a fixed maximum value
+        //~| NOTE `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
         0..=usize::MAX => {}
     }
 
@@ -12,7 +12,7 @@ fn main() {
         //~^ ERROR non-exhaustive patterns: `..isize::MIN` and `isize::MAX..` not covered
         //~| NOTE patterns `..isize::MIN` and `isize::MAX..` not covered
         //~| NOTE the matched value is of type `isize`
-        //~| NOTE `isize` does not have fixed minimum and maximum values
+        //~| NOTE `isize::MIN` and `isize::MAX` are not treated as exhaustive, so half-open ranges are necessary to match exhaustively
         isize::MIN..=isize::MAX => {}
     }
 }
diff --git a/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr b/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr
index 36743aa8102..fefe7f46ead 100644
--- a/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr
+++ b/tests/ui/pattern/usefulness/integer-ranges/precise_pointer_matching-message.stderr
@@ -5,7 +5,7 @@ LL |     match 0usize {
    |           ^^^^^^ pattern `usize::MAX..` not covered
    |
    = note: the matched value is of type `usize`
-   = note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
+   = note: `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
 LL ~         0..=usize::MAX => {},
@@ -19,7 +19,7 @@ LL |     match 0isize {
    |           ^^^^^^ patterns `..isize::MIN` and `isize::MAX..` not covered
    |
    = note: the matched value is of type `isize`
-   = note: `isize` does not have fixed minimum and maximum values, so half-open ranges are necessary to match exhaustively
+   = note: `isize::MIN` and `isize::MAX` are not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
    |
 LL ~         isize::MIN..=isize::MAX => {},
diff --git a/tests/ui/pattern/usefulness/issue-85222-types-containing-non-exhaustive-types.stderr b/tests/ui/pattern/usefulness/issue-85222-types-containing-non-exhaustive-types.stderr
index c31411018bc..9d7b53093df 100644
--- a/tests/ui/pattern/usefulness/issue-85222-types-containing-non-exhaustive-types.stderr
+++ b/tests/ui/pattern/usefulness/issue-85222-types-containing-non-exhaustive-types.stderr
@@ -5,7 +5,7 @@ LL |     match 0 {
    |           ^ pattern `usize::MAX..` not covered
    |
    = note: the matched value is of type `usize`
-   = note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
+   = note: `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
 LL ~         1..=usize::MAX => (),
@@ -19,7 +19,7 @@ LL |     match (0usize, 0usize) {
    |           ^^^^^^^^^^^^^^^^ pattern `(usize::MAX.., _)` not covered
    |
    = note: the matched value is of type `(usize, usize)`
-   = note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
+   = note: `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
 LL ~         (1..=usize::MAX, 1..=usize::MAX) => (),
@@ -33,7 +33,7 @@ LL |     match (0isize, 0usize) {
    |           ^^^^^^^^^^^^^^^^ patterns `(..isize::MIN, _)` and `(isize::MAX.., _)` not covered
    |
    = note: the matched value is of type `(isize, usize)`
-   = note: `isize` does not have fixed minimum and maximum values, so half-open ranges are necessary to match exhaustively
+   = note: `isize::MIN` and `isize::MAX` are not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
    |
 LL ~         (isize::MIN..=isize::MAX, 1..=usize::MAX) => (),
@@ -70,7 +70,7 @@ note: `Option<usize>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Option<usize>`
-   = note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
+   = note: `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
 LL ~         None => (),
@@ -93,7 +93,7 @@ note: `Option<Option<Option<usize>>>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Option<Option<Option<usize>>>`
-   = note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
+   = note: `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
 LL ~         None => (),
@@ -112,7 +112,7 @@ note: `A<usize>` defined here
 LL | struct A<T> {
    |        ^
    = note: the matched value is of type `A<usize>`
-   = note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
+   = note: `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
 LL ~         A { a: 1..=usize::MAX } => (),
@@ -131,7 +131,7 @@ note: `B<isize, usize>` defined here
 LL | struct B<T, U>(T, U);
    |        ^
    = note: the matched value is of type `B<isize, usize>`
-   = note: `isize` does not have fixed minimum and maximum values, so half-open ranges are necessary to match exhaustively
+   = note: `isize::MIN` and `isize::MAX` are not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
    |
 LL ~         B(isize::MIN..=isize::MAX, 1..=usize::MAX) => (),
@@ -150,7 +150,7 @@ note: `B<isize, usize>` defined here
 LL | struct B<T, U>(T, U);
    |        ^
    = note: the matched value is of type `B<isize, usize>`
-   = note: `usize` does not have a fixed maximum value, so half-open ranges are necessary to match exhaustively
+   = note: `usize::MAX` is not treated as exhaustive, so half-open ranges are necessary to match exhaustively
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
 LL ~         B(_, 1..=usize::MAX) => (),
diff --git a/tests/ui/print-request/print-lints-help.stderr b/tests/ui/print-request/print-lints-help.stderr
index bc48b2fa73c..297a3aa79e1 100644
--- a/tests/ui/print-request/print-lints-help.stderr
+++ b/tests/ui/print-request/print-lints-help.stderr
@@ -1,6 +1,6 @@
 error: unknown print request: `lints`
   |
-  = help: valid print requests are: `all-target-specs-json`, `calling-conventions`, `cfg`, `check-cfg`, `code-models`, `crate-name`, `crate-root-lint-levels`, `deployment-target`, `file-names`, `host-tuple`, `link-args`, `native-static-libs`, `relocation-models`, `split-debuginfo`, `stack-protector-strategies`, `supported-crate-types`, `sysroot`, `target-cpus`, `target-features`, `target-libdir`, `target-list`, `target-spec-json`, `tls-models`
+  = help: valid print requests are: `all-target-specs-json`, `calling-conventions`, `cfg`, `check-cfg`, `code-models`, `crate-name`, `crate-root-lint-levels`, `deployment-target`, `file-names`, `host-tuple`, `link-args`, `native-static-libs`, `relocation-models`, `split-debuginfo`, `stack-protector-strategies`, `supported-crate-types`, `sysroot`, `target-cpus`, `target-features`, `target-libdir`, `target-list`, `target-spec-json`, `target-spec-json-schema`, `tls-models`
   = help: use `-Whelp` to print a list of lints
   = help: for more information, see the rustc book: https://doc.rust-lang.org/rustc/command-line-arguments.html#--print-print-compiler-information
 
diff --git a/tests/ui/print_type_sizes/async.rs b/tests/ui/print_type_sizes/async.rs
index 951e7cd1012..b6ec8842634 100644
--- a/tests/ui/print_type_sizes/async.rs
+++ b/tests/ui/print_type_sizes/async.rs
@@ -1,3 +1,5 @@
+// FIXME(#61117): Respect debuginfo-level-tests, do not force debuginfo=0
+//@ compile-flags: -C debuginfo=0
 //@ compile-flags: -C panic=abort -Z print-type-sizes --crate-type lib
 //@ needs-deterministic-layouts
 //@ edition:2021
diff --git a/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.fixed b/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.fixed
new file mode 100644
index 00000000000..63cc3333b6b
--- /dev/null
+++ b/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.fixed
@@ -0,0 +1,20 @@
+#![allow(dead_code, unused_variables)]
+//@ run-rustfix
+pub use my_mod::Foo;
+//~^ NOTE the type is accessed through this re-export, but the type's constructor is not visible in this import's scope due to private fields
+//~| NOTE the type is accessed through this re-export, but the type's constructor is not visible in this import's scope due to private fields
+
+mod my_mod {
+    pub struct Foo(u32);
+
+    mod my_sub_mod {
+        fn my_func() {
+            let crate::my_mod::Foo(x) = crate::my_mod::Foo(42);
+            //~^ ERROR cannot initialize a tuple struct which contains private fields
+            //~| HELP the type can be constructed directly, because its fields are available from the current scope
+            //~| ERROR cannot match against a tuple struct which contains private fields
+            //~| HELP the type can be constructed directly, because its fields are available from the current scope
+        }
+    }
+}
+fn main() {}
diff --git a/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs b/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs
new file mode 100644
index 00000000000..0b695f90654
--- /dev/null
+++ b/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs
@@ -0,0 +1,20 @@
+#![allow(dead_code, unused_variables)]
+//@ run-rustfix
+pub use my_mod::Foo;
+//~^ NOTE the type is accessed through this re-export, but the type's constructor is not visible in this import's scope due to private fields
+//~| NOTE the type is accessed through this re-export, but the type's constructor is not visible in this import's scope due to private fields
+
+mod my_mod {
+    pub struct Foo(u32);
+
+    mod my_sub_mod {
+        fn my_func() {
+            let crate::Foo(x) = crate::Foo(42);
+            //~^ ERROR cannot initialize a tuple struct which contains private fields
+            //~| HELP the type can be constructed directly, because its fields are available from the current scope
+            //~| ERROR cannot match against a tuple struct which contains private fields
+            //~| HELP the type can be constructed directly, because its fields are available from the current scope
+        }
+    }
+}
+fn main() {}
diff --git a/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.stderr b/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.stderr
new file mode 100644
index 00000000000..6ab324cb32f
--- /dev/null
+++ b/tests/ui/privacy/ctor-not-accessible-due-to-inaccessible-field-in-reexport.stderr
@@ -0,0 +1,36 @@
+error[E0423]: cannot initialize a tuple struct which contains private fields
+  --> $DIR/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:12:33
+   |
+LL |             let crate::Foo(x) = crate::Foo(42);
+   |                                 ^^^^^^^^^^
+   |
+note: the type is accessed through this re-export, but the type's constructor is not visible in this import's scope due to private fields
+  --> $DIR/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:3:9
+   |
+LL | pub use my_mod::Foo;
+   |         ^^^^^^^^^^^
+help: the type can be constructed directly, because its fields are available from the current scope
+   |
+LL |             let crate::Foo(x) = crate::my_mod::Foo(42);
+   |                                        ++++++++
+
+error[E0532]: cannot match against a tuple struct which contains private fields
+  --> $DIR/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:12:17
+   |
+LL |             let crate::Foo(x) = crate::Foo(42);
+   |                 ^^^^^^^^^^
+   |
+note: the type is accessed through this re-export, but the type's constructor is not visible in this import's scope due to private fields
+  --> $DIR/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:3:9
+   |
+LL | pub use my_mod::Foo;
+   |         ^^^^^^^^^^^
+help: the type can be constructed directly, because its fields are available from the current scope
+   |
+LL |             let crate::my_mod::Foo(x) = crate::Foo(42);
+   |                        ++++++++
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0423, E0532.
+For more information about an error, try `rustc --explain E0423`.
diff --git a/tests/ui/proc-macro/add-impl.rs b/tests/ui/proc-macro/add-impl.rs
index 2299f05c2e7..645e9321bba 100644
--- a/tests/ui/proc-macro/add-impl.rs
+++ b/tests/ui/proc-macro/add-impl.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ proc-macro: add-impl.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate add_impl;
diff --git a/tests/ui/proc-macro/ambiguous-builtin-attrs-test.rs b/tests/ui/proc-macro/ambiguous-builtin-attrs-test.rs
index 8ee2223822a..e580e0784b3 100644
--- a/tests/ui/proc-macro/ambiguous-builtin-attrs-test.rs
+++ b/tests/ui/proc-macro/ambiguous-builtin-attrs-test.rs
@@ -1,5 +1,6 @@
 //@ proc-macro: builtin-attrs.rs
 //@ compile-flags:--test
+//@ ignore-backends: gcc
 
 #![feature(decl_macro, test)]
 
diff --git a/tests/ui/proc-macro/ambiguous-builtin-attrs-test.stderr b/tests/ui/proc-macro/ambiguous-builtin-attrs-test.stderr
index 346cebf639d..e5de873cf31 100644
--- a/tests/ui/proc-macro/ambiguous-builtin-attrs-test.stderr
+++ b/tests/ui/proc-macro/ambiguous-builtin-attrs-test.stderr
@@ -1,5 +1,5 @@
 error[E0425]: cannot find value `NonExistent` in this scope
-  --> $DIR/ambiguous-builtin-attrs-test.rs:19:5
+  --> $DIR/ambiguous-builtin-attrs-test.rs:20:5
    |
 LL |     NonExistent;
    |     ^^^^^^^^^^^ not found in this scope
diff --git a/tests/ui/proc-macro/ambiguous-builtin-attrs.rs b/tests/ui/proc-macro/ambiguous-builtin-attrs.rs
index edc7748eff3..63d3c79055c 100644
--- a/tests/ui/proc-macro/ambiguous-builtin-attrs.rs
+++ b/tests/ui/proc-macro/ambiguous-builtin-attrs.rs
@@ -1,5 +1,6 @@
 //@ edition:2018
 //@ proc-macro: builtin-attrs.rs
+//@ ignore-backends: gcc
 #![feature(decl_macro)] //~ ERROR `feature` is ambiguous
 
 extern crate builtin_attrs;
diff --git a/tests/ui/proc-macro/ambiguous-builtin-attrs.stderr b/tests/ui/proc-macro/ambiguous-builtin-attrs.stderr
index 0f4ddc065a7..ff7894a41ea 100644
--- a/tests/ui/proc-macro/ambiguous-builtin-attrs.stderr
+++ b/tests/ui/proc-macro/ambiguous-builtin-attrs.stderr
@@ -1,11 +1,11 @@
 error[E0425]: cannot find value `NonExistent` in this scope
-  --> $DIR/ambiguous-builtin-attrs.rs:34:5
+  --> $DIR/ambiguous-builtin-attrs.rs:35:5
    |
 LL |     NonExistent;
    |     ^^^^^^^^^^^ not found in this scope
 
 error[E0659]: `repr` is ambiguous
-  --> $DIR/ambiguous-builtin-attrs.rs:9:3
+  --> $DIR/ambiguous-builtin-attrs.rs:10:3
    |
 LL | #[repr(C)]
    |   ^^^^ ambiguous name
@@ -13,14 +13,14 @@ LL | #[repr(C)]
    = note: ambiguous because of a name conflict with a builtin attribute
    = note: `repr` could refer to a built-in attribute
 note: `repr` could also refer to the attribute macro imported here
-  --> $DIR/ambiguous-builtin-attrs.rs:6:5
+  --> $DIR/ambiguous-builtin-attrs.rs:7:5
    |
 LL | use builtin_attrs::*;
    |     ^^^^^^^^^^^^^^^^
    = help: use `crate::repr` to refer to this attribute macro unambiguously
 
 error[E0659]: `repr` is ambiguous
-  --> $DIR/ambiguous-builtin-attrs.rs:11:19
+  --> $DIR/ambiguous-builtin-attrs.rs:12:19
    |
 LL | #[cfg_attr(all(), repr(C))]
    |                   ^^^^ ambiguous name
@@ -28,14 +28,14 @@ LL | #[cfg_attr(all(), repr(C))]
    = note: ambiguous because of a name conflict with a builtin attribute
    = note: `repr` could refer to a built-in attribute
 note: `repr` could also refer to the attribute macro imported here
-  --> $DIR/ambiguous-builtin-attrs.rs:6:5
+  --> $DIR/ambiguous-builtin-attrs.rs:7:5
    |
 LL | use builtin_attrs::*;
    |     ^^^^^^^^^^^^^^^^
    = help: use `crate::repr` to refer to this attribute macro unambiguously
 
 error[E0659]: `repr` is ambiguous
-  --> $DIR/ambiguous-builtin-attrs.rs:20:34
+  --> $DIR/ambiguous-builtin-attrs.rs:21:34
    |
 LL | fn non_macro_expanded_location<#[repr(C)] T>() {
    |                                  ^^^^ ambiguous name
@@ -43,14 +43,14 @@ LL | fn non_macro_expanded_location<#[repr(C)] T>() {
    = note: ambiguous because of a name conflict with a builtin attribute
    = note: `repr` could refer to a built-in attribute
 note: `repr` could also refer to the attribute macro imported here
-  --> $DIR/ambiguous-builtin-attrs.rs:6:5
+  --> $DIR/ambiguous-builtin-attrs.rs:7:5
    |
 LL | use builtin_attrs::*;
    |     ^^^^^^^^^^^^^^^^
    = help: use `crate::repr` to refer to this attribute macro unambiguously
 
 error[E0659]: `repr` is ambiguous
-  --> $DIR/ambiguous-builtin-attrs.rs:24:11
+  --> $DIR/ambiguous-builtin-attrs.rs:25:11
    |
 LL |         #[repr(C)]
    |           ^^^^ ambiguous name
@@ -58,14 +58,14 @@ LL |         #[repr(C)]
    = note: ambiguous because of a name conflict with a builtin attribute
    = note: `repr` could refer to a built-in attribute
 note: `repr` could also refer to the attribute macro imported here
-  --> $DIR/ambiguous-builtin-attrs.rs:6:5
+  --> $DIR/ambiguous-builtin-attrs.rs:7:5
    |
 LL | use builtin_attrs::*;
    |     ^^^^^^^^^^^^^^^^
    = help: use `crate::repr` to refer to this attribute macro unambiguously
 
 error[E0659]: `allow` is ambiguous
-  --> $DIR/ambiguous-builtin-attrs.rs:38:3
+  --> $DIR/ambiguous-builtin-attrs.rs:39:3
    |
 LL | #[allow(unused)]
    |   ^^^^^ ambiguous name
@@ -73,14 +73,14 @@ LL | #[allow(unused)]
    = note: ambiguous because of a name conflict with a builtin attribute
    = note: `allow` could refer to a built-in attribute
 note: `allow` could also refer to the built-in attribute imported here
-  --> $DIR/ambiguous-builtin-attrs.rs:37:5
+  --> $DIR/ambiguous-builtin-attrs.rs:38:5
    |
 LL | use deny as allow;
    |     ^^^^^^^^^^^^^
    = help: use `crate::allow` to refer to this built-in attribute unambiguously
 
 error[E0659]: `feature` is ambiguous
-  --> $DIR/ambiguous-builtin-attrs.rs:3:4
+  --> $DIR/ambiguous-builtin-attrs.rs:4:4
    |
 LL | #![feature(decl_macro)]
    |    ^^^^^^^ ambiguous name
@@ -88,20 +88,20 @@ LL | #![feature(decl_macro)]
    = note: ambiguous because of a name conflict with a builtin attribute
    = note: `feature` could refer to a built-in attribute
 note: `feature` could also refer to the attribute macro imported here
-  --> $DIR/ambiguous-builtin-attrs.rs:6:5
+  --> $DIR/ambiguous-builtin-attrs.rs:7:5
    |
 LL | use builtin_attrs::*;
    |     ^^^^^^^^^^^^^^^^
    = help: use `crate::feature` to refer to this attribute macro unambiguously
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/ambiguous-builtin-attrs.rs:20:39
+  --> $DIR/ambiguous-builtin-attrs.rs:21:39
    |
 LL | fn non_macro_expanded_location<#[repr(C)] T>() {
    |                                       ^   - not a struct, enum, or union
 
 error[E0517]: attribute should be applied to a struct, enum, or union
-  --> $DIR/ambiguous-builtin-attrs.rs:24:16
+  --> $DIR/ambiguous-builtin-attrs.rs:25:16
    |
 LL |         #[repr(C)]
    |                ^
diff --git a/tests/ui/proc-macro/append-impl.rs b/tests/ui/proc-macro/append-impl.rs
index c0f208460b2..48d21968de0 100644
--- a/tests/ui/proc-macro/append-impl.rs
+++ b/tests/ui/proc-macro/append-impl.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ proc-macro: append-impl.rs
+//@ ignore-backends: gcc
 
 #![allow(warnings)]
 
diff --git a/tests/ui/proc-macro/attr-args.rs b/tests/ui/proc-macro/attr-args.rs
index 1d3e0f725d2..4109b450a8a 100644
--- a/tests/ui/proc-macro/attr-args.rs
+++ b/tests/ui/proc-macro/attr-args.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ proc-macro: attr-args.rs
+//@ ignore-backends: gcc
 
 #![allow(warnings)]
 
diff --git a/tests/ui/proc-macro/attr-invalid-exprs.rs b/tests/ui/proc-macro/attr-invalid-exprs.rs
index f476858a32b..bdfc0587b3b 100644
--- a/tests/ui/proc-macro/attr-invalid-exprs.rs
+++ b/tests/ui/proc-macro/attr-invalid-exprs.rs
@@ -1,6 +1,7 @@
 //! Attributes producing expressions in invalid locations
 
 //@ proc-macro: attr-stmt-expr.rs
+//@ ignore-backends: gcc
 
 #![feature(proc_macro_hygiene)]
 #![feature(stmt_expr_attributes)]
diff --git a/tests/ui/proc-macro/attr-invalid-exprs.stderr b/tests/ui/proc-macro/attr-invalid-exprs.stderr
index 0d500c87145..43241e1e6fd 100644
--- a/tests/ui/proc-macro/attr-invalid-exprs.stderr
+++ b/tests/ui/proc-macro/attr-invalid-exprs.stderr
@@ -1,11 +1,11 @@
 error: expected expression, found end of macro arguments
-  --> $DIR/attr-invalid-exprs.rs:12:13
+  --> $DIR/attr-invalid-exprs.rs:13:13
    |
 LL |     let _ = #[no_output] "Hello, world!";
    |             ^^^^^^^^^^^^
 
 error: macro expansion ignores `,` and any tokens following
-  --> $DIR/attr-invalid-exprs.rs:15:13
+  --> $DIR/attr-invalid-exprs.rs:16:13
    |
 LL |     let _ = #[duplicate] "Hello, world!";
    |             ^^^^^^^^^^^^ caused by the macro expansion here
@@ -17,7 +17,7 @@ LL |     let _ = #[duplicate]; "Hello, world!";
    |                         +
 
 error: macro expansion ignores `,` and any tokens following
-  --> $DIR/attr-invalid-exprs.rs:24:9
+  --> $DIR/attr-invalid-exprs.rs:25:9
    |
 LL |         #[duplicate]
    |         ^^^^^^^^^^^^ caused by the macro expansion here
diff --git a/tests/ui/proc-macro/attr-on-trait.rs b/tests/ui/proc-macro/attr-on-trait.rs
index e95760a837c..345653864f8 100644
--- a/tests/ui/proc-macro/attr-on-trait.rs
+++ b/tests/ui/proc-macro/attr-on-trait.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ proc-macro: attr-on-trait.rs
+//@ ignore-backends: gcc
 
 extern crate attr_on_trait;
 
diff --git a/tests/ui/proc-macro/bang-macro.rs b/tests/ui/proc-macro/bang-macro.rs
index 2287e34c5dd..75f40de242e 100644
--- a/tests/ui/proc-macro/bang-macro.rs
+++ b/tests/ui/proc-macro/bang-macro.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ proc-macro: bang-macro.rs
+//@ ignore-backends: gcc
 
 extern crate bang_macro;
 use bang_macro::rewrite;
diff --git a/tests/ui/proc-macro/call-site.rs b/tests/ui/proc-macro/call-site.rs
index 9c285e1ed11..5de4061b2a9 100644
--- a/tests/ui/proc-macro/call-site.rs
+++ b/tests/ui/proc-macro/call-site.rs
@@ -1,5 +1,6 @@
 //@ check-pass
 //@ proc-macro: call-site.rs
+//@ ignore-backends: gcc
 
 extern crate call_site;
 
diff --git a/tests/ui/proc-macro/count_compound_ops.rs b/tests/ui/proc-macro/count_compound_ops.rs
index 20b0b87817e..fe90e7bfbe4 100644
--- a/tests/ui/proc-macro/count_compound_ops.rs
+++ b/tests/ui/proc-macro/count_compound_ops.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ proc-macro: count_compound_ops.rs
+//@ ignore-backends: gcc
 
 extern crate count_compound_ops;
 use count_compound_ops::count_compound_ops;
diff --git a/tests/ui/proc-macro/derive-bad.rs b/tests/ui/proc-macro/derive-bad.rs
index 9b237c731db..9b9a2bc33c9 100644
--- a/tests/ui/proc-macro/derive-bad.rs
+++ b/tests/ui/proc-macro/derive-bad.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: derive-bad.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate derive_bad;
diff --git a/tests/ui/proc-macro/derive-bad.stderr b/tests/ui/proc-macro/derive-bad.stderr
index 43e97f40ba8..8a252e826ef 100644
--- a/tests/ui/proc-macro/derive-bad.stderr
+++ b/tests/ui/proc-macro/derive-bad.stderr
@@ -1,5 +1,5 @@
 error: expected `:`, found `}`
-  --> $DIR/derive-bad.rs:6:10
+  --> $DIR/derive-bad.rs:7:10
    |
 LL | #[derive(A)]
    |          ^
@@ -10,13 +10,13 @@ LL | #[derive(A)]
    = note: this error originates in the derive macro `A` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: proc-macro derive produced unparsable tokens
-  --> $DIR/derive-bad.rs:6:10
+  --> $DIR/derive-bad.rs:7:10
    |
 LL | #[derive(A)]
    |          ^
 
 error[E0428]: the name `A` is defined multiple times
-  --> $DIR/derive-bad.rs:9:1
+  --> $DIR/derive-bad.rs:10:1
    |
 LL | #[derive(A)]
    |          - previous definition of the type `A` here
diff --git a/tests/ui/proc-macro/derive-helper-shadowing.rs b/tests/ui/proc-macro/derive-helper-shadowing.rs
index ee883be3352..5ddd914d102 100644
--- a/tests/ui/proc-macro/derive-helper-shadowing.rs
+++ b/tests/ui/proc-macro/derive-helper-shadowing.rs
@@ -1,6 +1,7 @@
 //@ edition:2018
 //@ proc-macro: test-macros.rs
 //@ proc-macro: derive-helper-shadowing.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate test_macros;
diff --git a/tests/ui/proc-macro/derive-helper-shadowing.stderr b/tests/ui/proc-macro/derive-helper-shadowing.stderr
index 2e4ddd19b7e..90b42e8d6e2 100644
--- a/tests/ui/proc-macro/derive-helper-shadowing.stderr
+++ b/tests/ui/proc-macro/derive-helper-shadowing.stderr
@@ -1,17 +1,17 @@
 error: cannot use a derive helper attribute through an import
-  --> $DIR/derive-helper-shadowing.rs:42:15
+  --> $DIR/derive-helper-shadowing.rs:43:15
    |
 LL |             #[renamed]
    |               ^^^^^^^
    |
 note: the derive helper attribute imported here
-  --> $DIR/derive-helper-shadowing.rs:41:17
+  --> $DIR/derive-helper-shadowing.rs:42:17
    |
 LL |             use empty_helper as renamed;
    |                 ^^^^^^^^^^^^^^^^^^^^^^^
 
 error: cannot find attribute `empty_helper` in this scope
-  --> $DIR/derive-helper-shadowing.rs:38:22
+  --> $DIR/derive-helper-shadowing.rs:39:22
    |
 LL |             #[derive(GenHelperUse)]
    |                      ^^^^^^^^^^^^
@@ -24,7 +24,7 @@ LL +             use empty_helper;
    |
 
 error: cannot find attribute `empty_helper` in this scope
-  --> $DIR/derive-helper-shadowing.rs:14:11
+  --> $DIR/derive-helper-shadowing.rs:15:11
    |
 LL |         #[empty_helper]
    |           ^^^^^^^^^^^^
@@ -40,26 +40,26 @@ LL +             use crate::empty_helper;
    |
 
 error[E0659]: `empty_helper` is ambiguous
-  --> $DIR/derive-helper-shadowing.rs:19:3
+  --> $DIR/derive-helper-shadowing.rs:20:3
    |
 LL | #[empty_helper]
    |   ^^^^^^^^^^^^ ambiguous name
    |
    = note: ambiguous because of a name conflict with a derive helper attribute
 note: `empty_helper` could refer to the derive helper attribute defined here
-  --> $DIR/derive-helper-shadowing.rs:22:10
+  --> $DIR/derive-helper-shadowing.rs:23:10
    |
 LL | #[derive(Empty)]
    |          ^^^^^
 note: `empty_helper` could also refer to the attribute macro imported here
-  --> $DIR/derive-helper-shadowing.rs:10:5
+  --> $DIR/derive-helper-shadowing.rs:11:5
    |
 LL | use test_macros::empty_attr as empty_helper;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: use `crate::empty_helper` to refer to this attribute macro unambiguously
 
 error: derive helper attribute is used before it is introduced
-  --> $DIR/derive-helper-shadowing.rs:19:3
+  --> $DIR/derive-helper-shadowing.rs:20:3
    |
 LL | #[empty_helper]
    |   ^^^^^^^^^^^^
@@ -76,7 +76,7 @@ error: aborting due to 5 previous errors
 For more information about this error, try `rustc --explain E0659`.
 Future incompatibility report: Future breakage diagnostic:
 error: derive helper attribute is used before it is introduced
-  --> $DIR/derive-helper-shadowing.rs:19:3
+  --> $DIR/derive-helper-shadowing.rs:20:3
    |
 LL | #[empty_helper]
    |   ^^^^^^^^^^^^
diff --git a/tests/ui/proc-macro/derive-same-struct.rs b/tests/ui/proc-macro/derive-same-struct.rs
index f7669ba1480..04ab08dc76e 100644
--- a/tests/ui/proc-macro/derive-same-struct.rs
+++ b/tests/ui/proc-macro/derive-same-struct.rs
@@ -3,6 +3,7 @@
 #![allow(path_statements)]
 #![allow(dead_code)]
 //@ proc-macro: derive-same-struct.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate derive_same_struct;
diff --git a/tests/ui/proc-macro/edition-imports-2018.rs b/tests/ui/proc-macro/edition-imports-2018.rs
index a3808d9dce8..af9eed74adb 100644
--- a/tests/ui/proc-macro/edition-imports-2018.rs
+++ b/tests/ui/proc-macro/edition-imports-2018.rs
@@ -1,6 +1,7 @@
 //@ check-pass
 //@ edition:2018
 //@ proc-macro: edition-imports-2015.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate edition_imports_2015;
diff --git a/tests/ui/proc-macro/env.rs b/tests/ui/proc-macro/env.rs
index 94e3b09e526..fc248f88359 100644
--- a/tests/ui/proc-macro/env.rs
+++ b/tests/ui/proc-macro/env.rs
@@ -2,6 +2,7 @@
 //@ run-pass
 //@ rustc-env: THE_CONST=1
 //@ compile-flags: -Zunstable-options --env-set THE_CONST=12 --env-set ANOTHER=4
+//@ ignore-backends: gcc
 
 #![crate_name = "foo"]
 
diff --git a/tests/ui/proc-macro/expand-expr.rs b/tests/ui/proc-macro/expand-expr.rs
index 8a4ed9768d5..c3dddd8e459 100644
--- a/tests/ui/proc-macro/expand-expr.rs
+++ b/tests/ui/proc-macro/expand-expr.rs
@@ -1,5 +1,6 @@
 //@ proc-macro: expand-expr.rs
-// no-remap-src-base: check_expand_expr_file!() fails when enabled.
+//@ ignore-backends: gcc
+// No `remap-src-base`, since `check_expand_expr_file!()` fails when enabled.
 
 #![feature(concat_bytes)]
 extern crate expand_expr;
@@ -10,7 +11,7 @@ use expand_expr::{
 
 // Check builtin macros can be expanded.
 
-expand_expr_is!(13u32, line!());
+expand_expr_is!(14u32, line!());
 expand_expr_is!(24u32, column!());
 
 expand_expr_is!("Hello, World!", concat!("Hello, ", "World", "!"));
diff --git a/tests/ui/proc-macro/expand-expr.stderr b/tests/ui/proc-macro/expand-expr.stderr
index 8b1df177cfa..fd5f672adf5 100644
--- a/tests/ui/proc-macro/expand-expr.stderr
+++ b/tests/ui/proc-macro/expand-expr.stderr
@@ -1,29 +1,29 @@
 error: expected one of `.`, `?`, or an operator, found `;`
-  --> $DIR/expand-expr.rs:108:27
+  --> $DIR/expand-expr.rs:109:27
    |
 LL | expand_expr_fail!("string"; hello);
    |                           ^ expected one of `.`, `?`, or an operator
 
 error: expected expression, found `$`
-  --> $DIR/expand-expr.rs:111:19
+  --> $DIR/expand-expr.rs:112:19
    |
 LL | expand_expr_fail!($);
    |                   ^ expected expression
 
 error: expected expression, found `$`
-  --> $DIR/expand-expr.rs:112:29
+  --> $DIR/expand-expr.rs:113:29
    |
 LL | expand_expr_fail!(echo_tts!($));
    |                             ^ expected expression
 
 error: expected expression, found `$`
-  --> $DIR/expand-expr.rs:113:28
+  --> $DIR/expand-expr.rs:114:28
    |
 LL | expand_expr_fail!(echo_pm!($));
    |                            ^ expected expression
 
 error: macro expansion ignores `hello` and any tokens following
-  --> $DIR/expand-expr.rs:117:47
+  --> $DIR/expand-expr.rs:118:47
    |
 LL | expand_expr_is!("string", echo_tts!("string"; hello));
    |                           --------------------^^^^^- caused by the macro expansion here
@@ -35,7 +35,7 @@ LL | expand_expr_is!("string", echo_tts!("string"; hello););
    |                                                     +
 
 error: macro expansion ignores `;` and any tokens following
-  --> $DIR/expand-expr.rs:118:44
+  --> $DIR/expand-expr.rs:119:44
    |
 LL | expand_expr_is!("string", echo_pm!("string"; hello));
    |                           -----------------^------- caused by the macro expansion here
@@ -47,7 +47,7 @@ LL | expand_expr_is!("string", echo_pm!("string"; hello););
    |                                                    +
 
 error: recursion limit reached while expanding `recursive_expand!`
-  --> $DIR/expand-expr.rs:126:16
+  --> $DIR/expand-expr.rs:127:16
    |
 LL | const _: u32 = recursive_expand!();
    |                ^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/proc-macro/expand-to-unstable.rs b/tests/ui/proc-macro/expand-to-unstable.rs
index 8968471ebd8..37bfeab1fe7 100644
--- a/tests/ui/proc-macro/expand-to-unstable.rs
+++ b/tests/ui/proc-macro/expand-to-unstable.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: derive-unstable.rs
+//@ ignore-backends: gcc
 
 #![allow(warnings)]
 
diff --git a/tests/ui/proc-macro/expand-to-unstable.stderr b/tests/ui/proc-macro/expand-to-unstable.stderr
index 563c7ae8f95..255f80501ea 100644
--- a/tests/ui/proc-macro/expand-to-unstable.stderr
+++ b/tests/ui/proc-macro/expand-to-unstable.stderr
@@ -1,5 +1,5 @@
 error[E0658]: use of unstable library feature `core_intrinsics`: intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library
-  --> $DIR/expand-to-unstable.rs:8:10
+  --> $DIR/expand-to-unstable.rs:9:10
    |
 LL | #[derive(Unstable)]
    |          ^^^^^^^^
diff --git a/tests/ui/proc-macro/expand-with-a-macro.rs b/tests/ui/proc-macro/expand-with-a-macro.rs
index e5baf3601db..aa02cefbec6 100644
--- a/tests/ui/proc-macro/expand-with-a-macro.rs
+++ b/tests/ui/proc-macro/expand-with-a-macro.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-unwind
 //@ proc-macro: expand-with-a-macro.rs
+//@ ignore-backends: gcc
 
 
 #![deny(warnings)]
diff --git a/tests/ui/proc-macro/gen-macro-rules-hygiene.rs b/tests/ui/proc-macro/gen-macro-rules-hygiene.rs
index 3deec94fa34..fb7c830c2ed 100644
--- a/tests/ui/proc-macro/gen-macro-rules-hygiene.rs
+++ b/tests/ui/proc-macro/gen-macro-rules-hygiene.rs
@@ -3,6 +3,7 @@
 // `$crate` refers to the crate that defines `macro_rules` and not the outer transparent macro.
 
 //@ proc-macro: gen-macro-rules-hygiene.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate gen_macro_rules_hygiene;
diff --git a/tests/ui/proc-macro/gen-macro-rules-hygiene.stderr b/tests/ui/proc-macro/gen-macro-rules-hygiene.stderr
index df7c4f72eb0..e904b43aaae 100644
--- a/tests/ui/proc-macro/gen-macro-rules-hygiene.stderr
+++ b/tests/ui/proc-macro/gen-macro-rules-hygiene.stderr
@@ -1,5 +1,5 @@
 error[E0426]: use of undeclared label `'label_use`
-  --> $DIR/gen-macro-rules-hygiene.rs:12:1
+  --> $DIR/gen-macro-rules-hygiene.rs:13:1
    |
 LL | gen_macro_rules!();
    | ^^^^^^^^^^^^^^^^^^ undeclared label `'label_use`
@@ -10,7 +10,7 @@ LL |         generated!();
    = note: this error originates in the macro `generated` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0425]: cannot find value `local_use` in this scope
-  --> $DIR/gen-macro-rules-hygiene.rs:12:1
+  --> $DIR/gen-macro-rules-hygiene.rs:13:1
    |
 LL | gen_macro_rules!();
    | ^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `local_def`
@@ -21,7 +21,7 @@ LL |         generated!();
    = note: this error originates in the macro `generated` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0425]: cannot find value `local_def` in this scope
-  --> $DIR/gen-macro-rules-hygiene.rs:21:9
+  --> $DIR/gen-macro-rules-hygiene.rs:22:9
    |
 LL |         local_def;
    |         ^^^^^^^^^ help: a local variable with a similar name exists: `local_use`
diff --git a/tests/ui/proc-macro/gen-macro-rules.rs b/tests/ui/proc-macro/gen-macro-rules.rs
index 121d029e2e3..8ee38b2cc27 100644
--- a/tests/ui/proc-macro/gen-macro-rules.rs
+++ b/tests/ui/proc-macro/gen-macro-rules.rs
@@ -2,6 +2,7 @@
 
 //@ check-pass
 //@ proc-macro: gen-macro-rules.rs
+//@ ignore-backends: gcc
 
 extern crate gen_macro_rules as repro;
 
diff --git a/tests/ui/proc-macro/generate-mod.rs b/tests/ui/proc-macro/generate-mod.rs
index 729bfc1db66..0a1629e75ec 100644
--- a/tests/ui/proc-macro/generate-mod.rs
+++ b/tests/ui/proc-macro/generate-mod.rs
@@ -1,6 +1,7 @@
 // Modules generated by transparent proc macros still acts as barriers for names (issue #50504).
 
 //@ proc-macro: generate-mod.rs
+//@ ignore-backends: gcc
 
 extern crate generate_mod;
 
diff --git a/tests/ui/proc-macro/generate-mod.stderr b/tests/ui/proc-macro/generate-mod.stderr
index 142ff1abeed..03cf8c35188 100644
--- a/tests/ui/proc-macro/generate-mod.stderr
+++ b/tests/ui/proc-macro/generate-mod.stderr
@@ -1,5 +1,5 @@
 error[E0412]: cannot find type `FromOutside` in this scope
-  --> $DIR/generate-mod.rs:9:1
+  --> $DIR/generate-mod.rs:10:1
    |
 LL | generate_mod::check!();
    | ^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
@@ -9,7 +9,7 @@ LL | generate_mod::check!();
    = note: this error originates in the macro `generate_mod::check` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0412]: cannot find type `Outer` in this scope
-  --> $DIR/generate-mod.rs:9:1
+  --> $DIR/generate-mod.rs:10:1
    |
 LL | generate_mod::check!();
    | ^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
@@ -19,7 +19,7 @@ LL | generate_mod::check!();
    = note: this error originates in the macro `generate_mod::check` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0412]: cannot find type `FromOutside` in this scope
-  --> $DIR/generate-mod.rs:12:1
+  --> $DIR/generate-mod.rs:13:1
    |
 LL | #[generate_mod::check_attr]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
@@ -29,7 +29,7 @@ LL | #[generate_mod::check_attr]
    = note: this error originates in the attribute macro `generate_mod::check_attr` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0412]: cannot find type `OuterAttr` in this scope
-  --> $DIR/generate-mod.rs:12:1
+  --> $DIR/generate-mod.rs:13:1
    |
 LL | #[generate_mod::check_attr]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
@@ -39,7 +39,7 @@ LL | #[generate_mod::check_attr]
    = note: this error originates in the attribute macro `generate_mod::check_attr` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: cannot find type `FromOutside` in this scope
-  --> $DIR/generate-mod.rs:16:10
+  --> $DIR/generate-mod.rs:17:10
    |
 LL | #[derive(generate_mod::CheckDerive)]
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
@@ -50,7 +50,7 @@ LL | #[derive(generate_mod::CheckDerive)]
    = note: this error originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: cannot find type `OuterDerive` in this scope
-  --> $DIR/generate-mod.rs:16:10
+  --> $DIR/generate-mod.rs:17:10
    |
 LL | #[derive(generate_mod::CheckDerive)]
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
@@ -60,7 +60,7 @@ LL | #[derive(generate_mod::CheckDerive)]
    = note: this error originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: cannot find type `FromOutside` in this scope
-  --> $DIR/generate-mod.rs:23:14
+  --> $DIR/generate-mod.rs:24:14
    |
 LL |     #[derive(generate_mod::CheckDerive)]
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
@@ -70,7 +70,7 @@ LL |     #[derive(generate_mod::CheckDerive)]
    = note: this error originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: cannot find type `OuterDerive` in this scope
-  --> $DIR/generate-mod.rs:23:14
+  --> $DIR/generate-mod.rs:24:14
    |
 LL |     #[derive(generate_mod::CheckDerive)]
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
@@ -84,7 +84,7 @@ error: aborting due to 8 previous errors
 For more information about this error, try `rustc --explain E0412`.
 Future incompatibility report: Future breakage diagnostic:
 error: cannot find type `FromOutside` in this scope
-  --> $DIR/generate-mod.rs:16:10
+  --> $DIR/generate-mod.rs:17:10
    |
 LL | #[derive(generate_mod::CheckDerive)]
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
@@ -96,7 +96,7 @@ LL | #[derive(generate_mod::CheckDerive)]
 
 Future breakage diagnostic:
 error: cannot find type `OuterDerive` in this scope
-  --> $DIR/generate-mod.rs:16:10
+  --> $DIR/generate-mod.rs:17:10
    |
 LL | #[derive(generate_mod::CheckDerive)]
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
@@ -108,7 +108,7 @@ LL | #[derive(generate_mod::CheckDerive)]
 
 Future breakage diagnostic:
 error: cannot find type `FromOutside` in this scope
-  --> $DIR/generate-mod.rs:23:14
+  --> $DIR/generate-mod.rs:24:14
    |
 LL |     #[derive(generate_mod::CheckDerive)]
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
@@ -120,7 +120,7 @@ LL |     #[derive(generate_mod::CheckDerive)]
 
 Future breakage diagnostic:
 error: cannot find type `OuterDerive` in this scope
-  --> $DIR/generate-mod.rs:23:14
+  --> $DIR/generate-mod.rs:24:14
    |
 LL |     #[derive(generate_mod::CheckDerive)]
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
@@ -132,7 +132,7 @@ LL |     #[derive(generate_mod::CheckDerive)]
 
 Future breakage diagnostic:
 warning: cannot find type `FromOutside` in this scope
-  --> $DIR/generate-mod.rs:30:10
+  --> $DIR/generate-mod.rs:31:10
    |
 LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
@@ -143,7 +143,7 @@ LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
 
 Future breakage diagnostic:
 warning: cannot find type `OuterDeriveLint` in this scope
-  --> $DIR/generate-mod.rs:30:10
+  --> $DIR/generate-mod.rs:31:10
    |
 LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
diff --git a/tests/ui/proc-macro/hygiene_example.rs b/tests/ui/proc-macro/hygiene_example.rs
index 84b5e345608..f74f22fb3b0 100644
--- a/tests/ui/proc-macro/hygiene_example.rs
+++ b/tests/ui/proc-macro/hygiene_example.rs
@@ -1,5 +1,6 @@
 //@ check-pass
 //@ aux-build:hygiene_example.rs
+//@ ignore-backends: gcc
 
 extern crate hygiene_example;
 use hygiene_example::hello;
diff --git a/tests/ui/proc-macro/is-available.rs b/tests/ui/proc-macro/is-available.rs
index faee560d7a9..9e9cf5d11b6 100644
--- a/tests/ui/proc-macro/is-available.rs
+++ b/tests/ui/proc-macro/is-available.rs
@@ -3,6 +3,7 @@
 extern crate proc_macro;
 
 //@ proc-macro: is-available.rs
+//@ ignore-backends: gcc
 extern crate is_available;
 
 fn main() {
diff --git a/tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.rs b/tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.rs
index abdd6bf136d..d420f2641da 100644
--- a/tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.rs
+++ b/tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: issue-104884.rs
+//@ ignore-backends: gcc
 
 use std::collections::BinaryHeap;
 
diff --git a/tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.stderr b/tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.stderr
index f3ed9e5761d..b7aed4a8485 100644
--- a/tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.stderr
+++ b/tests/ui/proc-macro/issue-104884-trait-impl-sugg-err.stderr
@@ -1,11 +1,11 @@
 error[E0277]: can't compare `PriorityQueue<T>` with `PriorityQueue<T>`
-  --> $DIR/issue-104884-trait-impl-sugg-err.rs:13:10
+  --> $DIR/issue-104884-trait-impl-sugg-err.rs:14:10
    |
 LL | #[derive(PartialOrd, AddImpl)]
    |          ^^^^^^^^^^ no implementation for `PriorityQueue<T> == PriorityQueue<T>`
    |
 help: the trait `PartialEq` is not implemented for `PriorityQueue<T>`
-  --> $DIR/issue-104884-trait-impl-sugg-err.rs:20:1
+  --> $DIR/issue-104884-trait-impl-sugg-err.rs:21:1
    |
 LL | struct PriorityQueue<T>(BinaryHeap<PriorityQueueEntry<T>>);
    | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -13,13 +13,13 @@ note: required by a bound in `PartialOrd`
   --> $SRC_DIR/core/src/cmp.rs:LL:COL
 
 error[E0277]: the trait bound `PriorityQueue<T>: Eq` is not satisfied
-  --> $DIR/issue-104884-trait-impl-sugg-err.rs:13:22
+  --> $DIR/issue-104884-trait-impl-sugg-err.rs:14:22
    |
 LL | #[derive(PartialOrd, AddImpl)]
    |                      ^^^^^^^ unsatisfied trait bound
    |
 help: the trait `Eq` is not implemented for `PriorityQueue<T>`
-  --> $DIR/issue-104884-trait-impl-sugg-err.rs:20:1
+  --> $DIR/issue-104884-trait-impl-sugg-err.rs:21:1
    |
 LL | struct PriorityQueue<T>(BinaryHeap<PriorityQueueEntry<T>>);
    | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -28,13 +28,13 @@ note: required by a bound in `Ord`
    = note: this error originates in the derive macro `AddImpl` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0277]: can't compare `T` with `T`
-  --> $DIR/issue-104884-trait-impl-sugg-err.rs:13:22
+  --> $DIR/issue-104884-trait-impl-sugg-err.rs:14:22
    |
 LL | #[derive(PartialOrd, AddImpl)]
    |                      ^^^^^^^ no implementation for `T < T` and `T > T`
    |
 note: required for `PriorityQueue<T>` to implement `PartialOrd`
-  --> $DIR/issue-104884-trait-impl-sugg-err.rs:13:10
+  --> $DIR/issue-104884-trait-impl-sugg-err.rs:14:10
    |
 LL | #[derive(PartialOrd, AddImpl)]
    |          ^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
@@ -42,7 +42,7 @@ note: required by a bound in `Ord`
   --> $SRC_DIR/core/src/cmp.rs:LL:COL
 
 error[E0277]: can't compare `BinaryHeap<PriorityQueueEntry<T>>` with `_`
-  --> $DIR/issue-104884-trait-impl-sugg-err.rs:20:25
+  --> $DIR/issue-104884-trait-impl-sugg-err.rs:21:25
    |
 LL | #[derive(PartialOrd, AddImpl)]
    |          ---------- in this derive macro expansion
@@ -53,7 +53,7 @@ LL | struct PriorityQueue<T>(BinaryHeap<PriorityQueueEntry<T>>);
    = help: the trait `PartialOrd<_>` is not implemented for `BinaryHeap<PriorityQueueEntry<T>>`
 
 error[E0599]: no method named `cmp` found for struct `BinaryHeap<PriorityQueueEntry<T>>` in the current scope
-  --> $DIR/issue-104884-trait-impl-sugg-err.rs:13:22
+  --> $DIR/issue-104884-trait-impl-sugg-err.rs:14:22
    |
 LL | #[derive(PartialOrd, AddImpl)]
    |                      ^^^^^^^ `BinaryHeap<PriorityQueueEntry<T>>` is not an iterator
@@ -61,7 +61,7 @@ LL | #[derive(PartialOrd, AddImpl)]
    = note: this error originates in the derive macro `AddImpl` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0609]: no field `height` on type `&PriorityQueue<T>`
-  --> $DIR/issue-104884-trait-impl-sugg-err.rs:13:22
+  --> $DIR/issue-104884-trait-impl-sugg-err.rs:14:22
    |
 LL | #[derive(PartialOrd, AddImpl)]
    |                      ^^^^^^^ unknown field
diff --git a/tests/ui/proc-macro/issue-107113-wrap.rs b/tests/ui/proc-macro/issue-107113-wrap.rs
index 2799e79bb1c..a46cf893d90 100644
--- a/tests/ui/proc-macro/issue-107113-wrap.rs
+++ b/tests/ui/proc-macro/issue-107113-wrap.rs
@@ -1,5 +1,6 @@
 //@ edition:2021
 //@ proc-macro: issue-107113.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate issue_107113;
diff --git a/tests/ui/proc-macro/issue-107113-wrap.stderr b/tests/ui/proc-macro/issue-107113-wrap.stderr
index b541051147d..9b5b0333256 100644
--- a/tests/ui/proc-macro/issue-107113-wrap.stderr
+++ b/tests/ui/proc-macro/issue-107113-wrap.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-107113-wrap.rs:7:1
+  --> $DIR/issue-107113-wrap.rs:8:1
    |
 LL | #[issue_107113::main]
    | ^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/proc-macro/issue-118809.rs b/tests/ui/proc-macro/issue-118809.rs
index a6a3956981a..3ceede7e885 100644
--- a/tests/ui/proc-macro/issue-118809.rs
+++ b/tests/ui/proc-macro/issue-118809.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: issue-118809.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate issue_118809;
diff --git a/tests/ui/proc-macro/issue-118809.stderr b/tests/ui/proc-macro/issue-118809.stderr
index 30b09fd4006..98329fea119 100644
--- a/tests/ui/proc-macro/issue-118809.stderr
+++ b/tests/ui/proc-macro/issue-118809.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-118809.rs:6:10
+  --> $DIR/issue-118809.rs:7:10
    |
 LL | #[derive(Deserialize)]
    |          ^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | #[derive(Deserialize)]
    |          arguments to this enum variant are incorrect
    |
 help: the type constructed contains `u32` due to the type of the argument passed
-  --> $DIR/issue-118809.rs:6:10
+  --> $DIR/issue-118809.rs:7:10
    |
 LL | #[derive(Deserialize)]
    |          ^^^^^^^^^^^ this argument influences the type of `Some`
diff --git a/tests/ui/proc-macro/issue-38586.rs b/tests/ui/proc-macro/issue-38586.rs
index 88dbb8037be..c9623fd383b 100644
--- a/tests/ui/proc-macro/issue-38586.rs
+++ b/tests/ui/proc-macro/issue-38586.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: issue-38586.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate issue_38586;
diff --git a/tests/ui/proc-macro/issue-38586.stderr b/tests/ui/proc-macro/issue-38586.stderr
index 00491556450..e49d4c83e27 100644
--- a/tests/ui/proc-macro/issue-38586.stderr
+++ b/tests/ui/proc-macro/issue-38586.stderr
@@ -1,5 +1,5 @@
 error[E0425]: cannot find value `foo` in this scope
-  --> $DIR/issue-38586.rs:6:10
+  --> $DIR/issue-38586.rs:7:10
    |
 LL | #[derive(A)]
    |          ^ not found in this scope
diff --git a/tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs b/tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs
index df236cce6d2..988641b2b9c 100644
--- a/tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs
+++ b/tests/ui/proc-macro/issue-59191-replace-root-with-fn.rs
@@ -4,6 +4,7 @@
 //@ edition:2018
 //@ proc-macro: issue-59191.rs
 //@ needs-unwind (affects error output)
+//@ ignore-backends: gcc
 
 #![feature(custom_inner_attributes)]
 #![issue_59191::no_main]
diff --git a/tests/ui/proc-macro/issue-79148.rs b/tests/ui/proc-macro/issue-79148.rs
index b2248759b5f..7ce6216c842 100644
--- a/tests/ui/proc-macro/issue-79148.rs
+++ b/tests/ui/proc-macro/issue-79148.rs
@@ -1,5 +1,6 @@
 //@ proc-macro: re-export.rs
 //@ edition:2018
+//@ ignore-backends: gcc
 
 extern crate re_export;
 
diff --git a/tests/ui/proc-macro/issue-79148.stderr b/tests/ui/proc-macro/issue-79148.stderr
index 8adc4c6e0db..80a5b1a0855 100644
--- a/tests/ui/proc-macro/issue-79148.stderr
+++ b/tests/ui/proc-macro/issue-79148.stderr
@@ -1,11 +1,11 @@
 error[E0364]: `Variant` is only public within the crate, and cannot be re-exported outside
-  --> $DIR/issue-79148.rs:8:1
+  --> $DIR/issue-79148.rs:9:1
    |
 LL | cause_ice!();
    | ^^^^^^^^^^^^
    |
 note: consider marking `Variant` as `pub` in the imported module
-  --> $DIR/issue-79148.rs:8:1
+  --> $DIR/issue-79148.rs:9:1
    |
 LL | cause_ice!();
    | ^^^^^^^^^^^^
diff --git a/tests/ui/proc-macro/issue-83510.rs b/tests/ui/proc-macro/issue-83510.rs
index 67469511fc3..d49e1867f1d 100644
--- a/tests/ui/proc-macro/issue-83510.rs
+++ b/tests/ui/proc-macro/issue-83510.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: issue-83510.rs
+//@ ignore-backends: gcc
 
 extern crate issue_83510;
 
diff --git a/tests/ui/proc-macro/issue-83510.stderr b/tests/ui/proc-macro/issue-83510.stderr
index e59b77af3dc..a7c3f5a1d5b 100644
--- a/tests/ui/proc-macro/issue-83510.stderr
+++ b/tests/ui/proc-macro/issue-83510.stderr
@@ -1,5 +1,5 @@
 error[E0412]: cannot find type `Foo` in this scope
-  --> $DIR/issue-83510.rs:5:1
+  --> $DIR/issue-83510.rs:6:1
    |
 LL | issue_83510::dance_like_you_want_to_ice!();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
@@ -7,7 +7,7 @@ LL | issue_83510::dance_like_you_want_to_ice!();
    = note: this error originates in the macro `issue_83510::dance_like_you_want_to_ice` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0404]: expected trait, found struct `Box`
-  --> $DIR/issue-83510.rs:5:1
+  --> $DIR/issue-83510.rs:6:1
    |
 LL | issue_83510::dance_like_you_want_to_ice!();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a trait
@@ -15,7 +15,7 @@ LL | issue_83510::dance_like_you_want_to_ice!();
    = note: this error originates in the macro `issue_83510::dance_like_you_want_to_ice` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0405]: cannot find trait `Baz` in this scope
-  --> $DIR/issue-83510.rs:5:1
+  --> $DIR/issue-83510.rs:6:1
    |
 LL | issue_83510::dance_like_you_want_to_ice!();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
@@ -23,7 +23,7 @@ LL | issue_83510::dance_like_you_want_to_ice!();
    = note: this error originates in the macro `issue_83510::dance_like_you_want_to_ice` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0658]: inherent associated types are unstable
-  --> $DIR/issue-83510.rs:5:1
+  --> $DIR/issue-83510.rs:6:1
    |
 LL | issue_83510::dance_like_you_want_to_ice!();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/proc-macro/issue-91800.rs b/tests/ui/proc-macro/issue-91800.rs
index 8cecfad32b5..79cbf8632f0 100644
--- a/tests/ui/proc-macro/issue-91800.rs
+++ b/tests/ui/proc-macro/issue-91800.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: issue-91800-macro.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate issue_91800_macro;
diff --git a/tests/ui/proc-macro/issue-91800.stderr b/tests/ui/proc-macro/issue-91800.stderr
index 63ebc0a552e..be5a8ece384 100644
--- a/tests/ui/proc-macro/issue-91800.stderr
+++ b/tests/ui/proc-macro/issue-91800.stderr
@@ -1,5 +1,5 @@
 error: macros that expand to items must be delimited with braces or followed by a semicolon
-  --> $DIR/issue-91800.rs:6:10
+  --> $DIR/issue-91800.rs:7:10
    |
 LL | #[derive(MyTrait)]
    |          ^^^^^^^
@@ -7,13 +7,13 @@ LL | #[derive(MyTrait)]
    = note: this error originates in the derive macro `MyTrait` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: proc-macro derive produced unparsable tokens
-  --> $DIR/issue-91800.rs:6:10
+  --> $DIR/issue-91800.rs:7:10
    |
 LL | #[derive(MyTrait)]
    |          ^^^^^^^
 
 error: 
-  --> $DIR/issue-91800.rs:6:10
+  --> $DIR/issue-91800.rs:7:10
    |
 LL | #[derive(MyTrait)]
    |          ^^^^^^^
@@ -21,7 +21,7 @@ LL | #[derive(MyTrait)]
    = note: this error originates in the derive macro `MyTrait` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: macros that expand to items must be delimited with braces or followed by a semicolon
-  --> $DIR/issue-91800.rs:10:1
+  --> $DIR/issue-91800.rs:11:1
    |
 LL | #[attribute_macro]
    | ^^^^^^^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL | #[attribute_macro]
    = note: this error originates in the attribute macro `attribute_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: 
-  --> $DIR/issue-91800.rs:10:1
+  --> $DIR/issue-91800.rs:11:1
    |
 LL | #[attribute_macro]
    | ^^^^^^^^^^^^^^^^^^
@@ -37,7 +37,7 @@ LL | #[attribute_macro]
    = note: this error originates in the attribute macro `attribute_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: macros that expand to items must be delimited with braces or followed by a semicolon
-  --> $DIR/issue-91800.rs:15:1
+  --> $DIR/issue-91800.rs:16:1
    |
 LL | fn_macro! {}
    | ^^^^^^^^^^^^
@@ -45,7 +45,7 @@ LL | fn_macro! {}
    = note: this error originates in the macro `fn_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: 
-  --> $DIR/issue-91800.rs:15:1
+  --> $DIR/issue-91800.rs:16:1
    |
 LL | fn_macro! {}
    | ^^^^^^^^^^^^
diff --git a/tests/ui/proc-macro/lifetimes-rpass.rs b/tests/ui/proc-macro/lifetimes-rpass.rs
index c462b27722f..9b794e695cd 100644
--- a/tests/ui/proc-macro/lifetimes-rpass.rs
+++ b/tests/ui/proc-macro/lifetimes-rpass.rs
@@ -2,6 +2,7 @@
 
 #![allow(unused_variables)]
 //@ proc-macro: lifetimes-rpass.rs
+//@ ignore-backends: gcc
 
 extern crate lifetimes_rpass as lifetimes;
 use lifetimes::*;
diff --git a/tests/ui/proc-macro/lints_in_proc_macros.rs b/tests/ui/proc-macro/lints_in_proc_macros.rs
index 6714b8b6e1d..2c22c787982 100644
--- a/tests/ui/proc-macro/lints_in_proc_macros.rs
+++ b/tests/ui/proc-macro/lints_in_proc_macros.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: bang_proc_macro2.rs
+//@ ignore-backends: gcc
 
 extern crate bang_proc_macro2;
 
diff --git a/tests/ui/proc-macro/lints_in_proc_macros.stderr b/tests/ui/proc-macro/lints_in_proc_macros.stderr
index 244d218608b..016b236bda8 100644
--- a/tests/ui/proc-macro/lints_in_proc_macros.stderr
+++ b/tests/ui/proc-macro/lints_in_proc_macros.stderr
@@ -1,5 +1,5 @@
 error[E0425]: cannot find value `foobar2` in this scope
-  --> $DIR/lints_in_proc_macros.rs:9:5
+  --> $DIR/lints_in_proc_macros.rs:10:5
    |
 LL |     bang_proc_macro2!();
    |     ^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `foobar`
diff --git a/tests/ui/proc-macro/load-two.rs b/tests/ui/proc-macro/load-two.rs
index 608379949e6..197e7845db3 100644
--- a/tests/ui/proc-macro/load-two.rs
+++ b/tests/ui/proc-macro/load-two.rs
@@ -4,6 +4,7 @@
 #![allow(dead_code)]
 //@ proc-macro: derive-atob.rs
 //@ proc-macro: derive-ctod.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate derive_atob;
diff --git a/tests/ui/proc-macro/macro-crate-multi-decorator.rs b/tests/ui/proc-macro/macro-crate-multi-decorator.rs
index c4f02e7adfc..e247c9526a4 100644
--- a/tests/ui/proc-macro/macro-crate-multi-decorator.rs
+++ b/tests/ui/proc-macro/macro-crate-multi-decorator.rs
@@ -2,6 +2,7 @@
 
 //@ check-pass
 //@ proc-macro: duplicate.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate duplicate;
diff --git a/tests/ui/proc-macro/macro_rules_edition_from_pm.rs b/tests/ui/proc-macro/macro_rules_edition_from_pm.rs
index 8fc7d909749..fc3ae3ef2c8 100644
--- a/tests/ui/proc-macro/macro_rules_edition_from_pm.rs
+++ b/tests/ui/proc-macro/macro_rules_edition_from_pm.rs
@@ -7,6 +7,7 @@
 //@[edition2021] edition:2021
 //@[edition2024] edition:2024
 //@ check-pass
+//@ ignore-backends: gcc
 
 // This checks how the expr fragment specifier works.
 macro_rules_edition_pm::make_edition_macro!{}
diff --git a/tests/ui/proc-macro/match-expander.rs b/tests/ui/proc-macro/match-expander.rs
index 23e5746c540..b7245c7e682 100644
--- a/tests/ui/proc-macro/match-expander.rs
+++ b/tests/ui/proc-macro/match-expander.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: match-expander.rs
+//@ ignore-backends: gcc
 // Ensure that we don't point at macro invocation when providing inference contexts.
 
 #[macro_use]
diff --git a/tests/ui/proc-macro/match-expander.stderr b/tests/ui/proc-macro/match-expander.stderr
index b77468ec60a..d2423336b1d 100644
--- a/tests/ui/proc-macro/match-expander.stderr
+++ b/tests/ui/proc-macro/match-expander.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/match-expander.rs:8:5
+  --> $DIR/match-expander.rs:9:5
    |
 LL |     match_expander::matcher!();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `S`, found `bool`
diff --git a/tests/ui/proc-macro/mixed-site-span.rs b/tests/ui/proc-macro/mixed-site-span.rs
index 442b440c121..98a022632cd 100644
--- a/tests/ui/proc-macro/mixed-site-span.rs
+++ b/tests/ui/proc-macro/mixed-site-span.rs
@@ -2,6 +2,7 @@
 
 //@ aux-build: token-site-span.rs
 //@ proc-macro: mixed-site-span.rs
+//@ ignore-backends: gcc
 
 extern crate mixed_site_span;
 extern crate token_site_span;
diff --git a/tests/ui/proc-macro/mixed-site-span.stderr b/tests/ui/proc-macro/mixed-site-span.stderr
index d62031a853c..2d2d55fe148 100644
--- a/tests/ui/proc-macro/mixed-site-span.stderr
+++ b/tests/ui/proc-macro/mixed-site-span.stderr
@@ -1,5 +1,5 @@
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:47:5
+  --> $DIR/mixed-site-span.rs:48:5
    |
 LL |     invoke_with_crate!{input proc_macro_item}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
@@ -7,7 +7,7 @@ LL |     invoke_with_crate!{input proc_macro_item}
    = note: this error originates in the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:48:5
+  --> $DIR/mixed-site-span.rs:49:5
    |
 LL |     invoke_with_ident!{input proc_macro_item}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
@@ -15,7 +15,7 @@ LL |     invoke_with_ident!{input proc_macro_item}
    = note: this error originates in the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:49:5
+  --> $DIR/mixed-site-span.rs:50:5
    |
 LL |     invoke_with_crate!{call proc_macro_item}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
@@ -23,7 +23,7 @@ LL |     invoke_with_crate!{call proc_macro_item}
    = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:50:5
+  --> $DIR/mixed-site-span.rs:51:5
    |
 LL |     invoke_with_ident!{call proc_macro_item}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
@@ -31,7 +31,7 @@ LL |     invoke_with_ident!{call proc_macro_item}
    = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:51:5
+  --> $DIR/mixed-site-span.rs:52:5
    |
 LL |     invoke_with_ident!{hello call proc_macro_item}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
@@ -39,7 +39,7 @@ LL |     invoke_with_ident!{hello call proc_macro_item}
    = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate::proc_macro_item`
-  --> $DIR/mixed-site-span.rs:54:5
+  --> $DIR/mixed-site-span.rs:55:5
    |
 LL |     invoke_with_ident!{krate input proc_macro_item}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------^
@@ -50,7 +50,7 @@ LL |     invoke_with_ident!{krate input proc_macro_item}
    = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate::proc_macro_item`
-  --> $DIR/mixed-site-span.rs:55:5
+  --> $DIR/mixed-site-span.rs:56:5
    |
 LL |     with_crate!{krate input proc_macro_item}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^---------------^
@@ -61,7 +61,7 @@ LL |     with_crate!{krate input proc_macro_item}
    = note: this error originates in the macro `with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:56:5
+  --> $DIR/mixed-site-span.rs:57:5
    |
 LL |     with_crate!{krate call proc_macro_item}
    |     ^^^^^^^^^^^^^^^^^^^^^^^---------------^
@@ -72,7 +72,7 @@ LL |     with_crate!{krate call proc_macro_item}
    = note: this error originates in the macro `with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:60:28
+  --> $DIR/mixed-site-span.rs:61:28
    |
 LL |         invoke_with_ident!{$crate input proc_macro_item}
    |                            ^^^^^^       --------------- help: a similar name exists in the module: `proc_macro_rules`
@@ -85,7 +85,7 @@ LL |     test!();
    = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:61:21
+  --> $DIR/mixed-site-span.rs:62:21
    |
 LL |         with_crate!{$crate input proc_macro_item}
    |                     ^^^^^^       --------------- help: a similar name exists in the module: `proc_macro_rules`
@@ -98,7 +98,7 @@ LL |     test!();
    = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:62:9
+  --> $DIR/mixed-site-span.rs:63:9
    |
 LL |         with_crate!{$crate call proc_macro_item}
    |         ^^^^^^^^^^^^^^^^^^^^^^^^---------------^
@@ -112,7 +112,7 @@ LL |     test!();
    = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:67:5
+  --> $DIR/mixed-site-span.rs:68:5
    |
 LL |     test!();
    |     ^^^^^^^ no `proc_macro_item` in the root
@@ -120,7 +120,7 @@ LL |     test!();
    = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate::TokenItem`
-  --> $DIR/mixed-site-span.rs:87:5
+  --> $DIR/mixed-site-span.rs:88:5
    |
 LL |     invoke_with_ident!{krate input TokenItem}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
@@ -133,7 +133,7 @@ LL |     quote!(use $krate::$ident as token_site_span::TokenItem as _;)
    |                                  +++++++++++++++++++++++++++++
 
 error[E0432]: unresolved import `$crate::TokenItem`
-  --> $DIR/mixed-site-span.rs:88:5
+  --> $DIR/mixed-site-span.rs:89:5
    |
 LL |     with_crate!{krate input TokenItem}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
@@ -146,7 +146,7 @@ LL |     quote!(use $krate::$ident as token_site_span::TokenItem as _;)
    |                                  +++++++++++++++++++++++++++++
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:89:5
+  --> $DIR/mixed-site-span.rs:90:5
    |
 LL |     with_crate!{krate call TokenItem}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
@@ -159,7 +159,7 @@ LL +     token_site_span::TokenItem as _
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:92:5
+  --> $DIR/mixed-site-span.rs:93:5
    |
 LL |     invoke_with_crate!{mixed TokenItem}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
@@ -173,7 +173,7 @@ LL +     ($s:ident $i:ident) => { token_site_span::TokenItem as _ };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:93:5
+  --> $DIR/mixed-site-span.rs:94:5
    |
 LL |     invoke_with_ident!{mixed TokenItem}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
@@ -187,7 +187,7 @@ LL +     ($s:ident $i:ident) => { token_site_span::TokenItem as _ };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:94:5
+  --> $DIR/mixed-site-span.rs:95:5
    |
 LL |     invoke_with_ident!{krate mixed TokenItem}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
@@ -201,7 +201,7 @@ LL +     ($m:ident $s:ident $i:ident) => { token_site_span::TokenItem as _ };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:95:5
+  --> $DIR/mixed-site-span.rs:96:5
    |
 LL |     with_crate!{krate mixed TokenItem}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
@@ -214,7 +214,7 @@ LL +     token_site_span::TokenItem as _
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:99:28
+  --> $DIR/mixed-site-span.rs:100:28
    |
 LL |         invoke_with_ident!{$crate input TokenItem}
    |                            ^^^^^^ no `TokenItem` in the root
@@ -230,7 +230,7 @@ LL +         invoke_with_ident!{token_site_span::TokenItem as _ input TokenItem}
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:100:21
+  --> $DIR/mixed-site-span.rs:101:21
    |
 LL |         with_crate!{$crate input TokenItem}
    |                     ^^^^^^ no `TokenItem` in the root
@@ -246,7 +246,7 @@ LL +         with_crate!{token_site_span::TokenItem as _ input TokenItem}
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:101:9
+  --> $DIR/mixed-site-span.rs:102:9
    |
 LL |         with_crate!{$crate call TokenItem}
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
@@ -262,7 +262,7 @@ LL +         token_site_span::TokenItem as _
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:108:5
+  --> $DIR/mixed-site-span.rs:109:5
    |
 LL |     test!();
    |     ^^^^^^^ no `TokenItem` in the root
@@ -276,7 +276,7 @@ LL +     ($m:ident $s:ident $i:ident) => { token_site_span::TokenItem as _ };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:105:9
+  --> $DIR/mixed-site-span.rs:106:9
    |
 LL |         with_crate!{$crate mixed TokenItem}
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
@@ -292,7 +292,7 @@ LL +         token_site_span::TokenItem as _
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:129:5
+  --> $DIR/mixed-site-span.rs:130:5
    |
 LL |     invoke_with_crate!{input ItemUse}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -306,7 +306,7 @@ LL +     ($s:ident $i:ident) => { with_crate!{ItemUse as _ $s $i} };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:130:5
+  --> $DIR/mixed-site-span.rs:131:5
    |
 LL |     invoke_with_ident!{input ItemUse}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -320,7 +320,7 @@ LL +     ($s:ident $i:ident) => { with_crate!{ItemUse as _ $s $i} };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:133:5
+  --> $DIR/mixed-site-span.rs:134:5
    |
 LL |     invoke_with_crate!{mixed ItemUse}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -334,7 +334,7 @@ LL +     ($s:ident $i:ident) => { ItemUse as _ };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:134:5
+  --> $DIR/mixed-site-span.rs:135:5
    |
 LL |     invoke_with_ident!{mixed ItemUse}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -348,7 +348,7 @@ LL +     ($s:ident $i:ident) => { ItemUse as _ };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:135:5
+  --> $DIR/mixed-site-span.rs:136:5
    |
 LL |     invoke_with_ident!{krate mixed ItemUse}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -362,7 +362,7 @@ LL +     ($m:ident $s:ident $i:ident) => { ItemUse as _ };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:136:5
+  --> $DIR/mixed-site-span.rs:137:5
    |
 LL |     with_crate!{krate mixed ItemUse}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -375,7 +375,7 @@ LL +     ItemUse as _
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:138:5
+  --> $DIR/mixed-site-span.rs:139:5
    |
 LL |     invoke_with_crate!{call ItemUse}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -389,7 +389,7 @@ LL +     ($s:ident $i:ident) => { ItemUse as _ };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:139:5
+  --> $DIR/mixed-site-span.rs:140:5
    |
 LL |     invoke_with_ident!{call ItemUse}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -403,7 +403,7 @@ LL +     ($s:ident $i:ident) => { ItemUse as _ };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:140:5
+  --> $DIR/mixed-site-span.rs:141:5
    |
 LL |     invoke_with_ident!{hello call ItemUse}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -417,7 +417,7 @@ LL +     ($m:ident $s:ident $i:ident) => { ItemUse as _ };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:148:5
+  --> $DIR/mixed-site-span.rs:149:5
    |
 LL |     test!();
    |     ^^^^^^^ no `ItemUse` in the root
@@ -431,7 +431,7 @@ LL +     ($m:ident $s:ident $i:ident) => { ItemUse as _ };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:144:9
+  --> $DIR/mixed-site-span.rs:145:9
    |
 LL |         with_crate!{$crate mixed ItemUse}
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -447,7 +447,7 @@ LL +         ItemUse as _
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:148:5
+  --> $DIR/mixed-site-span.rs:149:5
    |
 LL |     test!();
    |     ^^^^^^^ no `ItemUse` in the root
@@ -461,7 +461,7 @@ LL +     ($m:ident $s:ident $i:ident) => { ItemUse as _ };
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:153:1
+  --> $DIR/mixed-site-span.rs:154:1
    |
 LL | use_input_crate!{proc_macro_item}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
@@ -469,7 +469,7 @@ LL | use_input_crate!{proc_macro_item}
    = note: this error originates in the macro `use_input_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:154:1
+  --> $DIR/mixed-site-span.rs:155:1
    |
 LL | use_input_krate!{proc_macro_item}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
@@ -477,7 +477,7 @@ LL | use_input_krate!{proc_macro_item}
    = note: this error originates in the macro `use_input_krate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:157:1
+  --> $DIR/mixed-site-span.rs:158:1
    |
 LL | use_call_crate!{proc_macro_item}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
@@ -485,7 +485,7 @@ LL | use_call_crate!{proc_macro_item}
    = note: this error originates in the macro `use_call_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:158:1
+  --> $DIR/mixed-site-span.rs:159:1
    |
 LL | use_call_krate!{proc_macro_item}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
@@ -493,7 +493,7 @@ LL | use_call_krate!{proc_macro_item}
    = note: this error originates in the macro `use_call_krate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:163:1
+  --> $DIR/mixed-site-span.rs:164:1
    |
 LL | use_mixed_crate!{TokenItem}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
@@ -507,7 +507,7 @@ LL +     token_site_span::TokenItem as _
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:164:1
+  --> $DIR/mixed-site-span.rs:165:1
    |
 LL | use_mixed_krate!{TokenItem}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
@@ -521,7 +521,7 @@ LL + token_site_span::TokenItem as _
    |
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:169:1
+  --> $DIR/mixed-site-span.rs:170:1
    |
 LL | use_input_crate!{ItemUse}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -529,7 +529,7 @@ LL | use_input_crate!{ItemUse}
    = note: this error originates in the macro `use_input_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:170:1
+  --> $DIR/mixed-site-span.rs:171:1
    |
 LL | use_input_krate!{ItemUse}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -537,7 +537,7 @@ LL | use_input_krate!{ItemUse}
    = note: this error originates in the macro `use_input_krate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:171:1
+  --> $DIR/mixed-site-span.rs:172:1
    |
 LL | use_mixed_crate!{ItemUse}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -545,7 +545,7 @@ LL | use_mixed_crate!{ItemUse}
    = note: this error originates in the macro `use_mixed_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:172:1
+  --> $DIR/mixed-site-span.rs:173:1
    |
 LL | use_mixed_krate!{ItemUse}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -553,7 +553,7 @@ LL | use_mixed_krate!{ItemUse}
    = note: this error originates in the macro `use_mixed_krate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:173:1
+  --> $DIR/mixed-site-span.rs:174:1
    |
 LL | use_call_crate!{ItemUse}
    | ^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -561,7 +561,7 @@ LL | use_call_crate!{ItemUse}
    = note: this error originates in the macro `use_call_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0432]: unresolved import `$crate`
-  --> $DIR/mixed-site-span.rs:174:1
+  --> $DIR/mixed-site-span.rs:175:1
    |
 LL | use_call_krate!{ItemUse}
    | ^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
@@ -569,7 +569,7 @@ LL | use_call_krate!{ItemUse}
    = note: this error originates in the macro `use_call_krate` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0426]: use of undeclared label `'label_use`
-  --> $DIR/mixed-site-span.rs:21:9
+  --> $DIR/mixed-site-span.rs:22:9
    |
 LL |         proc_macro_rules!();
    |         ^^^^^^^^^^^^^^^^^^^ undeclared label `'label_use`
@@ -577,7 +577,7 @@ LL |         proc_macro_rules!();
    = note: this error originates in the macro `proc_macro_rules` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0412]: cannot find type `ItemUse` in crate `$crate`
-  --> $DIR/mixed-site-span.rs:21:9
+  --> $DIR/mixed-site-span.rs:22:9
    |
 LL |         proc_macro_rules!();
    |         ^^^^^^^^^^^^^^^^^^^ not found in `$crate`
@@ -589,7 +589,7 @@ LL + use ItemUse;
    |
 
 error[E0425]: cannot find value `local_use` in this scope
-  --> $DIR/mixed-site-span.rs:21:9
+  --> $DIR/mixed-site-span.rs:22:9
    |
 LL |         proc_macro_rules!();
    |         ^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `local_def`
@@ -597,7 +597,7 @@ LL |         proc_macro_rules!();
    = note: this error originates in the macro `proc_macro_rules` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0425]: cannot find value `local_def` in this scope
-  --> $DIR/mixed-site-span.rs:26:9
+  --> $DIR/mixed-site-span.rs:27:9
    |
 LL |         local_def;
    |         ^^^^^^^^^ help: a local variable with a similar name exists: `local_use`
diff --git a/tests/ui/proc-macro/modify-ast.rs b/tests/ui/proc-macro/modify-ast.rs
index 9e890f3ebaa..75aea597ed5 100644
--- a/tests/ui/proc-macro/modify-ast.rs
+++ b/tests/ui/proc-macro/modify-ast.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ proc-macro: modify-ast.rs
+//@ ignore-backends: gcc
 
 extern crate modify_ast;
 
diff --git a/tests/ui/proc-macro/panic-abort.rs b/tests/ui/proc-macro/panic-abort.rs
index 58e1d006433..adedba4ebca 100644
--- a/tests/ui/proc-macro/panic-abort.rs
+++ b/tests/ui/proc-macro/panic-abort.rs
@@ -2,4 +2,4 @@
 //@ force-host
 //@ check-pass
 
-//~? WARN building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic
+//~? WARN building proc macro crate with `panic=abort` or `panic=immediate-abort` may crash the compiler should the proc-macro panic
diff --git a/tests/ui/proc-macro/panic-abort.stderr b/tests/ui/proc-macro/panic-abort.stderr
index a6e18614f8f..3dd75768bc4 100644
--- a/tests/ui/proc-macro/panic-abort.stderr
+++ b/tests/ui/proc-macro/panic-abort.stderr
@@ -1,4 +1,4 @@
-warning: building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic
+warning: building proc macro crate with `panic=abort` or `panic=immediate-abort` may crash the compiler should the proc-macro panic
 
 warning: 1 warning emitted
 
diff --git a/tests/ui/proc-macro/parent-source-spans.rs b/tests/ui/proc-macro/parent-source-spans.rs
index cc3ac795f7f..f675f6fb6f7 100644
--- a/tests/ui/proc-macro/parent-source-spans.rs
+++ b/tests/ui/proc-macro/parent-source-spans.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: parent-source-spans.rs
+//@ ignore-backends: gcc
 
 #![feature(decl_macro)]
 
diff --git a/tests/ui/proc-macro/parent-source-spans.stderr b/tests/ui/proc-macro/parent-source-spans.stderr
index db1eed5e458..28a70eea873 100644
--- a/tests/ui/proc-macro/parent-source-spans.stderr
+++ b/tests/ui/proc-macro/parent-source-spans.stderr
@@ -1,5 +1,5 @@
 error: first final: "hello"
-  --> $DIR/parent-source-spans.rs:16:12
+  --> $DIR/parent-source-spans.rs:17:12
    |
 LL |     three!($a, $b);
    |            ^^
@@ -10,7 +10,7 @@ LL |     one!("hello", "world");
    = note: this error originates in the macro `two` which comes from the expansion of the macro `one` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: second final: "world"
-  --> $DIR/parent-source-spans.rs:16:16
+  --> $DIR/parent-source-spans.rs:17:16
    |
 LL |     three!($a, $b);
    |                ^^
@@ -21,7 +21,7 @@ LL |     one!("hello", "world");
    = note: this error originates in the macro `two` which comes from the expansion of the macro `one` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: first parent: "hello"
-  --> $DIR/parent-source-spans.rs:10:5
+  --> $DIR/parent-source-spans.rs:11:5
    |
 LL |     two!($a, $b);
    |     ^^^^^^^^^^^^
@@ -32,7 +32,7 @@ LL |     one!("hello", "world");
    = note: this error originates in the macro `one` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: second parent: "world"
-  --> $DIR/parent-source-spans.rs:10:5
+  --> $DIR/parent-source-spans.rs:11:5
    |
 LL |     two!($a, $b);
    |     ^^^^^^^^^^^^
@@ -43,31 +43,31 @@ LL |     one!("hello", "world");
    = note: this error originates in the macro `one` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: first grandparent: "hello"
-  --> $DIR/parent-source-spans.rs:36:5
+  --> $DIR/parent-source-spans.rs:37:5
    |
 LL |     one!("hello", "world");
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 error: second grandparent: "world"
-  --> $DIR/parent-source-spans.rs:36:5
+  --> $DIR/parent-source-spans.rs:37:5
    |
 LL |     one!("hello", "world");
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 error: first source: "hello"
-  --> $DIR/parent-source-spans.rs:36:5
+  --> $DIR/parent-source-spans.rs:37:5
    |
 LL |     one!("hello", "world");
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 error: second source: "world"
-  --> $DIR/parent-source-spans.rs:36:5
+  --> $DIR/parent-source-spans.rs:37:5
    |
 LL |     one!("hello", "world");
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 error: first final: "yay"
-  --> $DIR/parent-source-spans.rs:16:12
+  --> $DIR/parent-source-spans.rs:17:12
    |
 LL |     three!($a, $b);
    |            ^^
@@ -78,7 +78,7 @@ LL |     two!("yay", "rust");
    = note: this error originates in the macro `two` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: second final: "rust"
-  --> $DIR/parent-source-spans.rs:16:16
+  --> $DIR/parent-source-spans.rs:17:16
    |
 LL |     three!($a, $b);
    |                ^^
@@ -89,55 +89,55 @@ LL |     two!("yay", "rust");
    = note: this error originates in the macro `two` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: first parent: "yay"
-  --> $DIR/parent-source-spans.rs:42:5
+  --> $DIR/parent-source-spans.rs:43:5
    |
 LL |     two!("yay", "rust");
    |     ^^^^^^^^^^^^^^^^^^^
 
 error: second parent: "rust"
-  --> $DIR/parent-source-spans.rs:42:5
+  --> $DIR/parent-source-spans.rs:43:5
    |
 LL |     two!("yay", "rust");
    |     ^^^^^^^^^^^^^^^^^^^
 
 error: first source: "yay"
-  --> $DIR/parent-source-spans.rs:42:5
+  --> $DIR/parent-source-spans.rs:43:5
    |
 LL |     two!("yay", "rust");
    |     ^^^^^^^^^^^^^^^^^^^
 
 error: second source: "rust"
-  --> $DIR/parent-source-spans.rs:42:5
+  --> $DIR/parent-source-spans.rs:43:5
    |
 LL |     two!("yay", "rust");
    |     ^^^^^^^^^^^^^^^^^^^
 
 error: first final: "hip"
-  --> $DIR/parent-source-spans.rs:48:12
+  --> $DIR/parent-source-spans.rs:49:12
    |
 LL |     three!("hip", "hop");
    |            ^^^^^
 
 error: second final: "hop"
-  --> $DIR/parent-source-spans.rs:48:19
+  --> $DIR/parent-source-spans.rs:49:19
    |
 LL |     three!("hip", "hop");
    |                   ^^^^^
 
 error: first source: "hip"
-  --> $DIR/parent-source-spans.rs:48:12
+  --> $DIR/parent-source-spans.rs:49:12
    |
 LL |     three!("hip", "hop");
    |            ^^^^^
 
 error: second source: "hop"
-  --> $DIR/parent-source-spans.rs:48:19
+  --> $DIR/parent-source-spans.rs:49:19
    |
 LL |     three!("hip", "hop");
    |                   ^^^^^
 
 error[E0425]: cannot find value `ok` in this scope
-  --> $DIR/parent-source-spans.rs:29:5
+  --> $DIR/parent-source-spans.rs:30:5
    |
 LL |     parent_source_spans!($($tokens)*);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a tuple variant with a similar name exists: `Ok`
@@ -152,7 +152,7 @@ LL |     one!("hello", "world");
    = note: this error originates in the macro `parent_source_spans` which comes from the expansion of the macro `one` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0425]: cannot find value `ok` in this scope
-  --> $DIR/parent-source-spans.rs:29:5
+  --> $DIR/parent-source-spans.rs:30:5
    |
 LL |     parent_source_spans!($($tokens)*);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a tuple variant with a similar name exists: `Ok`
@@ -167,7 +167,7 @@ LL |     two!("yay", "rust");
    = note: this error originates in the macro `parent_source_spans` which comes from the expansion of the macro `two` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0425]: cannot find value `ok` in this scope
-  --> $DIR/parent-source-spans.rs:29:5
+  --> $DIR/parent-source-spans.rs:30:5
    |
 LL |     parent_source_spans!($($tokens)*);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a tuple variant with a similar name exists: `Ok`
diff --git a/tests/ui/proc-macro/pretty-print-hack-show.rs b/tests/ui/proc-macro/pretty-print-hack-show.rs
index 70f0d5f6ea9..08e26c81142 100644
--- a/tests/ui/proc-macro/pretty-print-hack-show.rs
+++ b/tests/ui/proc-macro/pretty-print-hack-show.rs
@@ -1,7 +1,6 @@
 //@ proc-macro: test-macros.rs
 //@ compile-flags: -Z span-debug
 //@ revisions: local remapped
-// [local] no-remap-src-base: The hack should work regardless of remapping.
 //@ [remapped] remap-src-base
 
 #![no_std] // Don't load unnecessary hygiene information from std
diff --git a/tests/ui/proc-macro/quote/basic.rs b/tests/ui/proc-macro/quote/basic.rs
index 0336dbb7856..4c6fb2408fb 100644
--- a/tests/ui/proc-macro/quote/basic.rs
+++ b/tests/ui/proc-macro/quote/basic.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ proc-macro: basic.rs
+//@ ignore-backends: gcc
 
 extern crate basic;
 
diff --git a/tests/ui/proc-macro/quote/not-quotable.stderr b/tests/ui/proc-macro/quote/not-quotable.stderr
index d1c3d06f2b6..62a02638e54 100644
--- a/tests/ui/proc-macro/quote/not-quotable.stderr
+++ b/tests/ui/proc-macro/quote/not-quotable.stderr
@@ -15,8 +15,8 @@ LL |     let _ = quote! { $ip };
              Cow<'_, T>
              Option<T>
              Rc<T>
-             RepInterp<T>
-           and 25 others
+             bool
+           and 24 others
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/proc-macro/quote/not-repeatable.rs b/tests/ui/proc-macro/quote/not-repeatable.rs
index 0291e4ddf88..373f0e74dbd 100644
--- a/tests/ui/proc-macro/quote/not-repeatable.rs
+++ b/tests/ui/proc-macro/quote/not-repeatable.rs
@@ -8,5 +8,7 @@ struct Ipv4Addr;
 
 fn main() {
     let ip = Ipv4Addr;
-    let _ = quote! { $($ip)* }; //~ ERROR the method `quote_into_iter` exists for struct `Ipv4Addr`, but its trait bounds were not satisfied
+    let _ = quote! { $($ip)* };
+    //~^ ERROR the method `quote_into_iter` exists for struct `Ipv4Addr`, but its trait bounds were not satisfied
+    //~| ERROR type annotations needed
 }
diff --git a/tests/ui/proc-macro/quote/not-repeatable.stderr b/tests/ui/proc-macro/quote/not-repeatable.stderr
index aeda08d7de6..ff31799abb0 100644
--- a/tests/ui/proc-macro/quote/not-repeatable.stderr
+++ b/tests/ui/proc-macro/quote/not-repeatable.stderr
@@ -20,6 +20,13 @@ note: the traits `Iterator` and `ToTokens` must be implemented
   --> $SRC_DIR/proc_macro/src/to_tokens.rs:LL:COL
   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
 
-error: aborting due to 1 previous error
+error[E0282]: type annotations needed
+  --> $DIR/not-repeatable.rs:11:13
+   |
+LL |     let _ = quote! { $($ip)* };
+   |             ^^^^^^^^^^^^^^^^^^ cannot infer type
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0599`.
+Some errors have detailed explanations: E0282, E0599.
+For more information about an error, try `rustc --explain E0282`.
diff --git a/tests/ui/proc-macro/span-api-tests.rs b/tests/ui/proc-macro/span-api-tests.rs
index 792859ed05b..12832ba1163 100644
--- a/tests/ui/proc-macro/span-api-tests.rs
+++ b/tests/ui/proc-macro/span-api-tests.rs
@@ -2,6 +2,7 @@
 //@ proc-macro: span-api-tests.rs
 //@ aux-build:span-test-macros.rs
 //@ compile-flags: -Ztranslate-remapped-path-to-local-path=yes
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate span_test_macros;
diff --git a/tests/ui/proc-macro/span-from-proc-macro.rs b/tests/ui/proc-macro/span-from-proc-macro.rs
index 4e12a695a5c..24a28d53476 100644
--- a/tests/ui/proc-macro/span-from-proc-macro.rs
+++ b/tests/ui/proc-macro/span-from-proc-macro.rs
@@ -1,6 +1,7 @@
 //@ proc-macro: custom-quote.rs
 //@ proc-macro: span-from-proc-macro.rs
 //@ compile-flags: -Z macro-backtrace
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate span_from_proc_macro;
diff --git a/tests/ui/proc-macro/span-from-proc-macro.stderr b/tests/ui/proc-macro/span-from-proc-macro.stderr
index c79ab04eadf..945a5620fac 100644
--- a/tests/ui/proc-macro/span-from-proc-macro.stderr
+++ b/tests/ui/proc-macro/span-from-proc-macro.stderr
@@ -7,7 +7,7 @@ LL | pub fn error_from_attribute(_args: TokenStream, _input: TokenStream) -> Tok
 LL |             field: MissingType
    |                    ^^^^^^^^^^^ not found in this scope
    |
-  ::: $DIR/span-from-proc-macro.rs:8:1
+  ::: $DIR/span-from-proc-macro.rs:9:1
    |
 LL | #[error_from_attribute]
    | ----------------------- in this attribute macro expansion
@@ -21,7 +21,7 @@ LL | pub fn error_from_derive(_input: TokenStream) -> TokenStream {
 LL |             Variant(OtherMissingType)
    |                     ^^^^^^^^^^^^^^^^ not found in this scope
    |
-  ::: $DIR/span-from-proc-macro.rs:11:10
+  ::: $DIR/span-from-proc-macro.rs:12:10
    |
 LL | #[derive(ErrorFromDerive)]
    |          --------------- in this derive macro expansion
@@ -35,7 +35,7 @@ LL |     custom_quote::custom_quote! {
 LL |         my_ident
    |         ^^^^^^^^ not found in this scope
    |
-  ::: $DIR/span-from-proc-macro.rs:16:5
+  ::: $DIR/span-from-proc-macro.rs:17:5
    |
 LL |     other_error_from_bang!();
    |     ------------------------ in this macro invocation
@@ -51,7 +51,7 @@ LL |             let bang_error: bool = 25;
 LL | pub fn error_from_bang(_input: TokenStream) -> TokenStream {
    | ---------------------------------------------------------- in this expansion of `error_from_bang!`
    |
-  ::: $DIR/span-from-proc-macro.rs:15:5
+  ::: $DIR/span-from-proc-macro.rs:16:5
    |
 LL |     error_from_bang!();
    |     ------------------ in this macro invocation
diff --git a/tests/ui/proc-macro/weird-hygiene.rs b/tests/ui/proc-macro/weird-hygiene.rs
index de55484109a..8d8427d0e41 100644
--- a/tests/ui/proc-macro/weird-hygiene.rs
+++ b/tests/ui/proc-macro/weird-hygiene.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: weird-hygiene.rs
+//@ ignore-backends: gcc
 
 #![feature(stmt_expr_attributes)]
 #![feature(proc_macro_hygiene)]
diff --git a/tests/ui/proc-macro/weird-hygiene.stderr b/tests/ui/proc-macro/weird-hygiene.stderr
index 256e68e8970..0cfac3f89a0 100644
--- a/tests/ui/proc-macro/weird-hygiene.stderr
+++ b/tests/ui/proc-macro/weird-hygiene.stderr
@@ -1,5 +1,5 @@
 error[E0425]: cannot find value `hidden_ident` in this scope
-  --> $DIR/weird-hygiene.rs:23:43
+  --> $DIR/weird-hygiene.rs:24:43
    |
 LL |             Value = (stringify!($tokens + hidden_ident), 1).1
    |                                           ^^^^^^^^^^^^ not found in this scope
@@ -10,7 +10,7 @@ LL |     other!(50);
    = note: this error originates in the macro `inner` which comes from the expansion of the macro `other` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0425]: cannot find value `hidden_ident` in this scope
-  --> $DIR/weird-hygiene.rs:34:13
+  --> $DIR/weird-hygiene.rs:35:13
    |
 LL |             hidden_ident
    |             ^^^^^^^^^^^^ not found in this scope
diff --git a/tests/ui/process/core-run-destroy.rs b/tests/ui/process/core-run-destroy.rs
index f4be54da8fe..f381997ef79 100644
--- a/tests/ui/process/core-run-destroy.rs
+++ b/tests/ui/process/core-run-destroy.rs
@@ -8,6 +8,10 @@
 //@ needs-subprocess
 //@ ignore-vxworks no 'cat' and 'sleep'
 //@ ignore-fuchsia no 'cat'
+//@ ignore-ios no 'cat' and 'sleep'
+//@ ignore-tvos no 'cat' and 'sleep'
+//@ ignore-watchos no 'cat' and 'sleep'
+//@ ignore-visionos no 'cat' and 'sleep'
 
 // N.B., these tests kill child processes. Valgrind sees these children as leaking
 // memory, which makes for some *confusing* logs. That's why these are here
diff --git a/tests/ui/process/env-funky-keys.rs b/tests/ui/process/env-funky-keys.rs
index a4a71c94020..193659bea29 100644
--- a/tests/ui/process/env-funky-keys.rs
+++ b/tests/ui/process/env-funky-keys.rs
@@ -1,8 +1,7 @@
 //@ run-pass
 //@ edition: 2021
-// Ignore this test on Android, because it segfaults there.
 
-//@ ignore-android
+//@ ignore-android segfaults
 //@ ignore-windows
 //@ ignore-wasm32 no execve
 //@ ignore-sgx no execve
@@ -24,6 +23,9 @@ use std::ptr;
 fn main() {
     if env::args_os().count() == 2 {
         for (key, value) in env::vars_os() {
+            if key == "DYLD_ROOT_PATH" {
+                continue;
+            }
             panic!("found env value {:?} {:?}", key, value);
         }
         return;
@@ -35,7 +37,18 @@ fn main() {
                                        .as_bytes()).unwrap();
     let filename: *const c_char = current_exe.as_ptr();
     let argv: &[*const c_char] = &[filename, filename, ptr::null()];
-    let envp: &[*const c_char] = &[c"FOOBAR".as_ptr(), ptr::null()];
+
+    let root;
+    let envp: &[*const c_char] = if cfg!(all(target_vendor = "apple", target_env = "sim")) {
+        // Workaround: iOS/tvOS/watchOS/visionOS simulators need the root path
+        // from the current process.
+        root = format!("DYLD_ROOT_PATH={}\0", std::env::var("DYLD_ROOT_PATH").unwrap());
+        &[c"FOOBAR".as_ptr(), root.as_ptr().cast(), ptr::null()]
+    } else {
+        // Try to set an environment variable without a value.
+        &[c"FOOBAR".as_ptr(), ptr::null()]
+    };
+
     unsafe {
         execve(filename, &argv[0], &envp[0]);
     }
diff --git a/tests/ui/process/fds-are-cloexec.rs b/tests/ui/process/fds-are-cloexec.rs
index f6678379dd6..0fae7c2b502 100644
--- a/tests/ui/process/fds-are-cloexec.rs
+++ b/tests/ui/process/fds-are-cloexec.rs
@@ -74,8 +74,15 @@ fn child(args: &[String]) {
         let fd: libc::c_int = arg.parse().unwrap();
         unsafe {
             assert_eq!(libc::read(fd, b.as_mut_ptr() as *mut _, 2), -1);
-            assert_eq!(io::Error::last_os_error().raw_os_error(),
-                       Some(libc::EBADF));
+            let raw = io::Error::last_os_error().raw_os_error();
+            if cfg!(all(target_vendor = "apple", not(target_os = "macos"))) {
+                // Workaround: iOS/tvOS/watchOS/visionOS seems to treat `tcp6`
+                // as a directory?
+                if raw == Some(libc::EISDIR) {
+                    continue;
+                }
+            }
+            assert_eq!(raw, Some(libc::EBADF));
         }
     }
 }
diff --git a/tests/ui/process/multi-panic.rs b/tests/ui/process/multi-panic.rs
index 1fddffeb770..67bbd16fba7 100644
--- a/tests/ui/process/multi-panic.rs
+++ b/tests/ui/process/multi-panic.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-subprocess
 //@ needs-unwind
+//@ ignore-backends: gcc
 
 fn check_for_no_backtrace(test: std::process::Output) {
     assert!(!test.status.success());
diff --git a/tests/ui/process/println-with-broken-pipe.rs b/tests/ui/process/println-with-broken-pipe.rs
index 58b83a2dd9a..e87e2077370 100644
--- a/tests/ui/process/println-with-broken-pipe.rs
+++ b/tests/ui/process/println-with-broken-pipe.rs
@@ -5,6 +5,10 @@
 //@ ignore-fuchsia
 //@ ignore-horizon
 //@ ignore-android
+//@ ignore-ios no 'head'
+//@ ignore-tvos no 'head'
+//@ ignore-watchos no 'head'
+//@ ignore-visionos no 'head'
 //@ ignore-backends: gcc
 //@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:CC"
 //@ compile-flags: -Zon-broken-pipe=error
diff --git a/tests/ui/process/process-envs.rs b/tests/ui/process/process-envs.rs
index 98052f1d3a5..cbe16704a8e 100644
--- a/tests/ui/process/process-envs.rs
+++ b/tests/ui/process/process-envs.rs
@@ -2,6 +2,10 @@
 //@ needs-subprocess
 //@ ignore-vxworks no 'env'
 //@ ignore-fuchsia no 'env'
+//@ ignore-ios no 'env'
+//@ ignore-tvos no 'env'
+//@ ignore-watchos no 'env'
+//@ ignore-visionos no 'env'
 
 use std::process::Command;
 use std::env;
diff --git a/tests/ui/process/process-panic-after-fork.rs b/tests/ui/process/process-panic-after-fork.rs
index 6e0267e0a54..653ff6ce314 100644
--- a/tests/ui/process/process-panic-after-fork.rs
+++ b/tests/ui/process/process-panic-after-fork.rs
@@ -3,6 +3,8 @@
 //@ only-unix
 //@ needs-subprocess
 //@ ignore-fuchsia no fork
+//@ ignore-tvos fork is prohibited
+//@ ignore-watchos fork is prohibited
 
 #![feature(rustc_private)]
 #![feature(never_type)]
diff --git a/tests/ui/process/process-remove-from-env.rs b/tests/ui/process/process-remove-from-env.rs
index c1a2b2daf5b..68c3909b15a 100644
--- a/tests/ui/process/process-remove-from-env.rs
+++ b/tests/ui/process/process-remove-from-env.rs
@@ -2,6 +2,10 @@
 //@ needs-subprocess
 //@ ignore-vxworks no 'env'
 //@ ignore-fuchsia no 'env'
+//@ ignore-ios no 'env'
+//@ ignore-tvos no 'env'
+//@ ignore-watchos no 'env'
+//@ ignore-visionos no 'env'
 
 use std::process::Command;
 use std::env;
diff --git a/tests/ui/process/process-sigpipe.rs b/tests/ui/process/process-sigpipe.rs
index 3ecf271599d..574d79ee1dd 100644
--- a/tests/ui/process/process-sigpipe.rs
+++ b/tests/ui/process/process-sigpipe.rs
@@ -15,6 +15,10 @@
 
 //@ ignore-vxworks no 'sh'
 //@ ignore-fuchsia no 'sh'
+//@ ignore-ios no 'sh'
+//@ ignore-tvos no 'sh'
+//@ ignore-watchos no 'sh'
+//@ ignore-visionos no 'sh'
 //@ needs-threads
 //@ only-unix SIGPIPE is a unix feature
 
diff --git a/tests/ui/process/process-spawn-failure.rs b/tests/ui/process/process-spawn-failure.rs
index 0950b044c97..ac2c34bc783 100644
--- a/tests/ui/process/process-spawn-failure.rs
+++ b/tests/ui/process/process-spawn-failure.rs
@@ -9,6 +9,10 @@
 //@ ignore-vxworks no 'ps'
 //@ ignore-fuchsia no 'ps'
 //@ ignore-nto no 'ps'
+//@ ignore-ios no 'ps'
+//@ ignore-tvos no 'ps'
+//@ ignore-watchos no 'ps'
+//@ ignore-visionos no 'ps'
 
 #![feature(rustc_private)]
 
diff --git a/tests/ui/reborrow/custom_mut.rs b/tests/ui/reborrow/custom_mut.rs
new file mode 100644
index 00000000000..1e7c4693238
--- /dev/null
+++ b/tests/ui/reborrow/custom_mut.rs
@@ -0,0 +1,13 @@
+#![feature(reborrow)]
+use std::ops::Reborrow;
+
+struct CustomMut<'a, T>(&'a mut T);
+impl<'a, T> Reborrow for CustomMut<'a, T> {}
+
+fn method(a: CustomMut<'_, ()>) {}
+
+fn main() {
+    let a = CustomMut(&mut ());
+    let _ = method(a);
+    let _ = method(a); //~ERROR use of moved value: `a`
+}
diff --git a/tests/ui/reborrow/custom_mut.stderr b/tests/ui/reborrow/custom_mut.stderr
new file mode 100644
index 00000000000..3b3f47b62d6
--- /dev/null
+++ b/tests/ui/reborrow/custom_mut.stderr
@@ -0,0 +1,29 @@
+error[E0382]: use of moved value: `a`
+  --> $DIR/custom_mut.rs:12:20
+   |
+LL |     let a = CustomMut(&mut ());
+   |         - move occurs because `a` has type `CustomMut<'_, ()>`, which does not implement the `Copy` trait
+LL |     let _ = method(a);
+   |                    - value moved here
+LL |     let _ = method(a);
+   |                    ^ value used here after move
+   |
+note: consider changing this parameter type in function `method` to borrow instead if owning the value isn't necessary
+  --> $DIR/custom_mut.rs:7:14
+   |
+LL | fn method(a: CustomMut<'_, ()>) {}
+   |    ------    ^^^^^^^^^^^^^^^^^ this parameter takes ownership of the value
+   |    |
+   |    in this function
+note: if `CustomMut<'_, ()>` implemented `Clone`, you could clone the value
+  --> $DIR/custom_mut.rs:4:1
+   |
+LL | struct CustomMut<'a, T>(&'a mut T);
+   | ^^^^^^^^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type
+...
+LL |     let _ = method(a);
+   |                    - you could clone this value
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0382`.
diff --git a/tests/ui/reborrow/custom_mut_coerce_shared.rs b/tests/ui/reborrow/custom_mut_coerce_shared.rs
new file mode 100644
index 00000000000..e2d25835c09
--- /dev/null
+++ b/tests/ui/reborrow/custom_mut_coerce_shared.rs
@@ -0,0 +1,28 @@
+#![feature(reborrow)]
+use std::ops::{CoerceShared, Reborrow};
+
+struct CustomMut<'a, T>(&'a mut T);
+impl<'a, T> Reborrow for CustomMut<'a, T> {}
+impl<'a, T> CoerceShared for CustomMut<'a, T> {
+    type Target = CustomRef<'a, T>;
+}
+
+struct CustomRef<'a, T>(&'a T);
+
+impl<'a, T> Clone for CustomRef<'a, T> {
+    fn clone(&self) -> Self {
+        Self(self.0)
+    }
+}
+impl<'a, T> Copy for CustomRef<'a, T> {}
+
+fn method(a: CustomRef<'_, ()>) {}  //~NOTE function defined here
+
+fn main() {
+    let a = CustomMut(&mut ());
+    method(a);
+    //~^ ERROR mismatched types
+    //~| NOTE expected `CustomRef<'_, ()>`, found `CustomMut<'_, ()>`
+    //~| NOTE arguments to this function are incorrect
+    //~| NOTE expected struct `CustomRef<'_, ()>`
+}
diff --git a/tests/ui/reborrow/custom_mut_coerce_shared.stderr b/tests/ui/reborrow/custom_mut_coerce_shared.stderr
new file mode 100644
index 00000000000..508651badc0
--- /dev/null
+++ b/tests/ui/reborrow/custom_mut_coerce_shared.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+  --> $DIR/custom_mut_coerce_shared.rs:23:12
+   |
+LL |     method(a);
+   |     ------ ^ expected `CustomRef<'_, ()>`, found `CustomMut<'_, ()>`
+   |     |
+   |     arguments to this function are incorrect
+   |
+   = note: expected struct `CustomRef<'_, ()>`
+              found struct `CustomMut<'_, ()>`
+note: function defined here
+  --> $DIR/custom_mut_coerce_shared.rs:19:4
+   |
+LL | fn method(a: CustomRef<'_, ()>) {}
+   |    ^^^^^^ --------------------
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/reborrow/option_mut.rs b/tests/ui/reborrow/option_mut.rs
new file mode 100644
index 00000000000..04d8301772d
--- /dev/null
+++ b/tests/ui/reborrow/option_mut.rs
@@ -0,0 +1,7 @@
+fn method(a: Option<&mut ()>) {}
+
+fn main() {
+    let a = Some(&mut ());
+    let _ = method(a);
+    let _ = method(a); //~ERROR use of moved value: `a`
+}
diff --git a/tests/ui/reborrow/option_mut.stderr b/tests/ui/reborrow/option_mut.stderr
new file mode 100644
index 00000000000..d665e266079
--- /dev/null
+++ b/tests/ui/reborrow/option_mut.stderr
@@ -0,0 +1,21 @@
+error[E0382]: use of moved value: `a`
+  --> $DIR/option_mut.rs:6:20
+   |
+LL |     let a = Some(&mut ());
+   |         - move occurs because `a` has type `Option<&mut ()>`, which does not implement the `Copy` trait
+LL |     let _ = method(a);
+   |                    - value moved here
+LL |     let _ = method(a);
+   |                    ^ value used here after move
+   |
+note: consider changing this parameter type in function `method` to borrow instead if owning the value isn't necessary
+  --> $DIR/option_mut.rs:1:14
+   |
+LL | fn method(a: Option<&mut ()>) {}
+   |    ------    ^^^^^^^^^^^^^^^ this parameter takes ownership of the value
+   |    |
+   |    in this function
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0382`.
diff --git a/tests/ui/reborrow/option_mut_coerce_shared.rs b/tests/ui/reborrow/option_mut_coerce_shared.rs
new file mode 100644
index 00000000000..95d33ed94dd
--- /dev/null
+++ b/tests/ui/reborrow/option_mut_coerce_shared.rs
@@ -0,0 +1,11 @@
+fn method(a: Option<&()>) {}  //~NOTE function defined here
+
+fn main() {
+    let a = Some(&mut ());
+    method(a);
+    //~^ ERROR mismatched types
+    //~| NOTE arguments to this function are incorrect
+    //~| NOTE types differ in mutability
+    //~| NOTE expected enum `Option<&()>`
+    //~| NOTE    found enum `Option<&mut ()>`
+}
diff --git a/tests/ui/reborrow/option_mut_coerce_shared.stderr b/tests/ui/reborrow/option_mut_coerce_shared.stderr
new file mode 100644
index 00000000000..6ca1a237461
--- /dev/null
+++ b/tests/ui/reborrow/option_mut_coerce_shared.stderr
@@ -0,0 +1,23 @@
+error[E0308]: mismatched types
+  --> $DIR/option_mut_coerce_shared.rs:5:12
+   |
+LL |     method(a);
+   |     ------ ^ types differ in mutability
+   |     |
+   |     arguments to this function are incorrect
+   |
+   = note: expected enum `Option<&()>`
+              found enum `Option<&mut ()>`
+note: function defined here
+  --> $DIR/option_mut_coerce_shared.rs:1:4
+   |
+LL | fn method(a: Option<&()>) {}
+   |    ^^^^^^ --------------
+help: try using `.as_deref()` to convert `Option<&mut ()>` to `Option<&()>`
+   |
+LL |     method(a.as_deref());
+   |             +++++++++++
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/reborrow/pin_mut.rs b/tests/ui/reborrow/pin_mut.rs
new file mode 100644
index 00000000000..959cb14f8c9
--- /dev/null
+++ b/tests/ui/reborrow/pin_mut.rs
@@ -0,0 +1,10 @@
+use std::pin::Pin;
+
+fn method(a: Pin<&mut ()>) {}
+
+fn main() {
+    let a = &mut ();
+    let a = Pin::new(a);
+    let _ = method(a);
+    let _ = method(a); //~ERROR use of moved value: `a`
+}
diff --git a/tests/ui/reborrow/pin_mut.stderr b/tests/ui/reborrow/pin_mut.stderr
new file mode 100644
index 00000000000..64e3f603e11
--- /dev/null
+++ b/tests/ui/reborrow/pin_mut.stderr
@@ -0,0 +1,21 @@
+error[E0382]: use of moved value: `a`
+  --> $DIR/pin_mut.rs:9:20
+   |
+LL |     let a = Pin::new(a);
+   |         - move occurs because `a` has type `Pin<&mut ()>`, which does not implement the `Copy` trait
+LL |     let _ = method(a);
+   |                    - value moved here
+LL |     let _ = method(a);
+   |                    ^ value used here after move
+   |
+note: consider changing this parameter type in function `method` to borrow instead if owning the value isn't necessary
+  --> $DIR/pin_mut.rs:3:14
+   |
+LL | fn method(a: Pin<&mut ()>) {}
+   |    ------    ^^^^^^^^^^^^ this parameter takes ownership of the value
+   |    |
+   |    in this function
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0382`.
diff --git a/tests/ui/reborrow/pin_mut_coerce_shared.rs b/tests/ui/reborrow/pin_mut_coerce_shared.rs
new file mode 100644
index 00000000000..06af0b765d0
--- /dev/null
+++ b/tests/ui/reborrow/pin_mut_coerce_shared.rs
@@ -0,0 +1,13 @@
+use std::pin::Pin;
+
+fn method(a: Pin<&()>) {}  //~NOTE function defined here
+
+fn main() {
+    let a = &mut ();
+    let a = Pin::new(a);
+    method(a);
+    //~^ ERROR mismatched types
+    //~| NOTE arguments to this function are incorrect
+    //~| NOTE types differ in mutability
+    //~| NOTE expected struct `Pin<&()>`
+}
diff --git a/tests/ui/reborrow/pin_mut_coerce_shared.stderr b/tests/ui/reborrow/pin_mut_coerce_shared.stderr
new file mode 100644
index 00000000000..74ecf4de4c7
--- /dev/null
+++ b/tests/ui/reborrow/pin_mut_coerce_shared.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+  --> $DIR/pin_mut_coerce_shared.rs:8:12
+   |
+LL |     method(a);
+   |     ------ ^ types differ in mutability
+   |     |
+   |     arguments to this function are incorrect
+   |
+   = note: expected struct `Pin<&()>`
+              found struct `Pin<&mut ()>`
+note: function defined here
+  --> $DIR/pin_mut_coerce_shared.rs:3:4
+   |
+LL | fn method(a: Pin<&()>) {}
+   |    ^^^^^^ -----------
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/regions/multiple-sources-for-outlives-requirement.rs b/tests/ui/regions/multiple-sources-for-outlives-requirement.rs
new file mode 100644
index 00000000000..720cd1cf6ee
--- /dev/null
+++ b/tests/ui/regions/multiple-sources-for-outlives-requirement.rs
@@ -0,0 +1,11 @@
+fn outlives_indir<'a: 'b, 'b, T: 'a>(_x: T) {}
+//~^ NOTE: requirements that the value outlives `'b` introduced here
+
+fn foo<'b>() { //~ NOTE: lifetime `'b` defined here
+    outlives_indir::<'_, 'b, _>(&mut 1u32); //~ ERROR: temporary value dropped while borrowed
+    //~^ NOTE: argument requires that borrow lasts for `'b`
+    //~| NOTE: creates a temporary value which is freed while still in use
+    //~| NOTE: temporary value is freed at the end of this statement
+}
+
+fn main() {}
diff --git a/tests/ui/regions/multiple-sources-for-outlives-requirement.stderr b/tests/ui/regions/multiple-sources-for-outlives-requirement.stderr
new file mode 100644
index 00000000000..4cdaf950e15
--- /dev/null
+++ b/tests/ui/regions/multiple-sources-for-outlives-requirement.stderr
@@ -0,0 +1,20 @@
+error[E0716]: temporary value dropped while borrowed
+  --> $DIR/multiple-sources-for-outlives-requirement.rs:5:38
+   |
+LL | fn foo<'b>() {
+   |        -- lifetime `'b` defined here
+LL |     outlives_indir::<'_, 'b, _>(&mut 1u32);
+   |     ---------------------------------^^^^-- temporary value is freed at the end of this statement
+   |     |                                |
+   |     |                                creates a temporary value which is freed while still in use
+   |     argument requires that borrow lasts for `'b`
+   |
+note: requirements that the value outlives `'b` introduced here
+  --> $DIR/multiple-sources-for-outlives-requirement.rs:1:23
+   |
+LL | fn outlives_indir<'a: 'b, 'b, T: 'a>(_x: T) {}
+   |                       ^^         ^^
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0716`.
diff --git a/tests/ui/regions/regions-infer-proc-static-upvar.stderr b/tests/ui/regions/regions-infer-proc-static-upvar.stderr
index 919fcffdc53..158d74ed06d 100644
--- a/tests/ui/regions/regions-infer-proc-static-upvar.stderr
+++ b/tests/ui/regions/regions-infer-proc-static-upvar.stderr
@@ -11,6 +11,12 @@ LL | |     });
    | |______- argument requires that `x` is borrowed for `'static`
 LL |   }
    |   - `x` dropped here while still borrowed
+   |
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/regions-infer-proc-static-upvar.rs:4:19
+   |
+LL | fn foo<F:FnOnce()+'static>(_p: F) { }
+   |                   ^^^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/regions/regions-pattern-typing-issue-19552.stderr b/tests/ui/regions/regions-pattern-typing-issue-19552.stderr
index 1d3d5e831c3..a8fd827bc69 100644
--- a/tests/ui/regions/regions-pattern-typing-issue-19552.stderr
+++ b/tests/ui/regions/regions-pattern-typing-issue-19552.stderr
@@ -10,6 +10,12 @@ LL |         [ word ] => { assert_static(word); }
 LL |     }
 LL | }
    | - `line` dropped here while still borrowed
+   |
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/regions-pattern-typing-issue-19552.rs:1:21
+   |
+LL | fn assert_static<T: 'static>(_t: T) {}
+   |                     ^^^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.stderr b/tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.stderr
index ba44beb76db..b8a8f927542 100644
--- a/tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.stderr
+++ b/tests/ui/repeat-expr/copy-inference-side-effects-are-lazy.stderr
@@ -5,9 +5,9 @@ LL |     let x = [Foo(PhantomData); 2];
    |         ^
 LL |
 LL |     extract(x).max(2);
-   |     ---------- type must be known at this point
+   |                --- type must be known at this point
    |
-help: consider giving `x` an explicit type, where the type for type parameter `T` is specified
+help: consider giving `x` an explicit type, where the placeholders `_` are specified
    |
 LL |     let x: [Foo<T>; 2] = [Foo(PhantomData); 2];
    |          +++++++++++++
diff --git a/tests/ui/repr/repr-empty-packed.stderr b/tests/ui/repr/repr-empty-packed.stderr
index 6565b2e8c1d..adf32c95529 100644
--- a/tests/ui/repr/repr-empty-packed.stderr
+++ b/tests/ui/repr/repr-empty-packed.stderr
@@ -15,6 +15,7 @@ error: unused attribute
 LL | #[repr()]
    | ^^^^^^^^^ help: remove this attribute
    |
+   = note: using `repr` with an empty list has no effect
 note: the lint level is defined here
   --> $DIR/repr-empty-packed.rs:2:9
    |
diff --git a/tests/ui/issues/issue-58712.rs b/tests/ui/resolve/missing-type-in-scope-58712.rs
index 930bec6889b..b9ff74e426d 100644
--- a/tests/ui/issues/issue-58712.rs
+++ b/tests/ui/resolve/missing-type-in-scope-58712.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/58712
 struct AddrVec<H, A> {
     h: H,
     a: A,
diff --git a/tests/ui/issues/issue-58712.stderr b/tests/ui/resolve/missing-type-in-scope-58712.stderr
index f4bd4d1e826..d7e06eee856 100644
--- a/tests/ui/issues/issue-58712.stderr
+++ b/tests/ui/resolve/missing-type-in-scope-58712.stderr
@@ -1,5 +1,5 @@
 error[E0412]: cannot find type `DeviceId` in this scope
-  --> $DIR/issue-58712.rs:6:20
+  --> $DIR/missing-type-in-scope-58712.rs:7:20
    |
 LL | impl<H> AddrVec<H, DeviceId> {
    |                    ^^^^^^^^ not found in this scope
@@ -10,7 +10,7 @@ LL | impl<H, DeviceId> AddrVec<H, DeviceId> {
    |       ++++++++++
 
 error[E0412]: cannot find type `DeviceId` in this scope
-  --> $DIR/issue-58712.rs:8:29
+  --> $DIR/missing-type-in-scope-58712.rs:9:29
    |
 LL |     pub fn device(&self) -> DeviceId {
    |                             ^^^^^^^^ not found in this scope
diff --git a/tests/ui/resolve/prelude-order.rs b/tests/ui/resolve/prelude-order.rs
index a3f194270d4..c6683bdff22 100644
--- a/tests/ui/resolve/prelude-order.rs
+++ b/tests/ui/resolve/prelude-order.rs
@@ -1,5 +1,6 @@
 //@ proc-macro:macro_helpers.rs
 //@ compile-flags: --crate-type=lib
+//@ ignore-backends: gcc
 
 /* There are 5 preludes and 3 namespaces. Test the order in which they are resolved.
  * See https://doc.rust-lang.org/nightly/reference/names/preludes.html.
diff --git a/tests/ui/resolve/prelude-order.stderr b/tests/ui/resolve/prelude-order.stderr
index 1b9cc94285a..4dad39fb6d2 100644
--- a/tests/ui/resolve/prelude-order.stderr
+++ b/tests/ui/resolve/prelude-order.stderr
@@ -1,17 +1,17 @@
 error[E0433]: failed to resolve: could not find `inner` in `type_ns`
-  --> $DIR/prelude-order.rs:61:12
+  --> $DIR/prelude-order.rs:62:12
    |
 LL | #[type_ns::inner]
    |            ^^^^^ could not find `inner` in `type_ns`
 
 error[E0433]: failed to resolve: could not find `inner` in `usize`
-  --> $DIR/prelude-order.rs:73:10
+  --> $DIR/prelude-order.rs:74:10
    |
 LL | #[usize::inner]
    |          ^^^^^ could not find `inner` in `usize`
 
 error[E0573]: expected type, found crate `Option`
-  --> $DIR/prelude-order.rs:79:12
+  --> $DIR/prelude-order.rs:80:12
    |
 LL | fn e2() -> Option<i32> { None }
    |            ^^^^^^^^^^^ not a type
@@ -22,7 +22,7 @@ LL + use std::option::Option;
    |
 
 error[E0308]: mismatched types
-  --> $DIR/prelude-order.rs:82:1
+  --> $DIR/prelude-order.rs:83:1
    |
 LL | #[test]
    | ^^^^^^^- help: try adding a return type: `-> &'static str`
@@ -32,7 +32,7 @@ LL | #[test]
    = note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0308]: mismatched types
-  --> $DIR/prelude-order.rs:86:1
+  --> $DIR/prelude-order.rs:87:1
    |
 LL | #[global_allocator]
    | ^^^^^^^^^^^^^^^^^^^- help: try adding a return type: `-> &'static str`
diff --git a/tests/ui/resolve/unused-macro-import.rs b/tests/ui/resolve/unused-macro-import.rs
new file mode 100644
index 00000000000..e85f7a43993
--- /dev/null
+++ b/tests/ui/resolve/unused-macro-import.rs
@@ -0,0 +1,13 @@
+//@ check-pass
+
+#![warn(unused_imports)]
+
+#[macro_export]
+macro_rules! mac { () => {} }
+
+fn main() {
+    // Unused, `mac` as `macro_rules!` is already in scope and has higher priority.
+    use crate::mac; //~ WARN unused import: `crate::mac`
+
+    mac!();
+}
diff --git a/tests/ui/resolve/unused-macro-import.stderr b/tests/ui/resolve/unused-macro-import.stderr
new file mode 100644
index 00000000000..5f9813808a0
--- /dev/null
+++ b/tests/ui/resolve/unused-macro-import.stderr
@@ -0,0 +1,14 @@
+warning: unused import: `crate::mac`
+  --> $DIR/unused-macro-import.rs:10:9
+   |
+LL |     use crate::mac;
+   |         ^^^^^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/unused-macro-import.rs:3:9
+   |
+LL | #![warn(unused_imports)]
+   |         ^^^^^^^^^^^^^^
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/return/infer-return-ty-for-fn-sig-issue-125488.stderr b/tests/ui/return/infer-return-ty-for-fn-sig-issue-125488.stderr
index 8b7c5e1681a..839e4265e03 100644
--- a/tests/ui/return/infer-return-ty-for-fn-sig-issue-125488.stderr
+++ b/tests/ui/return/infer-return-ty-for-fn-sig-issue-125488.stderr
@@ -2,37 +2,49 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/infer-return-ty-for-fn-sig-issue-125488.rs:8:24
    |
 LL |     fn f1(s: S<'_>) -> _ {
-   |                        ^
-   |                        |
-   |                        not allowed in type signatures
-   |                        help: replace with the correct return type: `S<'_>`
+   |                        ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL -     fn f1(s: S<'_>) -> _ {
+LL +     fn f1(s: S<'_>) -> S<'_> {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/infer-return-ty-for-fn-sig-issue-125488.rs:13:24
    |
 LL |     fn f2(s: S<'_>) -> _ {
-   |                        ^
-   |                        |
-   |                        not allowed in type signatures
-   |                        help: replace with the correct return type: `S<'_>`
+   |                        ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL -     fn f2(s: S<'_>) -> _ {
+LL +     fn f2(s: S<'_>) -> S<'_> {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/infer-return-ty-for-fn-sig-issue-125488.rs:23:24
    |
 LL |     fn f3(s: S<'_>) -> _ {
-   |                        ^
-   |                        |
-   |                        not allowed in type signatures
-   |                        help: replace with the correct return type: `S<'_>`
+   |                        ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL -     fn f3(s: S<'_>) -> _ {
+LL +     fn f3(s: S<'_>) -> S<'_> {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/infer-return-ty-for-fn-sig-issue-125488.rs:28:24
    |
 LL |     fn f4(s: S<'_>) -> _ {
-   |                        ^
-   |                        |
-   |                        not allowed in type signatures
-   |                        help: replace with the correct return type: `S<'_>`
+   |                        ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL -     fn f4(s: S<'_>) -> _ {
+LL +     fn f4(s: S<'_>) -> S<'_> {
+   |
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/rfcs/rfc-2091-track-caller/file-is-nul-terminated.rs b/tests/ui/rfcs/rfc-2091-track-caller/file-is-nul-terminated.rs
index 7902f40b09b..698492966ad 100644
--- a/tests/ui/rfcs/rfc-2091-track-caller/file-is-nul-terminated.rs
+++ b/tests/ui/rfcs/rfc-2091-track-caller/file-is-nul-terminated.rs
@@ -1,5 +1,4 @@
 //@ run-pass
-#![feature(file_with_nul)]
 
 #[track_caller]
 const fn assert_file_has_trailing_zero() {
diff --git a/tests/ui/rfcs/rfc-3348-c-string-literals/edition-spans.rs b/tests/ui/rfcs/rfc-3348-c-string-literals/edition-spans.rs
index 414d5518e1f..2387dfb2bc5 100644
--- a/tests/ui/rfcs/rfc-3348-c-string-literals/edition-spans.rs
+++ b/tests/ui/rfcs/rfc-3348-c-string-literals/edition-spans.rs
@@ -7,6 +7,7 @@
 //@ check-pass
 
 //@ proc-macro: count.rs
+//@ ignore-backends: gcc
 extern crate count;
 
 const _: () = {
diff --git a/tests/ui/runtime/backtrace-debuginfo.rs b/tests/ui/runtime/backtrace-debuginfo.rs
index 5fb9943d6c3..d3b4d057e6d 100644
--- a/tests/ui/runtime/backtrace-debuginfo.rs
+++ b/tests/ui/runtime/backtrace-debuginfo.rs
@@ -11,10 +11,15 @@
 //@ compile-flags:-Cstrip=none
 //@ needs-subprocess
 //@ ignore-fuchsia Backtrace not symbolized, trace different line alignment
+//@ ignore-ios needs the `.dSYM` files to be moved to the device
+//@ ignore-tvos needs the `.dSYM` files to be moved to the device
+//@ ignore-watchos needs the `.dSYM` files to be moved to the device
+//@ ignore-visionos needs the `.dSYM` files to be moved to the device
 
 // FIXME(#117097): backtrace (possibly unwinding mechanism) seems to be different on at least
 // `i686-mingw` (32-bit windows-gnu)? cc #128911.
 //@ ignore-windows-gnu
+//@ ignore-backends: gcc
 
 use std::env;
 
diff --git a/tests/ui/runtime/on-broken-pipe/child-processes.rs b/tests/ui/runtime/on-broken-pipe/child-processes.rs
index c0c8ad4e2f5..b7022e1b09d 100644
--- a/tests/ui/runtime/on-broken-pipe/child-processes.rs
+++ b/tests/ui/runtime/on-broken-pipe/child-processes.rs
@@ -1,5 +1,6 @@
 //@ revisions: default error kill inherit
 //@ ignore-cross-compile because aux-bin does not yet support it
+//@ ignore-remote because aux-bin does not yet support it
 //@ only-unix because SIGPIPE is a unix thing
 //@ ignore-backends: gcc
 //@ run-pass
diff --git a/tests/ui/runtime/on-broken-pipe/inherit.rs b/tests/ui/runtime/on-broken-pipe/inherit.rs
index f3c8140eaae..e99c7c7a0fe 100644
--- a/tests/ui/runtime/on-broken-pipe/inherit.rs
+++ b/tests/ui/runtime/on-broken-pipe/inherit.rs
@@ -1,4 +1,5 @@
 //@ ignore-cross-compile because aux-bin does not yet support it
+//@ ignore-remote because aux-bin does not yet support it
 //@ only-unix because SIGPIPE is a unix thing
 //@ aux-bin: assert-inherit-sig_dfl.rs
 //@ aux-bin: assert-inherit-sig_ign.rs
diff --git a/tests/ui/runtime/out-of-stack.rs b/tests/ui/runtime/out-of-stack.rs
index 913d3637c8f..3e092728f29 100644
--- a/tests/ui/runtime/out-of-stack.rs
+++ b/tests/ui/runtime/out-of-stack.rs
@@ -10,6 +10,7 @@
 //@ ignore-tvos stack overflow handlers aren't enabled
 //@ ignore-watchos stack overflow handlers aren't enabled
 //@ ignore-visionos stack overflow handlers aren't enabled
+//@ ignore-backends: gcc
 
 #![feature(rustc_private)]
 
diff --git a/tests/ui/rust-2018/suggestions-not-always-applicable.fixed b/tests/ui/rust-2018/suggestions-not-always-applicable.fixed
index e3070ba150b..3a42434494d 100644
--- a/tests/ui/rust-2018/suggestions-not-always-applicable.fixed
+++ b/tests/ui/rust-2018/suggestions-not-always-applicable.fixed
@@ -3,6 +3,7 @@
 //@ run-rustfix
 //@ rustfix-only-machine-applicable
 //@ check-pass
+//@ ignore-backends: gcc
 
 #![warn(rust_2018_compatibility)]
 
diff --git a/tests/ui/rust-2018/suggestions-not-always-applicable.rs b/tests/ui/rust-2018/suggestions-not-always-applicable.rs
index e3070ba150b..3a42434494d 100644
--- a/tests/ui/rust-2018/suggestions-not-always-applicable.rs
+++ b/tests/ui/rust-2018/suggestions-not-always-applicable.rs
@@ -3,6 +3,7 @@
 //@ run-rustfix
 //@ rustfix-only-machine-applicable
 //@ check-pass
+//@ ignore-backends: gcc
 
 #![warn(rust_2018_compatibility)]
 
diff --git a/tests/ui/rust-2021/reserved-prefixes-via-macro.rs b/tests/ui/rust-2021/reserved-prefixes-via-macro.rs
index eec1b859c20..456649f23ca 100644
--- a/tests/ui/rust-2021/reserved-prefixes-via-macro.rs
+++ b/tests/ui/rust-2021/reserved-prefixes-via-macro.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ edition:2021
 //@ proc-macro: reserved-prefixes-macro-2018.rs
+//@ ignore-backends: gcc
 
 extern crate reserved_prefixes_macro_2018 as m2018;
 
diff --git a/tests/ui/rust-2024/reserved-guarded-strings-via-macro.rs b/tests/ui/rust-2024/reserved-guarded-strings-via-macro.rs
index ead2ab40b77..ddb32c26717 100644
--- a/tests/ui/rust-2024/reserved-guarded-strings-via-macro.rs
+++ b/tests/ui/rust-2024/reserved-guarded-strings-via-macro.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ edition:2024
 //@ proc-macro: reserved-guarded-strings-macro-2021.rs
+//@ ignore-backends: gcc
 
 extern crate reserved_guarded_strings_macro_2021 as m2021;
 
diff --git a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs
index e2c504e708c..8b7073649b7 100644
--- a/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs
+++ b/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-from-pm.rs
@@ -6,6 +6,7 @@
 //@[edition2021] edition:2021
 //@[edition2024] edition:2024
 //@ proc-macro: unsafe-attributes-pm.rs
+//@ ignore-backends: gcc
 
 unsafe_attributes_pm::missing_unsafe!();
 
diff --git a/tests/ui/rustc_public-ir-print/async-closure.rs b/tests/ui/rustc_public-ir-print/async-closure.rs
index 80f96e09cfc..bd8c7e888a3 100644
--- a/tests/ui/rustc_public-ir-print/async-closure.rs
+++ b/tests/ui/rustc_public-ir-print/async-closure.rs
@@ -1,6 +1,6 @@
 //@ compile-flags: -Z unpretty=stable-mir --crate-type lib -C panic=abort -Zmir-opt-level=0
 //@ check-pass
-//@ only-x86_64
+//@ only-64bit
 //@ edition: 2024
 //@ needs-unwind unwind edges are different with panic=abort
 
diff --git a/tests/ui/rustc_public-ir-print/async-closure.stdout b/tests/ui/rustc_public-ir-print/async-closure.stdout
index 73e9b8fc097..5113dc5048b 100644
--- a/tests/ui/rustc_public-ir-print/async-closure.stdout
+++ b/tests/ui/rustc_public-ir-print/async-closure.stdout
@@ -40,30 +40,28 @@ fn foo::{closure#0}::{closure#0}(_1: Pin<&mut {async closure body@$DIR/async-clo
     let  _3: i32;
     let mut _4: &i32;
     let mut _5: ();
-    let mut _6: &mut Context<'_>;
-    let mut _7: u32;
+    let mut _6: u32;
+    let mut _7: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
     let mut _8: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
     let mut _9: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
-    let mut _10: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
-    debug _task_context => _6;
+    debug _task_context => _2;
     debug y => (*((*(_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6})).0: &i32));
     debug y => _3;
     bb0: {
-        _8 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
-        _7 = discriminant((*_8));
-        switchInt(move _7) -> [0: bb1, 1: bb2, otherwise: bb3];
+        _7 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
+        _6 = discriminant((*_7));
+        switchInt(move _6) -> [0: bb1, 1: bb2, otherwise: bb3];
     }
     bb1: {
-        _6 = move _2;
         StorageLive(_3);
-        _9 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
-        _4 = CopyForDeref(((*_9).0: &i32));
+        _8 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
+        _4 = CopyForDeref(((*_8).0: &i32));
         _3 = (*_4);
         _5 = ();
         StorageDead(_3);
         _0 = std::task::Poll::Ready(move _5);
-        _10 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
-        discriminant((*_10)) = 1;
+        _9 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
+        discriminant((*_9)) = 1;
         return;
     }
     bb2: {
@@ -78,30 +76,28 @@ fn foo::{closure#0}::{synthetic#0}(_1: Pin<&mut {async closure body@$DIR/async-c
     let  _3: i32;
     let mut _4: &i32;
     let mut _5: ();
-    let mut _6: &mut Context<'_>;
-    let mut _7: u32;
+    let mut _6: u32;
+    let mut _7: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
     let mut _8: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
     let mut _9: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
-    let mut _10: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
-    debug _task_context => _6;
+    debug _task_context => _2;
     debug y => (*((*(_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6})).0: &i32));
     debug y => _3;
     bb0: {
-        _8 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
-        _7 = discriminant((*_8));
-        switchInt(move _7) -> [0: bb1, 1: bb2, otherwise: bb3];
+        _7 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
+        _6 = discriminant((*_7));
+        switchInt(move _6) -> [0: bb1, 1: bb2, otherwise: bb3];
     }
     bb1: {
-        _6 = move _2;
         StorageLive(_3);
-        _9 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
-        _4 = CopyForDeref(((*_9).0: &i32));
+        _8 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
+        _4 = CopyForDeref(((*_8).0: &i32));
         _3 = (*_4);
         _5 = ();
         StorageDead(_3);
         _0 = std::task::Poll::Ready(move _5);
-        _10 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
-        discriminant((*_10)) = 1;
+        _9 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
+        discriminant((*_9)) = 1;
         return;
     }
     bb2: {
diff --git a/tests/ui/sanitizer/cfi/transparent-has-regions.rs b/tests/ui/sanitizer/cfi/transparent-has-regions.rs
index b82850133c1..3e9893df23c 100644
--- a/tests/ui/sanitizer/cfi/transparent-has-regions.rs
+++ b/tests/ui/sanitizer/cfi/transparent-has-regions.rs
@@ -3,6 +3,7 @@
 //@ no-prefer-dynamic
 //@ only-x86_64-unknown-linux-gnu
 //@ build-pass
+//@ ignore-backends: gcc
 
 pub trait Trait {}
 
diff --git a/tests/ui/sanitizer/issue-111184-cfi-coroutine-witness.rs b/tests/ui/sanitizer/issue-111184-cfi-coroutine-witness.rs
index be81c7bd0ca..ac2b95b6398 100644
--- a/tests/ui/sanitizer/issue-111184-cfi-coroutine-witness.rs
+++ b/tests/ui/sanitizer/issue-111184-cfi-coroutine-witness.rs
@@ -7,6 +7,7 @@
 //@ no-prefer-dynamic
 //@ only-x86_64-unknown-linux-gnu
 //@ build-pass
+//@ ignore-backends: gcc
 
 use std::future::Future;
 
diff --git a/tests/ui/sepcomp/sepcomp-lib-lto.rs b/tests/ui/sepcomp/sepcomp-lib-lto.rs
index 2166a8fd031..f47ea25a4fc 100644
--- a/tests/ui/sepcomp/sepcomp-lib-lto.rs
+++ b/tests/ui/sepcomp/sepcomp-lib-lto.rs
@@ -5,6 +5,7 @@
 //@ aux-build:sepcomp_lib.rs
 //@ compile-flags: -C lto -g
 //@ no-prefer-dynamic
+//@ ignore-backends: gcc
 
 extern crate sepcomp_lib;
 use sepcomp_lib::a::one;
diff --git a/tests/ui/sepcomp/sepcomp-unwind.rs b/tests/ui/sepcomp/sepcomp-unwind.rs
index 95591676b5e..0038e887c4e 100644
--- a/tests/ui/sepcomp/sepcomp-unwind.rs
+++ b/tests/ui/sepcomp/sepcomp-unwind.rs
@@ -3,6 +3,7 @@
 #![allow(dead_code)]
 //@ compile-flags: -C codegen-units=3
 //@ needs-threads
+//@ ignore-backends: gcc
 
 // Test unwinding through multiple compilation units.
 
diff --git a/tests/ui/simd/auxiliary/simd-lane-limit.rs b/tests/ui/simd/auxiliary/simd-lane-limit.rs
new file mode 100644
index 00000000000..dde6b880c62
--- /dev/null
+++ b/tests/ui/simd/auxiliary/simd-lane-limit.rs
@@ -0,0 +1,5 @@
+#![feature(rustc_attrs, repr_simd)]
+
+#[repr(simd, packed)]
+#[rustc_simd_monomorphize_lane_limit = "8"]
+pub struct Simd<T, const N: usize>(pub [T; N]);
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-2.rs b/tests/ui/simd/intrinsic/generic-arithmetic-2.rs
index caec607d6fe..d67ff6b33b7 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-2.rs
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-2.rs
@@ -1,4 +1,5 @@
 //@ build-fail
+//@ ignore-backends: gcc
 
 #![feature(repr_simd, core_intrinsics)]
 #![allow(non_camel_case_types)]
diff --git a/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr b/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr
index a27a8d721fb..a2646c8e848 100644
--- a/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr
+++ b/tests/ui/simd/intrinsic/generic-arithmetic-2.stderr
@@ -1,167 +1,167 @@
 error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:68:9
+  --> $DIR/generic-arithmetic-2.rs:69:9
    |
 LL |         simd_add(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_sub` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:70:9
+  --> $DIR/generic-arithmetic-2.rs:71:9
    |
 LL |         simd_sub(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_mul` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:72:9
+  --> $DIR/generic-arithmetic-2.rs:73:9
    |
 LL |         simd_mul(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_div` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:74:9
+  --> $DIR/generic-arithmetic-2.rs:75:9
    |
 LL |         simd_div(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shl` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:76:9
+  --> $DIR/generic-arithmetic-2.rs:77:9
    |
 LL |         simd_shl(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shr` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:78:9
+  --> $DIR/generic-arithmetic-2.rs:79:9
    |
 LL |         simd_shr(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_funnel_shl` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:80:9
+  --> $DIR/generic-arithmetic-2.rs:81:9
    |
 LL |         simd_funnel_shl(0, 0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_funnel_shr` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:82:9
+  --> $DIR/generic-arithmetic-2.rs:83:9
    |
 LL |         simd_funnel_shr(0, 0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_and` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:84:9
+  --> $DIR/generic-arithmetic-2.rs:85:9
    |
 LL |         simd_and(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_or` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:86:9
+  --> $DIR/generic-arithmetic-2.rs:87:9
    |
 LL |         simd_or(0, 0);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_xor` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:88:9
+  --> $DIR/generic-arithmetic-2.rs:89:9
    |
 LL |         simd_xor(0, 0);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_neg` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:91:9
+  --> $DIR/generic-arithmetic-2.rs:92:9
    |
 LL |         simd_neg(0);
    |         ^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bswap` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:93:9
+  --> $DIR/generic-arithmetic-2.rs:94:9
    |
 LL |         simd_bswap(0);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitreverse` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:95:9
+  --> $DIR/generic-arithmetic-2.rs:96:9
    |
 LL |         simd_bitreverse(0);
    |         ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ctlz` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:97:9
+  --> $DIR/generic-arithmetic-2.rs:98:9
    |
 LL |         simd_ctlz(0);
    |         ^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_cttz` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-arithmetic-2.rs:99:9
+  --> $DIR/generic-arithmetic-2.rs:100:9
    |
 LL |         simd_cttz(0);
    |         ^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shl` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:102:9
+  --> $DIR/generic-arithmetic-2.rs:103:9
    |
 LL |         simd_shl(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shr` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:104:9
+  --> $DIR/generic-arithmetic-2.rs:105:9
    |
 LL |         simd_shr(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_funnel_shl` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:106:9
+  --> $DIR/generic-arithmetic-2.rs:107:9
    |
 LL |         simd_funnel_shl(z, z, z);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_funnel_shr` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:108:9
+  --> $DIR/generic-arithmetic-2.rs:109:9
    |
 LL |         simd_funnel_shr(z, z, z);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_and` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:110:9
+  --> $DIR/generic-arithmetic-2.rs:111:9
    |
 LL |         simd_and(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_or` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:112:9
+  --> $DIR/generic-arithmetic-2.rs:113:9
    |
 LL |         simd_or(z, z);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_xor` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:114:9
+  --> $DIR/generic-arithmetic-2.rs:115:9
    |
 LL |         simd_xor(z, z);
    |         ^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bswap` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:116:9
+  --> $DIR/generic-arithmetic-2.rs:117:9
    |
 LL |         simd_bswap(z);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_bitreverse` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:118:9
+  --> $DIR/generic-arithmetic-2.rs:119:9
    |
 LL |         simd_bitreverse(z);
    |         ^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ctlz` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:120:9
+  --> $DIR/generic-arithmetic-2.rs:121:9
    |
 LL |         simd_ctlz(z);
    |         ^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_ctpop` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:122:9
+  --> $DIR/generic-arithmetic-2.rs:123:9
    |
 LL |         simd_ctpop(z);
    |         ^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_cttz` intrinsic: unsupported operation on `f32x4` with element `f32`
-  --> $DIR/generic-arithmetic-2.rs:124:9
+  --> $DIR/generic-arithmetic-2.rs:125:9
    |
 LL |         simd_cttz(z);
    |         ^^^^^^^^^^^^
diff --git a/tests/ui/simd/intrinsic/generic-elements.rs b/tests/ui/simd/intrinsic/generic-elements.rs
index 905299a9289..08d1e3ce944 100644
--- a/tests/ui/simd/intrinsic/generic-elements.rs
+++ b/tests/ui/simd/intrinsic/generic-elements.rs
@@ -1,4 +1,5 @@
 //@ build-fail
+//@ ignore-backends: gcc
 
 #![feature(
     repr_simd,
diff --git a/tests/ui/simd/intrinsic/generic-elements.stderr b/tests/ui/simd/intrinsic/generic-elements.stderr
index 3779aa86cee..a32a923633b 100644
--- a/tests/ui/simd/intrinsic/generic-elements.stderr
+++ b/tests/ui/simd/intrinsic/generic-elements.stderr
@@ -1,125 +1,125 @@
 error[E0511]: invalid monomorphization of `simd_insert` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:51:9
+  --> $DIR/generic-elements.rs:52:9
    |
 LL |         simd_insert(0, 0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_insert` intrinsic: expected inserted type `i32` (element of input `i32x4`), found `f64`
-  --> $DIR/generic-elements.rs:53:9
+  --> $DIR/generic-elements.rs:54:9
    |
 LL |         simd_insert(x, 0, 1.0);
    |         ^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_extract` intrinsic: expected return type `i32` (element of input `i32x4`), found `f32`
-  --> $DIR/generic-elements.rs:55:9
+  --> $DIR/generic-elements.rs:56:9
    |
 LL |         simd_extract::<_, f32>(x, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:59:9
+  --> $DIR/generic-elements.rs:60:9
    |
 LL |         simd_shuffle::<i32, _, i32>(0, 0, IDX2);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:62:9
+  --> $DIR/generic-elements.rs:63:9
    |
 LL |         simd_shuffle::<i32, _, i32>(0, 0, IDX4);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:65:9
+  --> $DIR/generic-elements.rs:66:9
    |
 LL |         simd_shuffle::<i32, _, i32>(0, 0, IDX8);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x2` with element type `f32`
-  --> $DIR/generic-elements.rs:68:9
+  --> $DIR/generic-elements.rs:69:9
    |
 LL |         simd_shuffle::<_, _, f32x2>(x, x, IDX2);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x4` with element type `f32`
-  --> $DIR/generic-elements.rs:70:9
+  --> $DIR/generic-elements.rs:71:9
    |
 LL |         simd_shuffle::<_, _, f32x4>(x, x, IDX4);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x8` with element type `f32`
-  --> $DIR/generic-elements.rs:72:9
+  --> $DIR/generic-elements.rs:73:9
    |
 LL |         simd_shuffle::<_, _, f32x8>(x, x, IDX8);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return type of length 2, found `i32x8` with length 8
-  --> $DIR/generic-elements.rs:75:9
+  --> $DIR/generic-elements.rs:76:9
    |
 LL |         simd_shuffle::<_, _, i32x8>(x, x, IDX2);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return type of length 4, found `i32x8` with length 8
-  --> $DIR/generic-elements.rs:77:9
+  --> $DIR/generic-elements.rs:78:9
    |
 LL |         simd_shuffle::<_, _, i32x8>(x, x, IDX4);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: expected return type of length 8, found `i32x2` with length 2
-  --> $DIR/generic-elements.rs:79:9
+  --> $DIR/generic-elements.rs:80:9
    |
 LL |         simd_shuffle::<_, _, i32x2>(x, x, IDX8);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:83:9
+  --> $DIR/generic-elements.rs:84:9
    |
 LL |         simd_shuffle_const_generic::<i32, i32, I2>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:86:9
+  --> $DIR/generic-elements.rs:87:9
    |
 LL |         simd_shuffle_const_generic::<i32, i32, I4>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected SIMD input type, found non-SIMD `i32`
-  --> $DIR/generic-elements.rs:89:9
+  --> $DIR/generic-elements.rs:90:9
    |
 LL |         simd_shuffle_const_generic::<i32, i32, I8>(0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x2` with element type `f32`
-  --> $DIR/generic-elements.rs:92:9
+  --> $DIR/generic-elements.rs:93:9
    |
 LL |         simd_shuffle_const_generic::<_, f32x2, I2>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x4` with element type `f32`
-  --> $DIR/generic-elements.rs:94:9
+  --> $DIR/generic-elements.rs:95:9
    |
 LL |         simd_shuffle_const_generic::<_, f32x4, I4>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x8` with element type `f32`
-  --> $DIR/generic-elements.rs:96:9
+  --> $DIR/generic-elements.rs:97:9
    |
 LL |         simd_shuffle_const_generic::<_, f32x8, I8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected return type of length 2, found `i32x8` with length 8
-  --> $DIR/generic-elements.rs:99:9
+  --> $DIR/generic-elements.rs:100:9
    |
 LL |         simd_shuffle_const_generic::<_, i32x8, I2>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected return type of length 4, found `i32x8` with length 8
-  --> $DIR/generic-elements.rs:101:9
+  --> $DIR/generic-elements.rs:102:9
    |
 LL |         simd_shuffle_const_generic::<_, i32x8, I4>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_shuffle_const_generic` intrinsic: expected return type of length 8, found `i32x2` with length 2
-  --> $DIR/generic-elements.rs:103:9
+  --> $DIR/generic-elements.rs:104:9
    |
 LL |         simd_shuffle_const_generic::<_, i32x2, I8>(x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/masked-load-store-build-fail.rs b/tests/ui/simd/masked-load-store-build-fail.rs
index 4b6cc17683c..c711b6dfd97 100644
--- a/tests/ui/simd/masked-load-store-build-fail.rs
+++ b/tests/ui/simd/masked-load-store-build-fail.rs
@@ -1,4 +1,5 @@
 //@ build-fail
+//@ ignore-backends: gcc
 #![feature(repr_simd, core_intrinsics)]
 
 use std::intrinsics::simd::{simd_masked_load, simd_masked_store};
diff --git a/tests/ui/simd/masked-load-store-build-fail.stderr b/tests/ui/simd/masked-load-store-build-fail.stderr
index 7f09841b597..b9158f46ea9 100644
--- a/tests/ui/simd/masked-load-store-build-fail.stderr
+++ b/tests/ui/simd/masked-load-store-build-fail.stderr
@@ -1,47 +1,47 @@
 error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected third argument with length 8 (same as input type `Simd<i8, 8>`), found `Simd<u8, 4>` with length 4
-  --> $DIR/masked-load-store-build-fail.rs:15:9
+  --> $DIR/masked-load-store-build-fail.rs:16:9
    |
 LL |         simd_masked_load(Simd::<i8, 8>([-1, 0, -1, -1, 0, 0, 0, 0]), arr.as_ptr(), default);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected element type `u8` of second argument `*const i8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*_ u8`
-  --> $DIR/masked-load-store-build-fail.rs:18:9
+  --> $DIR/masked-load-store-build-fail.rs:19:9
    |
 LL |         simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr() as *const i8, default);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*_ u32`
-  --> $DIR/masked-load-store-build-fail.rs:21:9
+  --> $DIR/masked-load-store-build-fail.rs:22:9
    |
 LL |         simd_masked_load(Simd::<i8, 4>([-1, 0, -1, -1]), arr.as_ptr(), Simd::<u32, 4>([9; 4]));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_load` intrinsic: expected mask element type to be an integer, found `f32`
-  --> $DIR/masked-load-store-build-fail.rs:24:9
+  --> $DIR/masked-load-store-build-fail.rs:25:9
    |
 LL |         simd_masked_load(Simd::<f32, 4>([1.0, 0.0, 1.0, 1.0]), arr.as_ptr(), default);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected element type `u32` of second argument `*const u8` to be a pointer to the element type `u32` of the first argument `Simd<u32, 4>`, found `u32` != `*mut u32`
-  --> $DIR/masked-load-store-build-fail.rs:27:9
+  --> $DIR/masked-load-store-build-fail.rs:28:9
    |
 LL |         simd_masked_store(Simd([-1i8; 4]), arr.as_ptr(), Simd([5u32; 4]));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected element type `u8` of second argument `*const u8` to be a pointer to the element type `u8` of the first argument `Simd<u8, 4>`, found `u8` != `*mut u8`
-  --> $DIR/masked-load-store-build-fail.rs:30:9
+  --> $DIR/masked-load-store-build-fail.rs:31:9
    |
 LL |         simd_masked_store(Simd([-1i8; 4]), arr.as_ptr(), Simd([5u8; 4]));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected third argument with length 4 (same as input type `Simd<i8, 4>`), found `Simd<u8, 2>` with length 2
-  --> $DIR/masked-load-store-build-fail.rs:33:9
+  --> $DIR/masked-load-store-build-fail.rs:34:9
    |
 LL |         simd_masked_store(Simd([-1i8; 4]), arr.as_mut_ptr(), Simd([5u8; 2]));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_masked_store` intrinsic: expected mask element type to be an integer, found `f32`
-  --> $DIR/masked-load-store-build-fail.rs:36:9
+  --> $DIR/masked-load-store-build-fail.rs:37:9
    |
 LL |         simd_masked_store(Simd([1f32; 4]), arr.as_mut_ptr(), Simd([5u8; 4]));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/monomorphize-shuffle-index.generic.stderr b/tests/ui/simd/monomorphize-shuffle-index.generic.stderr
index b0742bc5ef8..c82adbf8d4c 100644
--- a/tests/ui/simd/monomorphize-shuffle-index.generic.stderr
+++ b/tests/ui/simd/monomorphize-shuffle-index.generic.stderr
@@ -1,5 +1,5 @@
 error: overly complex generic constant
-  --> $DIR/monomorphize-shuffle-index.rs:36:51
+  --> $DIR/monomorphize-shuffle-index.rs:37:51
    |
 LL |         return simd_shuffle_const_generic::<_, _, { &Self::I.0 }>(a, b);
    |                                                   ^^----------^^
diff --git a/tests/ui/simd/monomorphize-shuffle-index.rs b/tests/ui/simd/monomorphize-shuffle-index.rs
index 1490f8e2319..ba952cdb0dc 100644
--- a/tests/ui/simd/monomorphize-shuffle-index.rs
+++ b/tests/ui/simd/monomorphize-shuffle-index.rs
@@ -1,6 +1,7 @@
 //@ revisions: old generic generic_with_fn
 //@[old]run-pass
 //@[generic_with_fn]run-pass
+//@ ignore-backends: gcc
 #![feature(
     repr_simd,
     core_intrinsics,
diff --git a/tests/ui/simd/monomorphize-too-long.rs b/tests/ui/simd/monomorphize-too-long.rs
index 4fac987b0b5..9c837415191 100644
--- a/tests/ui/simd/monomorphize-too-long.rs
+++ b/tests/ui/simd/monomorphize-too-long.rs
@@ -6,7 +6,5 @@
 struct Simd<T, const N: usize>([T; N]);
 
 fn main() {
-    let _too_big = Simd([1_u16; 54321]);
+    let _too_big = Simd([1_u16; 54321]); //~ ERROR the SIMD type `Simd<u16, 54321>` has more elements than the limit 32768
 }
-
-//~? ERROR monomorphising SIMD type `Simd<u16, 54321>` of length greater than 32768
diff --git a/tests/ui/simd/monomorphize-too-long.stderr b/tests/ui/simd/monomorphize-too-long.stderr
index 978eef307ab..71bc78ef5c9 100644
--- a/tests/ui/simd/monomorphize-too-long.stderr
+++ b/tests/ui/simd/monomorphize-too-long.stderr
@@ -1,4 +1,8 @@
-error: monomorphising SIMD type `Simd<u16, 54321>` of length greater than 32768
+error: the SIMD type `Simd<u16, 54321>` has more elements than the limit 32768
+  --> $DIR/monomorphize-too-long.rs:9:9
+   |
+LL |     let _too_big = Simd([1_u16; 54321]);
+   |         ^^^^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/simd/monomorphize-zero-length.rs b/tests/ui/simd/monomorphize-zero-length.rs
index d38870c572d..f956197a61c 100644
--- a/tests/ui/simd/monomorphize-zero-length.rs
+++ b/tests/ui/simd/monomorphize-zero-length.rs
@@ -6,7 +6,5 @@
 struct Simd<T, const N: usize>([T; N]);
 
 fn main() {
-    let _empty = Simd([1.0; 0]);
+    let _empty = Simd([1.0; 0]); //~ ERROR the SIMD type `Simd<f64, 0>` has zero elements
 }
-
-//~? ERROR monomorphising SIMD type `Simd<f64, 0>` of zero length
diff --git a/tests/ui/simd/monomorphize-zero-length.stderr b/tests/ui/simd/monomorphize-zero-length.stderr
index 738c20fe51a..66f26d95c9d 100644
--- a/tests/ui/simd/monomorphize-zero-length.stderr
+++ b/tests/ui/simd/monomorphize-zero-length.stderr
@@ -1,4 +1,8 @@
-error: monomorphising SIMD type `Simd<f64, 0>` of zero length
+error: the SIMD type `Simd<f64, 0>` has zero elements
+  --> $DIR/monomorphize-zero-length.rs:9:9
+   |
+LL |     let _empty = Simd([1.0; 0]);
+   |         ^^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/simd/not-out-of-bounds.rs b/tests/ui/simd/not-out-of-bounds.rs
index 4bd2a69edbf..c80c90e3ab9 100644
--- a/tests/ui/simd/not-out-of-bounds.rs
+++ b/tests/ui/simd/not-out-of-bounds.rs
@@ -1,4 +1,5 @@
 //@ build-fail
+//@ ignore-backends: gcc
 #![allow(non_camel_case_types)]
 #![feature(repr_simd, core_intrinsics)]
 
diff --git a/tests/ui/simd/not-out-of-bounds.stderr b/tests/ui/simd/not-out-of-bounds.stderr
index 4b6bda93e45..734c21fbf41 100644
--- a/tests/ui/simd/not-out-of-bounds.stderr
+++ b/tests/ui/simd/not-out-of-bounds.stderr
@@ -1,5 +1,5 @@
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds (limit 4)
-  --> $DIR/not-out-of-bounds.rs:52:21
+  --> $DIR/not-out-of-bounds.rs:53:21
    |
 LL |                     $y(vec1, vec2, IDX)
    |                     ^^^^^^^^^^^^^^^^^^^
@@ -10,7 +10,7 @@ LL |     test_shuffle_lanes!(2, u8x2, simd_shuffle);
    = note: this error originates in the macro `test_shuffle_lanes` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds (limit 8)
-  --> $DIR/not-out-of-bounds.rs:52:21
+  --> $DIR/not-out-of-bounds.rs:53:21
    |
 LL |                     $y(vec1, vec2, IDX)
    |                     ^^^^^^^^^^^^^^^^^^^
@@ -21,7 +21,7 @@ LL |     test_shuffle_lanes!(4, u8x4, simd_shuffle);
    = note: this error originates in the macro `test_shuffle_lanes` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds (limit 16)
-  --> $DIR/not-out-of-bounds.rs:52:21
+  --> $DIR/not-out-of-bounds.rs:53:21
    |
 LL |                     $y(vec1, vec2, IDX)
    |                     ^^^^^^^^^^^^^^^^^^^
@@ -32,7 +32,7 @@ LL |     test_shuffle_lanes!(8, u8x8, simd_shuffle);
    = note: this error originates in the macro `test_shuffle_lanes` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds (limit 32)
-  --> $DIR/not-out-of-bounds.rs:52:21
+  --> $DIR/not-out-of-bounds.rs:53:21
    |
 LL |                     $y(vec1, vec2, IDX)
    |                     ^^^^^^^^^^^^^^^^^^^
@@ -43,7 +43,7 @@ LL |     test_shuffle_lanes!(16, u8x16, simd_shuffle);
    = note: this error originates in the macro `test_shuffle_lanes` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds (limit 64)
-  --> $DIR/not-out-of-bounds.rs:52:21
+  --> $DIR/not-out-of-bounds.rs:53:21
    |
 LL |                     $y(vec1, vec2, IDX)
    |                     ^^^^^^^^^^^^^^^^^^^
@@ -54,7 +54,7 @@ LL |     test_shuffle_lanes!(32, u8x32, simd_shuffle);
    = note: this error originates in the macro `test_shuffle_lanes` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds (limit 128)
-  --> $DIR/not-out-of-bounds.rs:52:21
+  --> $DIR/not-out-of-bounds.rs:53:21
    |
 LL |                     $y(vec1, vec2, IDX)
    |                     ^^^^^^^^^^^^^^^^^^^
@@ -65,19 +65,19 @@ LL |     test_shuffle_lanes!(64, u8x64, simd_shuffle);
    = note: this error originates in the macro `test_shuffle_lanes` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0511]: invalid monomorphization of `simd_shuffle` intrinsic: SIMD index #0 is out of bounds (limit 4)
-  --> $DIR/not-out-of-bounds.rs:77:23
+  --> $DIR/not-out-of-bounds.rs:78:23
    |
 LL |         let _: u8x2 = simd_shuffle(v, v, I);
    |                       ^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_insert` intrinsic: SIMD index #1 is out of bounds (limit 2)
-  --> $DIR/not-out-of-bounds.rs:83:9
+  --> $DIR/not-out-of-bounds.rs:84:9
    |
 LL |         simd_insert(v, 2, 0u8);
    |         ^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0511]: invalid monomorphization of `simd_extract` intrinsic: SIMD index #1 is out of bounds (limit 2)
-  --> $DIR/not-out-of-bounds.rs:84:24
+  --> $DIR/not-out-of-bounds.rs:85:24
    |
 LL |         let _val: u8 = simd_extract(v, 2);
    |                        ^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/simd/simd-lane-limit-err-npow2.rs b/tests/ui/simd/simd-lane-limit-err-npow2.rs
new file mode 100644
index 00000000000..d5c5c92e953
--- /dev/null
+++ b/tests/ui/simd/simd-lane-limit-err-npow2.rs
@@ -0,0 +1,12 @@
+//@ build-fail
+//@ aux-crate:simd=simd-lane-limit.rs
+
+extern crate simd;
+
+use simd::Simd;
+
+fn main() {
+    // test non-power-of-two, since #[repr(simd, packed)] has unusual layout
+    let _x: Simd<i32, 24> = Simd([0; 24]);
+    //~^ ERROR the SIMD type `simd::Simd<i32, 24>` has more elements than the limit 8
+}
diff --git a/tests/ui/simd/simd-lane-limit-err-npow2.stderr b/tests/ui/simd/simd-lane-limit-err-npow2.stderr
new file mode 100644
index 00000000000..fff26c4c1c1
--- /dev/null
+++ b/tests/ui/simd/simd-lane-limit-err-npow2.stderr
@@ -0,0 +1,8 @@
+error: the SIMD type `simd::Simd<i32, 24>` has more elements than the limit 8
+  --> $DIR/simd-lane-limit-err-npow2.rs:10:9
+   |
+LL |     let _x: Simd<i32, 24> = Simd([0; 24]);
+   |         ^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/simd/simd-lane-limit-err.rs b/tests/ui/simd/simd-lane-limit-err.rs
new file mode 100644
index 00000000000..00390bdbdaf
--- /dev/null
+++ b/tests/ui/simd/simd-lane-limit-err.rs
@@ -0,0 +1,11 @@
+//@ build-fail
+//@ aux-crate:simd=simd-lane-limit.rs
+
+extern crate simd;
+
+use simd::Simd;
+
+fn main() {
+    let _x: Simd<i32, 16> = Simd([0; 16]);
+    //~^ ERROR the SIMD type `simd::Simd<i32, 16>` has more elements than the limit 8
+}
diff --git a/tests/ui/simd/simd-lane-limit-err.stderr b/tests/ui/simd/simd-lane-limit-err.stderr
new file mode 100644
index 00000000000..3f2eaeda2d4
--- /dev/null
+++ b/tests/ui/simd/simd-lane-limit-err.stderr
@@ -0,0 +1,8 @@
+error: the SIMD type `simd::Simd<i32, 16>` has more elements than the limit 8
+  --> $DIR/simd-lane-limit-err.rs:9:9
+   |
+LL |     let _x: Simd<i32, 16> = Simd([0; 16]);
+   |         ^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/simd/simd-lane-limit-ok.rs b/tests/ui/simd/simd-lane-limit-ok.rs
new file mode 100644
index 00000000000..52fd3158440
--- /dev/null
+++ b/tests/ui/simd/simd-lane-limit-ok.rs
@@ -0,0 +1,14 @@
+//@ build-pass
+//@ aux-crate:simd=simd-lane-limit.rs
+
+extern crate simd;
+
+use simd::Simd;
+
+fn main() {
+    let _x: Simd<i32, 4> = Simd([0; 4]);
+    let _y: Simd<i32, 8> = Simd([0; 8]);
+
+    // test non-power-of-two, since #[repr(simd, packed)] has unusual layout
+    let _z: Simd<i32, 6> = Simd([0; 6]);
+}
diff --git a/tests/ui/simd/type-generic-monomorphisation-empty.rs b/tests/ui/simd/type-generic-monomorphisation-empty.rs
index c08dc9fe3df..7c43b8914da 100644
--- a/tests/ui/simd/type-generic-monomorphisation-empty.rs
+++ b/tests/ui/simd/type-generic-monomorphisation-empty.rs
@@ -6,7 +6,5 @@
 struct Simd<const N: usize>([f32; N]);
 
 fn main() {
-    let _ = Simd::<0>([]);
+    let _empty = Simd::<0>([]); //~ ERROR the SIMD type `Simd<0>` has zero elements
 }
-
-//~? ERROR monomorphising SIMD type `Simd<0>` of zero length
diff --git a/tests/ui/simd/type-generic-monomorphisation-empty.stderr b/tests/ui/simd/type-generic-monomorphisation-empty.stderr
index fc294607ae3..450db7e47db 100644
--- a/tests/ui/simd/type-generic-monomorphisation-empty.stderr
+++ b/tests/ui/simd/type-generic-monomorphisation-empty.stderr
@@ -1,4 +1,8 @@
-error: monomorphising SIMD type `Simd<0>` of zero length
+error: the SIMD type `Simd<0>` has zero elements
+  --> $DIR/type-generic-monomorphisation-empty.rs:9:9
+   |
+LL |     let _empty = Simd::<0>([]);
+   |         ^^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/simd/type-generic-monomorphisation-oversized.rs b/tests/ui/simd/type-generic-monomorphisation-oversized.rs
index efe3480317c..73a1f00e8c7 100644
--- a/tests/ui/simd/type-generic-monomorphisation-oversized.rs
+++ b/tests/ui/simd/type-generic-monomorphisation-oversized.rs
@@ -6,7 +6,6 @@
 struct Simd<const N: usize>([f32; N]);
 
 fn main() {
-    let _ = Simd::<65536>([0.; 65536]);
+    let _x = Simd::<65536>([0.; 65536]);
+    //~^ ERROR the SIMD type `Simd<65536>` has more elements than the limit 32768
 }
-
-//~? ERROR monomorphising SIMD type `Simd<65536>` of length greater than 32768
diff --git a/tests/ui/simd/type-generic-monomorphisation-oversized.stderr b/tests/ui/simd/type-generic-monomorphisation-oversized.stderr
index 39ff36799cc..0065049abd6 100644
--- a/tests/ui/simd/type-generic-monomorphisation-oversized.stderr
+++ b/tests/ui/simd/type-generic-monomorphisation-oversized.stderr
@@ -1,4 +1,8 @@
-error: monomorphising SIMD type `Simd<65536>` of length greater than 32768
+error: the SIMD type `Simd<65536>` has more elements than the limit 32768
+  --> $DIR/type-generic-monomorphisation-oversized.rs:9:9
+   |
+LL |     let _x = Simd::<65536>([0.; 65536]);
+   |         ^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/span/issue-42234-unknown-receiver-type.stderr b/tests/ui/span/issue-42234-unknown-receiver-type.stderr
index 10308ec07da..71ac4f53b3f 100644
--- a/tests/ui/span/issue-42234-unknown-receiver-type.stderr
+++ b/tests/ui/span/issue-42234-unknown-receiver-type.stderr
@@ -4,7 +4,7 @@ error[E0282]: type annotations needed
 LL |     let x: Option<_> = None;
    |                        ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option`
 LL |     x.unwrap().method_that_could_exist_on_some_type();
-   |     ---------- type must be known at this point
+   |                ------------------------------------ type must be known at this point
    |
 help: consider specifying the generic argument
    |
@@ -16,6 +16,8 @@ error[E0282]: type annotations needed
    |
 LL |         .sum::<_>()
    |          ^^^ cannot infer type of the type parameter `S` declared on the method `sum`
+LL |         .to_string()
+   |          --------- type must be known at this point
    |
 
 error: aborting due to 2 previous errors
diff --git a/tests/ui/span/suggestion-non-ascii.stderr b/tests/ui/span/suggestion-non-ascii.stderr
index 6e6e31a5698..361f744ee8e 100644
--- a/tests/ui/span/suggestion-non-ascii.stderr
+++ b/tests/ui/span/suggestion-non-ascii.stderr
@@ -2,7 +2,9 @@ error[E0608]: cannot index into a value of type `({integer},)`
   --> $DIR/suggestion-non-ascii.rs:3:24
    |
 LL |     println!("☃{}", tup[0]);
-   |                        ^^^ help: to access tuple elements, use: `.0`
+   |                        ^^^ help: to access tuple element `0`, use: `.0`
+   |
+   = help: tuples are indexed with a dot and a literal index: `tuple.0`, `tuple.1`, etc.
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/static/static-align.rs b/tests/ui/static/static-align.rs
index 93241db09f9..e2db7c01adf 100644
--- a/tests/ui/static/static-align.rs
+++ b/tests/ui/static/static-align.rs
@@ -1,10 +1,14 @@
 //@ run-pass
+//@ compile-flags: --cfg FOURTY_TWO="42" --cfg TRUE --check-cfg=cfg(FOURTY_TWO,values("42")) --check-cfg=cfg(TRUE)
 #![feature(static_align)]
+#![deny(non_upper_case_globals)]
+
+use std::cell::Cell;
 
 #[rustc_align_static(64)]
 static A: u8 = 0;
 
-#[rustc_align_static(64)]
+#[rustc_align_static(4096)]
 static B: u8 = 0;
 
 #[rustc_align_static(128)]
@@ -17,10 +21,86 @@ unsafe extern "C" {
     static C: u64;
 }
 
+struct HasDrop(*const HasDrop);
+
+impl Drop for HasDrop {
+    fn drop(&mut self) {
+        assert_eq!(core::ptr::from_mut(self).cast_const(), self.0);
+    }
+}
+
+thread_local! {
+    #[rustc_align_static(4096)]
+    static LOCAL: u64 = 0;
+
+    #[allow(unused_mut, reason = "test attribute handling")]
+    #[cfg_attr(true, rustc_align_static(4096))]
+    static CONST_LOCAL: u64 = const { 0 };
+
+    #[cfg_attr(any(true), cfg_attr(true, rustc_align_static(4096)))]
+    #[allow(unused_mut, reason = "test attribute handling")]
+    static HASDROP_LOCAL: Cell<HasDrop> = Cell::new(HasDrop(core::ptr::null()));
+
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    #[allow(unused_mut, reason = "test attribute handling")]
+    #[cfg_attr(TRUE,
+      cfg_attr(FOURTY_TWO = "42",
+      cfg_attr(all(),
+      cfg_attr(any(true),
+      cfg_attr(true, rustc_align_static(4096))))))]
+    #[allow(unused_mut, reason = "test attribute handling")]
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    static HASDROP_CONST_LOCAL: Cell<HasDrop> = const { Cell::new(HasDrop(core::ptr::null())) };
+
+    #[cfg_attr(TRUE,)]
+    #[cfg_attr(true,)]
+    #[cfg_attr(false,)]
+    #[cfg_attr(
+        TRUE,
+        rustc_align_static(32),
+        cfg_attr(true, allow(non_upper_case_globals, reason = "test attribute handling")),
+        cfg_attr(false,)
+    )]
+    #[cfg_attr(false, rustc_align_static(0))]
+    static more_attr_testing: u64 = 0;
+}
+
+fn thread_local_ptr<T>(key: &'static std::thread::LocalKey<T>) -> *const T {
+    key.with(|local| core::ptr::from_ref::<T>(local))
+}
+
 fn main() {
     assert!(core::ptr::from_ref(&A).addr().is_multiple_of(64));
-    assert!(core::ptr::from_ref(&B).addr().is_multiple_of(64));
+    assert!(core::ptr::from_ref(&B).addr().is_multiple_of(4096));
 
     assert!(core::ptr::from_ref(&EXPORTED).addr().is_multiple_of(128));
     unsafe { assert!(core::ptr::from_ref(&C).addr().is_multiple_of(128)) };
+
+    assert!(thread_local_ptr(&LOCAL).addr().is_multiple_of(4096));
+    assert!(thread_local_ptr(&CONST_LOCAL).addr().is_multiple_of(4096));
+    assert!(thread_local_ptr(&HASDROP_LOCAL).addr().is_multiple_of(4096));
+    assert!(thread_local_ptr(&HASDROP_CONST_LOCAL).addr().is_multiple_of(4096));
+    assert!(thread_local_ptr(&more_attr_testing).addr().is_multiple_of(32));
+
+    // Test that address (and therefore alignment) is maintained during drop
+    let hasdrop_ptr = thread_local_ptr(&HASDROP_LOCAL);
+    core::mem::forget(HASDROP_LOCAL.replace(HasDrop(hasdrop_ptr.cast())));
+    let hasdrop_const_ptr = thread_local_ptr(&HASDROP_CONST_LOCAL);
+    core::mem::forget(HASDROP_CONST_LOCAL.replace(HasDrop(hasdrop_const_ptr.cast())));
 }
diff --git a/tests/ui/static/static-lifetime-bound.stderr b/tests/ui/static/static-lifetime-bound.stderr
index 8b0d3a0bf4c..51be79be5db 100644
--- a/tests/ui/static/static-lifetime-bound.stderr
+++ b/tests/ui/static/static-lifetime-bound.stderr
@@ -10,6 +10,12 @@ LL |     f(&x);
    |     argument requires that `x` is borrowed for `'static`
 LL | }
    | - `x` dropped here while still borrowed
+   |
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/static-lifetime-bound.rs:1:10
+   |
+LL | fn f<'a: 'static>(_: &'a i32) {}
+   |          ^^^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/static/static-region-bound.stderr b/tests/ui/static/static-region-bound.stderr
index a47c9457102..8472738daa4 100644
--- a/tests/ui/static/static-region-bound.stderr
+++ b/tests/ui/static/static-region-bound.stderr
@@ -7,6 +7,12 @@ LL |     f(x);
    |     ---- argument requires that borrow lasts for `'static`
 LL | }
    | - temporary value is freed at the end of this statement
+   |
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/static-region-bound.rs:3:8
+   |
+LL | fn f<T:'static>(_: T) {}
+   |        ^^^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/issues/issue-59020.rs b/tests/ui/std/park-timeout-wakeup-59020.rs
index 2a34ba52b88..af530bb586c 100644
--- a/tests/ui/issues/issue-59020.rs
+++ b/tests/ui/std/park-timeout-wakeup-59020.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/59020
 //@ edition:2018
 //@ run-pass
 //@ needs-threads
diff --git a/tests/ui/structs-enums/unit-like-struct-drop-run.rs b/tests/ui/structs-enums/unit-like-struct-drop-run.rs
index 3d00871837c..5e3fc5931bd 100644
--- a/tests/ui/structs-enums/unit-like-struct-drop-run.rs
+++ b/tests/ui/structs-enums/unit-like-struct-drop-run.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-unwind
 //@ needs-threads
+//@ ignore-backends: gcc
 
 // Make sure the destructor is run for unit-like structs.
 
diff --git a/tests/ui/issues/issue-56835.rs b/tests/ui/structs/invalid-self-constructor-56835.rs
index 7132d15ee5f..fd8763443f0 100644
--- a/tests/ui/issues/issue-56835.rs
+++ b/tests/ui/structs/invalid-self-constructor-56835.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/56835
 pub struct Foo {}
 
 impl Foo {
diff --git a/tests/ui/issues/issue-56835.stderr b/tests/ui/structs/invalid-self-constructor-56835.stderr
index e949ae7b324..045781ec42b 100644
--- a/tests/ui/issues/issue-56835.stderr
+++ b/tests/ui/structs/invalid-self-constructor-56835.stderr
@@ -1,11 +1,11 @@
 error: the `Self` constructor can only be used with tuple or unit structs
-  --> $DIR/issue-56835.rs:4:12
+  --> $DIR/invalid-self-constructor-56835.rs:5:12
    |
 LL |     fn bar(Self(foo): Self) {}
    |            ^^^^^^^^^ help: use curly brackets: `Self { /* fields */ }`
 
 error[E0164]: expected tuple struct or tuple variant, found self constructor `Self`
-  --> $DIR/issue-56835.rs:4:12
+  --> $DIR/invalid-self-constructor-56835.rs:5:12
    |
 LL |     fn bar(Self(foo): Self) {}
    |            ^^^^^^^^^ not a tuple struct or tuple variant
diff --git a/tests/ui/suggestions/apitit-unimplemented-method.rs b/tests/ui/suggestions/apitit-unimplemented-method.rs
index b182e1939b3..c0cd709e230 100644
--- a/tests/ui/suggestions/apitit-unimplemented-method.rs
+++ b/tests/ui/suggestions/apitit-unimplemented-method.rs
@@ -4,9 +4,12 @@ extern crate dep;
 use dep::*;
 
 struct Local;
+
 impl Trait for Local {}
 //~^ ERROR not all trait items implemented
 //~| HELP implement the missing item: `fn foo(_: impl Sized) { todo!() }`
-//~| HELP implement the missing item: `fn bar<T>(_: impl Sized) { todo!() }`
+//~| HELP implement the missing item: `fn bar<T>(_: impl Sized) where Foo<T>: MetaSized { todo!() }`
+//~| HELP implement the missing item: `fn baz<const N: usize>() { todo!() }`
+//~| HELP implement the missing item: `fn quux<'a: 'b, 'b, T>() where T: ?Sized { todo!() }`
 
 fn main() {}
diff --git a/tests/ui/suggestions/apitit-unimplemented-method.stderr b/tests/ui/suggestions/apitit-unimplemented-method.stderr
index b309a64e958..1f2e0ea2cad 100644
--- a/tests/ui/suggestions/apitit-unimplemented-method.stderr
+++ b/tests/ui/suggestions/apitit-unimplemented-method.stderr
@@ -1,11 +1,13 @@
-error[E0046]: not all trait items implemented, missing: `foo`, `bar`
-  --> $DIR/apitit-unimplemented-method.rs:7:1
+error[E0046]: not all trait items implemented, missing: `foo`, `bar`, `baz`, `quux`
+  --> $DIR/apitit-unimplemented-method.rs:8:1
    |
 LL | impl Trait for Local {}
-   | ^^^^^^^^^^^^^^^^^^^^ missing `foo`, `bar` in implementation
+   | ^^^^^^^^^^^^^^^^^^^^ missing `foo`, `bar`, `baz`, `quux` in implementation
    |
    = help: implement the missing item: `fn foo(_: impl Sized) { todo!() }`
-   = help: implement the missing item: `fn bar<T>(_: impl Sized) { todo!() }`
+   = help: implement the missing item: `fn bar<T>(_: impl Sized) where Foo<T>: MetaSized { todo!() }`
+   = help: implement the missing item: `fn baz<const N: usize>() { todo!() }`
+   = help: implement the missing item: `fn quux<'a: 'b, 'b, T>() where T: ?Sized { todo!() }`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/suggestions/auxiliary/dep.rs b/tests/ui/suggestions/auxiliary/dep.rs
index ac0de418313..c28c8b8a52f 100644
--- a/tests/ui/suggestions/auxiliary/dep.rs
+++ b/tests/ui/suggestions/auxiliary/dep.rs
@@ -1,4 +1,16 @@
+#![feature(sized_hierarchy)]
+
+use std::marker::MetaSized;
+
+pub struct Foo<T> {
+    inner: T,
+}
+
 pub trait Trait {
     fn foo(_: impl Sized);
-    fn bar<T>(_: impl Sized);
+    fn bar<T>(_: impl Sized)
+    where
+        Foo<T>: MetaSized;
+    fn baz<'a, const N: usize>();
+    fn quux<'a: 'b, 'b, T: ?Sized>();
 }
diff --git a/tests/ui/suggestions/auxiliary/hidden-struct.rs b/tests/ui/suggestions/auxiliary/hidden-struct.rs
index 30d69acac20..1f495a9f222 100644
--- a/tests/ui/suggestions/auxiliary/hidden-struct.rs
+++ b/tests/ui/suggestions/auxiliary/hidden-struct.rs
@@ -1,3 +1,5 @@
+// `Foo` and `Bar` should not be suggested in diagnostics of dependents
+
 #[doc(hidden)]
 pub mod hidden {
     pub struct Foo;
@@ -5,13 +7,29 @@ pub mod hidden {
 
 pub mod hidden1 {
     #[doc(hidden)]
-    pub struct Foo;
+    pub struct Bar;
 }
 
+// `Baz` and `Quux` *should* be suggested in diagnostics of dependents
 
 #[doc(hidden)]
-pub(crate) mod hidden2 {
-    pub struct Bar;
+pub mod hidden2 {
+    pub struct Baz;
+}
+
+pub use hidden2::Baz;
+
+#[doc(hidden)]
+pub(crate) mod hidden3 {
+    pub struct Quux;
 }
 
-pub use hidden2::Bar;
+pub use hidden3::Quux;
+
+pub trait Marker {}
+
+impl Marker for Option<u32> {}
+impl Marker for hidden::Foo {}
+impl Marker for hidden1::Bar {}
+impl Marker for Baz {}
+impl Marker for Quux {}
diff --git a/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs b/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs
index 281975dcc2f..a83e496f270 100644
--- a/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs
+++ b/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.rs
@@ -1,5 +1,4 @@
 //@ aux-build:hidden-struct.rs
-//@ compile-flags: --crate-type lib
 
 extern crate hidden_struct;
 
@@ -9,7 +8,20 @@ mod local {
 }
 
 pub fn test(_: Foo) {}
-//~^ ERROR cannot find type `Foo` in this scope
+//~^ ERROR [E0412]
 
 pub fn test2(_: Bar) {}
-//~^ ERROR cannot find type `Bar` in this scope
+//~^ ERROR [E0412]
+
+pub fn test3(_: Baz) {}
+//~^ ERROR [E0412]
+
+pub fn test4(_: Quux) {}
+//~^ ERROR [E0412]
+
+fn test5<T: hidden_struct::Marker>() {}
+
+fn main() {
+    test5::<i32>();
+    //~^ ERROR [E0277]
+}
diff --git a/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.stderr b/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.stderr
index 7fb4d95ff9b..7036708756d 100644
--- a/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.stderr
+++ b/tests/ui/suggestions/dont-suggest-foreign-doc-hidden.stderr
@@ -1,5 +1,5 @@
 error[E0412]: cannot find type `Foo` in this scope
-  --> $DIR/dont-suggest-foreign-doc-hidden.rs:11:16
+  --> $DIR/dont-suggest-foreign-doc-hidden.rs:10:16
    |
 LL | pub fn test(_: Foo) {}
    |                ^^^ not found in this scope
@@ -10,16 +10,50 @@ LL + use local::Foo;
    |
 
 error[E0412]: cannot find type `Bar` in this scope
-  --> $DIR/dont-suggest-foreign-doc-hidden.rs:14:17
+  --> $DIR/dont-suggest-foreign-doc-hidden.rs:13:17
    |
 LL | pub fn test2(_: Bar) {}
    |                 ^^^ not found in this scope
+
+error[E0412]: cannot find type `Baz` in this scope
+  --> $DIR/dont-suggest-foreign-doc-hidden.rs:16:17
+   |
+LL | pub fn test3(_: Baz) {}
+   |                 ^^^ not found in this scope
    |
 help: consider importing this struct
    |
-LL + use hidden_struct::Bar;
+LL + use hidden_struct::Baz;
+   |
+
+error[E0412]: cannot find type `Quux` in this scope
+  --> $DIR/dont-suggest-foreign-doc-hidden.rs:19:17
+   |
+LL | pub fn test4(_: Quux) {}
+   |                 ^^^^ not found in this scope
+   |
+help: consider importing this struct
+   |
+LL + use hidden_struct::Quux;
+   |
+
+error[E0277]: the trait bound `i32: Marker` is not satisfied
+  --> $DIR/dont-suggest-foreign-doc-hidden.rs:25:13
+   |
+LL |     test5::<i32>();
+   |             ^^^ the trait `Marker` is not implemented for `i32`
+   |
+   = help: the following other types implement trait `Marker`:
+             Baz
+             Option<u32>
+             Quux
+note: required by a bound in `test5`
+  --> $DIR/dont-suggest-foreign-doc-hidden.rs:22:13
    |
+LL | fn test5<T: hidden_struct::Marker>() {}
+   |             ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test5`
 
-error: aborting due to 2 previous errors
+error: aborting due to 5 previous errors
 
-For more information about this error, try `rustc --explain E0412`.
+Some errors have detailed explanations: E0277, E0412.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/issues/issue-59756.fixed b/tests/ui/suggestions/incompatible-types-in-try-expression-59756.fixed
index 954ba917626..954ba917626 100644
--- a/tests/ui/issues/issue-59756.fixed
+++ b/tests/ui/suggestions/incompatible-types-in-try-expression-59756.fixed
diff --git a/tests/ui/issues/issue-59756.rs b/tests/ui/suggestions/incompatible-types-in-try-expression-59756.rs
index de349f43f46..570aa7d373b 100644
--- a/tests/ui/issues/issue-59756.rs
+++ b/tests/ui/suggestions/incompatible-types-in-try-expression-59756.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/59756
 //@ run-rustfix
 //@ ignore-test (rustfix needs multiple suggestions)
 //
diff --git a/tests/ui/issues/issue-59756.stderr b/tests/ui/suggestions/incompatible-types-in-try-expression-59756.stderr
index 27c07fecd5b..7182109b5a0 100644
--- a/tests/ui/issues/issue-59756.stderr
+++ b/tests/ui/suggestions/incompatible-types-in-try-expression-59756.stderr
@@ -1,5 +1,5 @@
 error[E0308]: try expression alternatives have incompatible types
-  --> $DIR/issue-59756.rs:13:5
+  --> $DIR/incompatible-types-in-try-expression-59756.rs:13:5
    |
 LL |     foo()?
    |     ^^^^^^ expected enum `std::result::Result`, found struct `A`
diff --git a/tests/ui/suggestions/incorrect-variant-literal.svg b/tests/ui/suggestions/incorrect-variant-literal.svg
index 2cab1f4b60f..4b952325cf7 100644
--- a/tests/ui/suggestions/incorrect-variant-literal.svg
+++ b/tests/ui/suggestions/incorrect-variant-literal.svg
@@ -1,7 +1,7 @@
 <svg width="886px" height="9524px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
-    .bg { background: #000000 }
+    .bg { fill: #000000 }
     .fg-ansi256-009 { fill: #FF5555 }
     .fg-ansi256-010 { fill: #55FF55 }
     .fg-ansi256-012 { fill: #5555FF }
diff --git a/tests/ui/suggestions/issue-61963.rs b/tests/ui/suggestions/issue-61963.rs
index 77e4b21f5db..bf0680b9860 100644
--- a/tests/ui/suggestions/issue-61963.rs
+++ b/tests/ui/suggestions/issue-61963.rs
@@ -1,6 +1,7 @@
 //@ edition: 2015
 //@ proc-macro: issue-61963.rs
 //@ proc-macro: issue-61963-1.rs
+//@ ignore-backends: gcc
 #![deny(bare_trait_objects)]
 
 #[macro_use]
diff --git a/tests/ui/suggestions/issue-61963.stderr b/tests/ui/suggestions/issue-61963.stderr
index ffdeef12bb7..f9146a619ec 100644
--- a/tests/ui/suggestions/issue-61963.stderr
+++ b/tests/ui/suggestions/issue-61963.stderr
@@ -1,5 +1,5 @@
 error: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/issue-61963.rs:23:14
+  --> $DIR/issue-61963.rs:24:14
    |
 LL |     bar: Box<Bar>,
    |              ^^^
@@ -7,7 +7,7 @@ LL |     bar: Box<Bar>,
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
    = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html>
 note: the lint level is defined here
-  --> $DIR/issue-61963.rs:4:9
+  --> $DIR/issue-61963.rs:5:9
    |
 LL | #![deny(bare_trait_objects)]
    |         ^^^^^^^^^^^^^^^^^^
@@ -17,7 +17,7 @@ LL |     bar: Box<dyn Bar>,
    |              +++
 
 error: trait objects without an explicit `dyn` are deprecated
-  --> $DIR/issue-61963.rs:19:1
+  --> $DIR/issue-61963.rs:20:1
    |
 LL | pub struct Foo {
    | ^^^
diff --git a/tests/ui/suggestions/issue-97760.stderr b/tests/ui/suggestions/issue-97760.stderr
index 1084ea7c9e0..c3cf7e13987 100644
--- a/tests/ui/suggestions/issue-97760.stderr
+++ b/tests/ui/suggestions/issue-97760.stderr
@@ -1,11 +1,8 @@
 error[E0277]: `<impl IntoIterator as IntoIterator>::Item` doesn't implement `std::fmt::Display`
-  --> $DIR/issue-97760.rs:4:20
+  --> $DIR/issue-97760.rs:4:19
    |
 LL |         println!("{x}");
-   |                   -^-
-   |                   ||
-   |                   |`<impl IntoIterator as IntoIterator>::Item` cannot be formatted with the default formatter
-   |                   required by this formatting parameter
+   |                   ^^^ `<impl IntoIterator as IntoIterator>::Item` cannot be formatted with the default formatter
    |
    = help: the trait `std::fmt::Display` is not implemented for `<impl IntoIterator as IntoIterator>::Item`
    = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
diff --git a/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.fixed b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.fixed
index 99433f73320..8a2be310e0d 100644
--- a/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.fixed
+++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.fixed
@@ -8,7 +8,7 @@ pub struct Vector2<T: Debug + Copy + Clone> {
 }
 
 #[derive(Debug, Copy, Clone)]
-pub struct AABB<K: Debug + std::marker::Copy + std::marker::Copy + std::marker::Copy + std::marker::Copy> {
+pub struct AABB<K: Debug + std::marker::Copy> {
     pub loc: Vector2<K>, //~ ERROR the trait bound `K: Copy` is not satisfied
     //~^ ERROR the trait bound `K: Copy` is not satisfied
     //~| ERROR the trait bound `K: Copy` is not satisfied
diff --git a/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed
index 6da3e351ffb..74df1d7c7cf 100644
--- a/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed
+++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-3.fixed
@@ -8,7 +8,7 @@ pub struct Vector2<T: Debug + Copy + Clone>{
 }
 
 #[derive(Debug, Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented for this type
-pub struct AABB<K: Copy + Debug + std::fmt::Debug + std::fmt::Debug + std::fmt::Debug>{
+pub struct AABB<K: Copy + Debug + std::fmt::Debug>{
     pub loc: Vector2<K>, //~ ERROR `K` doesn't implement `Debug`
     //~^ ERROR `K` doesn't implement `Debug`
     pub size: Vector2<K> //~ ERROR `K` doesn't implement `Debug`
diff --git a/tests/ui/suggestions/missing-format-specifiers-issue-68293.rs b/tests/ui/suggestions/missing-format-specifiers-issue-68293.rs
index 29799624d78..fbede7c41cb 100644
--- a/tests/ui/suggestions/missing-format-specifiers-issue-68293.rs
+++ b/tests/ui/suggestions/missing-format-specifiers-issue-68293.rs
@@ -32,4 +32,33 @@ fn missing_format_specifiers_multiple_unused_args() {
     //~| NOTE consider adding 2 format specifiers
 }
 
+fn unicode_unused_args() {
+    panic!("👆", "👆", 1);
+    //~^ ERROR multiple unused formatting arguments
+    //~| NOTE multiple missing formatting specifiers
+    //~| NOTE argument never used
+    //~| NOTE argument never used
+    //~| HELP format specifiers use curly braces, consider adding 2 format specifiers
+}
+
+fn raw_str_unused_arg() {
+    format_args!(r##"lJ𐏿Æ�.𐏿�"##, r#"r}J𐏿Æ" {}"#, 1);
+    //~^ ERROR multiple unused formatting arguments
+    //~| NOTE multiple missing formatting specifiers
+    //~| NOTE argument never used
+    //~| NOTE argument never used
+    //~| HELP format specifiers use curly braces, consider adding 2 format specifiers
+}
+
+fn valid_new_lines_unused_args() {
+    panic!("Expect 2 newlines
+
+", "👆", 1);
+    //~^ ERROR multiple unused formatting arguments
+    //~| NOTE argument never used
+    //~| NOTE argument never used
+    //~^^^^^^ NOTE multiple missing formatting specifiers
+    //~| HELP format specifiers use curly braces, consider adding 2 format specifiers
+}
+
 fn main() { }
diff --git a/tests/ui/suggestions/missing-format-specifiers-issue-68293.stderr b/tests/ui/suggestions/missing-format-specifiers-issue-68293.stderr
index 081409789f5..7e997241698 100644
--- a/tests/ui/suggestions/missing-format-specifiers-issue-68293.stderr
+++ b/tests/ui/suggestions/missing-format-specifiers-issue-68293.stderr
@@ -45,5 +45,52 @@ LL |     println!("list: {}", 1, 2, 3);
    |
    = note: consider adding 2 format specifiers
 
-error: aborting due to 4 previous errors
+error: multiple unused formatting arguments
+  --> $DIR/missing-format-specifiers-issue-68293.rs:36:17
+   |
+LL |     panic!("👆", "👆", 1);
+   |            ----  ^^^^  ^ argument never used
+   |            |     |
+   |            |     argument never used
+   |            multiple missing formatting specifiers
+   |
+help: format specifiers use curly braces, consider adding 2 format specifiers
+   |
+LL |     panic!("👆{}{}", "👆", 1);
+   |               ++++
+
+error: multiple unused formatting arguments
+  --> $DIR/missing-format-specifiers-issue-68293.rs:45:35
+   |
+LL |     format_args!(r##"lJ𐏿Æ�.𐏿�"##, r#"r}J𐏿Æ" {}"#, 1);
+   |                  ---------------  ^^^^^^^^^^^^^^  ^ argument never used
+   |                  |                |
+   |                  |                argument never used
+   |                  multiple missing formatting specifiers
+   |
+help: format specifiers use curly braces, consider adding 2 format specifiers
+   |
+LL |     format_args!(r##"lJ𐏿Æ�.𐏿�{}{}"##, r#"r}J𐏿Æ" {}"#, 1);
+   |                              ++++
+
+error: multiple unused formatting arguments
+  --> $DIR/missing-format-specifiers-issue-68293.rs:56:4
+   |
+LL |       panic!("Expect 2 newlines
+   |  ____________-
+LL | |
+LL | | ", "👆", 1);
+   | | -  ^^^^  ^ argument never used
+   | | |  |
+   | |_|  argument never used
+   |   multiple missing formatting specifiers
+   |
+help: format specifiers use curly braces, consider adding 2 format specifiers
+   |
+LL |     panic!("Expect 2 newlines
+LL |
+LL ~ {}{}", "👆", 1);
+   |
+
+error: aborting due to 7 previous errors
 
diff --git a/tests/ui/suggestions/non_copy_move_out_of_tuple.rs b/tests/ui/suggestions/non_copy_move_out_of_tuple.rs
new file mode 100644
index 00000000000..baf15dba33a
--- /dev/null
+++ b/tests/ui/suggestions/non_copy_move_out_of_tuple.rs
@@ -0,0 +1,8 @@
+// Regression test for #146537.
+
+struct NonCopy;
+fn main() {
+    let tuple = &(NonCopy,);
+    let b: NonCopy;
+    (b,) = *tuple; //~ ERROR: cannot move out of `tuple.0` which is behind a shared reference [E0507]
+}
diff --git a/tests/ui/suggestions/non_copy_move_out_of_tuple.stderr b/tests/ui/suggestions/non_copy_move_out_of_tuple.stderr
new file mode 100644
index 00000000000..62f24324fcc
--- /dev/null
+++ b/tests/ui/suggestions/non_copy_move_out_of_tuple.stderr
@@ -0,0 +1,26 @@
+error[E0507]: cannot move out of `tuple.0` which is behind a shared reference
+  --> $DIR/non_copy_move_out_of_tuple.rs:7:12
+   |
+LL |     (b,) = *tuple;
+   |      -     ^^^^^^
+   |      |
+   |      data moved here
+   |      move occurs because the place has type `NonCopy`, which does not implement the `Copy` trait
+   |
+note: if `NonCopy` implemented `Clone`, you could clone the value
+  --> $DIR/non_copy_move_out_of_tuple.rs:3:1
+   |
+LL | struct NonCopy;
+   | ^^^^^^^^^^^^^^ consider implementing `Clone` for this type
+...
+LL |     (b,) = *tuple;
+   |      - you could clone this value
+help: consider removing the dereference here
+   |
+LL -     (b,) = *tuple;
+LL +     (b,) = tuple;
+   |
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0507`.
diff --git a/tests/ui/suggestions/only-replace-intended-coma-not-all-in-pattern.fixed b/tests/ui/suggestions/only-replace-intended-coma-not-all-in-pattern.fixed
new file mode 100644
index 00000000000..0258f868f00
--- /dev/null
+++ b/tests/ui/suggestions/only-replace-intended-coma-not-all-in-pattern.fixed
@@ -0,0 +1,18 @@
+//@ run-rustfix
+
+// Regression test for issue #143330.
+// Ensure we suggest to replace only the intended coma with a bar, not all commas in the pattern.
+
+fn main() {
+    struct Foo { x: i32, ch: char }
+    let pos = Foo { x: 2, ch: 'x' };
+    match pos {
+        // All commas here were replaced with bars.
+        // Foo { x: 2 | ch: ' |' } | Foo { x: 3 | ch: '@' } => (),
+        (Foo { x: 2, ch: ',' } | Foo { x: 3, ch: '@' }) => (),
+        //~^ ERROR unexpected `,` in pattern
+        //~| HELP try adding parentheses to match on a tuple...
+        //~| HELP ...or a vertical bar to match on alternative
+        _ => todo!(),
+    }
+}
diff --git a/tests/ui/suggestions/only-replace-intended-coma-not-all-in-pattern.rs b/tests/ui/suggestions/only-replace-intended-coma-not-all-in-pattern.rs
new file mode 100644
index 00000000000..7d5087fa0ff
--- /dev/null
+++ b/tests/ui/suggestions/only-replace-intended-coma-not-all-in-pattern.rs
@@ -0,0 +1,18 @@
+//@ run-rustfix
+
+// Regression test for issue #143330.
+// Ensure we suggest to replace only the intended coma with a bar, not all commas in the pattern.
+
+fn main() {
+    struct Foo { x: i32, ch: char }
+    let pos = Foo { x: 2, ch: 'x' };
+    match pos {
+        // All commas here were replaced with bars.
+        // Foo { x: 2 | ch: ' |' } | Foo { x: 3 | ch: '@' } => (),
+        Foo { x: 2, ch: ',' }, Foo { x: 3, ch: '@' } => (),
+        //~^ ERROR unexpected `,` in pattern
+        //~| HELP try adding parentheses to match on a tuple...
+        //~| HELP ...or a vertical bar to match on alternative
+        _ => todo!(),
+    }
+}
diff --git a/tests/ui/suggestions/only-replace-intended-coma-not-all-in-pattern.stderr b/tests/ui/suggestions/only-replace-intended-coma-not-all-in-pattern.stderr
new file mode 100644
index 00000000000..ee75e2db133
--- /dev/null
+++ b/tests/ui/suggestions/only-replace-intended-coma-not-all-in-pattern.stderr
@@ -0,0 +1,18 @@
+error: unexpected `,` in pattern
+  --> $DIR/only-replace-intended-coma-not-all-in-pattern.rs:12:30
+   |
+LL |         Foo { x: 2, ch: ',' }, Foo { x: 3, ch: '@' } => (),
+   |                              ^
+   |
+help: try adding parentheses to match on a tuple...
+   |
+LL |         (Foo { x: 2, ch: ',' }, Foo { x: 3, ch: '@' }) => (),
+   |         +                                            +
+help: ...or a vertical bar to match on alternatives
+   |
+LL -         Foo { x: 2, ch: ',' }, Foo { x: 3, ch: '@' } => (),
+LL +         Foo { x: 2, ch: ',' } | Foo { x: 3, ch: '@' } => (),
+   |
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/suggestions/return-cycle-2.stderr b/tests/ui/suggestions/return-cycle-2.stderr
index 23de2309e87..e852cd34a72 100644
--- a/tests/ui/suggestions/return-cycle-2.stderr
+++ b/tests/ui/suggestions/return-cycle-2.stderr
@@ -2,10 +2,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/return-cycle-2.rs:6:34
    |
 LL |     fn as_ref(_: i32, _: i32) -> _ {
-   |                                  ^
-   |                                  |
-   |                                  not allowed in type signatures
-   |                                  help: replace with the correct return type: `Token<&'static T>`
+   |                                  ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL -     fn as_ref(_: i32, _: i32) -> _ {
+LL +     fn as_ref(_: i32, _: i32) -> Token<&'static T> {
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/suggestions/return-cycle.stderr b/tests/ui/suggestions/return-cycle.stderr
index 60470490441..cd46c2daa40 100644
--- a/tests/ui/suggestions/return-cycle.stderr
+++ b/tests/ui/suggestions/return-cycle.stderr
@@ -2,10 +2,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/return-cycle.rs:6:17
    |
 LL |     fn new() -> _ {
-   |                 ^
-   |                 |
-   |                 not allowed in type signatures
-   |                 help: replace with the correct return type: `Token<()>`
+   |                 ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL -     fn new() -> _ {
+LL +     fn new() -> Token<()> {
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/suggestions/suggest-fn-ptr-for-fn-item-in-fn-ret.stderr b/tests/ui/suggestions/suggest-fn-ptr-for-fn-item-in-fn-ret.stderr
index bf7790e2307..9880dd95d86 100644
--- a/tests/ui/suggestions/suggest-fn-ptr-for-fn-item-in-fn-ret.stderr
+++ b/tests/ui/suggestions/suggest-fn-ptr-for-fn-item-in-fn-ret.stderr
@@ -2,10 +2,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/suggest-fn-ptr-for-fn-item-in-fn-ret.rs:7:13
    |
 LL | fn bar() -> _ { Wrapper(foo) }
-   |             ^
-   |             |
-   |             not allowed in type signatures
-   |             help: replace with the correct return type: `Wrapper<fn()>`
+   |             ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - fn bar() -> _ { Wrapper(foo) }
+LL + fn bar() -> Wrapper<fn()> { Wrapper(foo) }
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/suggestions/suggest-ref-macro.rs b/tests/ui/suggestions/suggest-ref-macro.rs
index 2f31af33782..41a2acf9062 100644
--- a/tests/ui/suggestions/suggest-ref-macro.rs
+++ b/tests/ui/suggestions/suggest-ref-macro.rs
@@ -1,5 +1,6 @@
 // run-check
 //@ proc-macro: proc-macro-type-error.rs
+//@ ignore-backends: gcc
 
 extern crate proc_macro_type_error;
 
diff --git a/tests/ui/suggestions/suggest-ref-macro.stderr b/tests/ui/suggestions/suggest-ref-macro.stderr
index 08bc9e86a50..2a52c1e2445 100644
--- a/tests/ui/suggestions/suggest-ref-macro.stderr
+++ b/tests/ui/suggestions/suggest-ref-macro.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/suggest-ref-macro.rs:8:1
+  --> $DIR/suggest-ref-macro.rs:9:1
    |
 LL | #[hello]
    | ^^^^^^^^
@@ -8,14 +8,14 @@ LL | #[hello]
    | arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/suggest-ref-macro.rs:8:1
+  --> $DIR/suggest-ref-macro.rs:9:1
    |
 LL | #[hello]
    | ^^^^^^^^
    = note: this error originates in the attribute macro `hello` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0308]: mismatched types
-  --> $DIR/suggest-ref-macro.rs:15:11
+  --> $DIR/suggest-ref-macro.rs:16:11
    |
 LL |         x(123);
    |         - ^^^ expected `&mut i32`, found integer
@@ -26,7 +26,7 @@ LL |     bla!();
    |     ------ in this macro invocation
    |
 note: function defined here
-  --> $DIR/suggest-ref-macro.rs:11:4
+  --> $DIR/suggest-ref-macro.rs:12:4
    |
 LL | fn x(_: &mut i32) {}
    |    ^ -----------
@@ -37,7 +37,7 @@ LL |         x(&mut 123);
    |           ++++
 
 error[E0308]: mismatched types
-  --> $DIR/suggest-ref-macro.rs:26:10
+  --> $DIR/suggest-ref-macro.rs:27:10
    |
 LL |         x($v)
    |         - arguments to this function are incorrect
@@ -46,7 +46,7 @@ LL |     bla!(456);
    |          ^^^ expected `&mut i32`, found integer
    |
 note: function defined here
-  --> $DIR/suggest-ref-macro.rs:11:4
+  --> $DIR/suggest-ref-macro.rs:12:4
    |
 LL | fn x(_: &mut i32) {}
    |    ^ -----------
diff --git a/tests/ui/suggestions/trait-impl-bound-suggestions.fixed b/tests/ui/suggestions/trait-impl-bound-suggestions.fixed
index 9d3168f5acd..49793b4b6f4 100644
--- a/tests/ui/suggestions/trait-impl-bound-suggestions.fixed
+++ b/tests/ui/suggestions/trait-impl-bound-suggestions.fixed
@@ -10,7 +10,7 @@ struct ConstrainedStruct<X: Copy> {
 }
 
 #[allow(dead_code)]
-trait InsufficientlyConstrainedGeneric<X=()> where Self: Sized, X: std::marker::Copy, X: std::marker::Copy {
+trait InsufficientlyConstrainedGeneric<X=()> where Self: Sized, X: std::marker::Copy {
     fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> {
         //~^ ERROR the trait bound `X: Copy` is not satisfied
         ConstrainedStruct { x }
@@ -20,7 +20,7 @@ trait InsufficientlyConstrainedGeneric<X=()> where Self: Sized, X: std::marker::
 
 // Regression test for #120838
 #[allow(dead_code)]
-trait InsufficientlyConstrainedGenericWithEmptyWhere<X=()> where Self: Sized, X: std::marker::Copy, X: std::marker::Copy {
+trait InsufficientlyConstrainedGenericWithEmptyWhere<X=()> where Self: Sized, X: std::marker::Copy {
     fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> {
         //~^ ERROR the trait bound `X: Copy` is not satisfied
         ConstrainedStruct { x }
diff --git a/tests/ui/symbol-names/const-generics-structural-demangling.rs b/tests/ui/symbol-names/const-generics-structural-demangling.rs
index 06e3ce51fa6..0b4af61f991 100644
--- a/tests/ui/symbol-names/const-generics-structural-demangling.rs
+++ b/tests/ui/symbol-names/const-generics-structural-demangling.rs
@@ -6,7 +6,7 @@
 #![feature(adt_const_params, unsized_const_params, decl_macro, rustc_attrs)]
 #![allow(incomplete_features)]
 
-use std::marker::UnsizedConstParamTy;
+use std::marker::ConstParamTy;
 
 pub struct RefByte<const RB: &'static u8>;
 
@@ -42,7 +42,7 @@ pub struct TupleByteBool<const TBB: (u8, bool)>;
 //~| ERROR demangling-alt(<c::TupleByteBool<{(1, false)}>>)
 impl TupleByteBool<{ (1, false) }> {}
 
-#[derive(PartialEq, Eq, UnsizedConstParamTy)]
+#[derive(PartialEq, Eq, ConstParamTy)]
 pub enum MyOption<T> {
     Some(T),
     None,
@@ -66,7 +66,7 @@ impl OptionUsize<{ MyOption::None }> {}
 //~| ERROR demangling-alt(<c::OptionUsize<{c::MyOption::<usize>::Some(0)}>>)
 impl OptionUsize<{ MyOption::Some(0) }> {}
 
-#[derive(PartialEq, Eq, UnsizedConstParamTy)]
+#[derive(PartialEq, Eq, ConstParamTy)]
 pub struct Foo {
     s: &'static str,
     ch: char,
@@ -83,7 +83,7 @@ impl Foo_<{ Foo { s: "abc", ch: 'x', slice: &[1, 2, 3] } }> {}
 // NOTE(eddyb) this tests specifically the use of disambiguators in field names,
 // using macros 2.0 hygiene to create a `struct` with conflicting field names.
 macro duplicate_field_name_test($x:ident) {
-    #[derive(PartialEq, Eq, UnsizedConstParamTy)]
+    #[derive(PartialEq, Eq, ConstParamTy)]
     pub struct Bar {
         $x: u8,
         x: u16,
diff --git a/tests/ui/test-attrs/test-panic-abort-nocapture.rs b/tests/ui/test-attrs/test-panic-abort-nocapture.rs
index 6a1025ea087..7c78d432fa0 100644
--- a/tests/ui/test-attrs/test-panic-abort-nocapture.rs
+++ b/tests/ui/test-attrs/test-panic-abort-nocapture.rs
@@ -6,7 +6,6 @@
 //@ exec-env:RUST_BACKTRACE=0
 //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
 
-//@ ignore-android #120567
 //@ needs-subprocess
 
 #![cfg(test)]
diff --git a/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr b/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr
index 8d7c62f8ec7..d8f65a78261 100644
--- a/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr
+++ b/tests/ui/test-attrs/test-panic-abort-nocapture.run.stderr
@@ -1,11 +1,11 @@
 
-thread 'main' ($TID) panicked at $DIR/test-panic-abort-nocapture.rs:32:5:
+thread 'main' ($TID) panicked at $DIR/test-panic-abort-nocapture.rs:31:5:
 assertion `left == right` failed
   left: 2
  right: 4
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 
-thread 'main' ($TID) panicked at $DIR/test-panic-abort-nocapture.rs:26:5:
+thread 'main' ($TID) panicked at $DIR/test-panic-abort-nocapture.rs:25:5:
 assertion `left == right` failed
   left: 2
  right: 4
diff --git a/tests/ui/test-attrs/test-panic-abort.rs b/tests/ui/test-attrs/test-panic-abort.rs
index 6c9b641fb6f..13a30223399 100644
--- a/tests/ui/test-attrs/test-panic-abort.rs
+++ b/tests/ui/test-attrs/test-panic-abort.rs
@@ -6,7 +6,6 @@
 //@ exec-env:RUST_BACKTRACE=0
 //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
 
-//@ ignore-android #120567
 //@ needs-subprocess
 
 #![cfg(test)]
diff --git a/tests/ui/test-attrs/test-panic-abort.run.stdout b/tests/ui/test-attrs/test-panic-abort.run.stdout
index 4d65c05b944..ca247f7da41 100644
--- a/tests/ui/test-attrs/test-panic-abort.run.stdout
+++ b/tests/ui/test-attrs/test-panic-abort.run.stdout
@@ -18,7 +18,7 @@ testing123
 ---- it_fails stderr ----
 testing321
 
-thread 'main' ($TID) panicked at $DIR/test-panic-abort.rs:37:5:
+thread 'main' ($TID) panicked at $DIR/test-panic-abort.rs:36:5:
 assertion `left == right` failed
   left: 2
  right: 5
diff --git a/tests/ui/test-attrs/test-panic-while-printing.rs b/tests/ui/test-attrs/test-panic-while-printing.rs
index a50a15fbe5a..49e8d9c7afd 100644
--- a/tests/ui/test-attrs/test-panic-while-printing.rs
+++ b/tests/ui/test-attrs/test-panic-while-printing.rs
@@ -1,6 +1,7 @@
 //@ compile-flags:--test
 //@ run-pass
 //@ needs-unwind
+//@ ignore-backends: gcc
 
 use std::fmt;
 use std::fmt::{Display, Formatter};
diff --git a/tests/ui/thread-local/long-docs.rs b/tests/ui/thread-local/long-docs.rs
new file mode 100644
index 00000000000..0577d0b27c2
--- /dev/null
+++ b/tests/ui/thread-local/long-docs.rs
@@ -0,0 +1,266 @@
+//@ check-pass
+
+thread_local! {
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    pub static LONG_DOCS: () = ();
+
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    /// I love doc comments.
+    #[allow(unused_mut, reason = "testing")]
+    pub static LONG_DOCS_2: () = ();
+}
+
+fn main() {}
diff --git a/tests/ui/thread-local/no-unstable.rs b/tests/ui/thread-local/no-unstable.rs
new file mode 100644
index 00000000000..3de7985e62d
--- /dev/null
+++ b/tests/ui/thread-local/no-unstable.rs
@@ -0,0 +1,17 @@
+thread_local! {
+    //~^ ERROR: use of an internal attribute [E0658]
+    //~| ERROR: use of an internal attribute [E0658]
+    //~| ERROR: `#[used(linker)]` is currently unstable [E0658]
+    //~| ERROR: `#[used]` attribute cannot be used on constants
+
+    #[rustc_dummy = 17]
+    pub static FOO: () = ();
+
+    #[cfg_attr(true, rustc_dummy = 17)]
+    pub static BAR: () = ();
+
+    #[used(linker)]
+    pub static BAZ: () = ();
+}
+
+fn main() {}
diff --git a/tests/ui/thread-local/no-unstable.stderr b/tests/ui/thread-local/no-unstable.stderr
new file mode 100644
index 00000000000..fbcd804d917
--- /dev/null
+++ b/tests/ui/thread-local/no-unstable.stderr
@@ -0,0 +1,57 @@
+error[E0658]: use of an internal attribute
+  --> $DIR/no-unstable.rs:1:1
+   |
+LL | / thread_local! {
+...  |
+LL | |     pub static BAZ: () = ();
+LL | | }
+   | |_^
+   |
+   = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
+   = note: the `#[rustc_dummy]` attribute is an internal implementation detail that will never be stable
+   = note: the `#[rustc_dummy]` attribute is used for rustc unit tests
+   = note: this error originates in the macro `$crate::thread::local_impl::thread_local_process_attrs` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0658]: use of an internal attribute
+  --> $DIR/no-unstable.rs:1:1
+   |
+LL | / thread_local! {
+...  |
+LL | |     pub static BAZ: () = ();
+LL | | }
+   | |_^
+   |
+   = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
+   = note: the `#[rustc_dummy]` attribute is an internal implementation detail that will never be stable
+   = note: the `#[rustc_dummy]` attribute is used for rustc unit tests
+   = note: this error originates in the macro `$crate::thread::local_impl::thread_local_process_attrs` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0658]: `#[used(linker)]` is currently unstable
+  --> $DIR/no-unstable.rs:1:1
+   |
+LL | / thread_local! {
+...  |
+LL | |     pub static BAZ: () = ();
+LL | | }
+   | |_^
+   |
+   = note: see issue #93798 <https://github.com/rust-lang/rust/issues/93798> for more information
+   = help: add `#![feature(used_with_arg)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+   = note: this error originates in the macro `$crate::thread::local_impl::thread_local_process_attrs` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: `#[used]` attribute cannot be used on constants
+  --> $DIR/no-unstable.rs:1:1
+   |
+LL | / thread_local! {
+...  |
+LL | |     pub static BAZ: () = ();
+LL | | }
+   | |_^
+   |
+   = help: `#[used]` can only be applied to statics
+   = note: this error originates in the macro `$crate::thread::local_impl::thread_local_process_attrs` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/threads-sendsync/task-stderr.rs b/tests/ui/threads-sendsync/task-stderr.rs
index 3934084e02a..f54b5a5cc5f 100644
--- a/tests/ui/threads-sendsync/task-stderr.rs
+++ b/tests/ui/threads-sendsync/task-stderr.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ needs-threads
 //@ needs-unwind
+//@ ignore-backends: gcc
 
 #![feature(internal_output_capture)]
 
diff --git a/tests/ui/threads-sendsync/unwind-resource.rs b/tests/ui/threads-sendsync/unwind-resource.rs
index ec27a1846fe..c5fbfc5bf5b 100644
--- a/tests/ui/threads-sendsync/unwind-resource.rs
+++ b/tests/ui/threads-sendsync/unwind-resource.rs
@@ -3,6 +3,7 @@
 
 #![allow(non_camel_case_types)]
 //@ needs-threads
+//@ ignore-backends: gcc
 
 use std::sync::mpsc::{channel, Sender};
 use std::thread;
diff --git a/tests/ui/track-diagnostics/track.rs b/tests/ui/track-diagnostics/track.rs
index 9ce0a4a555a..2d6d6170fe0 100644
--- a/tests/ui/track-diagnostics/track.rs
+++ b/tests/ui/track-diagnostics/track.rs
@@ -13,13 +13,8 @@
 // top of this file are present, then assume all args are present.
 //@ normalize-stderr: "note: compiler flags: .*-Z ui-testing.*-Z track-diagnostics" -> "note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics"
 
-// FIXME: this tests a crash in rustc. For stage1, rustc is built with the downloaded standard
-// library which doesn't yet print the thread ID. Normalization can be removed at the stage bump.
-// For the grep: cfg(bootstrap)
-//@normalize-stderr: "thread 'rustc' panicked" -> "thread 'rustc' ($$TID) panicked"
-
 fn main() {
-    break rust
+    break rust;
     //~^ ERROR cannot find value `rust` in this scope
     //~| NOTE created at
     //~| ERROR `break` outside of a loop or labeled block
diff --git a/tests/ui/track-diagnostics/track.stderr b/tests/ui/track-diagnostics/track.stderr
index bc04ded379d..76b4bd14f5c 100644
--- a/tests/ui/track-diagnostics/track.stderr
+++ b/tests/ui/track-diagnostics/track.stderr
@@ -1,7 +1,7 @@
 error[E0425]: cannot find value `rust` in this scope
   --> $DIR/track.rs:LL:CC
    |
-LL |     break rust
+LL |     break rust;
    |           ^^^^ not found in this scope
    |
    = note: -Ztrack-diagnostics: created at compiler/rustc_resolve/src/late/diagnostics.rs:LL:CC
@@ -9,7 +9,7 @@ LL |     break rust
 error[E0268]: `break` outside of a loop or labeled block
   --> $DIR/track.rs:LL:CC
    |
-LL |     break rust
+LL |     break rust;
    |     ^^^^^^^^^^ cannot `break` outside of a loop or labeled block
    |
    = note: -Ztrack-diagnostics: created at compiler/rustc_hir_typeck/src/loops.rs:LL:CC
@@ -17,7 +17,7 @@ LL |     break rust
 error: internal compiler error: It looks like you're trying to break rust; would you like some ICE?
   --> $DIR/track.rs:LL:CC
    |
-LL |     break rust
+LL |     break rust;
    |     ^^^^^^^^^^
    |
    = note: -Ztrack-diagnostics: created at compiler/rustc_hir_typeck/src/lib.rs:LL:CC
diff --git a/tests/ui/issues/issue-58857.rs b/tests/ui/trait-bounds/negative-bound-not-supported-58857.rs
index 4350d7e5b40..0a0b70a216b 100644
--- a/tests/ui/issues/issue-58857.rs
+++ b/tests/ui/trait-bounds/negative-bound-not-supported-58857.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/58857
 struct Conj<A> {a : A}
 trait Valid {}
 
diff --git a/tests/ui/issues/issue-58857.stderr b/tests/ui/trait-bounds/negative-bound-not-supported-58857.stderr
index ac70bc725e2..05347a891b4 100644
--- a/tests/ui/issues/issue-58857.stderr
+++ b/tests/ui/trait-bounds/negative-bound-not-supported-58857.stderr
@@ -1,5 +1,5 @@
 error: negative bounds are not supported
-  --> $DIR/issue-58857.rs:4:9
+  --> $DIR/negative-bound-not-supported-58857.rs:5:9
    |
 LL | impl<A: !Valid> Conj<A>{}
    |         ^
diff --git a/tests/ui/issues/issue-19479.rs b/tests/ui/traits/associated_type_bound/assoc-type-via-another-trait-issue-19479.rs
index ed586b76550..f17a89bcb5f 100644
--- a/tests/ui/issues/issue-19479.rs
+++ b/tests/ui/traits/associated_type_bound/assoc-type-via-another-trait-issue-19479.rs
@@ -1,5 +1,11 @@
 //@ check-pass
 
+//! Tests that it's possible to define an associated type in a trait
+//! using an associated type from type parameter bound trait in a blanket implementation.
+//!
+//! # Context
+//! Original issue: https://github.com/rust-lang/rust/issues/19479
+
 trait Base {
     fn dummy(&self) { }
 }
diff --git a/tests/ui/traits/cast-as-dyn-trait-wo-assoc-type-issue-21950.rs b/tests/ui/traits/cast-as-dyn-trait-wo-assoc-type-issue-21950.rs
new file mode 100644
index 00000000000..3c381505450
--- /dev/null
+++ b/tests/ui/traits/cast-as-dyn-trait-wo-assoc-type-issue-21950.rs
@@ -0,0 +1,19 @@
+//! Tests that compiler yields error E0191 when value with existing trait implementation
+//! is cast as same `dyn` trait without specifying associated type at the cast.
+//!
+//! # Context
+//! Original issue: https://github.com/rust-lang/rust/issues/21950
+
+trait Add<Rhs=Self> {
+    type Output;
+}
+
+impl Add for i32 {
+    type Output = i32;
+}
+
+fn main() {
+    let x = &10 as &dyn Add<i32, Output = i32>; //OK
+    let x = &10 as &dyn Add;
+    //~^ ERROR E0191
+}
diff --git a/tests/ui/issues/issue-21950.stderr b/tests/ui/traits/cast-as-dyn-trait-wo-assoc-type-issue-21950.stderr
index 24230cfe17f..5f4974e6f23 100644
--- a/tests/ui/issues/issue-21950.stderr
+++ b/tests/ui/traits/cast-as-dyn-trait-wo-assoc-type-issue-21950.stderr
@@ -1,5 +1,5 @@
 error[E0191]: the value of the associated type `Output` in `Add` must be specified
-  --> $DIR/issue-21950.rs:10:25
+  --> $DIR/cast-as-dyn-trait-wo-assoc-type-issue-21950.rs:17:25
    |
 LL |     type Output;
    |     ----------- `Output` defined here
diff --git a/tests/ui/traits/clone-unwind-rc-cleanup.rs b/tests/ui/traits/clone-unwind-rc-cleanup.rs
index cd02050ea27..dab48a1b4c6 100644
--- a/tests/ui/traits/clone-unwind-rc-cleanup.rs
+++ b/tests/ui/traits/clone-unwind-rc-cleanup.rs
@@ -2,6 +2,7 @@
 
 //@ run-pass
 //@ needs-unwind
+//@ ignore-backends: gcc
 
 #![allow(unused_variables)]
 #![allow(unused_imports)]
diff --git a/tests/ui/traits/core-marker-name-shadowing-issue-2284.rs b/tests/ui/traits/core-marker-name-shadowing-issue-2284.rs
new file mode 100644
index 00000000000..e5d083ac8c3
--- /dev/null
+++ b/tests/ui/traits/core-marker-name-shadowing-issue-2284.rs
@@ -0,0 +1,21 @@
+//@ run-pass
+#![allow(dead_code)]
+
+//! Tests that user-defined trait is prioritized in compile time over
+//! the core::marker trait with the same name, allowing shadowing core traits.
+//!
+//! # Context
+//! Original issue: https://github.com/rust-lang/rust/issues/2284
+//! Original fix pull request: https://github.com/rust-lang/rust/pull/3792
+
+
+trait Send {
+    fn f(&self);
+}
+
+fn f<T:Send>(t: T) {
+    t.f();
+}
+
+pub fn main() {
+}
diff --git a/tests/ui/issues/issue-58212.rs b/tests/ui/traits/generic-trait-impl-aliased-array-58212.rs
index f266db603bf..a71194ba806 100644
--- a/tests/ui/issues/issue-58212.rs
+++ b/tests/ui/traits/generic-trait-impl-aliased-array-58212.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/58212
 //@ check-pass
 
 trait FromUnchecked {
diff --git a/tests/ui/traits/inheritance/supertrait-operator-issue-18088.rs b/tests/ui/traits/inheritance/supertrait-operator-issue-18088.rs
new file mode 100644
index 00000000000..8bd45cd54a4
--- /dev/null
+++ b/tests/ui/traits/inheritance/supertrait-operator-issue-18088.rs
@@ -0,0 +1,13 @@
+//@ check-pass
+
+//! Tests that operators from supertrait are available directly on `self` for an inheritor trait.
+//!
+//! # Context
+//! Original issue: https://github.com/rust-lang/rust/issues/18088
+
+pub trait Indexable<T>: std::ops::Index<usize, Output = T> {
+    fn index2(&self, i: usize) -> &T {
+        &self[i]
+    }
+}
+fn main() {}
diff --git a/tests/ui/traits/next-solver/cycles/ignore-head-usages-provisional-cache.rs b/tests/ui/traits/next-solver/cycles/ignore-head-usages-provisional-cache.rs
new file mode 100644
index 00000000000..9a33ae53644
--- /dev/null
+++ b/tests/ui/traits/next-solver/cycles/ignore-head-usages-provisional-cache.rs
@@ -0,0 +1,55 @@
+//@ compile-flags: -Znext-solver
+//@ check-pass
+
+// A regression test for trait-system-refactor-initiative#232. We've
+// previously incorrectly rebased provisional cache entries even if
+// the cycle head didn't reach a fixpoint as it did not depend on any
+// cycles itself.
+//
+// Just because the result of a goal does not depend on its own provisional
+// result, it does not mean its nested goals don't depend on its result.
+struct B;
+struct C;
+struct D;
+
+pub trait Trait {
+    type Output;
+}
+macro_rules! k {
+    ($t:ty) => {
+        <$t as Trait>::Output
+    };
+}
+
+trait CallB<T1, T2> {
+    type Output;
+    type Return;
+}
+
+trait CallC<T1> {
+    type Output;
+    type Return;
+}
+
+trait CallD<T1, T2> {
+    type Output;
+}
+
+fn foo<X, Y>()
+where
+    X: Trait,
+    Y: Trait,
+    D: CallD<k![X], k![Y]>,
+    C: CallC<<D as CallD<k![X], k![Y]>>::Output>,
+    <C as CallC<<D as CallD<k![X], k![Y]>>::Output>>::Output: Trait,
+    B: CallB<
+            <C as CallC<<D as CallD<k![X], k![Y]>>::Output>>::Return,
+            <C as CallC<<D as CallD<k![X], k![Y]>>::Output>>::Output,
+        >,
+    <B as CallB<
+        <C as CallC<<D as CallD<k![X], k![Y]>>::Output>>::Return,
+        <C as CallC<<D as CallD<k![X], k![Y]>>::Output>>::Output,
+    >>::Output: Trait<Output = ()>,
+{
+}
+fn main() {}
diff --git a/tests/ui/traits/next-solver/forced-ambiguity-typenum-ice.rs b/tests/ui/traits/next-solver/forced-ambiguity-typenum-ice.rs
new file mode 100644
index 00000000000..679d6b1fb16
--- /dev/null
+++ b/tests/ui/traits/next-solver/forced-ambiguity-typenum-ice.rs
@@ -0,0 +1,60 @@
+//@ compile-flags: -Znext-solver
+//@ check-pass
+
+// Regression test for trait-system-refactor-initiative#105. We previously encountered
+// an ICE in typenum as `forced_ambiguity` failed. While this test no longer causes
+// `forced_ambiguity` to error, we still want to use it as a regression test.
+
+pub struct UInt<U, B> {
+    _msb: U,
+    _lsb: B,
+}
+pub struct B1;
+pub trait Sub<Rhs> {
+    type Output;
+}
+impl<U, B> Sub<B1> for UInt<UInt<U, B>, B1> {
+    type Output = ();
+}
+impl<U> Sub<B1> for UInt<U, ()>
+where
+    U: Sub<B1>,
+    U::Output: Send,
+{
+    type Output = ();
+}
+
+pub trait Op<N, R, I> {
+    fn op(&self) {
+        unimplemented!()
+    }
+}
+trait OpIf<N, R, I> {}
+
+impl<N, Ur, Br, I> Op<N, UInt<Ur, Br>, I> for ()
+where
+    N: Sub<I>,
+    (): OpIf<N, UInt<UInt<Ur, Br>, N::Output>, I>,
+{
+}
+impl<N, R, Ui, Bi> OpIf<N, R, UInt<Ui, Bi>> for ()
+where
+    UInt<Ui, Bi>: Sub<B1>,
+    (): Op<N, R, <UInt<Ui, Bi> as Sub<B1>>::Output>,
+{
+}
+impl<N, R> OpIf<N, R, ()> for () where R: Sub<N> {}
+
+pub trait Compute {
+    type Output;
+}
+
+pub fn repro<Ul, Bl>()
+where
+    UInt<Ul, Bl>: Compute,
+    <UInt<Ul, Bl> as Compute>::Output: Sub<B1>,
+    (): Op<UInt<(), Bl>, (), ()>,
+{
+    ().op();
+}
+fn main() {}
diff --git a/tests/ui/traits/next-solver/opaques/overflow-hr-fn-trait-sized-1.rs b/tests/ui/traits/next-solver/opaques/overflow-hr-fn-trait-sized-1.rs
new file mode 100644
index 00000000000..e35e48dfcec
--- /dev/null
+++ b/tests/ui/traits/next-solver/opaques/overflow-hr-fn-trait-sized-1.rs
@@ -0,0 +1,25 @@
+//@ ignore-compare-mode-next-solver
+//@ compile-flags: -Znext-solver
+//@ check-pass
+
+// Regression test for trait-system-refactor-initiative#220. Builtin `Fn`-trait
+// candidates required `for<'latebound> Output<'latebound>: Sized` which ended
+// up resulting in overflow if the return type is an opaque in the defining scope.
+//
+// We now eagerly instantiate the binder of the function definition which avoids
+// that overflow by relating the lifetime of the opaque to something from the
+// input.
+fn flat_map<T, F, I, G>(_: F, _: G)
+where
+    F: FnOnce(T) -> I,
+    I: Iterator,
+    G: Fn(<I as Iterator>::Item) -> usize,
+{
+}
+
+fn rarw<'a>(_: &'a ()) -> impl Iterator<Item = &'a str> {
+    flat_map(rarw, |x| x.len());
+    std::iter::empty()
+}
+
+fn main() {}
diff --git a/tests/ui/traits/next-solver/opaques/overflow-hr-fn-trait-sized-2.rs b/tests/ui/traits/next-solver/opaques/overflow-hr-fn-trait-sized-2.rs
new file mode 100644
index 00000000000..1d64e422d89
--- /dev/null
+++ b/tests/ui/traits/next-solver/opaques/overflow-hr-fn-trait-sized-2.rs
@@ -0,0 +1,14 @@
+//@ ignore-compare-mode-next-solver
+//@ compile-flags: -Znext-solver
+//@ check-pass
+
+// Regression test for trait-system-refactor-initiative#204, see
+// the sibling test for more details.
+
+fn constrain<'a, F: FnOnce(&'a ())>(_: F) {}
+fn foo<'a>(_: &'a ()) -> impl Sized + use<'a> {
+    constrain(foo);
+    ()
+}
+
+fn main() {}
diff --git a/tests/ui/traits/next-solver/typeck/normalize-in-upvar-collection.rs b/tests/ui/traits/next-solver/typeck/normalize-in-upvar-collection.rs
index 6567f275240..2f108daf1e5 100644
--- a/tests/ui/traits/next-solver/typeck/normalize-in-upvar-collection.rs
+++ b/tests/ui/traits/next-solver/typeck/normalize-in-upvar-collection.rs
@@ -1,7 +1,7 @@
 //@ compile-flags: -Znext-solver
 //@ check-pass
 
-// Fixes a regression in icu_provider_adaptors where we weren't normalizing the
+// Fixes a regression in icu_provider_adapters where we weren't normalizing the
 // return type of a function type before performing a `Ty::builtin_deref` call,
 // leading to an ICE.
 
diff --git a/tests/ui/traits/next-solver/well-formed-in-relate.stderr b/tests/ui/traits/next-solver/well-formed-in-relate.stderr
index 5294a072d31..d79e465b3e3 100644
--- a/tests/ui/traits/next-solver/well-formed-in-relate.stderr
+++ b/tests/ui/traits/next-solver/well-formed-in-relate.stderr
@@ -12,6 +12,8 @@ LL |     x = unconstrained_map();
              where A: Tuple, F: Fn<A>, F: ?Sized;
            - impl<Args, F, A> Fn<Args> for Box<F, A>
              where Args: Tuple, F: Fn<Args>, A: Allocator, F: ?Sized;
+           - impl<F, Args> Fn<Args> for Exclusive<F>
+             where F: Sync, F: Fn<Args>, Args: Tuple;
 note: required by a bound in `unconstrained_map`
   --> $DIR/well-formed-in-relate.rs:21:25
    |
diff --git a/tests/ui/traits/next-solver/writeback-predicate-bound-region.rs b/tests/ui/traits/next-solver/writeback-predicate-bound-region.rs
new file mode 100644
index 00000000000..a7ed5dbcf08
--- /dev/null
+++ b/tests/ui/traits/next-solver/writeback-predicate-bound-region.rs
@@ -0,0 +1,14 @@
+//@ edition: 2024
+//@ check-pass
+//@ compile-flags: -Znext-solver
+
+// This previously ICE'd during writeback when resolving
+// the stalled coroutine predicate due to its bound lifetime.
+
+trait Trait<'a> {}
+impl<'a, T: Send> Trait<'a> for T {}
+
+fn is_trait<T: for<'a> Trait<'a>>(_: T) {}
+fn main() {
+    is_trait(async {})
+}
diff --git a/tests/ui/traits/solver-cycles/129541-recursive-struct.rs b/tests/ui/traits/solver-cycles/129541-recursive-struct.rs
index 723179302e3..c5c2c27b282 100644
--- a/tests/ui/traits/solver-cycles/129541-recursive-struct.rs
+++ b/tests/ui/traits/solver-cycles/129541-recursive-struct.rs
@@ -1,3 +1,4 @@
+//~ ERROR reached the recursion limit finding the struct tail for `<[Hello] as Normalize>::Assoc`
 // Regression test for #129541
 
 //@ revisions: unique_curr unique_next multiple_curr multiple_next
@@ -24,5 +25,3 @@ struct Hello {
 }
 
 fn main() {}
-
-//~? ERROR reached the recursion limit finding the struct tail for `<[Hello] as Normalize>::Assoc`
diff --git a/tests/ui/issues/issue-57156.rs b/tests/ui/traits/trait-object-lifetime-bounds-57156.rs
index 12251509abd..8f5bef7fe13 100644
--- a/tests/ui/issues/issue-57156.rs
+++ b/tests/ui/traits/trait-object-lifetime-bounds-57156.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/57156
 //@ check-pass
 
 trait Foo<Args> {
diff --git a/tests/ui/issues/issue-56229.rs b/tests/ui/traits/trait-objects-with-supertraits-56229.rs
index 1c6dd72ed2d..27cae968a6a 100644
--- a/tests/ui/issues/issue-56229.rs
+++ b/tests/ui/traits/trait-objects-with-supertraits-56229.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/56229
 //@ check-pass
 
 trait Mirror {
diff --git a/tests/ui/traits/trait-upcasting/illegal-upcast-to-impl-opaque.rs b/tests/ui/traits/trait-upcasting/illegal-upcast-to-impl-opaque.rs
index 2760c1696b5..f603ff1ec80 100644
--- a/tests/ui/traits/trait-upcasting/illegal-upcast-to-impl-opaque.rs
+++ b/tests/ui/traits/trait-upcasting/illegal-upcast-to-impl-opaque.rs
@@ -1,12 +1,5 @@
 //@ revisions: current next
 //@[next] compile-flags: -Znext-solver
-//@[next] failure-status: 101
-//@[next] known-bug: unknown
-//@[next] normalize-stderr: "note: .*\n\n" -> ""
-//@[next] normalize-stderr: "thread 'rustc' panicked.*\n.*\n" -> ""
-//@[next] normalize-stderr: "(error: internal compiler error: [^:]+):\d+:\d+: " -> "$1:LL:CC: "
-//@[next] normalize-stderr: "delayed at .*" -> ""
-//@[next] rustc-env:RUST_BACKTRACE=0
 //@ check-pass
 
 trait Super {
diff --git a/tests/ui/type-alias-impl-trait/closures_in_branches.stderr b/tests/ui/type-alias-impl-trait/closures_in_branches.stderr
index 849ffd214f0..559bc57d906 100644
--- a/tests/ui/type-alias-impl-trait/closures_in_branches.stderr
+++ b/tests/ui/type-alias-impl-trait/closures_in_branches.stderr
@@ -2,7 +2,7 @@ error[E0282]: type annotations needed
   --> $DIR/closures_in_branches.rs:8:10
    |
 LL |         |x| x.len()
-   |          ^  - type must be known at this point
+   |          ^    --- type must be known at this point
    |
 help: consider giving this closure parameter an explicit type
    |
@@ -13,7 +13,7 @@ error[E0282]: type annotations needed
   --> $DIR/closures_in_branches.rs:22:10
    |
 LL |         |x| x.len()
-   |          ^  - type must be known at this point
+   |          ^    --- type must be known at this point
    |
 help: consider giving this closure parameter an explicit type
    |
diff --git a/tests/ui/type-alias-impl-trait/issue-77179.stderr b/tests/ui/type-alias-impl-trait/issue-77179.stderr
index c0f197ec48c..222edfb90a7 100644
--- a/tests/ui/type-alias-impl-trait/issue-77179.stderr
+++ b/tests/ui/type-alias-impl-trait/issue-77179.stderr
@@ -11,10 +11,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/issue-77179.rs:8:22
    |
 LL | fn test() -> Pointer<_> {
-   |              --------^-
-   |              |       |
-   |              |       not allowed in type signatures
-   |              help: replace with the correct return type: `Pointer<i32>`
+   |                      ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - fn test() -> Pointer<_> {
+LL + fn test() -> Pointer<i32> {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions
   --> $DIR/issue-77179.rs:19:25
diff --git a/tests/ui/type-alias-impl-trait/method_resolution_trait_method_from_opaque.next.stderr b/tests/ui/type-alias-impl-trait/method_resolution_trait_method_from_opaque.next.stderr
index bbdd3923821..37bde4b18a4 100644
--- a/tests/ui/type-alias-impl-trait/method_resolution_trait_method_from_opaque.next.stderr
+++ b/tests/ui/type-alias-impl-trait/method_resolution_trait_method_from_opaque.next.stderr
@@ -1,8 +1,14 @@
 error[E0282]: type annotations needed
-  --> $DIR/method_resolution_trait_method_from_opaque.rs:28:9
+  --> $DIR/method_resolution_trait_method_from_opaque.rs:28:18
    |
 LL |         self.bar.next().unwrap();
-   |         ^^^^^^^^ cannot infer type
+   |                  ^^^^
+   |
+help: try using a fully qualified path to specify the expected types
+   |
+LL -         self.bar.next().unwrap();
+LL +         <_ as Iterator>::next(&mut self.bar).unwrap();
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/type-alias-impl-trait/recursive-drop-elaboration-2.rs b/tests/ui/type-alias-impl-trait/recursive-drop-elaboration-2.rs
new file mode 100644
index 00000000000..5541c5267f3
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/recursive-drop-elaboration-2.rs
@@ -0,0 +1,19 @@
+//! Regression test for ICE #139556
+
+#![feature(type_alias_impl_trait)]
+
+trait T {}
+
+type Alias<'a> = impl T;
+
+struct S;
+impl<'a> T for &'a S {}
+
+#[define_opaque(Alias)]
+fn with_positive(fun: impl Fn(Alias<'_>)) {
+//~^ WARN: function cannot return without recursing
+    with_positive(|&n| ());
+    //~^ ERROR: cannot move out of a shared reference
+}
+
+fn main() {}
diff --git a/tests/ui/type-alias-impl-trait/recursive-drop-elaboration-2.stderr b/tests/ui/type-alias-impl-trait/recursive-drop-elaboration-2.stderr
new file mode 100644
index 00000000000..e1fdd222ee1
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/recursive-drop-elaboration-2.stderr
@@ -0,0 +1,30 @@
+warning: function cannot return without recursing
+  --> $DIR/recursive-drop-elaboration-2.rs:13:1
+   |
+LL | fn with_positive(fun: impl Fn(Alias<'_>)) {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
+LL |
+LL |     with_positive(|&n| ());
+   |     ---------------------- recursive call site
+   |
+   = help: a `loop` may express intention better if this is on purpose
+   = note: `#[warn(unconditional_recursion)]` on by default
+
+error[E0507]: cannot move out of a shared reference
+  --> $DIR/recursive-drop-elaboration-2.rs:15:20
+   |
+LL |     with_positive(|&n| ());
+   |                    ^-
+   |                     |
+   |                     data moved here
+   |                     move occurs because `n` has type `S`, which does not implement the `Copy` trait
+   |
+help: consider removing the borrow
+   |
+LL -     with_positive(|&n| ());
+LL +     with_positive(|n| ());
+   |
+
+error: aborting due to 1 previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0507`.
diff --git a/tests/ui/type-alias-impl-trait/recursive-drop-elaboration.rs b/tests/ui/type-alias-impl-trait/recursive-drop-elaboration.rs
new file mode 100644
index 00000000000..dd28732ebb2
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/recursive-drop-elaboration.rs
@@ -0,0 +1,24 @@
+//! Regression test for #122904.
+
+#![feature(type_alias_impl_trait)]
+
+trait T {}
+
+type Alias<'a> = impl T;
+
+struct S;
+impl<'a> T for &'a S {}
+
+#[define_opaque(Alias)]
+fn with_positive(fun: impl Fn(Alias<'_>)) {
+//~^ WARN: function cannot return without recursing
+    with_positive(|&n| ());
+    //~^ ERROR: cannot move out of a shared reference
+}
+
+#[define_opaque(Alias)]
+fn main(_: Alias<'_>) {
+//~^ ERROR: `main` function has wrong type [E0580]
+    with_positive(|&a| ());
+    //~^ ERROR: cannot move out of a shared reference
+}
diff --git a/tests/ui/type-alias-impl-trait/recursive-drop-elaboration.stderr b/tests/ui/type-alias-impl-trait/recursive-drop-elaboration.stderr
new file mode 100644
index 00000000000..8b5dc950afd
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/recursive-drop-elaboration.stderr
@@ -0,0 +1,58 @@
+warning: function cannot return without recursing
+  --> $DIR/recursive-drop-elaboration.rs:13:1
+   |
+LL | fn with_positive(fun: impl Fn(Alias<'_>)) {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
+LL |
+LL |     with_positive(|&n| ());
+   |     ---------------------- recursive call site
+   |
+   = help: a `loop` may express intention better if this is on purpose
+   = note: `#[warn(unconditional_recursion)]` on by default
+
+error[E0507]: cannot move out of a shared reference
+  --> $DIR/recursive-drop-elaboration.rs:15:20
+   |
+LL |     with_positive(|&n| ());
+   |                    ^-
+   |                     |
+   |                     data moved here
+   |                     move occurs because `n` has type `S`, which does not implement the `Copy` trait
+   |
+help: consider removing the borrow
+   |
+LL -     with_positive(|&n| ());
+LL +     with_positive(|n| ());
+   |
+
+error[E0507]: cannot move out of a shared reference
+  --> $DIR/recursive-drop-elaboration.rs:22:20
+   |
+LL |     with_positive(|&a| ());
+   |                    ^-
+   |                     |
+   |                     data moved here
+   |                     move occurs because `a` has type `S`, which does not implement the `Copy` trait
+   |
+help: consider removing the borrow
+   |
+LL -     with_positive(|&a| ());
+LL +     with_positive(|a| ());
+   |
+
+error[E0580]: `main` function has wrong type
+  --> $DIR/recursive-drop-elaboration.rs:20:1
+   |
+LL | type Alias<'a> = impl T;
+   |                  ------ the found opaque type
+...
+LL | fn main(_: Alias<'_>) {
+   | ^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters
+   |
+   = note: expected signature `fn()`
+              found signature `for<'a> fn(Alias<'a>)`
+
+error: aborting due to 3 previous errors; 1 warning emitted
+
+Some errors have detailed explanations: E0507, E0580.
+For more information about an error, try `rustc --explain E0507`.
diff --git a/tests/crashes/125185.rs b/tests/ui/type-alias-impl-trait/type-error-drop-elaboration.rs
index e77666ca73d..c0fb9007865 100644
--- a/tests/crashes/125185.rs
+++ b/tests/ui/type-alias-impl-trait/type-error-drop-elaboration.rs
@@ -1,4 +1,4 @@
-//@ known-bug: rust-lang/rust#125185
+//! Regression test for #125185
 //@ compile-flags: -Zvalidate-mir
 
 #![feature(type_alias_impl_trait)]
@@ -10,6 +10,7 @@ struct A;
 #[define_opaque(Foo)]
 const fn foo() -> Foo {
     value()
+    //~^ ERROR: cannot find function `value` in this scope
 }
 
 const VALUE: Foo = foo();
diff --git a/tests/ui/type-alias-impl-trait/type-error-drop-elaboration.stderr b/tests/ui/type-alias-impl-trait/type-error-drop-elaboration.stderr
new file mode 100644
index 00000000000..1cb33eabd90
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/type-error-drop-elaboration.stderr
@@ -0,0 +1,12 @@
+error[E0425]: cannot find function `value` in this scope
+  --> $DIR/type-error-drop-elaboration.rs:12:5
+   |
+LL |     value()
+   |     ^^^^^ help: a constant with a similar name exists: `VALUE`
+...
+LL | const VALUE: Foo = foo();
+   | ------------------------- similarly named constant `VALUE` defined here
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/tests/ui/type-inference/box_has_sigdrop.rs b/tests/ui/type-inference/box_has_sigdrop.rs
new file mode 100644
index 00000000000..3e801197a78
--- /dev/null
+++ b/tests/ui/type-inference/box_has_sigdrop.rs
@@ -0,0 +1,9 @@
+//@ should-fail
+//@ compile-flags: -Wrust-2021-incompatible-closure-captures
+// Inference, canonicalization, and significant drops should work nicely together.
+// Related issue: #86868
+
+fn main() {
+    let mut state = 0;
+    Box::new(move || state)
+}
diff --git a/tests/ui/type-inference/box_has_sigdrop.stderr b/tests/ui/type-inference/box_has_sigdrop.stderr
new file mode 100644
index 00000000000..b61b6322c10
--- /dev/null
+++ b/tests/ui/type-inference/box_has_sigdrop.stderr
@@ -0,0 +1,17 @@
+error[E0308]: mismatched types
+  --> $DIR/box_has_sigdrop.rs:8:5
+   |
+LL | fn main() {
+   |          - expected `()` because of default return type
+LL |     let mut state = 0;
+LL |     Box::new(move || state)
+   |     ^^^^^^^^^^^^^^^^^^^^^^^- help: consider using a semicolon here: `;`
+   |     |
+   |     expected `()`, found `Box<{closure@box_has_sigdrop.rs:8:14}>`
+   |
+   = note: expected unit type `()`
+                 found struct `Box<{closure@$DIR/box_has_sigdrop.rs:8:14: 8:21}>`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/type-inference/dropper_has_sigdrop.rs b/tests/ui/type-inference/dropper_has_sigdrop.rs
new file mode 100644
index 00000000000..c3d835cfe16
--- /dev/null
+++ b/tests/ui/type-inference/dropper_has_sigdrop.rs
@@ -0,0 +1,18 @@
+//@ run-pass
+// Inference, canonicalization, and significant drops should work nicely together.
+// Related issue: #86868
+
+#[clippy::has_significant_drop]
+struct DropGuy {}
+
+fn creator() -> DropGuy {
+    DropGuy {}
+}
+
+fn dropper() {
+    let _ = creator();
+}
+
+fn main() {
+    dropper();
+}
diff --git a/tests/ui/type-inference/regression-issue-81317.stderr b/tests/ui/type-inference/regression-issue-81317.stderr
index fcd3fca06e1..a070b50e311 100644
--- a/tests/ui/type-inference/regression-issue-81317.stderr
+++ b/tests/ui/type-inference/regression-issue-81317.stderr
@@ -5,7 +5,7 @@ LL |     let iv = S ^ index.into();
    |         ^^
 LL |
 LL |     &iv.to_bytes_be();
-   |      -- type must be known at this point
+   |         ----------- type must be known at this point
    |
 help: consider giving `iv` an explicit type
    |
diff --git a/tests/ui/type/pattern_types/const_generics.rs b/tests/ui/type/pattern_types/const_generics.rs
index 79d46c010d7..f5eb90e94d4 100644
--- a/tests/ui/type/pattern_types/const_generics.rs
+++ b/tests/ui/type/pattern_types/const_generics.rs
@@ -1,4 +1,7 @@
 //@ check-pass
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
 
 #![feature(pattern_types, generic_pattern_types, pattern_type_macro)]
 #![expect(incomplete_features)]
diff --git a/tests/ui/type/pattern_types/transmute.stderr b/tests/ui/type/pattern_types/transmute.current.stderr
index 578549b515c..edec542e5e1 100644
--- a/tests/ui/type/pattern_types/transmute.stderr
+++ b/tests/ui/type/pattern_types/transmute.current.stderr
@@ -1,5 +1,5 @@
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute.rs:20:14
+  --> $DIR/transmute.rs:23:14
    |
 LL |     unsafe { std::mem::transmute(x) }
    |              ^^^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL |     unsafe { std::mem::transmute(x) }
    = note: target type: `u32` (32 bits)
 
 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
-  --> $DIR/transmute.rs:28:14
+  --> $DIR/transmute.rs:31:14
    |
 LL |     unsafe { std::mem::transmute(x) }
    |              ^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/type/pattern_types/transmute.next.stderr b/tests/ui/type/pattern_types/transmute.next.stderr
new file mode 100644
index 00000000000..edec542e5e1
--- /dev/null
+++ b/tests/ui/type/pattern_types/transmute.next.stderr
@@ -0,0 +1,21 @@
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+  --> $DIR/transmute.rs:23:14
+   |
+LL |     unsafe { std::mem::transmute(x) }
+   |              ^^^^^^^^^^^^^^^^^^^
+   |
+   = note: source type: `Option<(u32) is S..=E>` (size can vary because of u32)
+   = note: target type: `u32` (32 bits)
+
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+  --> $DIR/transmute.rs:31:14
+   |
+LL |     unsafe { std::mem::transmute(x) }
+   |              ^^^^^^^^^^^^^^^^^^^
+   |
+   = note: source type: `Option<(u32) is S..=E>` (size can vary because of u32)
+   = note: target type: `Option<u32>` (64 bits)
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0512`.
diff --git a/tests/ui/type/pattern_types/transmute.rs b/tests/ui/type/pattern_types/transmute.rs
index 43dd62a19e7..4e686245f93 100644
--- a/tests/ui/type/pattern_types/transmute.rs
+++ b/tests/ui/type/pattern_types/transmute.rs
@@ -1,3 +1,6 @@
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
 #![feature(pattern_types, pattern_type_macro, generic_pattern_types)]
 #![expect(incomplete_features)]
 
diff --git a/tests/ui/typeck/coercion-check-for-indexing-expression-issue-40861.stderr b/tests/ui/typeck/coercion-check-for-indexing-expression-issue-40861.stderr
index 13bc0cd94f3..ef5f1786801 100644
--- a/tests/ui/typeck/coercion-check-for-indexing-expression-issue-40861.stderr
+++ b/tests/ui/typeck/coercion-check-for-indexing-expression-issue-40861.stderr
@@ -4,7 +4,7 @@ error[E0608]: cannot index into a value of type `()`
 LL |     ()[f(&[1.0])];
    |       ^^^^^^^^^^^
    |
-   = help: to access tuple elements, use tuple indexing syntax (e.g., `tuple.0`)
+   = help: tuples are indexed with a dot and a literal index: `tuple.0`, `tuple.1`, etc.
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/typeck/invalid-sugg-for-derive-macro-issue-136343.rs b/tests/ui/typeck/invalid-sugg-for-derive-macro-issue-136343.rs
index c08030fc5c1..81c2d778b05 100644
--- a/tests/ui/typeck/invalid-sugg-for-derive-macro-issue-136343.rs
+++ b/tests/ui/typeck/invalid-sugg-for-derive-macro-issue-136343.rs
@@ -1,4 +1,5 @@
 //@ proc-macro: derive-demo-issue-136343.rs
+//@ ignore-backends: gcc
 
 #[macro_use]
 extern crate derive_demo_issue_136343;
diff --git a/tests/ui/typeck/invalid-sugg-for-derive-macro-issue-136343.stderr b/tests/ui/typeck/invalid-sugg-for-derive-macro-issue-136343.stderr
index 0b9c1d9123a..d69eaae5335 100644
--- a/tests/ui/typeck/invalid-sugg-for-derive-macro-issue-136343.stderr
+++ b/tests/ui/typeck/invalid-sugg-for-derive-macro-issue-136343.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/invalid-sugg-for-derive-macro-issue-136343.rs:6:10
+  --> $DIR/invalid-sugg-for-derive-macro-issue-136343.rs:7:10
    |
 LL | #[derive(Sample)]
    |          ^^^^^^
diff --git a/tests/ui/typeck/issue-13853.rs b/tests/ui/typeck/issue-13853.rs
index ac9886d2e72..ed44d506261 100644
--- a/tests/ui/typeck/issue-13853.rs
+++ b/tests/ui/typeck/issue-13853.rs
@@ -25,7 +25,7 @@ impl Node for Stuff {
 
 fn iterate<N: Node, G: Graph<N>>(graph: &G) {
     for node in graph.iter() { //~ ERROR no method named `iter` found
-        node.zomg();
+        node.zomg(); //~ ERROR type annotations needed
     }
 }
 
diff --git a/tests/ui/typeck/issue-13853.stderr b/tests/ui/typeck/issue-13853.stderr
index 45363c87d29..9b8698d6ed2 100644
--- a/tests/ui/typeck/issue-13853.stderr
+++ b/tests/ui/typeck/issue-13853.stderr
@@ -17,6 +17,12 @@ error[E0599]: no method named `iter` found for reference `&G` in the current sco
 LL |     for node in graph.iter() {
    |                       ^^^^ method not found in `&G`
 
+error[E0282]: type annotations needed
+  --> $DIR/issue-13853.rs:28:14
+   |
+LL |         node.zomg();
+   |              ^^^^ cannot infer type
+
 error[E0308]: mismatched types
   --> $DIR/issue-13853.rs:37:13
    |
@@ -37,7 +43,7 @@ help: consider borrowing here
 LL |     iterate(&graph);
    |             +
 
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
 
-Some errors have detailed explanations: E0308, E0599.
-For more information about an error, try `rustc --explain E0308`.
+Some errors have detailed explanations: E0282, E0308, E0599.
+For more information about an error, try `rustc --explain E0282`.
diff --git a/tests/ui/typeck/issue-80779.stderr b/tests/ui/typeck/issue-80779.stderr
index 2261ba61654..90c80fa2ea6 100644
--- a/tests/ui/typeck/issue-80779.stderr
+++ b/tests/ui/typeck/issue-80779.stderr
@@ -2,19 +2,25 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/issue-80779.rs:10:28
    |
 LL | pub fn g(_: T<'static>) -> _ {}
-   |                            ^
-   |                            |
-   |                            not allowed in type signatures
-   |                            help: replace with the correct return type: `()`
+   |                            ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - pub fn g(_: T<'static>) -> _ {}
+LL + pub fn g(_: T<'static>) -> () {}
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/issue-80779.rs:5:29
    |
 LL | pub fn f<'a>(val: T<'a>) -> _ {
-   |                             ^
-   |                             |
-   |                             not allowed in type signatures
-   |                             help: replace with the correct return type: `()`
+   |                             ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - pub fn f<'a>(val: T<'a>) -> _ {
+LL + pub fn f<'a>(val: T<'a>) -> () {
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/typeck/issue-98260.stderr b/tests/ui/typeck/issue-98260.stderr
index b7debd335b0..f380db55cdf 100644
--- a/tests/ui/typeck/issue-98260.stderr
+++ b/tests/ui/typeck/issue-98260.stderr
@@ -2,10 +2,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/issue-98260.rs:3:27
    |
 LL |     fn a(aa: B) -> Result<_, B> {
-   |                    -------^----
-   |                    |      |
-   |                    |      not allowed in type signatures
-   |                    help: replace with the correct return type: `Result<(), B>`
+   |                           ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL -     fn a(aa: B) -> Result<_, B> {
+LL +     fn a(aa: B) -> Result<(), B> {
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/issues/issue-57924.rs b/tests/ui/typeck/self-constructor-type-args-not-allowed-57924.rs
index 8846912a8ff..2b3b11c3f38 100644
--- a/tests/ui/issues/issue-57924.rs
+++ b/tests/ui/typeck/self-constructor-type-args-not-allowed-57924.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/57924
 pub struct Gcm<E>(E);
 
 impl<E> Gcm<E> {
diff --git a/tests/ui/issues/issue-57924.stderr b/tests/ui/typeck/self-constructor-type-args-not-allowed-57924.stderr
index 40435fd0f0a..b5be5b39eb8 100644
--- a/tests/ui/issues/issue-57924.stderr
+++ b/tests/ui/typeck/self-constructor-type-args-not-allowed-57924.stderr
@@ -1,5 +1,5 @@
 error[E0109]: type arguments are not allowed on self constructor
-  --> $DIR/issue-57924.rs:5:16
+  --> $DIR/self-constructor-type-args-not-allowed-57924.rs:6:16
    |
 LL |         Self::<E>(e)
    |         ----   ^ type argument not allowed
diff --git a/tests/ui/issues/issue-56199.rs b/tests/ui/typeck/self-constructor-type-error-56199.rs
index ba11582a9d5..b08d6918980 100644
--- a/tests/ui/issues/issue-56199.rs
+++ b/tests/ui/typeck/self-constructor-type-error-56199.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/56199
 enum Foo {}
 struct Bar {}
 
diff --git a/tests/ui/issues/issue-56199.stderr b/tests/ui/typeck/self-constructor-type-error-56199.stderr
index eb6d7005979..6e9d0fcd90c 100644
--- a/tests/ui/issues/issue-56199.stderr
+++ b/tests/ui/typeck/self-constructor-type-error-56199.stderr
@@ -1,5 +1,5 @@
 error: the `Self` constructor can only be used with tuple or unit structs
-  --> $DIR/issue-56199.rs:6:17
+  --> $DIR/self-constructor-type-error-56199.rs:7:17
    |
 LL |         let _ = Self;
    |                 ^^^^
@@ -7,7 +7,7 @@ LL |         let _ = Self;
    = help: did you mean to use one of the enum's variants?
 
 error: the `Self` constructor can only be used with tuple or unit structs
-  --> $DIR/issue-56199.rs:8:17
+  --> $DIR/self-constructor-type-error-56199.rs:9:17
    |
 LL |         let _ = Self();
    |                 ^^^^^^
@@ -15,13 +15,13 @@ LL |         let _ = Self();
    = help: did you mean to use one of the enum's variants?
 
 error: the `Self` constructor can only be used with tuple or unit structs
-  --> $DIR/issue-56199.rs:15:17
+  --> $DIR/self-constructor-type-error-56199.rs:16:17
    |
 LL |         let _ = Self;
    |                 ^^^^ help: use curly brackets: `Self { /* fields */ }`
 
 error: the `Self` constructor can only be used with tuple or unit structs
-  --> $DIR/issue-56199.rs:17:17
+  --> $DIR/self-constructor-type-error-56199.rs:18:17
    |
 LL |         let _ = Self();
    |                 ^^^^^^ help: use curly brackets: `Self { /* fields */ }`
diff --git a/tests/ui/typeck/typeck_type_placeholder_item.stderr b/tests/ui/typeck/typeck_type_placeholder_item.stderr
index 87750ee6dc1..240dc1ae8ab 100644
--- a/tests/ui/typeck/typeck_type_placeholder_item.stderr
+++ b/tests/ui/typeck/typeck_type_placeholder_item.stderr
@@ -48,20 +48,27 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/typeck_type_placeholder_item.rs:7:14
    |
 LL | fn test() -> _ { 5 }
-   |              ^
-   |              |
-   |              not allowed in type signatures
-   |              help: replace with the correct return type: `i32`
+   |              ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - fn test() -> _ { 5 }
+LL + fn test() -> i32 { 5 }
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/typeck_type_placeholder_item.rs:10:16
    |
 LL | fn test2() -> (_, _) { (5, 5) }
-   |               -^--^-
-   |               ||  |
-   |               ||  not allowed in type signatures
-   |               |not allowed in type signatures
-   |               help: replace with the correct return type: `(i32, i32)`
+   |                ^  ^ not allowed in type signatures
+   |                |
+   |                not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - fn test2() -> (_, _) { (5, 5) }
+LL + fn test2() -> (i32, i32) { (5, 5) }
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
   --> $DIR/typeck_type_placeholder_item.rs:13:15
@@ -189,19 +196,25 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/typeck_type_placeholder_item.rs:47:26
    |
 LL | fn test11(x: &usize) -> &_ {
-   |                         -^
-   |                         ||
-   |                         |not allowed in type signatures
-   |                         help: replace with the correct return type: `&&usize`
+   |                          ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - fn test11(x: &usize) -> &_ {
+LL + fn test11(x: &usize) -> &&usize {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/typeck_type_placeholder_item.rs:52:52
    |
 LL | unsafe fn test12(x: *const usize) -> *const *const _ {
-   |                                      --------------^
-   |                                      |             |
-   |                                      |             not allowed in type signatures
-   |                                      help: replace with the correct return type: `*const *const usize`
+   |                                                    ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - unsafe fn test12(x: *const usize) -> *const *const _ {
+LL + unsafe fn test12(x: *const usize) -> *const *const usize {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for methods
   --> $DIR/typeck_type_placeholder_item.rs:58:24
@@ -261,20 +274,27 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/typeck_type_placeholder_item.rs:80:21
    |
 LL |     fn fn_test() -> _ { 5 }
-   |                     ^
-   |                     |
-   |                     not allowed in type signatures
-   |                     help: replace with the correct return type: `i32`
+   |                     ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL -     fn fn_test() -> _ { 5 }
+LL +     fn fn_test() -> i32 { 5 }
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/typeck_type_placeholder_item.rs:83:23
    |
 LL |     fn fn_test2() -> (_, _) { (5, 5) }
-   |                      -^--^-
-   |                      ||  |
-   |                      ||  not allowed in type signatures
-   |                      |not allowed in type signatures
-   |                      help: replace with the correct return type: `(i32, i32)`
+   |                       ^  ^ not allowed in type signatures
+   |                       |
+   |                       not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL -     fn fn_test2() -> (_, _) { (5, 5) }
+LL +     fn fn_test2() -> (i32, i32) { (5, 5) }
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
   --> $DIR/typeck_type_placeholder_item.rs:86:22
@@ -374,20 +394,27 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/typeck_type_placeholder_item.rs:134:30
    |
 LL |     fn fn_test12(x: i32) -> (_, _) { (x, x) }
-   |                             -^--^-
-   |                             ||  |
-   |                             ||  not allowed in type signatures
-   |                             |not allowed in type signatures
-   |                             help: replace with the correct return type: `(i32, i32)`
+   |                              ^  ^ not allowed in type signatures
+   |                              |
+   |                              not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL -     fn fn_test12(x: i32) -> (_, _) { (x, x) }
+LL +     fn fn_test12(x: i32) -> (i32, i32) { (x, x) }
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
   --> $DIR/typeck_type_placeholder_item.rs:137:33
    |
 LL |     fn fn_test13(x: _) -> (i32, _) { (x, x) }
-   |                           ------^-
-   |                           |     |
-   |                           |     not allowed in type signatures
-   |                           help: replace with the correct return type: `(i32, i32)`
+   |                                 ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL -     fn fn_test13(x: _) -> (i32, _) { (x, x) }
+LL +     fn fn_test13(x: _) -> (i32, i32) { (x, x) }
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for methods
   --> $DIR/typeck_type_placeholder_item.rs:142:31
@@ -528,10 +555,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/typeck_type_placeholder_item.rs:226:31
    |
 LL | fn value() -> Option<&'static _> {
-   |               ----------------^-
-   |               |               |
-   |               |               not allowed in type signatures
-   |               help: replace with the correct return type: `Option<&'static u8>`
+   |                               ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - fn value() -> Option<&'static _> {
+LL + fn value() -> Option<&'static u8> {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
   --> $DIR/typeck_type_placeholder_item.rs:231:17
@@ -549,10 +579,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/typeck_type_placeholder_item.rs:235:31
    |
 LL | fn evens_squared(n: usize) -> _ {
-   |                               ^
-   |                               |
-   |                               not allowed in type signatures
-   |                               help: replace with an appropriate return type: `impl Iterator<Item = usize>`
+   |                               ^ not allowed in type signatures
+   |
+help: replace with an appropriate return type
+   |
+LL - fn evens_squared(n: usize) -> _ {
+LL + fn evens_squared(n: usize) -> impl Iterator<Item = usize> {
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
   --> $DIR/typeck_type_placeholder_item.rs:240:10
@@ -570,10 +603,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/typeck_type_placeholder_item.rs:40:24
    |
 LL |     fn test9(&self) -> _ { () }
-   |                        ^
-   |                        |
-   |                        not allowed in type signatures
-   |                        help: replace with the correct return type: `()`
+   |                        ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL -     fn test9(&self) -> _ { () }
+LL +     fn test9(&self) -> () { () }
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for methods
   --> $DIR/typeck_type_placeholder_item.rs:43:27
@@ -585,10 +621,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/typeck_type_placeholder_item.rs:107:31
    |
 LL |         fn fn_test9(&self) -> _ { () }
-   |                               ^
-   |                               |
-   |                               not allowed in type signatures
-   |                               help: replace with the correct return type: `()`
+   |                               ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL -         fn fn_test9(&self) -> _ { () }
+LL +         fn fn_test9(&self) -> () { () }
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for methods
   --> $DIR/typeck_type_placeholder_item.rs:110:34
diff --git a/tests/ui/typeck/typeck_type_placeholder_item_help.stderr b/tests/ui/typeck/typeck_type_placeholder_item_help.stderr
index 2fce00e7a8e..3f21ff6d4ec 100644
--- a/tests/ui/typeck/typeck_type_placeholder_item_help.stderr
+++ b/tests/ui/typeck/typeck_type_placeholder_item_help.stderr
@@ -2,10 +2,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/typeck_type_placeholder_item_help.rs:4:15
    |
 LL | fn test1() -> _ { Some(42) }
-   |               ^
-   |               |
-   |               not allowed in type signatures
-   |               help: replace with the correct return type: `Option<i32>`
+   |               ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - fn test1() -> _ { Some(42) }
+LL + fn test1() -> Option<i32> { Some(42) }
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
   --> $DIR/typeck_type_placeholder_item_help.rs:7:14
diff --git a/tests/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr b/tests/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr
index 058dbb1e220..739182e120b 100644
--- a/tests/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr
+++ b/tests/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr
@@ -5,7 +5,7 @@ LL |     let mut closure0 = None;
    |         ^^^^^^^^^^^^
 ...
 LL |                         return c();
-   |                                --- type must be known at this point
+   |                                - type must be known at this point
    |
 help: consider giving `closure0` an explicit type, where the placeholders `_` are specified
    |
diff --git a/tests/ui/union/union-unsafe.rs b/tests/ui/union/union-unsafe.rs
index bd3946686be..beb074f4e8e 100644
--- a/tests/ui/union/union-unsafe.rs
+++ b/tests/ui/union/union-unsafe.rs
@@ -1,5 +1,6 @@
 use std::cell::RefCell;
 use std::mem::ManuallyDrop;
+use std::ops::Deref;
 
 union U1 {
     a: u8,
@@ -17,6 +18,10 @@ union U4<T: Copy> {
     a: T,
 }
 
+union U5 {
+    a: usize,
+}
+
 union URef {
     p: &'static mut i32,
 }
@@ -31,6 +36,20 @@ fn deref_union_field(mut u: URef) {
     *(u.p) = 13; //~ ERROR access to union field is unsafe
 }
 
+union A {
+    a: usize,
+    b: &'static &'static B,
+}
+
+union B {
+    c: usize,
+}
+
+fn raw_deref_union_field(mut u: URef) {
+    // This is unsafe because we first dereference u.p (reading uninitialized memory)
+    let _p = &raw const *(u.p); //~ ERROR access to union field is unsafe
+}
+
 fn assign_noncopy_union_field(mut u: URefCell) {
     u.a = (ManuallyDrop::new(RefCell::new(0)), 1); // OK (assignment does not drop)
     u.a.0 = ManuallyDrop::new(RefCell::new(0)); // OK (assignment does not drop)
@@ -57,6 +76,20 @@ fn main() {
     let a = u1.a; //~ ERROR access to union field is unsafe
     u1.a = 11; // OK
 
+    let mut u2 = U1 { a: 10 };
+    let a = &raw mut u2.a; // OK
+    unsafe { *a = 3 };
+
+    let mut u3 = U1 { a: 10 };
+    let a = std::ptr::addr_of_mut!(u3.a); // OK
+    unsafe { *a = 14 };
+
+    let u4 = U5 { a: 2 };
+    let vec = vec![1, 2, 3];
+    // This is unsafe because we read u4.a (potentially uninitialized memory)
+    // to use as an array index
+    let _a = &raw const vec[u4.a]; //~ ERROR access to union field is unsafe
+
     let U1 { a } = u1; //~ ERROR access to union field is unsafe
     if let U1 { a: 12 } = u1 {} //~ ERROR access to union field is unsafe
     if let Some(U1 { a: 13 }) = Some(u1) {} //~ ERROR access to union field is unsafe
@@ -73,4 +106,44 @@ fn main() {
     let mut u3 = U3 { a: ManuallyDrop::new(String::from("old")) }; // OK
     u3.a = ManuallyDrop::new(String::from("new")); // OK (assignment does not drop)
     *u3.a = String::from("new"); //~ ERROR access to union field is unsafe
+
+    let mut unions = [U1 { a: 1 }, U1 { a: 2 }];
+
+    // Array indexing + union field raw borrow - should be OK
+    let ptr = &raw mut unions[0].a; // OK
+    let ptr2 = &raw const unions[1].a; // OK
+
+    let a = A { a: 0 };
+    let _p = &raw const (**a.b).c; //~ ERROR access to union field is unsafe
+
+    arbitrary_deref();
+}
+
+// regression test for https://github.com/rust-lang/rust/pull/141469#discussion_r2312546218
+fn arbitrary_deref() {
+    use std::ops::Deref;
+
+    union A {
+        a: usize,
+        b: B,
+    }
+
+    #[derive(Copy, Clone)]
+    struct B(&'static str);
+
+    impl Deref for B {
+        type Target = C;
+
+        fn deref(&self) -> &C {
+            println!("{:?}", self.0);
+            &C { c: 0 }
+        }
+    }
+
+    union C {
+        c: usize,
+    }
+
+    let a = A { a: 0 };
+    let _p = &raw const (*a.b).c; //~ ERROR access to union field is unsafe
 }
diff --git a/tests/ui/union/union-unsafe.stderr b/tests/ui/union/union-unsafe.stderr
index 82b3f897167..01f4d95eb64 100644
--- a/tests/ui/union/union-unsafe.stderr
+++ b/tests/ui/union/union-unsafe.stderr
@@ -1,5 +1,5 @@
 error[E0133]: access to union field is unsafe and requires unsafe function or block
-  --> $DIR/union-unsafe.rs:31:6
+  --> $DIR/union-unsafe.rs:36:6
    |
 LL |     *(u.p) = 13;
    |      ^^^^^ access to union field
@@ -7,7 +7,15 @@ LL |     *(u.p) = 13;
    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
 
 error[E0133]: access to union field is unsafe and requires unsafe function or block
-  --> $DIR/union-unsafe.rs:43:6
+  --> $DIR/union-unsafe.rs:50:26
+   |
+LL |     let _p = &raw const *(u.p);
+   |                          ^^^^^ access to union field
+   |
+   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+  --> $DIR/union-unsafe.rs:62:6
    |
 LL |     *u3.a = T::default();
    |      ^^^^ access to union field
@@ -15,7 +23,7 @@ LL |     *u3.a = T::default();
    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
 
 error[E0133]: access to union field is unsafe and requires unsafe function or block
-  --> $DIR/union-unsafe.rs:49:6
+  --> $DIR/union-unsafe.rs:68:6
    |
 LL |     *u3.a = T::default();
    |      ^^^^ access to union field
@@ -23,7 +31,7 @@ LL |     *u3.a = T::default();
    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
 
 error[E0133]: access to union field is unsafe and requires unsafe function or block
-  --> $DIR/union-unsafe.rs:57:13
+  --> $DIR/union-unsafe.rs:76:13
    |
 LL |     let a = u1.a;
    |             ^^^^ access to union field
@@ -31,7 +39,15 @@ LL |     let a = u1.a;
    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
 
 error[E0133]: access to union field is unsafe and requires unsafe function or block
-  --> $DIR/union-unsafe.rs:60:14
+  --> $DIR/union-unsafe.rs:91:29
+   |
+LL |     let _a = &raw const vec[u4.a];
+   |                             ^^^^ access to union field
+   |
+   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+  --> $DIR/union-unsafe.rs:93:14
    |
 LL |     let U1 { a } = u1;
    |              ^ access to union field
@@ -39,7 +55,7 @@ LL |     let U1 { a } = u1;
    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
 
 error[E0133]: access to union field is unsafe and requires unsafe function or block
-  --> $DIR/union-unsafe.rs:61:20
+  --> $DIR/union-unsafe.rs:94:20
    |
 LL |     if let U1 { a: 12 } = u1 {}
    |                    ^^ access to union field
@@ -47,7 +63,7 @@ LL |     if let U1 { a: 12 } = u1 {}
    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
 
 error[E0133]: access to union field is unsafe and requires unsafe function or block
-  --> $DIR/union-unsafe.rs:62:25
+  --> $DIR/union-unsafe.rs:95:25
    |
 LL |     if let Some(U1 { a: 13 }) = Some(u1) {}
    |                         ^^ access to union field
@@ -55,7 +71,7 @@ LL |     if let Some(U1 { a: 13 }) = Some(u1) {}
    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
 
 error[E0133]: access to union field is unsafe and requires unsafe function or block
-  --> $DIR/union-unsafe.rs:67:6
+  --> $DIR/union-unsafe.rs:100:6
    |
 LL |     *u2.a = String::from("new");
    |      ^^^^ access to union field
@@ -63,7 +79,7 @@ LL |     *u2.a = String::from("new");
    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
 
 error[E0133]: access to union field is unsafe and requires unsafe function or block
-  --> $DIR/union-unsafe.rs:71:6
+  --> $DIR/union-unsafe.rs:104:6
    |
 LL |     *u3.a = 1;
    |      ^^^^ access to union field
@@ -71,13 +87,29 @@ LL |     *u3.a = 1;
    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
 
 error[E0133]: access to union field is unsafe and requires unsafe function or block
-  --> $DIR/union-unsafe.rs:75:6
+  --> $DIR/union-unsafe.rs:108:6
    |
 LL |     *u3.a = String::from("new");
    |      ^^^^ access to union field
    |
    = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
 
-error: aborting due to 10 previous errors
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+  --> $DIR/union-unsafe.rs:117:28
+   |
+LL |     let _p = &raw const (**a.b).c;
+   |                            ^^^ access to union field
+   |
+   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+  --> $DIR/union-unsafe.rs:148:27
+   |
+LL |     let _p = &raw const (*a.b).c;
+   |                           ^^^ access to union field
+   |
+   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error: aborting due to 14 previous errors
 
 For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/unpretty/exhaustive.hir.stdout b/tests/ui/unpretty/exhaustive.hir.stdout
index 96d85d1e7c1..27cba656030 100644
--- a/tests/ui/unpretty/exhaustive.hir.stdout
+++ b/tests/ui/unpretty/exhaustive.hir.stdout
@@ -398,7 +398,8 @@ mod expressions {
         let expr;
         format_arguments::new_const(&[]);
         {
-            super let args = [format_argument::new_display(&expr)];
+            super let args = (&expr,);
+            super let args = [format_argument::new_display(args.0)];
             format_arguments::new_v1(&[""], &args)
         };
     }
diff --git a/tests/ui/unpretty/flattened-format-args.stdout b/tests/ui/unpretty/flattened-format-args.stdout
index 0792dc10e94..233c9f1c91b 100644
--- a/tests/ui/unpretty/flattened-format-args.stdout
+++ b/tests/ui/unpretty/flattened-format-args.stdout
@@ -11,7 +11,8 @@ fn main() {
     // Should flatten to println!("a 123 b {x} xyz\n"):
     {
         ::std::io::_print({
-                super let args = [format_argument::new_display(&x)];
+                super let args = (&x,);
+                super let args = [format_argument::new_display(args.0)];
                 format_arguments::new_v1(&["a 123 b ", " xyz\n"], &args)
             });
     };
diff --git a/tests/ui/unstable-feature-bound/unstable_impl_coherence.disabled.stderr b/tests/ui/unstable-feature-bound/unstable_impl_coherence.disabled.stderr
index c3147558b03..afef024e1b9 100644
--- a/tests/ui/unstable-feature-bound/unstable_impl_coherence.disabled.stderr
+++ b/tests/ui/unstable-feature-bound/unstable_impl_coherence.disabled.stderr
@@ -6,7 +6,7 @@ LL | impl aux::Trait for LocalTy {}
    |
    = note: conflicting implementation in crate `unstable_impl_coherence_aux`:
            - impl<T> Trait for T
-             where unstable feature: `foo`;
+             where feature(foo) is enabled;
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/unstable-feature-bound/unstable_impl_coherence.enabled.stderr b/tests/ui/unstable-feature-bound/unstable_impl_coherence.enabled.stderr
index c3147558b03..afef024e1b9 100644
--- a/tests/ui/unstable-feature-bound/unstable_impl_coherence.enabled.stderr
+++ b/tests/ui/unstable-feature-bound/unstable_impl_coherence.enabled.stderr
@@ -6,7 +6,7 @@ LL | impl aux::Trait for LocalTy {}
    |
    = note: conflicting implementation in crate `unstable_impl_coherence_aux`:
            - impl<T> Trait for T
-             where unstable feature: `foo`;
+             where feature(foo) is enabled;
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/unstable-feature-bound/unstable_impl_method_selection.stderr b/tests/ui/unstable-feature-bound/unstable_impl_method_selection.stderr
index c2bb10f043b..840af730154 100644
--- a/tests/ui/unstable-feature-bound/unstable_impl_method_selection.stderr
+++ b/tests/ui/unstable-feature-bound/unstable_impl_method_selection.stderr
@@ -7,7 +7,7 @@ LL |     vec![].foo();
    = note: multiple `impl`s satisfying `Vec<_>: Trait` found in the `unstable_impl_method_selection_aux` crate:
            - impl Trait for Vec<u32>;
            - impl Trait for Vec<u64>
-             where unstable feature: `bar`;
+             where feature(bar) is enabled;
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/variance/leaking-unnameables.stderr b/tests/ui/variance/leaking-unnameables.stderr
index 92afe952801..59bdc33040d 100644
--- a/tests/ui/variance/leaking-unnameables.stderr
+++ b/tests/ui/variance/leaking-unnameables.stderr
@@ -2,10 +2,13 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
   --> $DIR/leaking-unnameables.rs:8:18
    |
 LL | pub fn f<T>() -> _ {
-   |                  ^
-   |                  |
-   |                  not allowed in type signatures
-   |                  help: replace with the correct return type: `fn()`
+   |                  ^ not allowed in type signatures
+   |
+help: replace with the correct return type
+   |
+LL - pub fn f<T>() -> _ {
+LL + pub fn f<T>() -> fn() {
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/wf/wf-in-where-clause-static.current.stderr b/tests/ui/wf/wf-in-where-clause-static.current.stderr
index d0bb89884c6..788fe2c3faa 100644
--- a/tests/ui/wf/wf-in-where-clause-static.current.stderr
+++ b/tests/ui/wf/wf-in-where-clause-static.current.stderr
@@ -6,6 +6,12 @@ LL |     let s = foo(&String::from("blah blah blah"));
    |             |    |
    |             |    creates a temporary value which is freed while still in use
    |             argument requires that borrow lasts for `'static`
+   |
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/wf-in-where-clause-static.rs:12:17
+   |
+LL |     &'static S: Static,
+   |                 ^^^^^^
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/wf/wf-in-where-clause-static.next.stderr b/tests/ui/wf/wf-in-where-clause-static.next.stderr
index d0bb89884c6..788fe2c3faa 100644
--- a/tests/ui/wf/wf-in-where-clause-static.next.stderr
+++ b/tests/ui/wf/wf-in-where-clause-static.next.stderr
@@ -6,6 +6,12 @@ LL |     let s = foo(&String::from("blah blah blah"));
    |             |    |
    |             |    creates a temporary value which is freed while still in use
    |             argument requires that borrow lasts for `'static`
+   |
+note: requirement that the value outlives `'static` introduced here
+  --> $DIR/wf-in-where-clause-static.rs:12:17
+   |
+LL |     &'static S: Static,
+   |                 ^^^^^^
 
 error: aborting due to 1 previous error