about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/assembly/asm/aarch64-outline-atomics.rs3
-rw-r--r--tests/assembly/powerpc64-struct-abi.rs132
-rw-r--r--tests/assembly/x86-return-float.rs54
-rw-r--r--tests/assembly/x86_64-windows-float-abi.rs39
-rw-r--r--tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs2
-rw-r--r--tests/codegen-units/item-collection/cross-crate-closures.rs21
-rw-r--r--tests/codegen-units/item-collection/generic-impl.rs10
-rw-r--r--tests/codegen-units/item-collection/non-generic-closures.rs30
-rw-r--r--tests/codegen-units/item-collection/overloaded-operators.rs24
-rw-r--r--tests/codegen-units/partitioning/methods-are-with-self-type.rs42
-rw-r--r--tests/codegen/aarch64-struct-align-128.rs30
-rw-r--r--tests/codegen/array-from_fn.rs13
-rw-r--r--tests/codegen/atomic-operations.rs3
-rw-r--r--tests/codegen/branch-protection-old-llvm.rs45
-rw-r--r--tests/codegen/branch-protection.rs10
-rw-r--r--tests/codegen/call-metadata.rs1
-rw-r--r--tests/codegen/cast-optimized.rs2
-rw-r--r--tests/codegen/cold-call-declare-and-call.rs10
-rw-r--r--tests/codegen/common_prim_int_ptr.rs4
-rw-r--r--tests/codegen/const-vector.rs107
-rw-r--r--tests/codegen/default-requires-uwtable.rs10
-rw-r--r--tests/codegen/enum/enum-match.rs2
-rw-r--r--tests/codegen/function-arguments.rs6
-rw-r--r--tests/codegen/instrument-coverage/testprog.rs30
-rw-r--r--tests/codegen/intrinsics/nontemporal.rs30
-rw-r--r--tests/codegen/intrinsics/select_unpredictable.rs35
-rw-r--r--tests/codegen/intrinsics/transmute.rs5
-rw-r--r--tests/codegen/issues/issue-107681-unwrap_unchecked.rs20
-rw-r--r--tests/codegen/issues/issue-118306.rs23
-rw-r--r--tests/codegen/issues/issue-122600-ptr-discriminant-update.rs19
-rw-r--r--tests/codegen/issues/issue-126585.rs24
-rw-r--r--tests/codegen/issues/issue-68667-unwrap-combinators.rs2
-rw-r--r--tests/codegen/iter-repeat-n-trivial-drop.rs15
-rw-r--r--tests/codegen/range-attribute.rs68
-rw-r--r--tests/codegen/repr/transparent-sysv64.rs6
-rw-r--r--tests/codegen/repr/transparent.rs2
-rw-r--r--tests/codegen/simd/issue-120720-reduce-nan.rs21
-rw-r--r--tests/codegen/sse42-implies-crc32.rs2
-rw-r--r--tests/codegen/target-feature-overrides.rs8
-rw-r--r--tests/codegen/tied-features-strength.rs2
-rw-r--r--tests/coverage/mcdc/condition-limit.cov-map8
-rw-r--r--tests/coverage/mcdc/condition-limit.coverage1
-rw-r--r--tests/coverage/mcdc/condition-limit.rs1
-rw-r--r--tests/coverage/mcdc/if.cov-map28
-rw-r--r--tests/coverage/mcdc/if.coverage1
-rw-r--r--tests/coverage/mcdc/if.rs1
-rw-r--r--tests/coverage/mcdc/inlined_expressions.cov-map4
-rw-r--r--tests/coverage/mcdc/inlined_expressions.coverage1
-rw-r--r--tests/coverage/mcdc/inlined_expressions.rs1
-rw-r--r--tests/coverage/mcdc/nested_if.cov-map16
-rw-r--r--tests/coverage/mcdc/nested_if.coverage1
-rw-r--r--tests/coverage/mcdc/nested_if.rs1
-rw-r--r--tests/coverage/mcdc/non_control_flow.cov-map28
-rw-r--r--tests/coverage/mcdc/non_control_flow.coverage1
-rw-r--r--tests/coverage/mcdc/non_control_flow.rs1
-rw-r--r--tests/crashes/119716-2.rs2
-rw-r--r--tests/crashes/121127.rs2
-rw-r--r--tests/crashes/121613-2.rs28
-rw-r--r--tests/crashes/121613.rs24
-rw-r--r--tests/crashes/122909.rs15
-rw-r--r--tests/crashes/122914.rs11
-rw-r--r--tests/crashes/123809.rs2
-rw-r--r--tests/crashes/126272.rs28
-rw-r--r--tests/crashes/126896.rs2
-rw-r--r--tests/crashes/127222.rs3
-rw-r--r--tests/crashes/127299.rs12
-rw-r--r--tests/crashes/128094.rs14
-rw-r--r--tests/crashes/128176.rs13
-rw-r--r--tests/crashes/128190.rs7
-rw-r--r--tests/crashes/128327.rs5
-rw-r--r--tests/crashes/128346.rs13
-rw-r--r--tests/debuginfo/pretty-std.rs12
-rw-r--r--tests/debuginfo/strings-and-strs.rs2
-rw-r--r--tests/debuginfo/thread-names.rs4
-rw-r--r--tests/incremental/hashes/call_expressions.rs2
-rw-r--r--tests/incremental/hashes/for_loops.rs4
-rw-r--r--tests/mir-opt/building/custom/terminators.rs12
-rw-r--r--tests/mir-opt/building/custom/terminators.tail_call.built.after.mir11
-rw-r--r--tests/mir-opt/building/match/match_false_edges.full_tested_match.built.after.mir56
-rw-r--r--tests/mir-opt/building/match/match_false_edges.full_tested_match2.built.after.mir44
-rw-r--r--tests/mir-opt/building/match/match_false_edges.main.built.after.mir92
-rw-r--r--tests/mir-opt/building/match/never_patterns.opt1.SimplifyCfg-initial.after.mir10
-rw-r--r--tests/mir-opt/building/match/never_patterns.opt2.SimplifyCfg-initial.after.mir15
-rw-r--r--tests/mir-opt/building/match/never_patterns.opt3.SimplifyCfg-initial.after.mir17
-rw-r--r--tests/mir-opt/building/match/sort_candidates.constant_eq.SimplifyCfg-initial.after.mir40
-rw-r--r--tests/mir-opt/building/match/sort_candidates.disjoint_ranges.SimplifyCfg-initial.after.mir30
-rw-r--r--tests/mir-opt/const_prop/offset_of.rs2
-rw-r--r--tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff9
-rw-r--r--tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff9
-rw-r--r--tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff9
-rw-r--r--tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff9
-rw-r--r--tests/mir-opt/const_prop/slice_len.rs4
-rw-r--r--tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff44
-rw-r--r--tests/mir-opt/dataflow-const-prop/offset_of.rs2
-rw-r--r--tests/mir-opt/dataflow-const-prop/slice_len.rs2
-rw-r--r--tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff28
-rw-r--r--tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff28
-rw-r--r--tests/mir-opt/dont_inline_type_id.rs3
-rw-r--r--tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff14
-rw-r--r--tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff22
-rw-r--r--tests/mir-opt/early_otherwise_branch.opt4.EarlyOtherwiseBranch.diff22
-rw-r--r--tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff14
-rw-r--r--tests/mir-opt/early_otherwise_branch_3_element_tuple.opt2.EarlyOtherwiseBranch.diff30
-rw-r--r--tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff124
-rw-r--r--tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff26
-rw-r--r--tests/mir-opt/elaborate_box_deref_in_debuginfo.pointee.ElaborateBoxDerefs.diff13
-rw-r--r--tests/mir-opt/elaborate_box_deref_in_debuginfo.rs20
-rw-r--r--tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff4
-rw-r--r--tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff4
-rw-r--r--tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff2
-rw-r--r--tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff2
-rw-r--r--tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff2
-rw-r--r--tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff2
-rw-r--r--tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir4
-rw-r--r--tests/mir-opt/inline/inline_retag.bar.Inline.after.mir8
-rw-r--r--tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir2
-rw-r--r--tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir2
-rw-r--r--tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir4
-rw-r--r--tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir4
-rw-r--r--tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir6
-rw-r--r--tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir6
-rw-r--r--tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir4
-rw-r--r--tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir4
-rw-r--r--tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/bool_compare.rs18
-rw-r--r--tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/casts.redundant.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/casts.redundant.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/casts.rs8
-rw-r--r--tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff (renamed from tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify.panic-abort.diff)4
-rw-r--r--tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff (renamed from tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify.panic-unwind.diff)4
-rw-r--r--tests/mir-opt/instsimplify/combine_array_len.rs4
-rw-r--r--tests/mir-opt/instsimplify/combine_clone_of_primitives.rs4
-rw-r--r--tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-abort.diff (renamed from tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-abort.diff)4
-rw-r--r--tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-unwind.diff (renamed from tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff)4
-rw-r--r--tests/mir-opt/instsimplify/combine_transmutes.adt_transmutes.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/combine_transmutes.adt_transmutes.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/combine_transmutes.identity_transmutes.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/combine_transmutes.identity_transmutes.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/combine_transmutes.integer_transmutes.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/combine_transmutes.integer_transmutes.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/combine_transmutes.rs8
-rw-r--r--tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/duplicate_switch_targets.rs4
-rw-r--r--tests/mir-opt/instsimplify/intrinsic_asserts.generic.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/intrinsic_asserts.generic.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/intrinsic_asserts.generic_ref.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/intrinsic_asserts.generic_ref.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/intrinsic_asserts.panics.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/intrinsic_asserts.panics.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/intrinsic_asserts.removable.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/intrinsic_asserts.removable.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/intrinsic_asserts.rs10
-rw-r--r--tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/instsimplify/ref_of_deref.rs6
-rw-r--r--tests/mir-opt/instsimplify/ub_check.rs4
-rw-r--r--tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify.diff)4
-rw-r--r--tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff6
-rw-r--r--tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff6
-rw-r--r--tests/mir-opt/issue_78192.f.InstSimplify-after-simplifycfg.diff (renamed from tests/mir-opt/issue_78192.f.InstSimplify.diff)7
-rw-r--r--tests/mir-opt/issue_78192.rs2
-rw-r--r--tests/mir-opt/jump_threading.dfa.JumpThreading.panic-abort.diff18
-rw-r--r--tests/mir-opt/jump_threading.dfa.JumpThreading.panic-unwind.diff18
-rw-r--r--tests/mir-opt/jump_threading.rs6
-rw-r--r--tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff132
-rw-r--r--tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff132
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff61
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_i16_i8.MatchBranchSimplification.diff37
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_i8_i16.MatchBranchSimplification.diff37
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_i8_i16_failed.MatchBranchSimplification.diff37
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_sext_i8_i16.MatchBranchSimplification.diff52
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_sext_i8_i16_failed.MatchBranchSimplification.diff47
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_sext_i8_u16.MatchBranchSimplification.diff52
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_sext_i8_u16_failed.MatchBranchSimplification.diff47
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8.MatchBranchSimplification.diff77
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8_failed.MatchBranchSimplification.diff72
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8.MatchBranchSimplification.diff77
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8_failed.MatchBranchSimplification.diff72
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8.MatchBranchSimplification.diff67
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8_failed.MatchBranchSimplification.diff62
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8.MatchBranchSimplification.diff67
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8_failed.MatchBranchSimplification.diff62
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_u8_i16.MatchBranchSimplification.diff32
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_u8_i16_2.MatchBranchSimplification.diff26
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_u8_i16_failed.MatchBranchSimplification.diff32
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_u8_i16_fallback.MatchBranchSimplification.diff31
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_u8_i8.MatchBranchSimplification.diff47
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_u8_i8_2.MatchBranchSimplification.diff80
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_u8_i8_2_failed.MatchBranchSimplification.diff74
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_u8_i8_failed.MatchBranchSimplification.diff42
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_1.MatchBranchSimplification.diff42
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_2.MatchBranchSimplification.diff42
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_u8_i8_fallback.MatchBranchSimplification.diff38
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_u8_u16.MatchBranchSimplification.diff37
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_u8_u16_2.MatchBranchSimplification.diff37
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_zext_u8_i16.MatchBranchSimplification.diff47
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_zext_u8_i16_failed.MatchBranchSimplification.diff42
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_zext_u8_u16.MatchBranchSimplification.diff47
-rw-r--r--tests/mir-opt/matches_reduce_branches.match_zext_u8_u16_failed.MatchBranchSimplification.diff42
-rw-r--r--tests/mir-opt/matches_reduce_branches.rs578
-rw-r--r--tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff41
-rw-r--r--tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff41
-rw-r--r--tests/mir-opt/or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir30
-rw-r--r--tests/mir-opt/or_pattern.single_switchint.SimplifyCfg-initial.after.mir16
-rw-r--r--tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff19
-rw-r--r--tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff11
-rw-r--r--tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff19
-rw-r--r--tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff11
-rw-r--r--tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir2
-rw-r--r--tests/mir-opt/pre-codegen/no_inlined_clone.rs12
-rw-r--r--tests/mir-opt/pre-codegen/no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir15
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff2
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff2
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff2
-rw-r--r--tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff2
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir2
-rw-r--r--tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir2
-rw-r--r--tests/mir-opt/pre-codegen/slice_filter.variant_a-{closure#0}.PreCodegen.after.mir27
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir10
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir10
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir2
-rw-r--r--tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir2
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir2
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir2
-rw-r--r--tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-unwind.mir2
-rw-r--r--tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-abort.mir4
-rw-r--r--tests/mir-opt/pre-codegen/spans.outer.PreCodegen.after.panic-unwind.mir4
-rw-r--r--tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-abort.mir92
-rw-r--r--tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-unwind.mir92
-rw-r--r--tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff8
-rw-r--r--tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff8
-rw-r--r--tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff8
-rw-r--r--tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff8
-rw-r--r--tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UnreachableEnumBranching.diff8
-rw-r--r--tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UnreachableEnumBranching.diff8
-rw-r--r--tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-abort.diff16
-rw-r--r--tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff16
-rw-r--r--tests/mir-opt/unreachable.rs10
-rw-r--r--tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-abort.diff28
-rw-r--r--tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-unwind.diff28
-rw-r--r--tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-abort.diff12
-rw-r--r--tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-unwind.diff12
-rw-r--r--tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-abort.diff12
-rw-r--r--tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-unwind.diff12
-rw-r--r--tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-abort.diff12
-rw-r--r--tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-unwind.diff12
-rw-r--r--tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-abort.diff14
-rw-r--r--tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-unwind.diff14
-rw-r--r--tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff32
-rw-r--r--tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff32
-rw-r--r--tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-abort.diff14
-rw-r--r--tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-unwind.diff14
-rw-r--r--tests/mir-opt/unreachable_enum_branching.rs14
-rw-r--r--tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-abort.diff30
-rw-r--r--tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-unwind.diff30
-rw-r--r--tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs2
-rw-r--r--tests/run-make/arguments-non-c-like-enum/rmake.rs2
-rw-r--r--tests/run-make/branch-protection-check-IBT/_rmake.rs4
-rw-r--r--tests/run-make/c-link-to-rust-staticlib/rmake.rs1
-rw-r--r--tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs4
-rw-r--r--tests/run-make/cdylib-dylib-linkage/Makefile31
-rw-r--r--tests/run-make/cdylib-dylib-linkage/rmake.rs41
-rw-r--r--tests/run-make/comment-section/rmake.rs7
-rw-r--r--tests/run-make/compiler-builtins/rmake.rs9
-rw-r--r--tests/run-make/compressed-debuginfo/rmake.rs2
-rw-r--r--tests/run-make/const_fn_mir/rmake.rs2
-rw-r--r--tests/run-make/cpp-global-destructors/foo.cpp (renamed from tests/run-make/issue-36710/foo.cpp)0
-rw-r--r--tests/run-make/cpp-global-destructors/foo.rs (renamed from tests/run-make/issue-36710/foo.rs)0
-rw-r--r--tests/run-make/cpp-global-destructors/rmake.rs26
-rw-r--r--tests/run-make/crate-circular-deps-link/a.rs (renamed from tests/run-make/issue-69368/a.rs)0
-rw-r--r--tests/run-make/crate-circular-deps-link/b.rs (renamed from tests/run-make/issue-69368/b.rs)0
-rw-r--r--tests/run-make/crate-circular-deps-link/c.rs (renamed from tests/run-make/issue-69368/c.rs)0
-rw-r--r--tests/run-make/crate-circular-deps-link/rmake.rs20
-rw-r--r--tests/run-make/crate-hash-rustc-version/rmake.rs3
-rw-r--r--tests/run-make/crate-loading/multiple-dep-versions-1.rs6
-rw-r--r--tests/run-make/crate-loading/multiple-dep-versions-2.rs6
-rw-r--r--tests/run-make/crate-loading/multiple-dep-versions.rs8
-rw-r--r--tests/run-make/crate-loading/rmake.rs26
-rw-r--r--tests/run-make/cross-lang-lto-clang/Makefile25
-rw-r--r--tests/run-make/cross-lang-lto-clang/rmake.rs62
-rw-r--r--tests/run-make/cross-lang-lto-pgo-smoketest-clang/clib.c (renamed from tests/run-make/cross-lang-lto-pgo-smoketest/clib.c)0
-rw-r--r--tests/run-make/cross-lang-lto-pgo-smoketest-clang/cmain.c (renamed from tests/run-make/cross-lang-lto-pgo-smoketest/cmain.c)0
-rw-r--r--tests/run-make/cross-lang-lto-pgo-smoketest-clang/main.rs (renamed from tests/run-make/cross-lang-lto-pgo-smoketest/main.rs)0
-rw-r--r--tests/run-make/cross-lang-lto-pgo-smoketest-clang/rmake.rs120
-rw-r--r--tests/run-make/cross-lang-lto-pgo-smoketest-clang/rustlib.rs (renamed from tests/run-make/cross-lang-lto-pgo-smoketest/rustlib.rs)0
-rw-r--r--tests/run-make/cross-lang-lto-pgo-smoketest/Makefile90
-rw-r--r--tests/run-make/cross-lang-lto-riscv-abi/rmake.rs17
-rw-r--r--tests/run-make/cross-lang-lto-upstream-rlibs/Makefile32
-rw-r--r--tests/run-make/cross-lang-lto-upstream-rlibs/rmake.rs57
-rw-r--r--tests/run-make/cross-lang-lto/Makefile57
-rw-r--r--tests/run-make/cross-lang-lto/rmake.rs110
-rw-r--r--tests/run-make/doctests-keep-binaries/rmake.rs3
-rw-r--r--tests/run-make/doctests-runtool/rmake.rs3
-rw-r--r--tests/run-make/dos-device-input/rmake.rs13
-rw-r--r--tests/run-make/dump-ice-to-disk/rmake.rs250
-rw-r--r--tests/run-make/dylib-soname/rmake.rs1
-rw-r--r--tests/run-make/emit-shared-files/rmake.rs3
-rw-r--r--tests/run-make/extern-flag-disambiguates/rmake.rs2
-rw-r--r--tests/run-make/fmt-write-bloat/Makefile25
-rw-r--r--tests/run-make/fmt-write-bloat/main.rs2
-rw-r--r--tests/run-make/fmt-write-bloat/rmake.rs40
-rw-r--r--tests/run-make/foreign-double-unwind/Makefile12
-rw-r--r--tests/run-make/foreign-double-unwind/rmake.rs21
-rw-r--r--tests/run-make/foreign-exceptions/Makefile12
-rw-r--r--tests/run-make/foreign-exceptions/rmake.rs19
-rw-r--r--tests/run-make/git_clone_sha1.sh23
-rw-r--r--tests/run-make/ice-dep-cannot-find-dep/rmake.rs2
-rw-r--r--tests/run-make/incr-prev-body-beyond-eof/rmake.rs3
-rw-r--r--tests/run-make/incr-test-moved-file/rmake.rs2
-rw-r--r--tests/run-make/incremental-debugger-visualizer/rmake.rs1
-rw-r--r--tests/run-make/inline-always-many-cgu/rmake.rs7
-rw-r--r--tests/run-make/intrinsic-unreachable/exit-unreachable.rs1
-rw-r--r--tests/run-make/invalid-library/rmake.rs3
-rw-r--r--tests/run-make/issue-107495-archive-permissions/rmake.rs4
-rw-r--r--tests/run-make/issue-35164/Makefile4
-rw-r--r--tests/run-make/issue-36710/Makefile19
-rw-r--r--tests/run-make/issue-47551/Makefile10
-rw-r--r--tests/run-make/issue-69368/Makefile19
-rw-r--r--tests/run-make/issue-88756-default-output/Makefile4
-rw-r--r--tests/run-make/issue-88756-default-output/README.md1
-rw-r--r--tests/run-make/issue-88756-default-output/x.rs1
-rw-r--r--tests/run-make/json-error-no-offset/main.rs (renamed from tests/run-make/issue-35164/main.rs)0
-rw-r--r--tests/run-make/json-error-no-offset/rmake.rs15
-rw-r--r--tests/run-make/json-error-no-offset/submodule/mod.rs (renamed from tests/run-make/issue-35164/submodule/mod.rs)0
-rw-r--r--tests/run-make/lib-trait-for-trait-no-ice/rmake.rs3
-rw-r--r--tests/run-make/libtest-thread-limit/test.rs8
-rw-r--r--tests/run-make/link-args-order/rmake.rs11
-rw-r--r--tests/run-make/link-cfg/Makefile23
-rw-r--r--tests/run-make/link-cfg/rmake.rs43
-rw-r--r--tests/run-make/link-dedup/rmake.rs33
-rw-r--r--tests/run-make/link-eh-frame-terminator/eh_frame-terminator.rs (renamed from tests/run-make/issue-47551/eh_frame-terminator.rs)0
-rw-r--r--tests/run-make/link-eh-frame-terminator/rmake.rs23
-rw-r--r--tests/run-make/llvm-outputs/rmake.rs3
-rw-r--r--tests/run-make/long-linker-command-lines-cmd-exe/Makefile7
-rw-r--r--tests/run-make/long-linker-command-lines-cmd-exe/foo.rs26
-rw-r--r--tests/run-make/long-linker-command-lines-cmd-exe/rmake.rs26
-rw-r--r--tests/run-make/long-linker-command-lines/Makefile8
-rw-r--r--tests/run-make/long-linker-command-lines/foo.rs18
-rw-r--r--tests/run-make/long-linker-command-lines/rmake.rs19
-rw-r--r--tests/run-make/ls-metadata/rmake.rs3
-rw-r--r--tests/run-make/lto-readonly-lib/rmake.rs1
-rw-r--r--tests/run-make/manual-crate-name/rmake.rs3
-rw-r--r--tests/run-make/mte-ffi/bar.h43
-rw-r--r--tests/run-make/mte-ffi/bar_float.c44
-rw-r--r--tests/run-make/mte-ffi/bar_function.c39
-rw-r--r--tests/run-make/mte-ffi/bar_int.c47
-rw-r--r--tests/run-make/mte-ffi/bar_string.c48
-rw-r--r--tests/run-make/mte-ffi/foo_float.rs19
-rw-r--r--tests/run-make/mte-ffi/foo_function.rs17
-rw-r--r--tests/run-make/mte-ffi/foo_int.rs19
-rw-r--r--tests/run-make/mte-ffi/foo_string.rs27
-rw-r--r--tests/run-make/mte-ffi/rmake.rs38
-rw-r--r--tests/run-make/multiple-emits/rmake.rs2
-rw-r--r--tests/run-make/naked-symbol-visibility/a_rust_dylib.rs89
-rw-r--r--tests/run-make/naked-symbol-visibility/rmake.rs98
-rw-r--r--tests/run-make/native-link-modifier-whole-archive/Makefile52
-rw-r--r--tests/run-make/native-link-modifier-whole-archive/rmake.rs86
-rw-r--r--tests/run-make/no-builtins-attribute/Makefile9
-rw-r--r--tests/run-make/no-builtins-attribute/rmake.rs13
-rw-r--r--tests/run-make/no-duplicate-libs/main.rs6
-rw-r--r--tests/run-make/no-duplicate-libs/rmake.rs3
-rw-r--r--tests/run-make/no-intermediate-extras/rmake.rs3
-rw-r--r--tests/run-make/non-unicode-env/rmake.rs3
-rw-r--r--tests/run-make/non-unicode-in-incremental-dir/rmake.rs2
-rw-r--r--tests/run-make/obey-crate-type-flag/rmake.rs3
-rw-r--r--tests/run-make/output-type-permutations/rmake.rs47
-rw-r--r--tests/run-make/parallel-rustc-no-overwrite/rmake.rs3
-rw-r--r--tests/run-make/pdb-buildinfo-cl-cmd/Makefile16
-rw-r--r--tests/run-make/pdb-buildinfo-cl-cmd/rmake.rs39
-rw-r--r--tests/run-make/pdb-buildinfo-cl-cmd/stringlist.txt1
-rw-r--r--tests/run-make/pgo-branch-weights/rmake.rs3
-rw-r--r--tests/run-make/pgo-gen-lto/Makefile11
-rw-r--r--tests/run-make/pgo-gen-lto/rmake.rs22
-rw-r--r--tests/run-make/pgo-indirect-call-promotion/Makefile23
-rw-r--r--tests/run-make/pgo-indirect-call-promotion/rmake.rs33
-rw-r--r--tests/run-make/pretty-print-with-dep-file/rmake.rs3
-rw-r--r--tests/run-make/print-calling-conventions/Makefile4
-rw-r--r--tests/run-make/print-cfg/rmake.rs5
-rw-r--r--tests/run-make/print-check-cfg/rmake.rs3
-rw-r--r--tests/run-make/print-native-static-libs/rmake.rs2
-rw-r--r--tests/run-make/print-target-list/Makefile8
-rw-r--r--tests/run-make/print-target-list/rmake.rs21
-rw-r--r--tests/run-make/print-to-output/rmake.rs5
-rw-r--r--tests/run-make/profile/rmake.rs3
-rw-r--r--tests/run-make/raw-dylib-alt-calling-convention/Makefile24
-rw-r--r--tests/run-make/raw-dylib-alt-calling-convention/rmake.rs32
-rw-r--r--tests/run-make/raw-dylib-c/Makefile28
-rw-r--r--tests/run-make/raw-dylib-c/rmake.rs29
-rw-r--r--tests/run-make/raw-dylib-import-name-type/Makefile17
-rw-r--r--tests/run-make/raw-dylib-import-name-type/rmake.rs37
-rw-r--r--tests/run-make/raw-dylib-link-ordinal/Makefile17
-rw-r--r--tests/run-make/raw-dylib-link-ordinal/rmake.rs34
-rw-r--r--tests/run-make/raw-dylib-stdcall-ordinal/Makefile18
-rw-r--r--tests/run-make/raw-dylib-stdcall-ordinal/rmake.rs41
-rw-r--r--tests/run-make/redundant-libs/Makefile24
-rw-r--r--tests/run-make/redundant-libs/foo.c10
-rw-r--r--tests/run-make/redundant-libs/rmake.rs26
-rw-r--r--tests/run-make/relro-levels/rmake.rs3
-rw-r--r--tests/run-make/repr128-dwarf/rmake.rs7
-rw-r--r--tests/run-make/reproducible-build-2/Makefile27
-rw-r--r--tests/run-make/reproducible-build-2/rmake.rs47
-rw-r--r--tests/run-make/reset-codegen-1/rmake.rs3
-rw-r--r--tests/run-make/resolve-rename/rmake.rs3
-rw-r--r--tests/run-make/rlib-format-packed-bundled-libs-2/Makefile27
-rw-r--r--tests/run-make/rlib-format-packed-bundled-libs-2/rmake.rs28
-rw-r--r--tests/run-make/rlib-format-packed-bundled-libs-3/rmake.rs2
-rw-r--r--tests/run-make/run-in-tmpdir-self-test/rmake.rs2
-rw-r--r--tests/run-make/rust-lld-by-default-beta-stable/rmake.rs3
-rw-r--r--tests/run-make/rust-lld-by-default-nightly/rmake.rs1
-rw-r--r--tests/run-make/rust-lld-compress-debug-sections/main.rs1
-rw-r--r--tests/run-make/rust-lld-compress-debug-sections/rmake.rs39
-rw-r--r--tests/run-make/rust-lld-custom-target/rmake.rs1
-rw-r--r--tests/run-make/rust-lld/rmake.rs15
-rw-r--r--tests/run-make/rustdoc-default-output/output-default.stdout (renamed from tests/run-make/issue-88756-default-output/output-default.stdout)0
-rw-r--r--tests/run-make/rustdoc-default-output/rmake.rs16
-rw-r--r--tests/run-make/rustdoc-determinism/rmake.rs3
-rw-r--r--tests/run-make/rustdoc-io-error/rmake.rs11
-rw-r--r--tests/run-make/rustdoc-output-path/rmake.rs3
-rw-r--r--tests/run-make/rustdoc-scrape-examples-macros/rmake.rs3
-rw-r--r--tests/run-make/rustdoc-scrape-examples-remap/scrape.rs3
-rw-r--r--tests/run-make/rustdoc-test-args/rmake.rs3
-rw-r--r--tests/run-make/rustdoc-themes/rmake.rs3
-rw-r--r--tests/run-make/rustdoc-verify-output-files/rmake.rs3
-rw-r--r--tests/run-make/sepcomp-cci-copies/rmake.rs5
-rw-r--r--tests/run-make/sepcomp-inlining/rmake.rs5
-rw-r--r--tests/run-make/sepcomp-separate/rmake.rs5
-rw-r--r--tests/run-make/share-generics-dylib/Makefile23
-rw-r--r--tests/run-make/share-generics-dylib/rmake.rs30
-rw-r--r--tests/run-make/simd-ffi/Makefile47
-rw-r--r--tests/run-make/simd-ffi/rmake.rs63
-rw-r--r--tests/run-make/stable-symbol-names/Makefile41
-rw-r--r--tests/run-make/stable-symbol-names/rmake.rs68
-rw-r--r--tests/run-make/static-pie/rmake.rs4
-rw-r--r--tests/run-make/staticlib-dylib-linkage/Makefile21
-rw-r--r--tests/run-make/staticlib-dylib-linkage/rmake.rs36
-rw-r--r--tests/run-make/stdin-rustc/rmake.rs3
-rw-r--r--tests/run-make/stdin-rustdoc/rmake.rs3
-rw-r--r--tests/run-make/suspicious-library/rmake.rs3
-rw-r--r--tests/run-make/symbol-visibility/Makefile123
-rw-r--r--tests/run-make/symbol-visibility/rmake.rs167
-rw-r--r--tests/run-make/thumb-none-cortex-m/Makefile38
-rw-r--r--tests/run-make/thumb-none-cortex-m/rmake.rs59
-rw-r--r--tests/run-make/thumb-none-qemu/Makefile27
-rw-r--r--tests/run-make/thumb-none-qemu/example/.cargo/config.toml (renamed from tests/run-make/thumb-none-qemu/example/.cargo/config)5
-rw-r--r--tests/run-make/thumb-none-qemu/example/src/main.rs5
-rw-r--r--tests/run-make/thumb-none-qemu/rmake.rs62
-rw-r--r--tests/run-make/thumb-none-qemu/script.sh20
-rw-r--r--tests/run-make/used/rmake.rs8
-rw-r--r--tests/run-make/used/used.rs2
-rw-r--r--tests/run-make/volatile-intrinsics/rmake.rs3
-rw-r--r--tests/run-make/wasm-custom-section/rmake.rs3
-rw-r--r--tests/run-make/wasm-custom-sections-opt/rmake.rs3
-rw-r--r--tests/run-make/wasm-export-all-symbols/rmake.rs3
-rw-r--r--tests/run-make/wasm-import-module/rmake.rs3
-rw-r--r--tests/run-make/wasm-override-linker/rmake.rs4
-rw-r--r--tests/run-make/wasm-spurious-import/rmake.rs3
-rw-r--r--tests/run-make/wasm-symbols-different-module/rmake.rs3
-rw-r--r--tests/run-make/wasm-symbols-not-exported/rmake.rs3
-rw-r--r--tests/run-make/wasm-symbols-not-imported/rmake.rs3
-rw-r--r--tests/run-make/weird-output-filenames/rmake.rs3
-rw-r--r--tests/run-make/windows-binary-no-external-deps/rmake.rs3
-rw-r--r--tests/run-make/windows-ws2_32/rmake.rs3
-rw-r--r--tests/run-make/zero-extend-abi-param-passing/param_passing.rs2
-rw-r--r--tests/run-make/zero-extend-abi-param-passing/rmake.rs15
-rw-r--r--tests/rustdoc-gui/code-example-buttons.goml96
-rw-r--r--tests/rustdoc-gui/copy-code.goml54
-rw-r--r--tests/rustdoc-gui/duplicate-macro-reexport.goml4
-rw-r--r--tests/rustdoc-gui/font-weight.goml4
-rw-r--r--tests/rustdoc-gui/item-info.goml4
-rw-r--r--tests/rustdoc-gui/label-next-to-symbol.goml21
-rw-r--r--tests/rustdoc-gui/notable-trait.goml8
-rw-r--r--tests/rustdoc-gui/run-on-hover.goml54
-rw-r--r--tests/rustdoc-gui/search-result-color.goml12
-rw-r--r--tests/rustdoc-gui/search-result-impl-disambiguation.goml21
-rw-r--r--tests/rustdoc-gui/sidebar-macro-reexport.goml2
-rw-r--r--tests/rustdoc-gui/sidebar-mobile.goml7
-rw-r--r--tests/rustdoc-gui/sidebar-source-code.goml8
-rw-r--r--tests/rustdoc-gui/source-anchor-scroll.goml2
-rw-r--r--tests/rustdoc-gui/src/lib2/another_mod/mod.rs20
-rw-r--r--tests/rustdoc-js/self-is-not-generic.js22
-rw-r--r--tests/rustdoc-js/self-is-not-generic.rs11
-rw-r--r--tests/rustdoc-json/impl-trait-in-assoc-type.rs29
-rw-r--r--tests/rustdoc-json/impls/pub_for_hidden_private.rs10
-rw-r--r--tests/rustdoc-json/primitives/use_primitive.rs1
-rw-r--r--tests/rustdoc-json/pub_mod_in_private_mod.rs6
-rw-r--r--tests/rustdoc-json/the_smallest.rs5
-rw-r--r--tests/rustdoc-ui/doctest/doctest-no-run-invalid-langstring-124577.rs12
-rw-r--r--tests/rustdoc-ui/doctest/doctest-no-run-invalid-langstring-124577.stdout5
-rw-r--r--tests/rustdoc-ui/ice-unresolved-import-100241.stderr5
-rw-r--r--tests/rustdoc-ui/intra-doc/.gitattributes2
-rw-r--r--tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr5
-rw-r--r--tests/rustdoc-ui/intra-doc/warning-crlf.rs52
-rw-r--r--tests/rustdoc-ui/issues/issue-61732.stderr5
-rw-r--r--tests/rustdoc-ui/issues/issue-81662-shortness.rs2
-rw-r--r--tests/rustdoc-ui/issues/issue-81662-shortness.stdout2
-rw-r--r--tests/rustdoc-ui/remap-path-prefix-lint.rs10
-rw-r--r--tests/rustdoc-ui/remap-path-prefix-lint.stderr14
-rw-r--r--tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/q.rs2
-rw-r--r--tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/t.rs4
-rw-r--r--tests/rustdoc/cross-crate-info/cargo-transitive-no-index/s.rs16
-rw-r--r--tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/q.rs5
-rw-r--r--tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/t.rs7
-rw-r--r--tests/rustdoc/cross-crate-info/cargo-transitive/s.rs24
-rw-r--r--tests/rustdoc/cross-crate-info/cargo-two-no-index/auxiliary/f.rs2
-rw-r--r--tests/rustdoc/cross-crate-info/cargo-two-no-index/e.rs14
-rw-r--r--tests/rustdoc/cross-crate-info/cargo-two/auxiliary/f.rs5
-rw-r--r--tests/rustdoc/cross-crate-info/cargo-two/e.rs21
-rw-r--r--tests/rustdoc/cross-crate-info/index-on-last/auxiliary/f.rs2
-rw-r--r--tests/rustdoc/cross-crate-info/index-on-last/e.rs20
-rw-r--r--tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/q.rs5
-rw-r--r--tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/r.rs7
-rw-r--r--tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/s.rs8
-rw-r--r--tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/t.rs7
-rw-r--r--tests/rustdoc/cross-crate-info/kitchen-sink/i.rs30
-rw-r--r--tests/rustdoc/cross-crate-info/single-crate-baseline/q.rs12
-rw-r--r--tests/rustdoc/cross-crate-info/single-crate-no-index/q.rs6
-rw-r--r--tests/rustdoc/cross-crate-info/transitive/auxiliary/q.rs2
-rw-r--r--tests/rustdoc/cross-crate-info/transitive/auxiliary/t.rs4
-rw-r--r--tests/rustdoc/cross-crate-info/transitive/s.rs6
-rw-r--r--tests/rustdoc/cross-crate-info/two/auxiliary/f.rs2
-rw-r--r--tests/rustdoc/cross-crate-info/two/e.rs6
-rw-r--r--tests/rustdoc/cross-crate-info/working-dir-examples/q.rs10
-rw-r--r--tests/rustdoc/cross-crate-info/write-docs-somewhere-else/auxiliary/f.rs3
-rw-r--r--tests/rustdoc/cross-crate-info/write-docs-somewhere-else/e.rs14
-rw-r--r--tests/rustdoc/extremely_long_typename.extremely_long_typename.html1
-rw-r--r--tests/rustdoc/extremely_long_typename.rs7
-rw-r--r--tests/rustdoc/item-desc-list-at-start.item-table.html2
-rw-r--r--tests/rustdoc/negative-impl-no-items.rs26
-rw-r--r--tests/rustdoc/playground-arg.rs2
-rw-r--r--tests/rustdoc/playground-syntax-error.rs2
-rw-r--r--tests/rustdoc/playground.rs6
-rw-r--r--tests/rustdoc/type-alias/impl_trait_in_assoc_type.rs17
-rw-r--r--tests/rustdoc/unsafe-extern-blocks.rs3
-rw-r--r--tests/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent.rs1
-rw-r--r--tests/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent.stderr20
-rw-r--r--tests/ui/abi/large-byval-align.rs (renamed from tests/crashes/121444.rs)6
-rw-r--r--tests/ui/asm/aarch64/type-check-2.rs18
-rw-r--r--tests/ui/asm/aarch64/type-check-2.stderr34
-rw-r--r--tests/ui/asm/invalid-const-operand.rs51
-rw-r--r--tests/ui/asm/invalid-const-operand.stderr86
-rw-r--r--tests/ui/asm/invalid-sym-operand.rs34
-rw-r--r--tests/ui/asm/invalid-sym-operand.stderr26
-rw-r--r--tests/ui/asm/naked-functions.rs3
-rw-r--r--tests/ui/asm/parse-error.rs15
-rw-r--r--tests/ui/asm/parse-error.stderr40
-rw-r--r--tests/ui/asm/type-check-1.rs46
-rw-r--r--tests/ui/asm/type-check-1.stderr88
-rw-r--r--tests/ui/asm/x86_64/type-check-2.rs20
-rw-r--r--tests/ui/asm/x86_64/type-check-2.stderr42
-rw-r--r--tests/ui/associated-type-bounds/name-same-as-generic-type-issue-128249.rs15
-rw-r--r--tests/ui/associated-type-bounds/name-same-as-generic-type-issue-128249.stderr51
-rw-r--r--tests/ui/associated-types/associated-types-outlives.stderr2
-rw-r--r--tests/ui/async-await/async-closures/box-deref-in-debuginfo.rs35
-rw-r--r--tests/ui/async-await/async-closures/fn-exception-target-features.rs17
-rw-r--r--tests/ui/async-await/async-closures/fn-exception-target-features.stderr17
-rw-r--r--tests/ui/async-await/async-closures/fn-exception.rs21
-rw-r--r--tests/ui/async-await/async-closures/fn-exception.stderr31
-rw-r--r--tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs17
-rw-r--r--tests/ui/async-await/for-await-consumes-iter.rs2
-rw-r--r--tests/ui/async-await/for-await-passthrough.rs2
-rw-r--r--tests/ui/async-await/for-await.rs2
-rw-r--r--tests/ui/async-await/in-trait/generics-mismatch.rs2
-rw-r--r--tests/ui/async-await/in-trait/generics-mismatch.stderr2
-rw-r--r--tests/ui/async-await/unreachable-lint-2.rs15
-rw-r--r--tests/ui/async-await/unreachable-lint-2.stderr17
-rw-r--r--tests/ui/attributes/check-builtin-attr-ice.rs58
-rw-r--r--tests/ui/attributes/check-builtin-attr-ice.stderr21
-rw-r--r--tests/ui/attributes/check-cfg_attr-ice.rs68
-rw-r--r--tests/ui/attributes/check-cfg_attr-ice.stderr101
-rw-r--r--tests/ui/attributes/field-attributes-vis-unresolved.stderr10
-rw-r--r--tests/ui/attributes/no-sanitize.rs34
-rw-r--r--tests/ui/attributes/no-sanitize.stderr55
-rw-r--r--tests/ui/attributes/optimize.rs28
-rw-r--r--tests/ui/attributes/optimize.stderr20
-rw-r--r--tests/ui/attributes/unsafe/derive-unsafe-attributes.rs11
-rw-r--r--tests/ui/attributes/unsafe/derive-unsafe-attributes.stderr61
-rw-r--r--tests/ui/attributes/unsafe/double-unsafe-attributes.stderr2
-rw-r--r--tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs31
-rw-r--r--tests/ui/attributes/unsafe/extraneous-unsafe-attributes.stderr66
-rw-r--r--tests/ui/attributes/unsafe/proc-unsafe-attributes.rs37
-rw-r--r--tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr119
-rw-r--r--tests/ui/attributes/unsafe/unsafe-attributes.rs6
-rw-r--r--tests/ui/attributes/unsafe/unsafe-safe-attribute.stderr2
-rw-r--r--tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr2
-rw-r--r--tests/ui/augmented-assignments.rs1
-rw-r--r--tests/ui/augmented-assignments.stderr7
-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/binop-move-semantics.stderr4
-rw-r--r--tests/ui/borrowck/borrow-tuple-fields.stderr10
-rw-r--r--tests/ui/borrowck/borrowck-bad-nested-calls-move.stderr4
-rw-r--r--tests/ui/borrowck/borrowck-field-sensitivity.stderr10
-rw-r--r--tests/ui/borrowck/borrowck-issue-48962.stderr5
-rw-r--r--tests/ui/borrowck/borrowck-loan-blocks-move-cc.stderr10
-rw-r--r--tests/ui/borrowck/borrowck-loan-blocks-move.stderr5
-rw-r--r--tests/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr5
-rw-r--r--tests/ui/borrowck/borrowck-move-mut-base-ptr.stderr2
-rw-r--r--tests/ui/borrowck/borrowck-move-subcomponent.stderr2
-rw-r--r--tests/ui/borrowck/borrowck-multiple-captures.stderr15
-rw-r--r--tests/ui/borrowck/borrowck-overloaded-index-move-index.stderr10
-rw-r--r--tests/ui/borrowck/borrowck-unary-move.stderr2
-rw-r--r--tests/ui/borrowck/clone-on-ref.stderr4
-rw-r--r--tests/ui/borrowck/issue-101119.stderr8
-rw-r--r--tests/ui/btreemap/btreemap_dropck.stderr5
-rw-r--r--tests/ui/cast/dyn-tails-need-normalization.rs21
-rw-r--r--tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.current.stderr (renamed from tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.stderr)2
-rw-r--r--tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.next.stderr15
-rw-r--r--tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.rs3
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs-allow.rs4
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.debug_assertions_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.overflow_checks_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.panic_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.proc_macro_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.relocation_model_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.rs35
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.sanitize_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.sanitizer_cfi_generalize_pointers_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.sanitizer_cfi_normalize_integers_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.target_abi_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.target_arch_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.target_endian_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.target_env_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.target_family_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.target_feature_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_equal_alignment_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_load_store_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.target_os_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.target_pointer_width_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.target_thread_local_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.target_vendor_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.test_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.ub_checks_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.unix_.stderr8
-rw-r--r--tests/ui/cfg/disallowed-cli-cfgs.windows_.stderr8
-rw-r--r--tests/ui/check-cfg/mix.stderr2
-rw-r--r--tests/ui/check-cfg/well-known-values.stderr2
-rw-r--r--tests/ui/closures/2229_closure_analysis/run_pass/multivariant.rs3
-rw-r--r--tests/ui/codemap_tests/huge_multispan_highlight.svg2
-rw-r--r--tests/ui/coherence/normalize-for-errors.next.stderr1
-rw-r--r--tests/ui/coherence/normalize-for-errors.rs1
-rw-r--r--tests/ui/coherence/re-rebalance-coherence.rs1
-rw-r--r--tests/ui/coherence/super-traits/super-trait-knowable-1.current.stderr13
-rw-r--r--tests/ui/coherence/super-traits/super-trait-knowable-1.rs19
-rw-r--r--tests/ui/coherence/super-traits/super-trait-knowable-2.rs33
-rw-r--r--tests/ui/coherence/super-traits/super-trait-knowable-3.current.stderr13
-rw-r--r--tests/ui/coherence/super-traits/super-trait-knowable-3.rs22
-rw-r--r--tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.rs28
-rw-r--r--tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.stderr160
-rw-r--r--tests/ui/const-generics/cross_crate_complex.rs1
-rw-r--r--tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.rs10
-rw-r--r--tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr10
-rw-r--r--tests/ui/const-generics/defaults/repr-c-issue-82792.rs1
-rw-r--r--tests/ui/const-generics/generic_const_exprs/associated-consts.rs3
-rw-r--r--tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.rs7
-rw-r--r--tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr15
-rw-r--r--tests/ui/const-generics/generic_const_exprs/issue-105608.stderr4
-rw-r--r--tests/ui/const-generics/generic_const_exprs/issue-80742.stderr2
-rw-r--r--tests/ui/const-generics/generic_const_exprs/no_where_clause.rs1
-rw-r--r--tests/ui/const-generics/generic_const_exprs/no_where_clause.stderr13
-rw-r--r--tests/ui/const-generics/issues/issue-86535-2.rs1
-rw-r--r--tests/ui/const-generics/issues/issue-86535.rs1
-rw-r--r--tests/ui/const-generics/transparent-maybeunit-array-wrapper.rs1
-rw-r--r--tests/ui/const-ptr/forbidden_slices.stderr4
-rw-r--r--tests/ui/const-ptr/out_of_bounds_read.stderr6
-rw-r--r--tests/ui/consts/const-compare-bytes-ub.stderr10
-rw-r--r--tests/ui/consts/const-deref-ptr.stderr2
-rw-r--r--tests/ui/consts/const-eval/const_raw_ptr_ops2.stderr4
-rw-r--r--tests/ui/consts/const-eval/nonnull_as_ref_ub.stderr2
-rw-r--r--tests/ui/consts/const-eval/raw-bytes.32bit.stderr22
-rw-r--r--tests/ui/consts/const-eval/raw-bytes.64bit.stderr22
-rw-r--r--tests/ui/consts/const-eval/raw-bytes.rs4
-rw-r--r--tests/ui/consts/const-eval/raw-pointer-ub.rs2
-rw-r--r--tests/ui/consts/const-eval/raw-pointer-ub.stderr2
-rw-r--r--tests/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr40
-rw-r--r--tests/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr40
-rw-r--r--tests/ui/consts/const-eval/ub-incorrect-vtable.rs4
-rw-r--r--tests/ui/consts/const-eval/ub-nonnull.stderr2
-rw-r--r--tests/ui/consts/const-eval/ub-wide-ptr.rs14
-rw-r--r--tests/ui/consts/const-eval/ub-wide-ptr.stderr83
-rw-r--r--tests/ui/consts/const-eval/write-to-uninhabited-enum-variant.rs4
-rw-r--r--tests/ui/consts/copy-intrinsic.rs4
-rw-r--r--tests/ui/consts/copy-intrinsic.stderr4
-rw-r--r--tests/ui/consts/offset_from_ub.rs7
-rw-r--r--tests/ui/consts/offset_from_ub.stderr38
-rw-r--r--tests/ui/consts/offset_ub.rs3
-rw-r--r--tests/ui/consts/offset_ub.stderr44
-rw-r--r--tests/ui/coroutine/gen_block.none.stderr2
-rw-r--r--tests/ui/coroutine/invalid_attr_usage.rs11
-rw-r--r--tests/ui/coroutine/invalid_attr_usage.stderr14
-rw-r--r--tests/ui/delegation/explicit-paths.rs2
-rw-r--r--tests/ui/delegation/explicit-paths.stderr46
-rw-r--r--tests/ui/delegation/generics/free-fn-to-free-fn-pass.rs28
-rw-r--r--tests/ui/delegation/generics/free-fn-to-free-fn.rs27
-rw-r--r--tests/ui/delegation/generics/free-fn-to-free-fn.stderr54
-rw-r--r--tests/ui/delegation/generics/free-fn-to-trait-method-pass.rs30
-rw-r--r--tests/ui/delegation/generics/free-fn-to-trait-method.rs56
-rw-r--r--tests/ui/delegation/generics/free-fn-to-trait-method.stderr88
-rw-r--r--tests/ui/delegation/ice-issue-124347.rs3
-rw-r--r--tests/ui/delegation/ice-issue-124347.stderr15
-rw-r--r--tests/ui/delegation/not-supported.rs37
-rw-r--r--tests/ui/delegation/not-supported.stderr109
-rw-r--r--tests/ui/delegation/target-expr.rs5
-rw-r--r--tests/ui/delegation/target-expr.stderr43
-rw-r--r--tests/ui/derives/clone-debug-dead-code-in-the-same-struct.rs4
-rw-r--r--tests/ui/derives/clone-debug-dead-code-in-the-same-struct.stderr16
-rw-r--r--tests/ui/derives/deriving-with-repr-packed.rs11
-rw-r--r--tests/ui/derives/deriving-with-repr-packed.stderr74
-rw-r--r--tests/ui/deriving/deriving-all-codegen.rs10
-rw-r--r--tests/ui/deriving/deriving-all-codegen.stderr63
-rw-r--r--tests/ui/deriving/deriving-all-codegen.stdout20
-rw-r--r--tests/ui/deriving/deriving-smart-pointer-expanded.rs22
-rw-r--r--tests/ui/deriving/deriving-smart-pointer-expanded.stdout44
-rw-r--r--tests/ui/deriving/deriving-smart-pointer-neg.rs30
-rw-r--r--tests/ui/deriving/deriving-smart-pointer-neg.stderr26
-rw-r--r--tests/ui/deriving/smart-pointer-bounds-issue-127647.rs78
-rw-r--r--tests/ui/diagnostic_namespace/do_not_recommend/do_not_apply_attribute_without_feature_flag.rs21
-rw-r--r--tests/ui/diagnostic_namespace/do_not_recommend/do_not_apply_attribute_without_feature_flag.stderr21
-rw-r--r--tests/ui/dropck/drop-with-active-borrows-1.stderr5
-rw-r--r--tests/ui/dropck/dropck-empty-array.rs23
-rw-r--r--tests/ui/enum-discriminant/issue-61696.rs1
-rw-r--r--tests/ui/enum-discriminant/niche.rs1
-rw-r--r--tests/ui/error-codes/E0049.stderr4
-rw-r--r--tests/ui/error-codes/E0195.rs4
-rw-r--r--tests/ui/error-codes/E0195.stderr6
-rw-r--r--tests/ui/error-codes/E0283.stderr8
-rw-r--r--tests/ui/error-codes/E0396-fixed.stderr2
-rw-r--r--tests/ui/error-codes/E0432.stderr5
-rw-r--r--tests/ui/error-codes/E0504.stderr2
-rw-r--r--tests/ui/error-codes/E0505.stderr2
-rw-r--r--tests/ui/error-codes/E0790.stderr8
-rw-r--r--tests/ui/extern/extern-types-field-offset.run.stderr2
-rw-r--r--tests/ui/extern/extern-types-size_of_val.align.run.stderr2
-rw-r--r--tests/ui/extern/extern-types-size_of_val.size.run.stderr2
-rw-r--r--tests/ui/feature-gates/feature-gate-coroutines.none.stderr2
-rw-r--r--tests/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr21
-rw-r--r--tests/ui/feature-gates/feature-gate-exhaustive-patterns.rs2
-rw-r--r--tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr10
-rw-r--r--tests/ui/feature-gates/feature-gate-offset-of-enum.rs2
-rw-r--r--tests/ui/feature-gates/feature-gate-offset-of-enum.stderr8
-rw-r--r--tests/ui/feature-gates/feature-gate-offset-of-nested.rs28
-rw-r--r--tests/ui/feature-gates/feature-gate-offset-of-nested.stderr60
-rw-r--r--tests/ui/feature-gates/feature-gate-sha512_sm_x86.rs6
-rw-r--r--tests/ui/feature-gates/feature-gate-sha512_sm_x86.stderr13
-rw-r--r--tests/ui/feature-gates/feature-gate-unsafe-extern-blocks.rs13
-rw-r--r--tests/ui/feature-gates/feature-gate-unsafe-extern-blocks.stderr23
-rw-r--r--tests/ui/feature-gates/version_check.rs17
-rw-r--r--tests/ui/fn/implied-bounds-unnorm-associated-type-4.stderr5
-rw-r--r--tests/ui/fn/implied-bounds-unnorm-associated-type-5.rs1
-rw-r--r--tests/ui/fn/implied-bounds-unnorm-associated-type-5.stderr22
-rw-r--r--tests/ui/fn/implied-bounds-unnorm-associated-type.stderr5
-rw-r--r--tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs2
-rw-r--r--tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr2
-rw-r--r--tests/ui/generic-associated-types/issue-71176.rs2
-rw-r--r--tests/ui/generic-associated-types/issue-71176.stderr18
-rw-r--r--tests/ui/generic-associated-types/missing-bounds.fixed4
-rw-r--r--tests/ui/generic-associated-types/missing-bounds.rs4
-rw-r--r--tests/ui/generic-associated-types/missing-bounds.stderr18
-rw-r--r--tests/ui/hygiene/panic-location.run.stderr2
-rw-r--r--tests/ui/impl-trait/extra-impl-in-trait-impl.fixed2
-rw-r--r--tests/ui/impl-trait/extra-impl-in-trait-impl.rs2
-rw-r--r--tests/ui/impl-trait/extra-impl-in-trait-impl.stderr8
-rw-r--r--tests/ui/impl-trait/in-trait/cannot-capture-intersection.rs29
-rw-r--r--tests/ui/impl-trait/in-trait/cannot-capture-intersection.stderr13
-rw-r--r--tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.stderr2
-rw-r--r--tests/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.stderr9
-rw-r--r--tests/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.stderr9
-rw-r--r--tests/ui/impl-trait/where-allowed.stderr22
-rw-r--r--tests/ui/imports/import-from-missing-star-2.stderr5
-rw-r--r--tests/ui/imports/import-from-missing-star-3.stderr10
-rw-r--r--tests/ui/imports/import-from-missing-star.stderr5
-rw-r--r--tests/ui/imports/import3.stderr5
-rw-r--r--tests/ui/imports/issue-109343.stderr5
-rw-r--r--tests/ui/imports/issue-1697.rs2
-rw-r--r--tests/ui/imports/issue-1697.stderr5
-rw-r--r--tests/ui/imports/issue-33464.stderr15
-rw-r--r--tests/ui/imports/issue-36881.stderr5
-rw-r--r--tests/ui/imports/issue-37887.stderr5
-rw-r--r--tests/ui/imports/issue-53269.stderr5
-rw-r--r--tests/ui/imports/issue-55457.stderr5
-rw-r--r--tests/ui/imports/issue-55884-2.stderr4
-rw-r--r--tests/ui/imports/issue-81413.stderr5
-rw-r--r--tests/ui/imports/redundant-import-extern-prelude.rs7
-rw-r--r--tests/ui/imports/redundant-import-extern-prelude.stderr14
-rw-r--r--tests/ui/imports/redundant-import-issue-121915-2015.rs5
-rw-r--r--tests/ui/imports/redundant-import-issue-121915-2015.stderr17
-rw-r--r--tests/ui/imports/redundant-import-lang-prelude-attr.rs7
-rw-r--r--tests/ui/imports/redundant-import-lang-prelude-attr.stderr14
-rw-r--r--tests/ui/imports/redundant-import-lang-prelude.rs7
-rw-r--r--tests/ui/imports/redundant-import-lang-prelude.stderr14
-rw-r--r--tests/ui/imports/suggest-remove-issue-121315.rs11
-rw-r--r--tests/ui/imports/suggest-remove-issue-121315.stderr52
-rw-r--r--tests/ui/imports/tool-mod-child.stderr20
-rw-r--r--tests/ui/imports/unresolved-imports-used.stderr20
-rw-r--r--tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.rs24
-rw-r--r--tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.stderr32
-rw-r--r--tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.rs28
-rw-r--r--tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.stderr32
-rw-r--r--tests/ui/inline-const/using-late-bound-from-closure.rs16
-rw-r--r--tests/ui/inline-const/using-late-bound-from-closure.stderr19
-rw-r--r--tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs2
-rw-r--r--tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr5
-rw-r--r--tests/ui/issues/issue-19380.rs1
-rw-r--r--tests/ui/issues/issue-19380.stderr25
-rw-r--r--tests/ui/issues/issue-26812.rs4
-rw-r--r--tests/ui/issues/issue-26812.stderr25
-rw-r--r--tests/ui/issues/issue-48728.current.stderr (renamed from tests/ui/issues/issue-48728.stderr)2
-rw-r--r--tests/ui/issues/issue-48728.rs7
-rw-r--r--tests/ui/issues/issue-5708.rs1
-rw-r--r--tests/ui/json/json-bom-plus-crlf-multifile.stderr8
-rw-r--r--tests/ui/json/json-bom-plus-crlf.stderr8
-rw-r--r--tests/ui/json/json-short.stderr2
-rw-r--r--tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr5
-rw-r--r--tests/ui/lifetimes/elided-lint-in-mod.rs11
-rw-r--r--tests/ui/lifetimes/elided-lint-in-mod.stderr20
-rw-r--r--tests/ui/lifetimes/unusual-rib-combinations.stderr11
-rw-r--r--tests/ui/lint/command-line-lint-group-forbid.stderr1
-rw-r--r--tests/ui/lint/dead-code/allow-unconstructed-pub-struct.rs33
-rw-r--r--tests/ui/lint/dead-code/issue-59003.rs2
-rw-r--r--tests/ui/lint/dead-code/lint-dead-code-1.rs5
-rw-r--r--tests/ui/lint/dead-code/lint-dead-code-1.stderr26
-rw-r--r--tests/ui/lint/dead-code/lint-unused-adt-appeared-in-pattern.rs37
-rw-r--r--tests/ui/lint/dead-code/lint-unused-adt-appeared-in-pattern.stderr20
-rw-r--r--tests/ui/lint/dead-code/not-lint-used-adt-appeared-in-pattern.rs32
-rw-r--r--tests/ui/lint/dead-code/offset-of-correct-param-env.rs1
-rw-r--r--tests/ui/lint/dead-code/offset-of.rs1
-rw-r--r--tests/ui/lint/dead-code/offset-of.stderr12
-rw-r--r--tests/ui/lint/dead-code/unused-adt-impl-pub-trait-with-assoc-const.rs36
-rw-r--r--tests/ui/lint/dead-code/unused-adt-impl-pub-trait-with-assoc-const.stderr20
-rw-r--r--tests/ui/lint/dead-code/unused-assoc-const.rs20
-rw-r--r--tests/ui/lint/dead-code/unused-assoc-const.stderr16
-rw-r--r--tests/ui/lint/dead-code/unused-impl-for-non-adts.rs45
-rw-r--r--tests/ui/lint/dead-code/unused-impl-for-non-adts.stderr20
-rw-r--r--tests/ui/lint/dead-code/unused-pub-struct.rs48
-rw-r--r--tests/ui/lint/dead-code/unused-pub-struct.stderr14
-rw-r--r--tests/ui/lint/dead-code/unused-struct-derive-default.rs1
-rw-r--r--tests/ui/lint/dead-code/unused-struct-derive-default.stderr1
-rw-r--r--tests/ui/lint/dead-code/unused-trait-with-assoc-ty.rs11
-rw-r--r--tests/ui/lint/dead-code/unused-trait-with-assoc-ty.stderr20
-rw-r--r--tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr1
-rw-r--r--tests/ui/lint/force-warn/lint-group-allow-warnings.stderr1
-rw-r--r--tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr1
-rw-r--r--tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr1
-rw-r--r--tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr1
-rw-r--r--tests/ui/lint/group-forbid-always-trumps-cli.stderr1
-rw-r--r--tests/ui/lint/lint-unnecessary-parens.fixed8
-rw-r--r--tests/ui/lint/lint-unnecessary-parens.rs8
-rw-r--r--tests/ui/lint/lint-unnecessary-parens.stderr88
-rw-r--r--tests/ui/lint/negative_literals.rs2
-rw-r--r--tests/ui/lint/negative_literals.stderr28
-rw-r--r--tests/ui/lint/unaligned_references.current.stderr (renamed from tests/ui/lint/unaligned_references.stderr)26
-rw-r--r--tests/ui/lint/unaligned_references.next.stderr133
-rw-r--r--tests/ui/lint/unaligned_references.rs26
-rw-r--r--tests/ui/lint/unsafe_code/unsafe-extern-blocks.rs1
-rw-r--r--tests/ui/lint/unsafe_code/unsafe-extern-blocks.stderr4
-rw-r--r--tests/ui/lint/unused/issue-59896.rs5
-rw-r--r--tests/ui/lint/unused/issue-59896.stderr17
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-glob-parent.rs4
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-glob-parent.stderr17
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-glob.rs4
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-glob.stderr16
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-issue-71450.rs5
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-issue-71450.stderr17
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.rs14
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.stderr44
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.rs8
-rw-r--r--tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.stderr26
-rw-r--r--tests/ui/lint/use-redundant/use-redundant.rs4
-rw-r--r--tests/ui/lint/use-redundant/use-redundant.stderr19
-rw-r--r--tests/ui/lint/wide_pointer_comparisons.stderr38
-rw-r--r--tests/ui/macros/expr_2024_underscore_expr.edi2021.stderr32
-rw-r--r--tests/ui/macros/expr_2024_underscore_expr.edi2024.stderr17
-rw-r--r--tests/ui/macros/expr_2024_underscore_expr.rs24
-rw-r--r--tests/ui/methods/dont-ice-on-object-lookup-w-error-region.rs11
-rw-r--r--tests/ui/methods/dont-ice-on-object-lookup-w-error-region.stderr11
-rw-r--r--tests/ui/moves/move-fn-self-receiver.stderr9
-rw-r--r--tests/ui/never_type/never-result.rs5
-rw-r--r--tests/ui/nll/closure-access-spans.stderr15
-rw-r--r--tests/ui/nll/issue-27282-move-match-input-into-guard.stderr10
-rw-r--r--tests/ui/nll/issue-27282-move-ref-mut-into-guard.fixed23
-rw-r--r--tests/ui/nll/issue-27282-move-ref-mut-into-guard.rs2
-rw-r--r--tests/ui/nll/issue-27282-move-ref-mut-into-guard.stderr8
-rw-r--r--tests/ui/nll/issue-27282-mutation-in-guard.stderr8
-rw-r--r--tests/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr4
-rw-r--r--tests/ui/nll/match-guards-always-borrow.fixed66
-rw-r--r--tests/ui/nll/match-guards-always-borrow.rs1
-rw-r--r--tests/ui/nll/match-guards-always-borrow.stderr12
-rw-r--r--tests/ui/nll/polonius/polonius-smoke-test.stderr12
-rw-r--r--tests/ui/offset-of/offset-of-enum.rs2
-rw-r--r--tests/ui/offset-of/offset-of-private.rs2
-rw-r--r--tests/ui/offset-of/offset-of-self.rs2
-rw-r--r--tests/ui/offset-of/offset-of-self.stderr14
-rw-r--r--tests/ui/offset-of/offset-of-slice-normalized.rs37
-rw-r--r--tests/ui/offset-of/offset-of-slice.rs2
-rw-r--r--tests/ui/offset-of/offset-of-tuple-nested.rs2
-rw-r--r--tests/ui/offset-of/offset-of-tuple.rs1
-rw-r--r--tests/ui/offset-of/offset-of-tuple.stderr66
-rw-r--r--tests/ui/offset-of/offset-of-unstable-with-feature.rs2
-rw-r--r--tests/ui/offset-of/offset-of-unstable.rs2
-rw-r--r--tests/ui/offset-of/offset-of-unstable.stderr16
-rw-r--r--tests/ui/panics/panic-in-cleanup.run.stderr2
-rw-r--r--tests/ui/panics/panic-in-ffi.run.stderr2
-rw-r--r--tests/ui/parser/brace-in-let-chain.stderr8
-rw-r--r--tests/ui/parser/issues/issue-105366.fixed1
-rw-r--r--tests/ui/parser/issues/issue-105366.rs1
-rw-r--r--tests/ui/parser/issues/issue-105366.stderr2
-rw-r--r--tests/ui/parser/mismatched-delimiter-corner-case-issue-127868.rs6
-rw-r--r--tests/ui/parser/mismatched-delimiter-corner-case-issue-127868.stderr30
-rw-r--r--tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.fixed3
-rw-r--r--tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.rs3
-rw-r--r--tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.stderr10
-rw-r--r--tests/ui/parser/removed-syntax/removed-syntax-box.stderr10
-rw-r--r--tests/ui/parser/suggest-remove-compount-assign-let-ice.rs16
-rw-r--r--tests/ui/parser/suggest-remove-compount-assign-let-ice.stderr26
-rw-r--r--tests/ui/parser/unsafe-foreign-mod-2.rs2
-rw-r--r--tests/ui/parser/unsafe-foreign-mod-2.stderr18
-rw-r--r--tests/ui/parser/unsafe-foreign-mod.rs6
-rw-r--r--tests/ui/parser/unsafe-foreign-mod.stderr12
-rw-r--r--tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr16
-rw-r--r--tests/ui/pattern/issue-22546.rs2
-rw-r--r--tests/ui/pattern/issue-22546.stderr10
-rw-r--r--tests/ui/pattern/usefulness/always-inhabited-union-ref.exhaustive_patterns.stderr6
-rw-r--r--tests/ui/pattern/usefulness/always-inhabited-union-ref.normal.stderr (renamed from tests/ui/pattern/usefulness/always-inhabited-union-ref.min_exhaustive_patterns.stderr)6
-rw-r--r--tests/ui/pattern/usefulness/always-inhabited-union-ref.rs3
-rw-r--r--tests/ui/pattern/usefulness/empty-match-check-notes.exhaustive_patterns.stderr6
-rw-r--r--tests/ui/pattern/usefulness/empty-match-check-notes.normal.stderr7
-rw-r--r--tests/ui/pattern/usefulness/empty-match-check-notes.rs6
-rw-r--r--tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr93
-rw-r--r--tests/ui/pattern/usefulness/empty-match.normal.stderr93
-rw-r--r--tests/ui/pattern/usefulness/empty-match.rs7
-rw-r--r--tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr100
-rw-r--r--tests/ui/pattern/usefulness/empty-types.never_pats.stderr357
-rw-r--r--tests/ui/pattern/usefulness/empty-types.normal.stderr355
-rw-r--r--tests/ui/pattern/usefulness/empty-types.rs92
-rw-r--r--tests/ui/pattern/usefulness/explain-unreachable-pats.rs1
-rw-r--r--tests/ui/pattern/usefulness/explain-unreachable-pats.stderr24
-rw-r--r--tests/ui/pattern/usefulness/impl-trait.rs1
-rw-r--r--tests/ui/pattern/usefulness/impl-trait.stderr32
-rw-r--r--tests/ui/pattern/usefulness/match-privately-empty.exhaustive_patterns.stderr2
-rw-r--r--tests/ui/pattern/usefulness/match-privately-empty.normal.stderr21
-rw-r--r--tests/ui/pattern/usefulness/match-privately-empty.rs3
-rw-r--r--tests/ui/pattern/usefulness/slice_of_empty.exhaustive_patterns.stderr2
-rw-r--r--tests/ui/pattern/usefulness/slice_of_empty.normal.stderr30
-rw-r--r--tests/ui/pattern/usefulness/slice_of_empty.rs7
-rw-r--r--tests/ui/pattern/usefulness/uninhabited.rs1
-rw-r--r--tests/ui/polymorphization/inline-tainted-body.rs21
-rw-r--r--tests/ui/polymorphization/inline-tainted-body.stderr30
-rw-r--r--tests/ui/print-calling-conventions.rs2
-rw-r--r--tests/ui/print-calling-conventions.stdout34
-rw-r--r--tests/ui/privacy/issue-75907.stderr2
-rw-r--r--tests/ui/privacy/privacy5.stderr20
-rw-r--r--tests/ui/privacy/restricted/test.stderr5
-rw-r--r--tests/ui/proc-macro/auxiliary/parse-invis-delim-issue-128895.rs44
-rw-r--r--tests/ui/proc-macro/parse-invis-delim-issue-128895.rs14
-rw-r--r--tests/ui/process/println-with-broken-pipe.run.stderr2
-rw-r--r--tests/ui/pub/pub-ident-struct-4.fixed3
-rw-r--r--tests/ui/pub/pub-ident-struct-4.rs3
-rw-r--r--tests/ui/pub/pub-ident-struct-4.stderr6
-rw-r--r--tests/ui/reachable/unreachable-loop-patterns.rs2
-rw-r--r--tests/ui/reachable/unreachable-loop-patterns.stderr4
-rw-r--r--tests/ui/regions/regions-issue-21422.rs1
-rw-r--r--tests/ui/resolve/editions-crate-root-2015.stderr10
-rw-r--r--tests/ui/resolve/extern-prelude-fail.stderr10
-rw-r--r--tests/ui/resolve/issue-82865.stderr5
-rw-r--r--tests/ui/resolve/resolve-bad-visibility.stderr10
-rw-r--r--tests/ui/rfcs/rfc-0000-never_patterns/check.rs8
-rw-r--r--tests/ui/rfcs/rfc-0000-never_patterns/check.stderr22
-rw-r--r--tests/ui/rfcs/rfc-0000-never_patterns/typeck.fail.stderr16
-rw-r--r--tests/ui/rfcs/rfc-0000-never_patterns/typeck.rs1
-rw-r--r--tests/ui/rfcs/rfc-0000-never_patterns/unreachable.exh_pats.stderr14
-rw-r--r--tests/ui/rfcs/rfc-0000-never_patterns/unreachable.normal.stderr44
-rw-r--r--tests/ui/rfcs/rfc-0000-never_patterns/unreachable.rs15
-rw-r--r--tests/ui/rfcs/rfc-0000-never_patterns/unreachable.stderr55
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs11
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr79
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs1
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr8
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs1
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs7
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr64
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs1
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr8
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs1
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns.rs1
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs1
-rw-r--r--tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr10
-rw-r--r--tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs7
-rw-r--r--tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr34
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr4
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr4
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr6
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.stderr4
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/default-keyword.stderr2
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.stderr8
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.stderr8
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.stderr4
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr4
-rw-r--r--tests/ui/rust-2018/edition-lint-inter-outlives/auxiliary/edition-lint-infer-outlives-macro.rs (renamed from tests/ui/rust-2018/auxiliary/edition-lint-infer-outlives-macro.rs)0
-rw-r--r--tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.fixed (renamed from tests/ui/rust-2018/edition-lint-infer-outlives-macro.fixed)0
-rw-r--r--tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.rs (renamed from tests/ui/rust-2018/edition-lint-infer-outlives-macro.rs)0
-rw-r--r--tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.stderr (renamed from tests/ui/rust-2018/edition-lint-infer-outlives-macro.stderr)0
-rw-r--r--tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-multispan.rs (renamed from tests/ui/rust-2018/edition-lint-infer-outlives-multispan.rs)0
-rw-r--r--tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-multispan.stderr (renamed from tests/ui/rust-2018/edition-lint-infer-outlives-multispan.stderr)0
-rw-r--r--tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives.fixed (renamed from tests/ui/rust-2018/edition-lint-infer-outlives.fixed)0
-rw-r--r--tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives.rs (renamed from tests/ui/rust-2018/edition-lint-infer-outlives.rs)0
-rw-r--r--tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives.stderr (renamed from tests/ui/rust-2018/edition-lint-infer-outlives.stderr)0
-rw-r--r--tests/ui/rust-2018/edition-lint-inter-outlives/explicit-outlives-recursive-119228.fixed41
-rw-r--r--tests/ui/rust-2018/edition-lint-inter-outlives/explicit-outlives-recursive-119228.rs41
-rw-r--r--tests/ui/rust-2024/prelude-migration/future-poll-already-future.rs17
-rw-r--r--tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.fixed21
-rw-r--r--tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.stderr16
-rw-r--r--tests/ui/rust-2024/prelude-migration/future-poll-async-block.rs21
-rw-r--r--tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.fixed21
-rw-r--r--tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.stderr16
-rw-r--r--tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.rs21
-rw-r--r--tests/ui/rust-2024/prelude-migration/future-poll-not-future.rs15
-rw-r--r--tests/ui/rust-2024/prelude-migration/in_2024_compatibility.rs17
-rw-r--r--tests/ui/rust-2024/prelude-migration/in_2024_compatibility.stderr17
-rw-r--r--tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.fixed29
-rw-r--r--tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.stderr16
-rw-r--r--tests/ui/rust-2024/prelude-migration/into-future-adt.rs29
-rw-r--r--tests/ui/rust-2024/prelude-migration/into-future-already-into-future.rs24
-rw-r--r--tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.fixed23
-rw-r--r--tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.stderr16
-rw-r--r--tests/ui/rust-2024/prelude-migration/into-future-not-into-future.rs23
-rw-r--r--tests/ui/rust-2024/safe-outside-extern.rs8
-rw-r--r--tests/ui/rust-2024/safe-outside-extern.stderr38
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2021.stderr4
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2024.stderr4
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.rs2
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/extern-items.edition2024.stderr2
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/extern-items.rs2
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.rs3
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.stderr (renamed from tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.gated.stderr)2
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/safe-items.rs2
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.rs3
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.stderr8
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2021.stderr4
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2024.stderr6
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.rs2
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.fixed1
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.rs1
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.stderr4
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2021.stderr4
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2024.stderr4
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.rs2
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.fixed1
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.rs1
-rw-r--r--tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.stderr2
-rw-r--r--tests/ui/sanitizer/cfi/assoc-ty-lifetime-issue-123053.rs (renamed from tests/ui/sanitizer/cfi-assoc-ty-lifetime-issue-123053.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/async-closures.rs (renamed from tests/ui/sanitizer/cfi-async-closures.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/can-reveal-opaques.rs44
-rw-r--r--tests/ui/sanitizer/cfi/canonical-jump-tables-requires-cfi.rs (renamed from tests/ui/sanitizer/cfi-canonical-jump-tables-requires-cfi.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/canonical-jump-tables-requires-cfi.stderr (renamed from tests/ui/sanitizer/cfi-canonical-jump-tables-requires-cfi.stderr)0
-rw-r--r--tests/ui/sanitizer/cfi/closures.rs (renamed from tests/ui/sanitizer/cfi-closures.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/complex-receiver.rs (renamed from tests/ui/sanitizer/cfi-complex-receiver.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/coroutine.rs (renamed from tests/ui/sanitizer/cfi-coroutine.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/drop-in-place.rs (renamed from tests/ui/sanitizer/cfi-drop-in-place.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/drop-no-principal.rs (renamed from tests/ui/sanitizer/cfi-drop-no-principal.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/fn-ptr.rs (renamed from tests/ui/sanitizer/cfi-fn-ptr.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/generalize-pointers-attr-cfg.rs (renamed from tests/ui/sanitizer/cfi-generalize-pointers-attr-cfg.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/generalize-pointers-requires-cfi.rs (renamed from tests/ui/sanitizer/cfi-generalize-pointers-requires-cfi.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/generalize-pointers-requires-cfi.stderr (renamed from tests/ui/sanitizer/cfi-generalize-pointers-requires-cfi.stderr)0
-rw-r--r--tests/ui/sanitizer/cfi/invalid-attr-encoding.rs (renamed from tests/ui/sanitizer/cfi-invalid-attr-cfi-encoding.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/invalid-attr-encoding.stderr (renamed from tests/ui/sanitizer/cfi-invalid-attr-cfi-encoding.stderr)2
-rw-r--r--tests/ui/sanitizer/cfi/is-incompatible-with-kcfi.aarch64.stderr (renamed from tests/ui/sanitizer/cfi-is-incompatible-with-kcfi.aarch64.stderr)0
-rw-r--r--tests/ui/sanitizer/cfi/is-incompatible-with-kcfi.rs (renamed from tests/ui/sanitizer/cfi-is-incompatible-with-kcfi.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/is-incompatible-with-kcfi.x86_64.stderr (renamed from tests/ui/sanitizer/cfi-is-incompatible-with-kcfi.x86_64.stderr)0
-rw-r--r--tests/ui/sanitizer/cfi/normalize-integers-attr-cfg.rs (renamed from tests/ui/sanitizer/cfi-normalize-integers-attr-cfg.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/normalize-integers-requires-cfi.rs (renamed from tests/ui/sanitizer/cfi-normalize-integers-requires-cfi.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/normalize-integers-requires-cfi.stderr (renamed from tests/ui/sanitizer/cfi-normalize-integers-requires-cfi.stderr)0
-rw-r--r--tests/ui/sanitizer/cfi/requires-lto.rs (renamed from tests/ui/sanitizer/cfi-requires-lto.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/requires-lto.stderr (renamed from tests/ui/sanitizer/cfi-requires-lto.stderr)0
-rw-r--r--tests/ui/sanitizer/cfi/self-ref.rs (renamed from tests/ui/sanitizer/cfi-self-ref.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/sized-associated-ty.rs38
-rw-r--r--tests/ui/sanitizer/cfi/supertraits.rs (renamed from tests/ui/sanitizer/cfi-supertraits.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/virtual-auto.rs (renamed from tests/ui/sanitizer/cfi-virtual-auto.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/with-rustc-lto-requires-single-codegen-unit.rs (renamed from tests/ui/sanitizer/cfi-with-rustc-lto-requires-single-codegen-unit.rs)0
-rw-r--r--tests/ui/sanitizer/cfi/with-rustc-lto-requires-single-codegen-unit.stderr (renamed from tests/ui/sanitizer/cfi-with-rustc-lto-requires-single-codegen-unit.stderr)0
-rw-r--r--tests/ui/short-error-format.stderr4
-rw-r--r--tests/ui/span/issue-42234-unknown-receiver-type.full.stderr4
-rw-r--r--tests/ui/span/send-is-not-static-std-sync.stderr6
-rw-r--r--tests/ui/specialization/const_trait_impl.stderr10
-rw-r--r--tests/ui/stable-mir-print/basic_function.stdout6
-rw-r--r--tests/ui/static/static-lifetime.rs1
-rw-r--r--tests/ui/static/static-lifetime.stderr30
-rw-r--r--tests/ui/statics/unsizing-wfcheck-issue-127299.rs17
-rw-r--r--tests/ui/statics/unsizing-wfcheck-issue-127299.stderr87
-rw-r--r--tests/ui/structs-enums/newtype-struct-with-dtor.rs2
-rw-r--r--tests/ui/structs-enums/uninstantiable-struct.rs3
-rw-r--r--tests/ui/structs/field-implied-unsizing-wfcheck.rs32
-rw-r--r--tests/ui/structs/field-implied-unsizing-wfcheck.stderr163
-rw-r--r--tests/ui/suggestions/borrow-for-loop-head.stderr5
-rw-r--r--tests/ui/suggestions/derive-clone-for-eq.fixed1
-rw-r--r--tests/ui/suggestions/derive-clone-for-eq.rs1
-rw-r--r--tests/ui/suggestions/derive-clone-for-eq.stderr4
-rw-r--r--tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.stderr9
-rw-r--r--tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.stderr10
-rw-r--r--tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr10
-rw-r--r--tests/ui/suggestions/option-content-move.fixed2
-rw-r--r--tests/ui/suggestions/option-content-move.rs2
-rw-r--r--tests/ui/suggestions/option-content-move.stderr4
-rw-r--r--tests/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr2
-rw-r--r--tests/ui/target-feature/asm-implied-features-issue-128125.rs10
-rw-r--r--tests/ui/target-feature/implicit-features-cli.rs9
-rw-r--r--tests/ui/target-feature/implicit-features.rs10
-rw-r--r--tests/ui/target-feature/implied-features.rs24
-rw-r--r--tests/ui/target-feature/wasm-relaxed-simd.rs9
-rw-r--r--tests/ui/traits/alias/not-a-marker.rs7
-rw-r--r--tests/ui/traits/alias/not-a-marker.stderr11
-rw-r--r--tests/ui/traits/non_lifetime_binders/shadowed.rs18
-rw-r--r--tests/ui/traits/non_lifetime_binders/shadowed.stderr44
-rw-r--r--tests/ui/traits/object/generics.rs1
-rw-r--r--tests/ui/try-block/try-block-bad-lifetime.stderr5
-rw-r--r--tests/ui/try-trait/try-operator-custom.rs3
-rw-r--r--tests/ui/type-inference/unbounded-type-param-in-fn-with-assoc-type.stderr10
-rw-r--r--tests/ui/type/default_type_parameter_in_fn_or_impl.rs (renamed from tests/ui/feature-gates/feature-gate-default_type_parameter_fallback.rs)0
-rw-r--r--tests/ui/type/default_type_parameter_in_fn_or_impl.stderr43
-rw-r--r--tests/ui/type/pattern_types/feature-gate-pattern_types.stderr5
-rw-r--r--tests/ui/type/pattern_types/missing-is.rs8
-rw-r--r--tests/ui/type/pattern_types/missing-is.stderr8
-rw-r--r--tests/ui/typeck/issue-36708.stderr2
-rw-r--r--tests/ui/typeck/suggest-arg-comma-delete-ice.rs19
-rw-r--r--tests/ui/typeck/suggest-arg-comma-delete-ice.stderr38
-rw-r--r--tests/ui/underscore-imports/issue-110164.stderr16
-rw-r--r--tests/ui/uninhabited/exhaustive-wo-nevertype-issue-51221.rs2
-rw-r--r--tests/ui/uninhabited/uninhabited-irrefutable.exhaustive_patterns.stderr4
-rw-r--r--tests/ui/uninhabited/uninhabited-irrefutable.normal.stderr26
-rw-r--r--tests/ui/uninhabited/uninhabited-irrefutable.rs3
-rw-r--r--tests/ui/uninhabited/uninhabited-matches-feature-gated.rs7
-rw-r--r--tests/ui/uninhabited/uninhabited-matches-feature-gated.stderr66
-rw-r--r--tests/ui/uninhabited/uninhabited-patterns.rs1
-rw-r--r--tests/ui/uninhabited/uninhabited-patterns.stderr8
-rw-r--r--tests/ui/unop/unop-move-semantics.stderr4
-rw-r--r--tests/ui/unpretty/expanded-exhaustive.rs1
-rw-r--r--tests/ui/unpretty/expanded-exhaustive.stdout1
-rw-r--r--tests/ui/unresolved/unresolved-asterisk-imports.stderr5
-rw-r--r--tests/ui/unresolved/unresolved-import.rs3
-rw-r--r--tests/ui/unresolved/unresolved-import.stderr15
-rw-r--r--tests/ui/variance/variance-issue-20533.stderr13
-rw-r--r--tests/ui/wf/wf-in-where-clause-static.current.stderr12
-rw-r--r--tests/ui/wf/wf-in-where-clause-static.next.stderr12
-rw-r--r--tests/ui/wf/wf-in-where-clause-static.rs10
1144 files changed, 13946 insertions, 6304 deletions
diff --git a/tests/assembly/asm/aarch64-outline-atomics.rs b/tests/assembly/asm/aarch64-outline-atomics.rs
index bcf0964b722..46586f0f31c 100644
--- a/tests/assembly/asm/aarch64-outline-atomics.rs
+++ b/tests/assembly/asm/aarch64-outline-atomics.rs
@@ -7,7 +7,8 @@
 
 #![crate_type = "rlib"]
 
-use std::sync::atomic::{AtomicI32, Ordering::*};
+use std::sync::atomic::AtomicI32;
+use std::sync::atomic::Ordering::*;
 
 pub fn compare_exchange(a: &AtomicI32) {
     // On AArch64 LLVM should outline atomic operations.
diff --git a/tests/assembly/powerpc64-struct-abi.rs b/tests/assembly/powerpc64-struct-abi.rs
new file mode 100644
index 00000000000..9a3540d8b41
--- /dev/null
+++ b/tests/assembly/powerpc64-struct-abi.rs
@@ -0,0 +1,132 @@
+//@ revisions: elfv1-be elfv2-be elfv2-le
+//@ assembly-output: emit-asm
+//@ compile-flags: -O
+//@[elfv1-be] compile-flags: --target powerpc64-unknown-linux-gnu
+//@[elfv1-be] needs-llvm-components: powerpc
+//@[elfv2-be] compile-flags: --target powerpc64-unknown-linux-musl
+//@[elfv2-be] needs-llvm-components: powerpc
+//@[elfv2-le] compile-flags: --target powerpc64le-unknown-linux-gnu
+//@[elfv2-le] needs-llvm-components: powerpc
+//@[elfv1-be] filecheck-flags: --check-prefix be
+//@[elfv2-be] filecheck-flags: --check-prefix be
+
+#![feature(no_core, lang_items)]
+#![no_std]
+#![no_core]
+#![crate_type = "lib"]
+
+#[lang = "sized"]
+trait Sized {}
+
+#[lang = "copy"]
+trait Copy {}
+
+#[lang = "freeze"]
+trait Freeze {}
+
+#[lang = "unpin"]
+trait Unpin {}
+
+impl Copy for u8 {}
+impl Copy for u16 {}
+impl Copy for u32 {}
+impl Copy for FiveU32s {}
+impl Copy for FiveU16s {}
+impl Copy for ThreeU8s {}
+
+#[repr(C)]
+struct FiveU32s(u32, u32, u32, u32, u32);
+
+#[repr(C)]
+struct FiveU16s(u16, u16, u16, u16, u16);
+
+#[repr(C)]
+struct ThreeU8s(u8, u8, u8);
+
+// CHECK-LABEL: read_large
+// be: lwz [[REG1:.*]], 16(4)
+// be-NEXT: stw [[REG1]], 16(3)
+// be-NEXT: ld [[REG2:.*]], 8(4)
+// be-NEXT: ld [[REG3:.*]], 0(4)
+// be-NEXT: std [[REG2]], 8(3)
+// be-NEXT: std [[REG3]], 0(3)
+// elfv2-le: lxvd2x [[REG1:.*]], 0, 4
+// elfv2-le-NEXT: lwz [[REG2:.*]], 16(4)
+// elfv2-le-NEXT: stw [[REG2]], 16(3)
+// elfv2-le-NEXT: stxvd2x [[REG1]], 0, 3
+// CHECK-NEXT: blr
+#[no_mangle]
+extern "C" fn read_large(x: &FiveU32s) -> FiveU32s {
+    *x
+}
+
+// CHECK-LABEL: read_medium
+// elfv1-be: lhz [[REG1:.*]], 8(4)
+// elfv1-be-NEXT: ld [[REG2:.*]], 0(4)
+// elfv1-be-NEXT: sth [[REG1]], 8(3)
+// elfv1-be-NEXT: std [[REG2]], 0(3)
+// elfv2-be: lhz [[REG1:.*]], 8(3)
+// elfv2-be-NEXT: ld 3, 0(3)
+// elfv2-be-NEXT: sldi 4, [[REG1]], 48
+// elfv2-le: ld [[REG1:.*]], 0(3)
+// elfv2-le-NEXT: lhz 4, 8(3)
+// elfv2-le-NEXT: mr 3, [[REG1]]
+// CHECK-NEXT: blr
+#[no_mangle]
+extern "C" fn read_medium(x: &FiveU16s) -> FiveU16s {
+    *x
+}
+
+// CHECK-LABEL: read_small
+// elfv1-be: lbz [[REG1:.*]], 2(4)
+// elfv1-be-NEXT: lhz [[REG2:.*]], 0(4)
+// elfv1-be-NEXT: stb [[REG1]], 2(3)
+// elfv1-be-NEXT: sth [[REG2]], 0(3)
+// elfv2-be: lhz [[REG1:.*]], 0(3)
+// elfv2-be-NEXT: lbz 3, 2(3)
+// elfv2-be-NEXT: rldimi 3, [[REG1]], 8, 0
+// elfv2-le: lbz [[REG1:.*]], 2(3)
+// elfv2-le-NEXT: lhz 3, 0(3)
+// elfv2-le-NEXT: rldimi 3, [[REG1]], 16, 0
+// CHECK-NEXT: blr
+#[no_mangle]
+extern "C" fn read_small(x: &ThreeU8s) -> ThreeU8s {
+    *x
+}
+
+// CHECK-LABEL: write_large
+// CHECK: std 3, 0(6)
+// be-NEXT: rldicl [[REG1:.*]], 5, 32, 32
+// CHECK-NEXT: std 4, 8(6)
+// be-NEXT: stw [[REG1]], 16(6)
+// elfv2-le-NEXT: stw 5, 16(6)
+// CHECK-NEXT: blr
+#[no_mangle]
+extern "C" fn write_large(x: FiveU32s, dest: &mut FiveU32s) {
+    *dest = x;
+}
+
+// CHECK-LABEL: write_medium
+// CHECK: std 3, 0(5)
+// be-NEXT: rldicl [[REG1:.*]], 4, 16, 48
+// be-NEXT: sth [[REG1]], 8(5)
+// elfv2-le-NEXT: sth 4, 8(5)
+// CHECK-NEXT: blr
+#[no_mangle]
+extern "C" fn write_medium(x: FiveU16s, dest: &mut FiveU16s) {
+    *dest = x;
+}
+
+// CHECK-LABEL: write_small
+// be: stb 3, 2(4)
+// be-NEXT: srwi [[REG1:.*]], 3, 8
+// be-NEXT: sth [[REG1]], 0(4)
+// The order these instructions are emitted in changed in LLVM 18.
+// elfv2-le-DAG: sth 3, 0(4)
+// elfv2-le-DAG: srwi [[REG1:.*]], 3, 16
+// elfv2-le-NEXT: stb [[REG1]], 2(4)
+// CHECK-NEXT: blr
+#[no_mangle]
+extern "C" fn write_small(x: ThreeU8s, dest: &mut ThreeU8s) {
+    *dest = x;
+}
diff --git a/tests/assembly/x86-return-float.rs b/tests/assembly/x86-return-float.rs
index c4a2c1ad44e..f9ebf53dddc 100644
--- a/tests/assembly/x86-return-float.rs
+++ b/tests/assembly/x86-return-float.rs
@@ -8,9 +8,9 @@
 // Force frame pointers to make ASM more consistent between targets
 //@ compile-flags: -O -C force-frame-pointers
 //@ filecheck-flags: --implicit-check-not fld --implicit-check-not fst
-//@ revisions: unix windows
-//@[unix] ignore-windows
-//@[windows] only-windows
+//@ revisions: normal win
+//@[normal] ignore-windows
+//@[win] only-windows
 
 #![crate_type = "lib"]
 #![feature(f16, f128)]
@@ -190,10 +190,10 @@ pub unsafe fn call_f64_f64(x: &mut (f64, f64)) {
     }
     // CHECK: movl {{.*}}(%ebp), %[[PTR:.*]]
     // CHECK: calll {{()|_}}get_f64_f64
-    // unix: movsd [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
-    // unix-NEXT: movsd [[#%d,OFFSET+8]](%ebp), %[[VAL2:.*]]
-    // windows: movsd (%esp), %[[VAL1:.*]]
-    // windows-NEXT: movsd 8(%esp), %[[VAL2:.*]]
+    // normal: movsd [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
+    // normal-NEXT: movsd [[#%d,OFFSET+8]](%ebp), %[[VAL2:.*]]
+    // win: movsd (%esp), %[[VAL1:.*]]
+    // win-NEXT: movsd 8(%esp), %[[VAL2:.*]]
     // CHECK-NEXT: movsd %[[VAL1]], (%[[PTR]])
     // CHECK-NEXT: movsd %[[VAL2]], 8(%[[PTR]])
     *x = get_f64_f64();
@@ -207,13 +207,13 @@ pub unsafe fn call_f32_f64(x: &mut (f32, f64)) {
     }
     // CHECK: movl {{.*}}(%ebp), %[[PTR:.*]]
     // CHECK: calll {{()|_}}get_f32_f64
-    // unix: movss [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
-    // unix-NEXT: movsd [[#%d,OFFSET+4]](%ebp), %[[VAL2:.*]]
-    // windows: movss (%esp), %[[VAL1:.*]]
-    // windows-NEXT: movsd 8(%esp), %[[VAL2:.*]]
+    // normal: movss [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
+    // normal-NEXT: movsd [[#%d,OFFSET+4]](%ebp), %[[VAL2:.*]]
+    // win: movss (%esp), %[[VAL1:.*]]
+    // win-NEXT: movsd 8(%esp), %[[VAL2:.*]]
     // CHECK-NEXT: movss %[[VAL1]], (%[[PTR]])
-    // unix-NEXT: movsd %[[VAL2]], 4(%[[PTR]])
-    // windows-NEXT: movsd %[[VAL2]], 8(%[[PTR]])
+    // normal-NEXT: movsd %[[VAL2]], 4(%[[PTR]])
+    // win-NEXT: movsd %[[VAL2]], 8(%[[PTR]])
     *x = get_f32_f64();
 }
 
@@ -225,10 +225,10 @@ pub unsafe fn call_f64_f32(x: &mut (f64, f32)) {
     }
     // CHECK: movl {{.*}}(%ebp), %[[PTR:.*]]
     // CHECK: calll {{()|_}}get_f64_f32
-    // unix: movsd [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
-    // unix-NEXT: movss [[#%d,OFFSET+8]](%ebp), %[[VAL2:.*]]
-    // windows: movsd (%esp), %[[VAL1:.*]]
-    // windows-NEXT: movss 8(%esp), %[[VAL2:.*]]
+    // normal: movsd [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
+    // normal-NEXT: movss [[#%d,OFFSET+8]](%ebp), %[[VAL2:.*]]
+    // win: movsd (%esp), %[[VAL1:.*]]
+    // win-NEXT: movss 8(%esp), %[[VAL2:.*]]
     // CHECK-NEXT: movsd %[[VAL1]], (%[[PTR]])
     // CHECK-NEXT: movss %[[VAL2]], 8(%[[PTR]])
     *x = get_f64_f32();
@@ -257,10 +257,10 @@ pub unsafe fn call_f64_other(x: &mut (f64, usize)) {
     }
     // CHECK: movl {{.*}}(%ebp), %[[PTR:.*]]
     // CHECK: calll {{()|_}}get_f64_other
-    // unix: movsd [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
-    // unix-NEXT: movl [[#%d,OFFSET+8]](%ebp), %[[VAL2:.*]]
-    // windows: movsd (%esp), %[[VAL1:.*]]
-    // windows-NEXT: movl 8(%esp), %[[VAL2:.*]]
+    // normal: movsd [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
+    // normal-NEXT: movl [[#%d,OFFSET+8]](%ebp), %[[VAL2:.*]]
+    // win: movsd (%esp), %[[VAL1:.*]]
+    // win-NEXT: movl 8(%esp), %[[VAL2:.*]]
     // CHECK-NEXT: movsd %[[VAL1]], (%[[PTR]])
     // CHECK-NEXT: movl %[[VAL2]], 8(%[[PTR]])
     *x = get_f64_other();
@@ -289,13 +289,13 @@ pub unsafe fn call_other_f64(x: &mut (usize, f64)) {
     }
     // CHECK: movl {{.*}}(%ebp), %[[PTR:.*]]
     // CHECK: calll {{()|_}}get_other_f64
-    // unix: movl [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
-    // unix-NEXT: movsd [[#%d,OFFSET+4]](%ebp), %[[VAL2:.*]]
-    // windows: movl (%esp), %[[VAL1:.*]]
-    // windows-NEXT: movsd 8(%esp), %[[VAL2:.*]]
+    // normal: movl [[#%d,OFFSET:]](%ebp), %[[VAL1:.*]]
+    // normal-NEXT: movsd [[#%d,OFFSET+4]](%ebp), %[[VAL2:.*]]
+    // win: movl (%esp), %[[VAL1:.*]]
+    // win-NEXT: movsd 8(%esp), %[[VAL2:.*]]
     // CHECK-NEXT: movl %[[VAL1]], (%[[PTR]])
-    // unix-NEXT: movsd %[[VAL2]], 4(%[[PTR]])
-    // windows-NEXT: movsd %[[VAL2]], 8(%[[PTR]])
+    // normal-NEXT: movsd %[[VAL2]], 4(%[[PTR]])
+    // win-NEXT: movsd %[[VAL2]], 8(%[[PTR]])
     *x = get_other_f64();
 }
 
diff --git a/tests/assembly/x86_64-windows-float-abi.rs b/tests/assembly/x86_64-windows-float-abi.rs
new file mode 100644
index 00000000000..1381d492fa5
--- /dev/null
+++ b/tests/assembly/x86_64-windows-float-abi.rs
@@ -0,0 +1,39 @@
+//@ assembly-output: emit-asm
+//@ compile-flags: -O
+//@ only-windows
+//@ only-x86_64
+
+#![feature(f16, f128)]
+#![crate_type = "lib"]
+
+// CHECK-LABEL: second_f16
+// CHECK: movaps %xmm1, %xmm0
+// CHECK-NEXT: retq
+#[no_mangle]
+pub extern "C" fn second_f16(_: f16, x: f16) -> f16 {
+    x
+}
+
+// CHECK-LABEL: second_f32
+// CHECK: movaps %xmm1, %xmm0
+// CHECK-NEXT: retq
+#[no_mangle]
+pub extern "C" fn second_f32(_: f32, x: f32) -> f32 {
+    x
+}
+
+// CHECK-LABEL: second_f64
+// CHECK: movaps %xmm1, %xmm0
+// CHECK-NEXT: retq
+#[no_mangle]
+pub extern "C" fn second_f64(_: f64, x: f64) -> f64 {
+    x
+}
+
+// CHECK-LABEL: second_f128
+// CHECK: movaps %xmm1, %xmm0
+// CHECK-NEXT: retq
+#[no_mangle]
+pub extern "C" fn second_f128(_: f128, x: f128) -> f128 {
+    x
+}
diff --git a/tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs b/tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs
index 0192a3d4188..33a32d7fea9 100644
--- a/tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs
+++ b/tests/codegen-units/item-collection/auxiliary/cgu_extern_closures.rs
@@ -1,3 +1,5 @@
+//@ compile-flags: -Zinline-mir=no
+
 #![crate_type = "lib"]
 
 #[inline]
diff --git a/tests/codegen-units/item-collection/cross-crate-closures.rs b/tests/codegen-units/item-collection/cross-crate-closures.rs
index 2dab19401ed..cb86cf18c0c 100644
--- a/tests/codegen-units/item-collection/cross-crate-closures.rs
+++ b/tests/codegen-units/item-collection/cross-crate-closures.rs
@@ -1,9 +1,6 @@
-// In the current version of the collector that still has to support
-// legacy-codegen, closures do not generate their own MonoItems, so we are
-// ignoring this test until MIR codegen has taken over completely
-//@ ignore-test
-
-//@ compile-flags:-Zprint-mono-items=eager
+// We need to disable MIR inlining in both this and its aux-build crate. The MIR inliner
+// will just inline everything into our start function if we let it. As it should.
+//@ compile-flags:-Zprint-mono-items=eager -Zinline-mir=no
 
 #![deny(dead_code)]
 #![feature(start)]
@@ -11,15 +8,15 @@
 //@ aux-build:cgu_extern_closures.rs
 extern crate cgu_extern_closures;
 
-//~ MONO_ITEM fn cross_crate_closures::start[0]
+//~ MONO_ITEM fn start @@ cross_crate_closures-cgu.0[Internal]
 #[start]
 fn start(_: isize, _: *const *const u8) -> isize {
-    //~ MONO_ITEM fn cgu_extern_closures::inlined_fn[0]
-    //~ MONO_ITEM fn cgu_extern_closures::inlined_fn[0]::{{closure}}[0]
+    //~ MONO_ITEM fn cgu_extern_closures::inlined_fn @@ cross_crate_closures-cgu.0[Internal]
+    //~ MONO_ITEM fn cgu_extern_closures::inlined_fn::{closure#0} @@ cross_crate_closures-cgu.0[Internal]
     let _ = cgu_extern_closures::inlined_fn(1, 2);
 
-    //~ MONO_ITEM fn cgu_extern_closures::inlined_fn_generic[0]<i32>
-    //~ MONO_ITEM fn cgu_extern_closures::inlined_fn_generic[0]::{{closure}}[0]<i32>
+    //~ MONO_ITEM fn cgu_extern_closures::inlined_fn_generic::<i32> @@ cross_crate_closures-cgu.0[Internal]
+    //~ MONO_ITEM fn cgu_extern_closures::inlined_fn_generic::<i32>::{closure#0} @@ cross_crate_closures-cgu.0[Internal]
     let _ = cgu_extern_closures::inlined_fn_generic(3, 4, 5i32);
 
     // Nothing should be generated for this call, we just link to the instance
@@ -28,5 +25,3 @@ fn start(_: isize, _: *const *const u8) -> isize {
 
     0
 }
-
-//~ MONO_ITEM drop-glue i8
diff --git a/tests/codegen-units/item-collection/generic-impl.rs b/tests/codegen-units/item-collection/generic-impl.rs
index b4cd99272b1..23d09e0d8af 100644
--- a/tests/codegen-units/item-collection/generic-impl.rs
+++ b/tests/codegen-units/item-collection/generic-impl.rs
@@ -22,16 +22,16 @@ impl<T> Struct<T> {
     }
 }
 
-pub struct _LifeTimeOnly<'a> {
+pub struct LifeTimeOnly<'a> {
     _a: &'a u32,
 }
 
-impl<'a> _LifeTimeOnly<'a> {
-    //~ MONO_ITEM fn _LifeTimeOnly::<'_>::foo
+impl<'a> LifeTimeOnly<'a> {
+    //~ MONO_ITEM fn LifeTimeOnly::<'_>::foo
     pub fn foo(&self) {}
-    //~ MONO_ITEM fn _LifeTimeOnly::<'_>::bar
+    //~ MONO_ITEM fn LifeTimeOnly::<'_>::bar
     pub fn bar(&'a self) {}
-    //~ MONO_ITEM fn _LifeTimeOnly::<'_>::baz
+    //~ MONO_ITEM fn LifeTimeOnly::<'_>::baz
     pub fn baz<'b>(&'b self) {}
 
     pub fn non_instantiated<T>(&self) {}
diff --git a/tests/codegen-units/item-collection/non-generic-closures.rs b/tests/codegen-units/item-collection/non-generic-closures.rs
index 105348e9d09..dc0846f2cd3 100644
--- a/tests/codegen-units/item-collection/non-generic-closures.rs
+++ b/tests/codegen-units/item-collection/non-generic-closures.rs
@@ -1,49 +1,45 @@
-// In the current version of the collector that still has to support
-// legacy-codegen, closures do not generate their own MonoItems, so we are
-// ignoring this test until MIR codegen has taken over completely
-//@ ignore-test
-
-//
-//@ compile-flags:-Zprint-mono-items=eager
+//@ compile-flags:-Zprint-mono-items=eager -Zinline-mir=no
 
 #![deny(dead_code)]
 #![feature(start)]
 
-//~ MONO_ITEM fn non_generic_closures::temporary[0]
+//~ MONO_ITEM fn temporary @@ non_generic_closures-cgu.0[Internal]
 fn temporary() {
-    //~ MONO_ITEM fn non_generic_closures::temporary[0]::{{closure}}[0]
+    //~ MONO_ITEM fn temporary::{closure#0} @@ non_generic_closures-cgu.0[Internal]
     (|a: u32| {
         let _ = a;
     })(4);
 }
 
-//~ MONO_ITEM fn non_generic_closures::assigned_to_variable_but_not_executed[0]
+//~ MONO_ITEM fn assigned_to_variable_but_not_executed @@ non_generic_closures-cgu.0[Internal]
 fn assigned_to_variable_but_not_executed() {
-    //~ MONO_ITEM fn non_generic_closures::assigned_to_variable_but_not_executed[0]::{{closure}}[0]
     let _x = |a: i16| {
         let _ = a + 1;
     };
 }
 
-//~ MONO_ITEM fn non_generic_closures::assigned_to_variable_executed_directly[0]
+//~ MONO_ITEM fn assigned_to_variable_executed_indirectly @@ non_generic_closures-cgu.0[Internal]
 fn assigned_to_variable_executed_indirectly() {
-    //~ MONO_ITEM fn non_generic_closures::assigned_to_variable_executed_directly[0]::{{closure}}[0]
+    //~ MONO_ITEM fn assigned_to_variable_executed_indirectly::{closure#0} @@ non_generic_closures-cgu.0[Internal]
+    //~ MONO_ITEM fn <{closure@TEST_PATH:27:13: 27:21} as std::ops::FnOnce<(i32,)>>::call_once - shim @@ non_generic_closures-cgu.0[Internal]
+    //~ MONO_ITEM fn <{closure@TEST_PATH:27:13: 27:21} as std::ops::FnOnce<(i32,)>>::call_once - shim(vtable) @@ non_generic_closures-cgu.0[Internal]
+    //~ MONO_ITEM fn std::ptr::drop_in_place::<{closure@TEST_PATH:27:13: 27:21}> - shim(None) @@ non_generic_closures-cgu.0[Internal]
     let f = |a: i32| {
         let _ = a + 2;
     };
     run_closure(&f);
 }
 
-//~ MONO_ITEM fn non_generic_closures::assigned_to_variable_executed_indirectly[0]
+//~ MONO_ITEM fn assigned_to_variable_executed_directly @@ non_generic_closures-cgu.0[Internal]
 fn assigned_to_variable_executed_directly() {
-    //~ MONO_ITEM fn non_generic_closures::assigned_to_variable_executed_indirectly[0]::{{closure}}[0]
+    //~ MONO_ITEM fn assigned_to_variable_executed_directly::{closure#0} @@ non_generic_closures-cgu.0[Internal]
     let f = |a: i64| {
         let _ = a + 3;
     };
     f(4);
 }
 
-//~ MONO_ITEM fn non_generic_closures::start[0]
+//~ MONO_ITEM fn start @@ non_generic_closures-cgu.0[Internal]
 #[start]
 fn start(_: isize, _: *const *const u8) -> isize {
     temporary();
@@ -54,7 +50,7 @@ fn start(_: isize, _: *const *const u8) -> isize {
     0
 }
 
-//~ MONO_ITEM fn non_generic_closures::run_closure[0]
+//~ MONO_ITEM fn run_closure @@ non_generic_closures-cgu.0[Internal]
 fn run_closure(f: &Fn(i32)) {
     f(3);
 }
diff --git a/tests/codegen-units/item-collection/overloaded-operators.rs b/tests/codegen-units/item-collection/overloaded-operators.rs
index e00e22dbab9..69b55695d3d 100644
--- a/tests/codegen-units/item-collection/overloaded-operators.rs
+++ b/tests/codegen-units/item-collection/overloaded-operators.rs
@@ -5,44 +5,44 @@
 
 use std::ops::{Add, Deref, Index, IndexMut};
 
-pub struct _Indexable {
+pub struct Indexable {
     data: [u8; 3],
 }
 
-impl Index<usize> for _Indexable {
+impl Index<usize> for Indexable {
     type Output = u8;
 
-    //~ MONO_ITEM fn <_Indexable as std::ops::Index<usize>>::index
+    //~ MONO_ITEM fn <Indexable as std::ops::Index<usize>>::index
     fn index(&self, index: usize) -> &Self::Output {
         if index >= 3 { &self.data[0] } else { &self.data[index] }
     }
 }
 
-impl IndexMut<usize> for _Indexable {
-    //~ MONO_ITEM fn <_Indexable as std::ops::IndexMut<usize>>::index_mut
+impl IndexMut<usize> for Indexable {
+    //~ MONO_ITEM fn <Indexable as std::ops::IndexMut<usize>>::index_mut
     fn index_mut(&mut self, index: usize) -> &mut Self::Output {
         if index >= 3 { &mut self.data[0] } else { &mut self.data[index] }
     }
 }
 
-//~ MONO_ITEM fn <_Equatable as std::cmp::PartialEq>::eq
-//~ MONO_ITEM fn <_Equatable as std::cmp::PartialEq>::ne
+//~ MONO_ITEM fn <Equatable as std::cmp::PartialEq>::eq
+//~ MONO_ITEM fn <Equatable as std::cmp::PartialEq>::ne
 #[derive(PartialEq)]
-pub struct _Equatable(u32);
+pub struct Equatable(u32);
 
-impl Add<u32> for _Equatable {
+impl Add<u32> for Equatable {
     type Output = u32;
 
-    //~ MONO_ITEM fn <_Equatable as std::ops::Add<u32>>::add
+    //~ MONO_ITEM fn <Equatable as std::ops::Add<u32>>::add
     fn add(self, rhs: u32) -> u32 {
         self.0 + rhs
     }
 }
 
-impl Deref for _Equatable {
+impl Deref for Equatable {
     type Target = u32;
 
-    //~ MONO_ITEM fn <_Equatable as std::ops::Deref>::deref
+    //~ MONO_ITEM fn <Equatable as std::ops::Deref>::deref
     fn deref(&self) -> &Self::Target {
         &self.0
     }
diff --git a/tests/codegen-units/partitioning/methods-are-with-self-type.rs b/tests/codegen-units/partitioning/methods-are-with-self-type.rs
index 901e7507d73..7c9045e8f1a 100644
--- a/tests/codegen-units/partitioning/methods-are-with-self-type.rs
+++ b/tests/codegen-units/partitioning/methods-are-with-self-type.rs
@@ -1,30 +1,23 @@
-// Currently, all generic functions are instantiated in each codegen unit that
-// uses them, even those not marked with #[inline], so this test does not make
-// much sense at the moment.
-//@ ignore-test
-
 // We specify incremental here because we want to test the partitioning for incremental compilation
 //@ incremental
 //@ compile-flags:-Zprint-mono-items=lazy
 
-#![allow(dead_code)]
-#![feature(start)]
+#![crate_type = "lib"]
 
-struct SomeType;
+pub struct SomeType;
 
 struct SomeGenericType<T1, T2>(T1, T2);
 
-mod mod1 {
+pub mod mod1 {
     use super::{SomeGenericType, SomeType};
 
     // Even though the impl is in `mod1`, the methods should end up in the
     // parent module, since that is where their self-type is.
     impl SomeType {
-        //~ MONO_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[0]::method[0] @@ methods_are_with_self_type[External]
-        fn method(&self) {}
-
-        //~ MONO_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[0]::associated_fn[0] @@ methods_are_with_self_type[External]
-        fn associated_fn() {}
+        //~ MONO_ITEM fn mod1::<impl SomeType>::method @@ methods_are_with_self_type[External]
+        pub fn method(&self) {}
+        //~ MONO_ITEM fn mod1::<impl SomeType>::associated_fn @@ methods_are_with_self_type[External]
+        pub fn associated_fn() {}
     }
 
     impl<T1, T2> SomeGenericType<T1, T2> {
@@ -52,25 +45,20 @@ mod type2 {
     pub struct Struct;
 }
 
-//~ MONO_ITEM fn methods_are_with_self_type::start[0]
-#[start]
-fn start(_: isize, _: *const *const u8) -> isize {
-    //~ MONO_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[1]::method[0]<u32, u64> @@ methods_are_with_self_type.volatile[WeakODR]
+//~ MONO_ITEM fn start @@ methods_are_with_self_type[External]
+pub fn start() {
+    //~ MONO_ITEM fn mod1::<impl SomeGenericType<u32, u64>>::method @@ methods_are_with_self_type.volatile[External]
     SomeGenericType(0u32, 0u64).method();
-    //~ MONO_ITEM fn methods_are_with_self_type::mod1[0]::{{impl}}[1]::associated_fn[0]<char, &str> @@ methods_are_with_self_type.volatile[WeakODR]
+    //~ MONO_ITEM fn mod1::<impl SomeGenericType<char, &str>>::associated_fn @@ methods_are_with_self_type.volatile[External]
     SomeGenericType::associated_fn('c', "&str");
 
-    //~ MONO_ITEM fn methods_are_with_self_type::{{impl}}[0]::foo[0]<methods_are_with_self_type::type1[0]::Struct[0]> @@ methods_are_with_self_type-type1.volatile[WeakODR]
+    //~ MONO_ITEM fn <type1::Struct as Trait>::foo @@ methods_are_with_self_type-type1.volatile[External]
     type1::Struct.foo();
-    //~ MONO_ITEM fn methods_are_with_self_type::{{impl}}[0]::foo[0]<methods_are_with_self_type::type2[0]::Struct[0]> @@ methods_are_with_self_type-type2.volatile[WeakODR]
+    //~ MONO_ITEM fn <type2::Struct as Trait>::foo @@ methods_are_with_self_type-type2.volatile[External]
     type2::Struct.foo();
 
-    //~ MONO_ITEM fn methods_are_with_self_type::Trait[0]::default[0]<methods_are_with_self_type::type1[0]::Struct[0]> @@ methods_are_with_self_type-type1.volatile[WeakODR]
+    //~ MONO_ITEM fn <type1::Struct as Trait>::default @@ methods_are_with_self_type-type1.volatile[External]
     type1::Struct.default();
-    //~ MONO_ITEM fn methods_are_with_self_type::Trait[0]::default[0]<methods_are_with_self_type::type2[0]::Struct[0]> @@ methods_are_with_self_type-type2.volatile[WeakODR]
+    //~ MONO_ITEM fn <type2::Struct as Trait>::default @@ methods_are_with_self_type-type2.volatile[External]
     type2::Struct.default();
-
-    0
 }
-
-//~ MONO_ITEM drop-glue i8
diff --git a/tests/codegen/aarch64-struct-align-128.rs b/tests/codegen/aarch64-struct-align-128.rs
index d1b4132d501..3fed19d96b1 100644
--- a/tests/codegen/aarch64-struct-align-128.rs
+++ b/tests/codegen/aarch64-struct-align-128.rs
@@ -1,12 +1,12 @@
 // Test that structs aligned to 128 bits are passed with the correct ABI on aarch64.
 
-//@ revisions:linux darwin windows
+//@ revisions: linux darwin win
 //@[linux] compile-flags: --target aarch64-unknown-linux-gnu
 //@[darwin] compile-flags: --target aarch64-apple-darwin
-//@[windows] compile-flags: --target aarch64-pc-windows-msvc
+//@[win] compile-flags: --target aarch64-pc-windows-msvc
 //@[linux] needs-llvm-components: aarch64
 //@[darwin] needs-llvm-components: aarch64
-//@[windows] needs-llvm-components: aarch64
+//@[win] needs-llvm-components: aarch64
 
 #![feature(no_core, lang_items)]
 #![crate_type = "lib"]
@@ -39,9 +39,9 @@ pub struct Wrapped8 {
 }
 
 extern "C" {
-    // linux:   declare void @test_8([2 x i64], [2 x i64], [2 x i64])
-    // darwin:  declare void @test_8([2 x i64], [2 x i64], [2 x i64])
-    // windows: declare void @test_8([2 x i64], [2 x i64], [2 x i64])
+    // linux:  declare void @test_8([2 x i64], [2 x i64], [2 x i64])
+    // darwin: declare void @test_8([2 x i64], [2 x i64], [2 x i64])
+    // win:    declare void @test_8([2 x i64], [2 x i64], [2 x i64])
     fn test_8(a: Align8, b: Transparent8, c: Wrapped8);
 }
 
@@ -69,9 +69,9 @@ pub struct Wrapped16 {
 }
 
 extern "C" {
-    // linux:   declare void @test_16([2 x i64], [2 x i64], i128)
-    // darwin:  declare void @test_16(i128, i128, i128)
-    // windows: declare void @test_16(i128, i128, i128)
+    // linux:  declare void @test_16([2 x i64], [2 x i64], i128)
+    // darwin: declare void @test_16(i128, i128, i128)
+    // win:    declare void @test_16(i128, i128, i128)
     fn test_16(a: Align16, b: Transparent16, c: Wrapped16);
 }
 
@@ -94,9 +94,9 @@ pub struct WrappedI128 {
 }
 
 extern "C" {
-    // linux:   declare void @test_i128(i128, i128, i128)
-    // darwin:  declare void @test_i128(i128, i128, i128)
-    // windows: declare void @test_i128(i128, i128, i128)
+    // linux:  declare void @test_i128(i128, i128, i128)
+    // darwin: declare void @test_i128(i128, i128, i128)
+    // win:    declare void @test_i128(i128, i128, i128)
     fn test_i128(a: I128, b: TransparentI128, c: WrappedI128);
 }
 
@@ -121,9 +121,9 @@ pub struct WrappedPacked {
 }
 
 extern "C" {
-    // linux:   declare void @test_packed([2 x i64], [2 x i64], [2 x i64])
-    // darwin:  declare void @test_packed([2 x i64], [2 x i64], [2 x i64])
-    // windows: declare void @test_packed([2 x i64], [2 x i64], [2 x i64])
+    // linux:  declare void @test_packed([2 x i64], [2 x i64], [2 x i64])
+    // darwin: declare void @test_packed([2 x i64], [2 x i64], [2 x i64])
+    // win:    declare void @test_packed([2 x i64], [2 x i64], [2 x i64])
     fn test_packed(a: Packed, b: TransparentPacked, c: WrappedPacked);
 }
 
diff --git a/tests/codegen/array-from_fn.rs b/tests/codegen/array-from_fn.rs
new file mode 100644
index 00000000000..7202d0c67e6
--- /dev/null
+++ b/tests/codegen/array-from_fn.rs
@@ -0,0 +1,13 @@
+//@ revisions: NORMAL OPT
+//@ [NORMAL] compile-flags: -C opt-level=0 -C debuginfo=2
+//@ [OPT] compile-flags: -C opt-level=s -C debuginfo=0
+
+#![crate_type = "lib"]
+#![feature(array_from_fn)]
+
+#[no_mangle]
+pub fn iota() -> [u8; 16] {
+    // OPT-NOT: core..array..Guard
+    // NORMAL: core..array..Guard
+    std::array::from_fn(|i| i as _)
+}
diff --git a/tests/codegen/atomic-operations.rs b/tests/codegen/atomic-operations.rs
index b1350273542..8a70c94e480 100644
--- a/tests/codegen/atomic-operations.rs
+++ b/tests/codegen/atomic-operations.rs
@@ -2,7 +2,8 @@
 //@ compile-flags: -O
 #![crate_type = "lib"]
 
-use std::sync::atomic::{AtomicI32, Ordering::*};
+use std::sync::atomic::AtomicI32;
+use std::sync::atomic::Ordering::*;
 
 // CHECK-LABEL: @compare_exchange
 #[no_mangle]
diff --git a/tests/codegen/branch-protection-old-llvm.rs b/tests/codegen/branch-protection-old-llvm.rs
new file mode 100644
index 00000000000..bb3c7a4b70c
--- /dev/null
+++ b/tests/codegen/branch-protection-old-llvm.rs
@@ -0,0 +1,45 @@
+// Test that the correct module flags are emitted with different branch protection flags.
+
+//@ revisions: BTI PACRET LEAF BKEY NONE
+//@ needs-llvm-components: aarch64
+//@ [BTI] compile-flags: -Z branch-protection=bti
+//@ [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
+//@ compile-flags: --target aarch64-unknown-linux-gnu
+//@ ignore-llvm-version: 19 - 99
+
+#![crate_type = "lib"]
+#![feature(no_core, lang_items)]
+#![no_core]
+
+#[lang = "sized"]
+trait Sized {}
+
+// A basic test function.
+pub fn test() {}
+
+// BTI: !"branch-target-enforcement", i32 1
+// BTI: !"sign-return-address", i32 0
+// BTI: !"sign-return-address-all", i32 0
+// BTI: !"sign-return-address-with-bkey", i32 0
+
+// PACRET: !"branch-target-enforcement", i32 0
+// PACRET: !"sign-return-address", i32 1
+// PACRET: !"sign-return-address-all", i32 0
+// PACRET: !"sign-return-address-with-bkey", i32 0
+
+// LEAF: !"branch-target-enforcement", i32 0
+// LEAF: !"sign-return-address", i32 1
+// LEAF: !"sign-return-address-all", i32 1
+// LEAF: !"sign-return-address-with-bkey", i32 0
+
+// BKEY: !"branch-target-enforcement", i32 0
+// BKEY: !"sign-return-address", i32 1
+// BKEY: !"sign-return-address-all", i32 0
+// BKEY: !"sign-return-address-with-bkey", i32 1
+
+// NONE-NOT: branch-target-enforcement
+// NONE-NOT: sign-return-address
+// NONE-NOT: sign-return-address-all
+// NONE-NOT: sign-return-address-with-bkey
diff --git a/tests/codegen/branch-protection.rs b/tests/codegen/branch-protection.rs
index a29ec67d578..2f5ff9e98c2 100644
--- a/tests/codegen/branch-protection.rs
+++ b/tests/codegen/branch-protection.rs
@@ -7,6 +7,7 @@
 //@ [LEAF] compile-flags: -Z branch-protection=pac-ret,leaf
 //@ [BKEY] compile-flags: -Z branch-protection=pac-ret,b-key
 //@ compile-flags: --target aarch64-unknown-linux-gnu
+//@ min-llvm-version: 19
 
 #![crate_type = "lib"]
 #![feature(no_core, lang_items)]
@@ -16,23 +17,32 @@
 trait Sized {}
 
 // A basic test function.
+// CHECK: @test(){{.*}} [[ATTR:#[0-9]+]] {
+#[no_mangle]
 pub fn test() {}
 
+// BTI: attributes [[ATTR]] = {{.*}} "branch-target-enforcement"
 // BTI: !"branch-target-enforcement", i32 1
 // BTI: !"sign-return-address", i32 0
 // BTI: !"sign-return-address-all", i32 0
 // BTI: !"sign-return-address-with-bkey", i32 0
 
+// PACRET: attributes [[ATTR]] = {{.*}} "sign-return-address"="non-leaf"
+// PACRET-SAME: "sign-return-address-key"="a_key"
 // PACRET: !"branch-target-enforcement", i32 0
 // PACRET: !"sign-return-address", i32 1
 // PACRET: !"sign-return-address-all", i32 0
 // PACRET: !"sign-return-address-with-bkey", i32 0
 
+// LEAF: attributes [[ATTR]] = {{.*}} "sign-return-address"="all"
+// LEAF-SAME: "sign-return-address-key"="a_key"
 // LEAF: !"branch-target-enforcement", i32 0
 // LEAF: !"sign-return-address", i32 1
 // LEAF: !"sign-return-address-all", i32 1
 // LEAF: !"sign-return-address-with-bkey", i32 0
 
+// BKEY: attributes [[ATTR]] = {{.*}} "sign-return-address"="non-leaf"
+// BKEY-SAME: "sign-return-address-key"="b_key"
 // BKEY: !"branch-target-enforcement", i32 0
 // BKEY: !"sign-return-address", i32 1
 // BKEY: !"sign-return-address-all", i32 0
diff --git a/tests/codegen/call-metadata.rs b/tests/codegen/call-metadata.rs
index b2168990ff8..73c4b33e2cf 100644
--- a/tests/codegen/call-metadata.rs
+++ b/tests/codegen/call-metadata.rs
@@ -2,6 +2,7 @@
 // scalar value.
 
 //@ compile-flags: -O -C no-prepopulate-passes
+//@ ignore-llvm-version: 19 - 99
 
 #![crate_type = "lib"]
 
diff --git a/tests/codegen/cast-optimized.rs b/tests/codegen/cast-optimized.rs
index 313b2b4f0d6..59cf40935cd 100644
--- a/tests/codegen/cast-optimized.rs
+++ b/tests/codegen/cast-optimized.rs
@@ -20,8 +20,6 @@ pub fn u32_index(c: u32) -> [bool; 22] {
 // CHECK-LABEL: @char_as_u32_index
 #[no_mangle]
 pub fn char_as_u32_index(c: char) -> [bool; 22] {
-    // CHECK: %[[B:.+]] = icmp ult i32 %c, 1114112
-    // CHECK: call void @llvm.assume(i1 %[[B]])
     let c = c as u32;
 
     let mut array = [false; 22];
diff --git a/tests/codegen/cold-call-declare-and-call.rs b/tests/codegen/cold-call-declare-and-call.rs
index cd41c0a6dfb..b18565ee6c3 100644
--- a/tests/codegen/cold-call-declare-and-call.rs
+++ b/tests/codegen/cold-call-declare-and-call.rs
@@ -1,8 +1,8 @@
-//@ revisions: NORMAL WINDOWS
+//@ revisions: NORMAL WIN
 //@ compile-flags: -C no-prepopulate-passes
 //@[NORMAL] ignore-windows
-//@[WINDOWS] only-windows
-//@[WINDOWS] only-x86_64
+//@[WIN] only-windows
+//@[WIN] only-x86_64
 
 #![crate_type = "lib"]
 #![feature(rust_cold_cc)]
@@ -14,8 +14,8 @@
 
 // See the comment in `Target::adjust_abi` for why this differs
 
-// WINDOWS: define void @this_should_never_happen(i16
-// WINDOWS: call void @this_should_never_happen(i16
+// WIN: define void @this_should_never_happen(i16
+// WIN: call void @this_should_never_happen(i16
 
 #[no_mangle]
 pub extern "rust-cold" fn this_should_never_happen(x: u16) {}
diff --git a/tests/codegen/common_prim_int_ptr.rs b/tests/codegen/common_prim_int_ptr.rs
index 87fa89abb86..aa7ebb4c911 100644
--- a/tests/codegen/common_prim_int_ptr.rs
+++ b/tests/codegen/common_prim_int_ptr.rs
@@ -28,7 +28,7 @@ pub fn insert_box(x: Box<()>) -> Result<usize, Box<()>> {
 
 // CHECK-LABEL: @extract_int
 // CHECK-NOT: nonnull
-// CHECK-SAME: (i{{[0-9]+}} {{[^,]+}} [[DISCRIMINANT:%[0-9]+]], ptr {{[^,]+}} [[PAYLOAD:%[0-9]+]])
+// CHECK-SAME: (i{{[0-9]+}} {{[^%]+}} [[DISCRIMINANT:%[0-9]+]], ptr {{[^,]+}} [[PAYLOAD:%[0-9]+]])
 #[no_mangle]
 pub unsafe fn extract_int(x: Result<usize, Box<()>>) -> usize {
     // CHECK: [[TEMP:%.+]] = ptrtoint ptr [[PAYLOAD]] to [[USIZE:i[0-9]+]]
@@ -40,7 +40,7 @@ pub unsafe fn extract_int(x: Result<usize, Box<()>>) -> usize {
 }
 
 // CHECK-LABEL: @extract_box
-// CHECK-SAME: (i{{[0-9]+}} {{[^,]+}} [[DISCRIMINANT:%[0-9]+]], ptr {{[^,]+}} [[PAYLOAD:%[0-9]+]])
+// CHECK-SAME: (i{{[0-9]+}} {{[^%]+}} [[DISCRIMINANT:%[0-9]+]], ptr {{[^,]+}} [[PAYLOAD:%[0-9]+]])
 #[no_mangle]
 pub unsafe fn extract_box(x: Result<usize, Box<i32>>) -> Box<i32> {
     // CHECK: ret ptr [[PAYLOAD]]
diff --git a/tests/codegen/const-vector.rs b/tests/codegen/const-vector.rs
new file mode 100644
index 00000000000..d368838201e
--- /dev/null
+++ b/tests/codegen/const-vector.rs
@@ -0,0 +1,107 @@
+//@ compile-flags: -C no-prepopulate-passes -Copt-level=0
+
+// This test checks that constants of SIMD type are passed as immediate vectors.
+// We ensure that both vector representations (struct with fields and struct wrapping array) work.
+#![crate_type = "lib"]
+#![feature(abi_unadjusted)]
+#![feature(const_trait_impl)]
+#![feature(repr_simd)]
+#![feature(rustc_attrs)]
+#![feature(simd_ffi)]
+#![allow(non_camel_case_types)]
+
+// Setting up structs that can be used as const vectors
+#[repr(simd)]
+#[derive(Clone)]
+pub struct i8x2(i8, i8);
+
+#[repr(simd)]
+#[derive(Clone)]
+pub struct i8x2_arr([i8; 2]);
+
+#[repr(simd)]
+#[derive(Clone)]
+pub struct f32x2(f32, f32);
+
+#[repr(simd)]
+#[derive(Clone)]
+pub struct f32x2_arr([f32; 2]);
+
+#[repr(simd, packed)]
+#[derive(Copy, Clone)]
+pub struct Simd<T, const N: usize>([T; N]);
+
+// The following functions are required for the tests to ensure
+// that they are called with a const vector
+
+extern "unadjusted" {
+    #[no_mangle]
+    fn test_i8x2(a: i8x2);
+}
+
+extern "unadjusted" {
+    #[no_mangle]
+    fn test_i8x2_two_args(a: i8x2, b: i8x2);
+}
+
+extern "unadjusted" {
+    #[no_mangle]
+    fn test_i8x2_mixed_args(a: i8x2, c: i32, b: i8x2);
+}
+
+extern "unadjusted" {
+    #[no_mangle]
+    fn test_i8x2_arr(a: i8x2_arr);
+}
+
+extern "unadjusted" {
+    #[no_mangle]
+    fn test_f32x2(a: f32x2);
+}
+
+extern "unadjusted" {
+    #[no_mangle]
+    fn test_f32x2_arr(a: f32x2_arr);
+}
+
+extern "unadjusted" {
+    #[no_mangle]
+    fn test_simd(a: Simd<i32, 4>);
+}
+
+extern "unadjusted" {
+    #[no_mangle]
+    fn test_simd_unaligned(a: Simd<i32, 3>);
+}
+
+// Ensure the packed variant of the simd struct does not become a const vector
+// if the size is not a power of 2
+// CHECK: %"Simd<i32, 3>" = type { [3 x i32] }
+
+pub fn do_call() {
+    unsafe {
+        // CHECK: call void @test_i8x2(<2 x i8> <i8 32, i8 64>
+        test_i8x2(const { i8x2(32, 64) });
+
+        // CHECK: call void @test_i8x2_two_args(<2 x i8> <i8 32, i8 64>, <2 x i8> <i8 8, i8 16>
+        test_i8x2_two_args(const { i8x2(32, 64) }, const { i8x2(8, 16) });
+
+        // CHECK: call void @test_i8x2_mixed_args(<2 x i8> <i8 32, i8 64>, i32 43, <2 x i8> <i8 8, i8 16>
+        test_i8x2_mixed_args(const { i8x2(32, 64) }, 43, const { i8x2(8, 16) });
+
+        // CHECK: call void @test_i8x2_arr(<2 x i8> <i8 32, i8 64>
+        test_i8x2_arr(const { i8x2_arr([32, 64]) });
+
+        // CHECK: call void @test_f32x2(<2 x float> <float 0x3FD47AE140000000, float 0x3FE47AE140000000>
+        test_f32x2(const { f32x2(0.32, 0.64) });
+
+        // CHECK: void @test_f32x2_arr(<2 x float> <float 0x3FD47AE140000000, float 0x3FE47AE140000000>
+        test_f32x2_arr(const { f32x2_arr([0.32, 0.64]) });
+
+        // CHECK: call void @test_simd(<4 x i32> <i32 2, i32 4, i32 6, i32 8>
+        test_simd(const { Simd::<i32, 4>([2, 4, 6, 8]) });
+
+        // CHECK: call void @test_simd_unaligned(%"Simd<i32, 3>" %1
+        test_simd_unaligned(const { Simd::<i32, 3>([2, 4, 6]) });
+    }
+}
diff --git a/tests/codegen/default-requires-uwtable.rs b/tests/codegen/default-requires-uwtable.rs
index 567bd55ecc3..3cb35cea022 100644
--- a/tests/codegen/default-requires-uwtable.rs
+++ b/tests/codegen/default-requires-uwtable.rs
@@ -1,9 +1,9 @@
-//@ revisions: WINDOWS ANDROID
+//@ revisions: WINDOWS_ ANDROID_
 //@ compile-flags: -C panic=abort -Copt-level=0
-//@ [WINDOWS] compile-flags: --target=x86_64-pc-windows-msvc
-//@ [WINDOWS] needs-llvm-components: x86
-//@ [ANDROID] compile-flags: --target=armv7-linux-androideabi
-//@ [ANDROID] needs-llvm-components: arm
+//@ [WINDOWS_] compile-flags: --target=x86_64-pc-windows-msvc
+//@ [WINDOWS_] needs-llvm-components: x86
+//@ [ANDROID_] compile-flags: --target=armv7-linux-androideabi
+//@ [ANDROID_] needs-llvm-components: arm
 
 #![feature(no_core, lang_items)]
 #![crate_type = "lib"]
diff --git a/tests/codegen/enum/enum-match.rs b/tests/codegen/enum/enum-match.rs
index 8da5de63e67..a24b98050d2 100644
--- a/tests/codegen/enum/enum-match.rs
+++ b/tests/codegen/enum/enum-match.rs
@@ -34,7 +34,7 @@ pub enum Enum1 {
 
 // CHECK: define noundef{{( range\(i8 [0-9]+, [0-9]+\))?}} i8 @match1{{.*}}
 // CHECK-NEXT: start:
-// CHECK-NEXT: %1 = add i8 %0, -2
+// CHECK-NEXT: %1 = add{{( nsw)?}} i8 %0, -2
 // CHECK-NEXT: %2 = zext i8 %1 to i64
 // CHECK-NEXT: %3 = icmp ult i8 %1, 2
 // CHECK-NEXT: %4 = add nuw nsw i64 %2, 1
diff --git a/tests/codegen/function-arguments.rs b/tests/codegen/function-arguments.rs
index 56504df4034..bf9f405192b 100644
--- a/tests/codegen/function-arguments.rs
+++ b/tests/codegen/function-arguments.rs
@@ -50,7 +50,7 @@ pub fn maybeuninit_enum_bool(x: MaybeUninit<MyBool>) -> MaybeUninit<MyBool> {
     x
 }
 
-// CHECK: noundef i32 @char(i32 noundef %x)
+// CHECK: noundef{{( range\(i32 0, 1114112\))?}} i32 @char(i32 noundef{{( range\(i32 0, 1114112\))?}} %x)
 #[no_mangle]
 pub fn char(x: char) -> char {
     x
@@ -68,7 +68,7 @@ pub fn int(x: u64) -> u64 {
     x
 }
 
-// CHECK: noundef i64 @nonzero_int(i64 noundef %x)
+// CHECK: noundef{{( range\(i64 1, 0\))?}} i64 @nonzero_int(i64 noundef{{( range\(i64 1, 0\))?}} %x)
 #[no_mangle]
 pub fn nonzero_int(x: NonZero<u64>) -> NonZero<u64> {
     x
@@ -250,7 +250,7 @@ pub fn return_slice(x: &[u16]) -> &[u16] {
     x
 }
 
-// CHECK: { i16, i16 } @enum_id_1(i16 noundef %x.0, i16 %x.1)
+// CHECK: { i16, i16 } @enum_id_1(i16 noundef{{( range\(i16 0, 3\))?}} %x.0, i16 %x.1)
 #[no_mangle]
 pub fn enum_id_1(x: Option<Result<u16, u16>>) -> Option<Result<u16, u16>> {
     x
diff --git a/tests/codegen/instrument-coverage/testprog.rs b/tests/codegen/instrument-coverage/testprog.rs
index eea4d9cb3cf..655fe779fca 100644
--- a/tests/codegen/instrument-coverage/testprog.rs
+++ b/tests/codegen/instrument-coverage/testprog.rs
@@ -1,7 +1,7 @@
 //@ edition: 2021
 //@ compile-flags: -Zno-profiler-runtime
 //@ compile-flags: -Cinstrument-coverage -Copt-level=0
-//@ revisions: LINUX DARWIN WINDOWS
+//@ revisions: LINUX DARWIN WIN
 
 //@ [LINUX] only-linux
 //@ [LINUX] filecheck-flags: -DINSTR_PROF_DATA=__llvm_prf_data
@@ -19,13 +19,13 @@
 //@ [DARWIN] filecheck-flags: -DINSTR_PROF_COVFUN=__LLVM_COV,__llvm_covfun
 //@ [DARWIN] filecheck-flags: -DCOMDAT_IF_SUPPORTED=
 
-//@ [WINDOWS] only-windows
-//@ [WINDOWS] filecheck-flags: -DINSTR_PROF_DATA=.lprfd$M
-//@ [WINDOWS] filecheck-flags: -DINSTR_PROF_NAME=.lprfn$M
-//@ [WINDOWS] filecheck-flags: -DINSTR_PROF_CNTS=.lprfc$M
-//@ [WINDOWS] filecheck-flags: -DINSTR_PROF_COVMAP=.lcovmap$M
-//@ [WINDOWS] filecheck-flags: -DINSTR_PROF_COVFUN=.lcovfun$M
-//@ [WINDOWS] filecheck-flags: '-DCOMDAT_IF_SUPPORTED=, comdat'
+//@ [WIN] only-windows
+//@ [WIN] filecheck-flags: -DINSTR_PROF_DATA=.lprfd$M
+//@ [WIN] filecheck-flags: -DINSTR_PROF_NAME=.lprfn$M
+//@ [WIN] filecheck-flags: -DINSTR_PROF_CNTS=.lprfc$M
+//@ [WIN] filecheck-flags: -DINSTR_PROF_COVMAP=.lcovmap$M
+//@ [WIN] filecheck-flags: -DINSTR_PROF_COVFUN=.lcovfun$M
+//@ [WIN] filecheck-flags: '-DCOMDAT_IF_SUPPORTED=, comdat'
 
 // ignore-tidy-linelength
 
@@ -71,7 +71,7 @@ fn main() {
 // Check for metadata, variables, declarations, and function definitions injected
 // into LLVM IR when compiling with -Cinstrument-coverage.
 
-// WINDOWS:      $__llvm_profile_runtime_user = comdat any
+// WIN:          $__llvm_profile_runtime_user = comdat any
 
 // CHECK:        @__llvm_coverage_mapping = private constant
 // CHECK-SAME:   section "[[INSTR_PROF_COVMAP]]", align 8
@@ -79,7 +79,7 @@ fn main() {
 // CHECK:        @__covrec_{{[A-F0-9]+}}u = linkonce_odr hidden constant
 // CHECK-SAME:   section "[[INSTR_PROF_COVFUN]]"[[COMDAT_IF_SUPPORTED]], align 8
 
-// WINDOWS:      @__llvm_profile_runtime = external{{.*}}global i32
+// WIN:          @__llvm_profile_runtime = external{{.*}}global i32
 
 // CHECK:        @__profc__R{{[a-zA-Z0-9_]+}}testprog14will_be_called = {{private|internal}} global
 // CHECK-SAME:   section "[[INSTR_PROF_CNTS]]"{{.*}}, align 8
@@ -111,10 +111,10 @@ fn main() {
 
 // CHECK:        declare void @llvm.instrprof.increment(ptr, i64, i32, i32) #[[LLVM_INSTRPROF_INCREMENT_ATTR:[0-9]+]]
 
-// WINDOWS:      define linkonce_odr hidden i32 @__llvm_profile_runtime_user() #[[LLVM_PROFILE_RUNTIME_USER_ATTR:[0-9]+]] comdat {
-// WINDOWS-NEXT: %1 = load i32, ptr @__llvm_profile_runtime
-// WINDOWS-NEXT: ret i32 %1
-// WINDOWS-NEXT: }
+// WIN:          define linkonce_odr hidden i32 @__llvm_profile_runtime_user() #[[LLVM_PROFILE_RUNTIME_USER_ATTR:[0-9]+]] comdat {
+// WIN-NEXT:     %1 = load i32, ptr @__llvm_profile_runtime
+// WIN-NEXT:     ret i32 %1
+// WIN-NEXT:     }
 
 // CHECK:        attributes #[[LLVM_INSTRPROF_INCREMENT_ATTR]] = { nounwind }
-// WINDOWS:      attributes #[[LLVM_PROFILE_RUNTIME_USER_ATTR]] = { noinline }
+// WIN:          attributes #[[LLVM_PROFILE_RUNTIME_USER_ATTR]] = { noinline }
diff --git a/tests/codegen/intrinsics/nontemporal.rs b/tests/codegen/intrinsics/nontemporal.rs
index 076d6d6d9da..ff2d6296066 100644
--- a/tests/codegen/intrinsics/nontemporal.rs
+++ b/tests/codegen/intrinsics/nontemporal.rs
@@ -1,13 +1,37 @@
 //@ compile-flags: -O
+//@revisions: with_nontemporal without_nontemporal
+//@[with_nontemporal] compile-flags: --target aarch64-unknown-linux-gnu
+//@[with_nontemporal] needs-llvm-components: aarch64
+//@[without_nontemporal] compile-flags: --target x86_64-unknown-linux-gnu
+//@[without_nontemporal] needs-llvm-components: x86
 
-#![feature(core_intrinsics)]
+// Ensure that we *do* emit the `!nontemporal` flag on architectures where it
+// is well-behaved, but do *not* emit it on architectures where it is ill-behaved.
+// For more context, see <https://github.com/rust-lang/rust/issues/114582> and
+// <https://github.com/llvm/llvm-project/issues/64521>.
+
+#![feature(no_core, lang_items, intrinsics)]
+#![no_core]
 #![crate_type = "lib"]
 
+#[lang = "sized"]
+pub trait Sized {}
+#[lang = "copy"]
+pub trait Copy {}
+
+impl Copy for u32 {}
+impl<T> Copy for *mut T {}
+
+extern "rust-intrinsic" {
+    pub fn nontemporal_store<T>(ptr: *mut T, val: T);
+}
+
 #[no_mangle]
 pub fn a(a: &mut u32, b: u32) {
     // CHECK-LABEL: define{{.*}}void @a
-    // CHECK: store i32 %b, ptr %a, align 4, !nontemporal
+    // with_nontemporal: store i32 %b, ptr %a, align 4, !nontemporal
+    // without_nontemporal-NOT: nontemporal
     unsafe {
-        std::intrinsics::nontemporal_store(a, b);
+        nontemporal_store(a, b);
     }
 }
diff --git a/tests/codegen/intrinsics/select_unpredictable.rs b/tests/codegen/intrinsics/select_unpredictable.rs
new file mode 100644
index 00000000000..2054838dd79
--- /dev/null
+++ b/tests/codegen/intrinsics/select_unpredictable.rs
@@ -0,0 +1,35 @@
+//@ compile-flags: -O
+
+#![feature(core_intrinsics)]
+#![crate_type = "lib"]
+
+#[no_mangle]
+pub fn test_int(p: bool, a: u64, b: u64) -> u64 {
+    // CHECK-LABEL: define{{.*}} @test_int
+    // CHECK: select i1 %p, i64 %a, i64 %b, !unpredictable
+    core::intrinsics::select_unpredictable(p, a, b)
+}
+
+#[no_mangle]
+pub fn test_pair(p: bool, a: (u64, u64), b: (u64, u64)) -> (u64, u64) {
+    // CHECK-LABEL: define{{.*}} @test_pair
+    // CHECK: select i1 %p, {{.*}}, !unpredictable
+    core::intrinsics::select_unpredictable(p, a, b)
+}
+
+struct Large {
+    e: [u64; 100],
+}
+
+#[no_mangle]
+pub fn test_struct(p: bool, a: Large, b: Large) -> Large {
+    // CHECK-LABEL: define{{.*}} @test_struct
+    // CHECK: select i1 %p, {{.*}}, !unpredictable
+    core::intrinsics::select_unpredictable(p, a, b)
+}
+
+#[no_mangle]
+pub fn test_zst(p: bool, a: (), b: ()) -> () {
+    // CHECK-LABEL: define{{.*}} @test_zst
+    core::intrinsics::select_unpredictable(p, a, b)
+}
diff --git a/tests/codegen/intrinsics/transmute.rs b/tests/codegen/intrinsics/transmute.rs
index 04a91bb87f7..8c8e975d327 100644
--- a/tests/codegen/intrinsics/transmute.rs
+++ b/tests/codegen/intrinsics/transmute.rs
@@ -6,11 +6,10 @@
 #![feature(custom_mir)]
 #![allow(unreachable_code)]
 
-use std::intrinsics::{transmute, transmute_unchecked};
-use std::mem::MaybeUninit;
-
 // Some of these need custom MIR to not get removed by MIR optimizations.
 use std::intrinsics::mir::*;
+use std::intrinsics::{transmute, transmute_unchecked};
+use std::mem::MaybeUninit;
 
 pub enum ZstNever {}
 
diff --git a/tests/codegen/issues/issue-107681-unwrap_unchecked.rs b/tests/codegen/issues/issue-107681-unwrap_unchecked.rs
new file mode 100644
index 00000000000..7d9679d2322
--- /dev/null
+++ b/tests/codegen/issues/issue-107681-unwrap_unchecked.rs
@@ -0,0 +1,20 @@
+//@ compile-flags: -O
+//@ min-llvm-version: 19
+
+// Test for #107681.
+// Make sure we don't create `br` or `select` instructions.
+
+#![crate_type = "lib"]
+
+use std::iter::Copied;
+use std::slice::Iter;
+
+#[no_mangle]
+pub unsafe fn foo(x: &mut Copied<Iter<'_, u32>>) -> u32 {
+    // CHECK-LABEL: @foo(
+    // CHECK-NOT: br
+    // CHECK-NOT: select
+    // CHECK: [[RET:%.*]] = load i32, ptr
+    // CHECK-NEXT: ret i32 [[RET]]
+    x.next().unwrap_unchecked()
+}
diff --git a/tests/codegen/issues/issue-118306.rs b/tests/codegen/issues/issue-118306.rs
new file mode 100644
index 00000000000..8af1c6a971c
--- /dev/null
+++ b/tests/codegen/issues/issue-118306.rs
@@ -0,0 +1,23 @@
+//@ compile-flags: -O
+//@ min-llvm-version: 19
+//@ only-x86_64
+
+// Test for #118306.
+// Make sure we don't create `br` or `select` instructions.
+
+#![crate_type = "lib"]
+
+#[no_mangle]
+pub fn branchy(input: u64) -> u64 {
+    // CHECK-LABEL: @branchy(
+    // CHECK-NEXT:  start:
+    // CHECK-NEXT:    [[_2:%.*]] = and i64 [[INPUT:%.*]], 3
+    // CHECK-NEXT:    [[SWITCH_GEP:%.*]] = getelementptr inbounds [4 x i64], ptr @switch.table.branchy, i64 0, i64 [[_2]]
+    // CHECK-NEXT:    [[SWITCH_LOAD:%.*]] = load i64, ptr [[SWITCH_GEP]]
+    // CHECK-NEXT:    ret i64 [[SWITCH_LOAD]]
+    match input % 4 {
+        1 | 2 => 1,
+        3 => 2,
+        _ => 0,
+    }
+}
diff --git a/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs b/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs
new file mode 100644
index 00000000000..4b520a62069
--- /dev/null
+++ b/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs
@@ -0,0 +1,19 @@
+//@ compile-flags: -O
+//@ min-llvm-version: 19
+
+#![crate_type = "lib"]
+
+pub enum State {
+    A([u8; 753]),
+    B([u8; 753]),
+}
+
+// CHECK-LABEL: @update
+#[no_mangle]
+pub unsafe fn update(s: *mut State) {
+    // CHECK-NEXT: start:
+    // CHECK-NEXT: store i8
+    // CHECK-NEXT: ret
+    let State::A(v) = s.read() else { std::hint::unreachable_unchecked() };
+    s.write(State::B(v));
+}
diff --git a/tests/codegen/issues/issue-126585.rs b/tests/codegen/issues/issue-126585.rs
new file mode 100644
index 00000000000..a468efd728d
--- /dev/null
+++ b/tests/codegen/issues/issue-126585.rs
@@ -0,0 +1,24 @@
+//@ compile-flags: -Copt-level=s
+//@ min-llvm-version: 19
+//@ only-x86_64
+
+// Test for #126585.
+// Ensure that this IR doesn't have extra undef phi input, which also guarantees that this asm
+// doesn't have subsequent labels and unnecessary `jmp` instructions.
+
+#![crate_type = "lib"]
+
+#[no_mangle]
+fn checked_div_round(a: u64, b: u64) -> Option<u64> {
+    // CHECK-LABEL: @checked_div_round
+    // CHECK: phi
+    // CHECK-NOT: undef
+    // CHECK: phi
+    // CHECK-NOT: undef
+    match b {
+        0 => None,
+        1 => Some(a),
+        // `a / b` is computable and `(a % b) * 2` can not overflow since `b >= 2`.
+        b => Some(a / b + if (a % b) * 2 >= b { 1 } else { 0 }),
+    }
+}
diff --git a/tests/codegen/issues/issue-68667-unwrap-combinators.rs b/tests/codegen/issues/issue-68667-unwrap-combinators.rs
index 6bd4c566a0c..21a5a5bf4ee 100644
--- a/tests/codegen/issues/issue-68667-unwrap-combinators.rs
+++ b/tests/codegen/issues/issue-68667-unwrap-combinators.rs
@@ -5,7 +5,7 @@
 // MIR inlining now optimizes this code.
 
 // CHECK-LABEL: @unwrap_combinators
-// CHECK: icmp
+// CHECK: {{icmp|trunc}}
 // CHECK-NEXT: icmp
 // CHECK-NEXT: select i1
 // CHECK-NEXT: ret i1
diff --git a/tests/codegen/iter-repeat-n-trivial-drop.rs b/tests/codegen/iter-repeat-n-trivial-drop.rs
index 31020b77984..7de224b92d8 100644
--- a/tests/codegen/iter-repeat-n-trivial-drop.rs
+++ b/tests/codegen/iter-repeat-n-trivial-drop.rs
@@ -1,8 +1,9 @@
-//@ compile-flags: -O
+//@ compile-flags: -C opt-level=3
 //@ only-x86_64
 
 #![crate_type = "lib"]
 #![feature(iter_repeat_n)]
+#![feature(array_repeat)]
 
 #[derive(Clone)]
 pub struct NotCopy(u16);
@@ -54,3 +55,15 @@ pub fn vec_extend_via_iter_repeat_n() -> Vec<u8> {
     v.extend(std::iter::repeat_n(42_u8, n));
     v
 }
+
+// Array repeat uses `RepeatN::next_unchecked` internally,
+// so also check that the distinction disappears there.
+
+#[no_mangle]
+// CHECK-LABEL: @array_repeat_not_copy
+pub unsafe fn array_repeat_not_copy(item: NotCopy) -> [NotCopy; 8] {
+    // CHECK: insertelement {{.+}} i16 %item
+    // CHECK: shufflevector <8 x i16> {{.+}} zeroinitializer
+    // CHECK: store <8 x i16>
+    std::array::repeat(item)
+}
diff --git a/tests/codegen/range-attribute.rs b/tests/codegen/range-attribute.rs
new file mode 100644
index 00000000000..bb19bec0fb9
--- /dev/null
+++ b/tests/codegen/range-attribute.rs
@@ -0,0 +1,68 @@
+// Checks that range metadata gets emitted on functions result and arguments
+// with scalar value.
+
+//@ compile-flags: -O -C no-prepopulate-passes
+//@ min-llvm-version: 19
+
+#![crate_type = "lib"]
+
+use std::num::NonZero;
+
+// Hack to get the correct size for usize
+// CHECK: @helper([[USIZE:i[0-9]+]] noundef %_1)
+#[no_mangle]
+pub fn helper(_: usize) {}
+
+// CHECK: noundef range(i128 1, 0) i128 @nonzero_int(i128 noundef range(i128 1, 0) %x)
+#[no_mangle]
+pub fn nonzero_int(x: NonZero<u128>) -> NonZero<u128> {
+    x
+}
+
+// CHECK: noundef range(i8 0, 3) i8 @optional_bool(i8 noundef range(i8 0, 3) %x)
+#[no_mangle]
+pub fn optional_bool(x: Option<bool>) -> Option<bool> {
+    x
+}
+
+pub enum Enum0 {
+    A(bool),
+    B,
+    C,
+}
+
+// CHECK: noundef range(i8 0, 4) i8 @enum0_value(i8 noundef range(i8 0, 4) %x)
+#[no_mangle]
+pub fn enum0_value(x: Enum0) -> Enum0 {
+    x
+}
+
+pub enum Enum1 {
+    A(u64),
+    B(u64),
+    C(u64),
+}
+
+// CHECK: { [[ENUM1_TYP:i[0-9]+]], i64 } @enum1_value([[ENUM1_TYP]] noundef range([[ENUM1_TYP]] 0, 3) %x.0, i64 noundef %x.1)
+#[no_mangle]
+pub fn enum1_value(x: Enum1) -> Enum1 {
+    x
+}
+
+pub enum Enum2 {
+    A(Enum0),
+    B(Enum0),
+    C(Enum0),
+}
+
+// CHECK: { i8, i8 } @enum2_value(i8 noundef range(i8 0, 3) %x.0, i8 noundef %x.1)
+#[no_mangle]
+pub fn enum2_value(x: Enum2) -> Enum2 {
+    x
+}
+
+// CHECK: noundef [[USIZE]] @takes_slice(ptr noalias noundef nonnull readonly align 4 %x.0, [[USIZE]] noundef %x.1)
+#[no_mangle]
+pub fn takes_slice(x: &[i32]) -> usize {
+    x.len()
+}
diff --git a/tests/codegen/repr/transparent-sysv64.rs b/tests/codegen/repr/transparent-sysv64.rs
index afb06dcc1bd..068414976c5 100644
--- a/tests/codegen/repr/transparent-sysv64.rs
+++ b/tests/codegen/repr/transparent-sysv64.rs
@@ -1,12 +1,12 @@
-//@ revisions: linux apple windows
+//@ revisions: linux apple win
 //@ compile-flags: -O -C no-prepopulate-passes
 
 //@[linux] compile-flags: --target x86_64-unknown-linux-gnu
 //@[linux] needs-llvm-components: x86
 //@[apple] compile-flags: --target x86_64-apple-darwin
 //@[apple] needs-llvm-components: x86
-//@[windows] compile-flags: --target x86_64-pc-windows-msvc
-//@[windows] needs-llvm-components: x86
+//@[win] compile-flags: --target x86_64-pc-windows-msvc
+//@[win] needs-llvm-components: x86
 
 #![feature(no_core, lang_items)]
 #![crate_type = "lib"]
diff --git a/tests/codegen/repr/transparent.rs b/tests/codegen/repr/transparent.rs
index 4b41332db45..9140b8542ec 100644
--- a/tests/codegen/repr/transparent.rs
+++ b/tests/codegen/repr/transparent.rs
@@ -74,7 +74,7 @@ pub enum Bool {
     FileNotFound,
 }
 
-// CHECK: define{{( dso_local)?}} noundef{{( zeroext)?}} i8 @test_Gpz(i8 noundef{{( zeroext)?}} %_1)
+// CHECK: define{{( dso_local)?}} noundef{{( zeroext)?( range\(i8 0, 3\))?}} i8 @test_Gpz(i8 noundef{{( zeroext)?( range\(i8 0, 3\))?}} %_1)
 #[no_mangle]
 pub extern "C" fn test_Gpz(_: GenericPlusZst<Bool>) -> GenericPlusZst<Bool> {
     loop {}
diff --git a/tests/codegen/simd/issue-120720-reduce-nan.rs b/tests/codegen/simd/issue-120720-reduce-nan.rs
deleted file mode 100644
index 13af0bb076e..00000000000
--- a/tests/codegen/simd/issue-120720-reduce-nan.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-//@ compile-flags: -C opt-level=3 -C target-cpu=cannonlake
-//@ only-x86_64
-
-// In a previous implementation, _mm512_reduce_add_pd did the reduction with all fast-math flags
-// enabled, making it UB to reduce a vector containing a NaN.
-
-#![crate_type = "lib"]
-#![feature(stdarch_x86_avx512, avx512_target_feature)]
-use std::arch::x86_64::*;
-
-// CHECK-LABEL: @demo(
-#[no_mangle]
-#[target_feature(enable = "avx512f")] // Function-level target feature mismatches inhibit inlining
-pub unsafe fn demo() -> bool {
-    // CHECK: %0 = tail call reassoc double @llvm.vector.reduce.fadd.v8f64(
-    // CHECK: %_0.i = fcmp uno double %0, 0.000000e+00
-    // CHECK: ret i1 %_0.i
-    let res =
-        unsafe { _mm512_reduce_add_pd(_mm512_set_pd(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, f64::NAN)) };
-    res.is_nan()
-}
diff --git a/tests/codegen/sse42-implies-crc32.rs b/tests/codegen/sse42-implies-crc32.rs
index 94fcd77bc88..8a9c496a3a5 100644
--- a/tests/codegen/sse42-implies-crc32.rs
+++ b/tests/codegen/sse42-implies-crc32.rs
@@ -12,4 +12,4 @@ pub unsafe fn crc32sse(v: u8) -> u32 {
     _mm_crc32_u8(out, v)
 }
 
-// CHECK: attributes #0 {{.*"target-features"=".*\+sse4.2,\+crc32"}}
+// CHECK: attributes #0 {{.*"target-features"=".*\+sse4.2,\+crc32.*"}}
diff --git a/tests/codegen/target-feature-overrides.rs b/tests/codegen/target-feature-overrides.rs
index 1e2c364dbbc..f38a1ae72de 100644
--- a/tests/codegen/target-feature-overrides.rs
+++ b/tests/codegen/target-feature-overrides.rs
@@ -1,7 +1,7 @@
 //@ revisions: COMPAT INCOMPAT
 //@ needs-llvm-components: x86
 //@ compile-flags: --target=x86_64-unknown-linux-gnu -Copt-level=3
-//@ [COMPAT] compile-flags: -Ctarget-feature=+avx2,+avx
+//@ [COMPAT] compile-flags: -Ctarget-feature=+avx2
 //@ [INCOMPAT] compile-flags: -Ctarget-feature=-avx2,-avx
 
 // See also tests/assembly/target-feature-multiple.rs
@@ -39,8 +39,8 @@ pub unsafe fn banana() -> u32 {
 }
 
 // CHECK: attributes [[APPLEATTRS]]
-// COMPAT-SAME: "target-features"="+avx2,+avx,+avx"
-// INCOMPAT-SAME: "target-features"="-avx2,-avx,+avx"
+// COMPAT-SAME: "target-features"="+avx,+avx2,{{.*}}"
+// INCOMPAT-SAME: "target-features"="-avx2,-avx,+avx,{{.*}}"
 // CHECK: attributes [[BANANAATTRS]]
-// COMPAT-SAME: "target-features"="+avx2,+avx"
+// COMPAT-SAME: "target-features"="+avx,+avx2,{{.*}}"
 // INCOMPAT-SAME: "target-features"="-avx2,-avx"
diff --git a/tests/codegen/tied-features-strength.rs b/tests/codegen/tied-features-strength.rs
index 7f0805bc1b4..1b4596ae2cb 100644
--- a/tests/codegen/tied-features-strength.rs
+++ b/tests/codegen/tied-features-strength.rs
@@ -8,7 +8,7 @@
 // is LLVM-14 we can remove the optional regex matching for this feature.
 
 //@ [ENABLE_SVE] compile-flags: -C target-feature=+sve -Copt-level=0
-// ENABLE_SVE: attributes #0 = { {{.*}} "target-features"="{{((\+outline-atomics,?)|(\+v8a,?)?|(\+sve,?)|(\+neon,?))*}}" }
+// ENABLE_SVE: attributes #0 = { {{.*}} "target-features"="{{((\+outline-atomics,?)|(\+v8a,?)?|(\+sve,?)|(\+neon,?)|(\+fp-armv8,?))*}}" }
 
 //@ [DISABLE_SVE] compile-flags: -C target-feature=-sve -Copt-level=0
 // DISABLE_SVE: attributes #0 = { {{.*}} "target-features"="{{((\+outline-atomics,?)|(\+v8a,?)?|(-sve,?)|(\+neon,?))*}}" }
diff --git a/tests/coverage/mcdc/condition-limit.cov-map b/tests/coverage/mcdc/condition-limit.cov-map
index b4447a33691..b565353572a 100644
--- a/tests/coverage/mcdc/condition-limit.cov-map
+++ b/tests/coverage/mcdc/condition-limit.cov-map
@@ -1,5 +1,5 @@
 Function name: condition_limit::bad
-Raw bytes (204): 0x[01, 01, 2c, 01, 05, 05, 1d, 05, 1d, 7a, 19, 05, 1d, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 21, 9b, 01, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 11, 01, 14, 01, 03, 09, 20, 05, 02, 03, 08, 00, 09, 05, 00, 0d, 00, 0e, 20, 7a, 1d, 00, 0d, 00, 0e, 7a, 00, 12, 00, 13, 20, 76, 19, 00, 12, 00, 13, 76, 00, 17, 00, 18, 20, 72, 15, 00, 17, 00, 18, 72, 00, 1c, 00, 1d, 20, 6e, 11, 00, 1c, 00, 1d, 6e, 00, 21, 00, 22, 20, 6a, 0d, 00, 21, 00, 22, 6a, 00, 26, 00, 27, 20, 21, 09, 00, 26, 00, 27, 21, 00, 28, 02, 06, 9b, 01, 02, 06, 00, 07, 97, 01, 01, 01, 00, 02]
+Raw bytes (204): 0x[01, 01, 2c, 01, 05, 05, 1d, 05, 1d, 7a, 19, 05, 1d, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 6e, 0d, 72, 11, 76, 15, 7a, 19, 05, 1d, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 21, 9b, 01, 9f, 01, 02, a3, 01, 1d, a7, 01, 19, ab, 01, 15, af, 01, 11, 09, 0d, 11, 01, 15, 01, 03, 09, 20, 05, 02, 03, 08, 00, 09, 05, 00, 0d, 00, 0e, 20, 7a, 1d, 00, 0d, 00, 0e, 7a, 00, 12, 00, 13, 20, 76, 19, 00, 12, 00, 13, 76, 00, 17, 00, 18, 20, 72, 15, 00, 17, 00, 18, 72, 00, 1c, 00, 1d, 20, 6e, 11, 00, 1c, 00, 1d, 6e, 00, 21, 00, 22, 20, 6a, 0d, 00, 21, 00, 22, 6a, 00, 26, 00, 27, 20, 21, 09, 00, 26, 00, 27, 21, 00, 28, 02, 06, 9b, 01, 02, 06, 00, 07, 97, 01, 01, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 44
@@ -48,7 +48,7 @@ Number of expressions: 44
 - expression 42 operands: lhs = Expression(43, Add), rhs = Counter(4)
 - expression 43 operands: lhs = Counter(2), rhs = Counter(3)
 Number of file 0 mappings: 17
-- Code(Counter(0)) at (prev + 20, 1) to (start + 3, 9)
+- Code(Counter(0)) at (prev + 21, 1) to (start + 3, 9)
 - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 3, 8) to (start + 0, 9)
     true  = c1
     false = (c0 - c1)
@@ -88,7 +88,7 @@ Number of file 0 mappings: 17
     = (c8 + ((((((c2 + c3) + c4) + c5) + c6) + c7) + (c0 - c1)))
 
 Function name: condition_limit::good
-Raw bytes (180): 0x[01, 01, 20, 01, 05, 05, 19, 05, 19, 52, 15, 05, 19, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 1d, 6f, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 10, 01, 0c, 01, 03, 09, 28, 00, 06, 03, 08, 00, 22, 30, 05, 02, 01, 06, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 52, 19, 06, 05, 00, 00, 0d, 00, 0e, 52, 00, 12, 00, 13, 30, 4e, 15, 05, 04, 00, 00, 12, 00, 13, 4e, 00, 17, 00, 18, 30, 4a, 11, 04, 03, 00, 00, 17, 00, 18, 4a, 00, 1c, 00, 1d, 30, 46, 0d, 03, 02, 00, 00, 1c, 00, 1d, 46, 00, 21, 00, 22, 30, 1d, 09, 02, 00, 00, 00, 21, 00, 22, 1d, 00, 23, 02, 06, 6f, 02, 06, 00, 07, 6b, 01, 01, 00, 02]
+Raw bytes (180): 0x[01, 01, 20, 01, 05, 05, 19, 05, 19, 52, 15, 05, 19, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 4a, 0d, 4e, 11, 52, 15, 05, 19, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 1d, 6f, 73, 02, 77, 19, 7b, 15, 7f, 11, 09, 0d, 10, 01, 0d, 01, 03, 09, 28, 00, 06, 03, 08, 00, 22, 30, 05, 02, 01, 06, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 52, 19, 06, 05, 00, 00, 0d, 00, 0e, 52, 00, 12, 00, 13, 30, 4e, 15, 05, 04, 00, 00, 12, 00, 13, 4e, 00, 17, 00, 18, 30, 4a, 11, 04, 03, 00, 00, 17, 00, 18, 4a, 00, 1c, 00, 1d, 30, 46, 0d, 03, 02, 00, 00, 1c, 00, 1d, 46, 00, 21, 00, 22, 30, 1d, 09, 02, 00, 00, 00, 21, 00, 22, 1d, 00, 23, 02, 06, 6f, 02, 06, 00, 07, 6b, 01, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 32
@@ -125,7 +125,7 @@ Number of expressions: 32
 - expression 30 operands: lhs = Expression(31, Add), rhs = Counter(4)
 - expression 31 operands: lhs = Counter(2), rhs = Counter(3)
 Number of file 0 mappings: 16
-- Code(Counter(0)) at (prev + 12, 1) to (start + 3, 9)
+- Code(Counter(0)) at (prev + 13, 1) to (start + 3, 9)
 - MCDCDecision { bitmap_idx: 0, conditions_num: 6 } at (prev + 3, 8) to (start + 0, 34)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 6, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
     true  = c1
diff --git a/tests/coverage/mcdc/condition-limit.coverage b/tests/coverage/mcdc/condition-limit.coverage
index 4eb87432fab..81e832d6a49 100644
--- a/tests/coverage/mcdc/condition-limit.coverage
+++ b/tests/coverage/mcdc/condition-limit.coverage
@@ -1,6 +1,7 @@
    LL|       |#![feature(coverage_attribute)]
    LL|       |//@ edition: 2021
    LL|       |//@ min-llvm-version: 18
+   LL|       |//@ ignore-llvm-version: 19 - 99
    LL|       |//@ compile-flags: -Zcoverage-options=mcdc
    LL|       |//@ llvm-cov-flags: --show-branches=count --show-mcdc
    LL|       |
diff --git a/tests/coverage/mcdc/condition-limit.rs b/tests/coverage/mcdc/condition-limit.rs
index 571c600ebd0..2ff46b11a16 100644
--- a/tests/coverage/mcdc/condition-limit.rs
+++ b/tests/coverage/mcdc/condition-limit.rs
@@ -1,6 +1,7 @@
 #![feature(coverage_attribute)]
 //@ edition: 2021
 //@ min-llvm-version: 18
+//@ ignore-llvm-version: 19 - 99
 //@ compile-flags: -Zcoverage-options=mcdc
 //@ llvm-cov-flags: --show-branches=count --show-mcdc
 
diff --git a/tests/coverage/mcdc/if.cov-map b/tests/coverage/mcdc/if.cov-map
index 9a7d15f700d..ea8dedb0ac3 100644
--- a/tests/coverage/mcdc/if.cov-map
+++ b/tests/coverage/mcdc/if.cov-map
@@ -1,5 +1,5 @@
 Function name: if::mcdc_check_a
-Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 0f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
+Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 10, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 4
@@ -8,7 +8,7 @@ Number of expressions: 4
 - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
 - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
 Number of file 0 mappings: 8
-- Code(Counter(0)) at (prev + 15, 1) to (start + 1, 9)
+- Code(Counter(0)) at (prev + 16, 1) to (start + 1, 9)
 - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
     true  = c1
@@ -24,7 +24,7 @@ Number of file 0 mappings: 8
     = (c3 + (c2 + (c0 - c1)))
 
 Function name: if::mcdc_check_b
-Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 17, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
+Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 18, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 4
@@ -33,7 +33,7 @@ Number of expressions: 4
 - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
 - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
 Number of file 0 mappings: 8
-- Code(Counter(0)) at (prev + 23, 1) to (start + 1, 9)
+- Code(Counter(0)) at (prev + 24, 1) to (start + 1, 9)
 - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
     true  = c1
@@ -49,7 +49,7 @@ Number of file 0 mappings: 8
     = (c3 + (c2 + (c0 - c1)))
 
 Function name: if::mcdc_check_both
-Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 1f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
+Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 20, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 4
@@ -58,7 +58,7 @@ Number of expressions: 4
 - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
 - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
 Number of file 0 mappings: 8
-- Code(Counter(0)) at (prev + 31, 1) to (start + 1, 9)
+- Code(Counter(0)) at (prev + 32, 1) to (start + 1, 9)
 - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
     true  = c1
@@ -74,7 +74,7 @@ Number of file 0 mappings: 8
     = (c3 + (c2 + (c0 - c1)))
 
 Function name: if::mcdc_check_neither
-Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 07, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
+Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 08, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 4
@@ -83,7 +83,7 @@ Number of expressions: 4
 - expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
 - expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
 Number of file 0 mappings: 8
-- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 9)
+- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 9)
 - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
     true  = c1
@@ -99,7 +99,7 @@ Number of file 0 mappings: 8
     = (c3 + (c2 + (c0 - c1)))
 
 Function name: if::mcdc_check_not_tree_decision
-Raw bytes (87): 0x[01, 01, 08, 01, 05, 02, 09, 05, 09, 0d, 1e, 02, 09, 11, 1b, 0d, 1e, 02, 09, 0a, 01, 31, 01, 03, 0a, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 03, 00, 09, 00, 0a, 02, 00, 0e, 00, 0f, 30, 09, 1e, 03, 02, 00, 00, 0e, 00, 0f, 0b, 00, 14, 00, 15, 30, 11, 0d, 02, 00, 00, 00, 14, 00, 15, 11, 00, 16, 02, 06, 1b, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
+Raw bytes (87): 0x[01, 01, 08, 01, 05, 02, 09, 05, 09, 0d, 1e, 02, 09, 11, 1b, 0d, 1e, 02, 09, 0a, 01, 32, 01, 03, 0a, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 03, 00, 09, 00, 0a, 02, 00, 0e, 00, 0f, 30, 09, 1e, 03, 02, 00, 00, 0e, 00, 0f, 0b, 00, 14, 00, 15, 30, 11, 0d, 02, 00, 00, 00, 14, 00, 15, 11, 00, 16, 02, 06, 1b, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 8
@@ -112,7 +112,7 @@ Number of expressions: 8
 - expression 6 operands: lhs = Counter(3), rhs = Expression(7, Sub)
 - expression 7 operands: lhs = Expression(0, Sub), rhs = Counter(2)
 Number of file 0 mappings: 10
-- Code(Counter(0)) at (prev + 49, 1) to (start + 3, 10)
+- Code(Counter(0)) at (prev + 50, 1) to (start + 3, 10)
 - MCDCDecision { bitmap_idx: 0, conditions_num: 3 } at (prev + 3, 8) to (start + 0, 21)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 3 } at (prev + 0, 9) to (start + 0, 10)
     true  = c1
@@ -134,7 +134,7 @@ Number of file 0 mappings: 10
     = (c4 + (c3 + ((c0 - c1) - c2)))
 
 Function name: if::mcdc_check_tree_decision
-Raw bytes (87): 0x[01, 01, 08, 01, 05, 05, 0d, 05, 0d, 0d, 11, 09, 02, 1b, 1f, 0d, 11, 09, 02, 0a, 01, 27, 01, 03, 09, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0e, 00, 0f, 30, 0d, 0a, 02, 00, 03, 00, 0e, 00, 0f, 0a, 00, 13, 00, 14, 30, 11, 09, 03, 00, 00, 00, 13, 00, 14, 1b, 00, 16, 02, 06, 1f, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
+Raw bytes (87): 0x[01, 01, 08, 01, 05, 05, 0d, 05, 0d, 0d, 11, 09, 02, 1b, 1f, 0d, 11, 09, 02, 0a, 01, 28, 01, 03, 09, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0e, 00, 0f, 30, 0d, 0a, 02, 00, 03, 00, 0e, 00, 0f, 0a, 00, 13, 00, 14, 30, 11, 09, 03, 00, 00, 00, 13, 00, 14, 1b, 00, 16, 02, 06, 1f, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 8
@@ -147,7 +147,7 @@ Number of expressions: 8
 - expression 6 operands: lhs = Counter(3), rhs = Counter(4)
 - expression 7 operands: lhs = Counter(2), rhs = Expression(0, Sub)
 Number of file 0 mappings: 10
-- Code(Counter(0)) at (prev + 39, 1) to (start + 3, 9)
+- Code(Counter(0)) at (prev + 40, 1) to (start + 3, 9)
 - MCDCDecision { bitmap_idx: 0, conditions_num: 3 } at (prev + 3, 8) to (start + 0, 21)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
     true  = c1
@@ -169,7 +169,7 @@ Number of file 0 mappings: 10
     = ((c3 + c4) + (c2 + (c0 - c1)))
 
 Function name: if::mcdc_nested_if
-Raw bytes (124): 0x[01, 01, 0d, 01, 05, 02, 09, 05, 09, 1b, 15, 05, 09, 1b, 15, 05, 09, 11, 15, 02, 09, 2b, 32, 0d, 2f, 11, 15, 02, 09, 0e, 01, 3b, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 00, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 30, 09, 32, 02, 00, 00, 00, 0d, 00, 0e, 1b, 01, 09, 01, 0d, 28, 01, 02, 01, 0c, 00, 12, 30, 16, 15, 01, 02, 00, 00, 0c, 00, 0d, 16, 00, 11, 00, 12, 30, 0d, 11, 02, 00, 00, 00, 11, 00, 12, 0d, 00, 13, 02, 0a, 2f, 02, 0a, 00, 0b, 32, 01, 0c, 02, 06, 27, 03, 01, 00, 02]
+Raw bytes (124): 0x[01, 01, 0d, 01, 05, 02, 09, 05, 09, 1b, 15, 05, 09, 1b, 15, 05, 09, 11, 15, 02, 09, 2b, 32, 0d, 2f, 11, 15, 02, 09, 0e, 01, 3c, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 00, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 30, 09, 32, 02, 00, 00, 00, 0d, 00, 0e, 1b, 01, 09, 01, 0d, 28, 01, 02, 01, 0c, 00, 12, 30, 16, 15, 01, 02, 00, 00, 0c, 00, 0d, 16, 00, 11, 00, 12, 30, 0d, 11, 02, 00, 00, 00, 11, 00, 12, 0d, 00, 13, 02, 0a, 2f, 02, 0a, 00, 0b, 32, 01, 0c, 02, 06, 27, 03, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 13
@@ -187,7 +187,7 @@ Number of expressions: 13
 - expression 11 operands: lhs = Counter(4), rhs = Counter(5)
 - expression 12 operands: lhs = Expression(0, Sub), rhs = Counter(2)
 Number of file 0 mappings: 14
-- Code(Counter(0)) at (prev + 59, 1) to (start + 1, 9)
+- Code(Counter(0)) at (prev + 60, 1) to (start + 1, 9)
 - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 8) to (start + 0, 9)
     true  = c1
diff --git a/tests/coverage/mcdc/if.coverage b/tests/coverage/mcdc/if.coverage
index 91fff073d0c..dc93319950b 100644
--- a/tests/coverage/mcdc/if.coverage
+++ b/tests/coverage/mcdc/if.coverage
@@ -1,6 +1,7 @@
    LL|       |#![feature(coverage_attribute)]
    LL|       |//@ edition: 2021
    LL|       |//@ min-llvm-version: 18
+   LL|       |//@ ignore-llvm-version: 19 - 99
    LL|       |//@ compile-flags: -Zcoverage-options=mcdc
    LL|       |//@ llvm-cov-flags: --show-branches=count --show-mcdc
    LL|       |
diff --git a/tests/coverage/mcdc/if.rs b/tests/coverage/mcdc/if.rs
index d8e6b61a9d5..6f589659a3d 100644
--- a/tests/coverage/mcdc/if.rs
+++ b/tests/coverage/mcdc/if.rs
@@ -1,6 +1,7 @@
 #![feature(coverage_attribute)]
 //@ edition: 2021
 //@ min-llvm-version: 18
+//@ ignore-llvm-version: 19 - 99
 //@ compile-flags: -Zcoverage-options=mcdc
 //@ llvm-cov-flags: --show-branches=count --show-mcdc
 
diff --git a/tests/coverage/mcdc/inlined_expressions.cov-map b/tests/coverage/mcdc/inlined_expressions.cov-map
index 09b7291c964..8bb488c0dc0 100644
--- a/tests/coverage/mcdc/inlined_expressions.cov-map
+++ b/tests/coverage/mcdc/inlined_expressions.cov-map
@@ -1,5 +1,5 @@
 Function name: inlined_expressions::inlined_instance
-Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 08, 01, 01, 06, 28, 00, 02, 01, 05, 00, 0b, 30, 05, 02, 01, 02, 00, 00, 05, 00, 06, 05, 00, 0a, 00, 0b, 30, 09, 0d, 02, 00, 00, 00, 0a, 00, 0b, 07, 01, 01, 00, 02]
+Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 09, 01, 01, 06, 28, 00, 02, 01, 05, 00, 0b, 30, 05, 02, 01, 02, 00, 00, 05, 00, 06, 05, 00, 0a, 00, 0b, 30, 09, 0d, 02, 00, 00, 00, 0a, 00, 0b, 07, 01, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 3
@@ -7,7 +7,7 @@ Number of expressions: 3
 - expression 1 operands: lhs = Expression(2, Add), rhs = Expression(0, Sub)
 - expression 2 operands: lhs = Counter(2), rhs = Counter(3)
 Number of file 0 mappings: 6
-- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 6)
+- Code(Counter(0)) at (prev + 9, 1) to (start + 1, 6)
 - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 5) to (start + 0, 11)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 5) to (start + 0, 6)
     true  = c1
diff --git a/tests/coverage/mcdc/inlined_expressions.coverage b/tests/coverage/mcdc/inlined_expressions.coverage
index 5b083d62186..4e4800310c9 100644
--- a/tests/coverage/mcdc/inlined_expressions.coverage
+++ b/tests/coverage/mcdc/inlined_expressions.coverage
@@ -1,6 +1,7 @@
    LL|       |#![feature(coverage_attribute)]
    LL|       |//@ edition: 2021
    LL|       |//@ min-llvm-version: 18
+   LL|       |//@ ignore-llvm-version: 19 - 99
    LL|       |//@ compile-flags: -Zcoverage-options=mcdc -Copt-level=z -Cllvm-args=--inline-threshold=0
    LL|       |//@ llvm-cov-flags: --show-branches=count --show-mcdc
    LL|       |
diff --git a/tests/coverage/mcdc/inlined_expressions.rs b/tests/coverage/mcdc/inlined_expressions.rs
index 65f7ee66f39..fc1e4dae37c 100644
--- a/tests/coverage/mcdc/inlined_expressions.rs
+++ b/tests/coverage/mcdc/inlined_expressions.rs
@@ -1,6 +1,7 @@
 #![feature(coverage_attribute)]
 //@ edition: 2021
 //@ min-llvm-version: 18
+//@ ignore-llvm-version: 19 - 99
 //@ compile-flags: -Zcoverage-options=mcdc -Copt-level=z -Cllvm-args=--inline-threshold=0
 //@ llvm-cov-flags: --show-branches=count --show-mcdc
 
diff --git a/tests/coverage/mcdc/nested_if.cov-map b/tests/coverage/mcdc/nested_if.cov-map
index adeb6cbc1fb..0bd2aef814c 100644
--- a/tests/coverage/mcdc/nested_if.cov-map
+++ b/tests/coverage/mcdc/nested_if.cov-map
@@ -1,5 +1,5 @@
 Function name: nested_if::doubly_nested_if_in_condition
-Raw bytes (168): 0x[01, 01, 0e, 01, 05, 05, 11, 05, 11, 26, 19, 05, 11, 19, 1d, 19, 1d, 1d, 22, 26, 19, 05, 11, 11, 15, 09, 02, 0d, 37, 09, 02, 14, 01, 0f, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 01, 02, 00, 10, 00, 36, 30, 11, 26, 01, 00, 02, 00, 10, 00, 11, 30, 15, 21, 02, 00, 00, 00, 15, 00, 36, 26, 00, 18, 00, 19, 28, 00, 02, 00, 18, 00, 1e, 30, 19, 22, 01, 02, 00, 00, 18, 00, 19, 19, 00, 1d, 00, 1e, 30, 1a, 1d, 02, 00, 00, 00, 1d, 00, 1e, 1a, 00, 21, 00, 25, 1f, 00, 2f, 00, 34, 2b, 00, 39, 00, 3e, 21, 00, 48, 00, 4c, 0d, 00, 4f, 02, 06, 37, 02, 0c, 02, 06, 33, 03, 01, 00, 02]
+Raw bytes (168): 0x[01, 01, 0e, 01, 05, 05, 11, 05, 11, 26, 19, 05, 11, 19, 1d, 19, 1d, 1d, 22, 26, 19, 05, 11, 11, 15, 09, 02, 0d, 37, 09, 02, 14, 01, 10, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 01, 02, 00, 10, 00, 36, 30, 11, 26, 01, 00, 02, 00, 10, 00, 11, 30, 15, 21, 02, 00, 00, 00, 15, 00, 36, 26, 00, 18, 00, 19, 28, 00, 02, 00, 18, 00, 1e, 30, 19, 22, 01, 02, 00, 00, 18, 00, 19, 19, 00, 1d, 00, 1e, 30, 1a, 1d, 02, 00, 00, 00, 1d, 00, 1e, 1a, 00, 21, 00, 25, 1f, 00, 2f, 00, 34, 2b, 00, 39, 00, 3e, 21, 00, 48, 00, 4c, 0d, 00, 4f, 02, 06, 37, 02, 0c, 02, 06, 33, 03, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 14
@@ -18,7 +18,7 @@ Number of expressions: 14
 - expression 12 operands: lhs = Counter(3), rhs = Expression(13, Add)
 - expression 13 operands: lhs = Counter(2), rhs = Expression(0, Sub)
 Number of file 0 mappings: 20
-- Code(Counter(0)) at (prev + 15, 1) to (start + 1, 9)
+- Code(Counter(0)) at (prev + 16, 1) to (start + 1, 9)
 - MCDCDecision { bitmap_idx: 2, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 78)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
     true  = c1
@@ -58,7 +58,7 @@ Number of file 0 mappings: 20
     = (c3 + (c2 + (c0 - c1)))
 
 Function name: nested_if::nested_if_in_condition
-Raw bytes (120): 0x[01, 01, 0b, 01, 05, 05, 11, 05, 11, 1e, 15, 05, 11, 11, 15, 1e, 15, 05, 11, 09, 02, 0d, 2b, 09, 02, 0e, 01, 07, 01, 01, 09, 28, 01, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 1e, 01, 00, 02, 00, 10, 00, 11, 1e, 00, 15, 00, 16, 30, 15, 1a, 02, 00, 00, 00, 15, 00, 16, 17, 00, 19, 00, 1d, 1a, 00, 27, 00, 2c, 0d, 00, 2f, 02, 06, 2b, 02, 0c, 02, 06, 27, 03, 01, 00, 02]
+Raw bytes (120): 0x[01, 01, 0b, 01, 05, 05, 11, 05, 11, 1e, 15, 05, 11, 11, 15, 1e, 15, 05, 11, 09, 02, 0d, 2b, 09, 02, 0e, 01, 08, 01, 01, 09, 28, 01, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 1e, 01, 00, 02, 00, 10, 00, 11, 1e, 00, 15, 00, 16, 30, 15, 1a, 02, 00, 00, 00, 15, 00, 16, 17, 00, 19, 00, 1d, 1a, 00, 27, 00, 2c, 0d, 00, 2f, 02, 06, 2b, 02, 0c, 02, 06, 27, 03, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 11
@@ -74,7 +74,7 @@ Number of expressions: 11
 - expression 9 operands: lhs = Counter(3), rhs = Expression(10, Add)
 - expression 10 operands: lhs = Counter(2), rhs = Expression(0, Sub)
 Number of file 0 mappings: 14
-- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 9)
+- Code(Counter(0)) at (prev + 8, 1) to (start + 1, 9)
 - MCDCDecision { bitmap_idx: 1, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 46)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
     true  = c1
@@ -103,7 +103,7 @@ Number of file 0 mappings: 14
     = (c3 + (c2 + (c0 - c1)))
 
 Function name: nested_if::nested_in_then_block_in_condition
-Raw bytes (176): 0x[01, 01, 12, 01, 05, 05, 11, 05, 11, 3a, 15, 05, 11, 11, 15, 33, 19, 11, 15, 19, 1d, 19, 1d, 1d, 2e, 33, 19, 11, 15, 3a, 15, 05, 11, 09, 02, 0d, 47, 09, 02, 14, 01, 22, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 3a, 01, 00, 02, 00, 10, 00, 11, 3a, 00, 15, 00, 16, 30, 15, 36, 02, 00, 00, 00, 15, 00, 16, 33, 00, 1c, 00, 1d, 28, 01, 02, 00, 1c, 00, 22, 30, 19, 2e, 01, 02, 00, 00, 1c, 00, 1d, 19, 00, 21, 00, 22, 30, 26, 1d, 02, 00, 00, 00, 21, 00, 22, 26, 00, 25, 00, 29, 2b, 00, 33, 00, 38, 36, 00, 44, 00, 49, 0d, 00, 4c, 02, 06, 47, 02, 0c, 02, 06, 43, 03, 01, 00, 02]
+Raw bytes (176): 0x[01, 01, 12, 01, 05, 05, 11, 05, 11, 3a, 15, 05, 11, 11, 15, 33, 19, 11, 15, 19, 1d, 19, 1d, 1d, 2e, 33, 19, 11, 15, 3a, 15, 05, 11, 09, 02, 0d, 47, 09, 02, 14, 01, 23, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 3a, 01, 00, 02, 00, 10, 00, 11, 3a, 00, 15, 00, 16, 30, 15, 36, 02, 00, 00, 00, 15, 00, 16, 33, 00, 1c, 00, 1d, 28, 01, 02, 00, 1c, 00, 22, 30, 19, 2e, 01, 02, 00, 00, 1c, 00, 1d, 19, 00, 21, 00, 22, 30, 26, 1d, 02, 00, 00, 00, 21, 00, 22, 26, 00, 25, 00, 29, 2b, 00, 33, 00, 38, 36, 00, 44, 00, 49, 0d, 00, 4c, 02, 06, 47, 02, 0c, 02, 06, 43, 03, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 18
@@ -126,7 +126,7 @@ Number of expressions: 18
 - expression 16 operands: lhs = Counter(3), rhs = Expression(17, Add)
 - expression 17 operands: lhs = Counter(2), rhs = Expression(0, Sub)
 Number of file 0 mappings: 20
-- Code(Counter(0)) at (prev + 34, 1) to (start + 1, 9)
+- Code(Counter(0)) at (prev + 35, 1) to (start + 1, 9)
 - MCDCDecision { bitmap_idx: 2, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 75)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
     true  = c1
@@ -167,7 +167,7 @@ Number of file 0 mappings: 20
     = (c3 + (c2 + (c0 - c1)))
 
 Function name: nested_if::nested_single_condition_decision
-Raw bytes (85): 0x[01, 01, 06, 01, 05, 05, 11, 05, 11, 09, 02, 0d, 17, 09, 02, 0b, 01, 17, 01, 04, 09, 28, 00, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 11, 0a, 00, 10, 00, 11, 11, 00, 14, 00, 19, 0a, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 17, 02, 0c, 02, 06, 13, 03, 01, 00, 02]
+Raw bytes (85): 0x[01, 01, 06, 01, 05, 05, 11, 05, 11, 09, 02, 0d, 17, 09, 02, 0b, 01, 18, 01, 04, 09, 28, 00, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 11, 0a, 00, 10, 00, 11, 11, 00, 14, 00, 19, 0a, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 17, 02, 0c, 02, 06, 13, 03, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 6
@@ -178,7 +178,7 @@ Number of expressions: 6
 - expression 4 operands: lhs = Counter(3), rhs = Expression(5, Add)
 - expression 5 operands: lhs = Counter(2), rhs = Expression(0, Sub)
 Number of file 0 mappings: 11
-- Code(Counter(0)) at (prev + 23, 1) to (start + 4, 9)
+- Code(Counter(0)) at (prev + 24, 1) to (start + 4, 9)
 - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 4, 8) to (start + 0, 41)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
     true  = c1
diff --git a/tests/coverage/mcdc/nested_if.coverage b/tests/coverage/mcdc/nested_if.coverage
index a273a713a8a..916bb94745d 100644
--- a/tests/coverage/mcdc/nested_if.coverage
+++ b/tests/coverage/mcdc/nested_if.coverage
@@ -1,6 +1,7 @@
    LL|       |#![feature(coverage_attribute)]
    LL|       |//@ edition: 2021
    LL|       |//@ min-llvm-version: 18
+   LL|       |//@ ignore-llvm-version: 19 - 99
    LL|       |//@ compile-flags: -Zcoverage-options=mcdc
    LL|       |//@ llvm-cov-flags: --show-branches=count --show-mcdc
    LL|       |
diff --git a/tests/coverage/mcdc/nested_if.rs b/tests/coverage/mcdc/nested_if.rs
index f5068b5dcc2..f9ce7a0bc25 100644
--- a/tests/coverage/mcdc/nested_if.rs
+++ b/tests/coverage/mcdc/nested_if.rs
@@ -1,6 +1,7 @@
 #![feature(coverage_attribute)]
 //@ edition: 2021
 //@ min-llvm-version: 18
+//@ ignore-llvm-version: 19 - 99
 //@ compile-flags: -Zcoverage-options=mcdc
 //@ llvm-cov-flags: --show-branches=count --show-mcdc
 
diff --git a/tests/coverage/mcdc/non_control_flow.cov-map b/tests/coverage/mcdc/non_control_flow.cov-map
index f8576831e75..0c6928b684d 100644
--- a/tests/coverage/mcdc/non_control_flow.cov-map
+++ b/tests/coverage/mcdc/non_control_flow.cov-map
@@ -1,5 +1,5 @@
 Function name: non_control_flow::assign_3
-Raw bytes (89): 0x[01, 01, 09, 05, 07, 0b, 11, 09, 0d, 01, 05, 01, 05, 22, 11, 01, 05, 22, 11, 01, 05, 0a, 01, 16, 01, 00, 28, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 22, 01, 00, 02, 00, 0d, 00, 0e, 22, 00, 12, 00, 13, 30, 1e, 11, 02, 03, 00, 00, 12, 00, 13, 1e, 00, 17, 00, 18, 30, 09, 0d, 03, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02]
+Raw bytes (89): 0x[01, 01, 09, 05, 07, 0b, 11, 09, 0d, 01, 05, 01, 05, 22, 11, 01, 05, 22, 11, 01, 05, 0a, 01, 17, 01, 00, 28, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 22, 01, 00, 02, 00, 0d, 00, 0e, 22, 00, 12, 00, 13, 30, 1e, 11, 02, 03, 00, 00, 12, 00, 13, 1e, 00, 17, 00, 18, 30, 09, 0d, 03, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 9
@@ -13,7 +13,7 @@ Number of expressions: 9
 - expression 7 operands: lhs = Expression(8, Sub), rhs = Counter(4)
 - expression 8 operands: lhs = Counter(0), rhs = Counter(1)
 Number of file 0 mappings: 10
-- Code(Counter(0)) at (prev + 22, 1) to (start + 0, 40)
+- Code(Counter(0)) at (prev + 23, 1) to (start + 0, 40)
 - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
     = (c1 + ((c2 + c3) + c4))
 - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
@@ -35,7 +35,7 @@ Number of file 0 mappings: 10
     = (c1 + ((c2 + c3) + c4))
 
 Function name: non_control_flow::assign_3_bis
-Raw bytes (85): 0x[01, 01, 07, 07, 11, 09, 0d, 01, 05, 05, 09, 16, 1a, 05, 09, 01, 05, 0a, 01, 1b, 01, 00, 2c, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 1a, 01, 03, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 16, 03, 00, 02, 00, 12, 00, 13, 13, 00, 17, 00, 18, 30, 0d, 11, 02, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02]
+Raw bytes (85): 0x[01, 01, 07, 07, 11, 09, 0d, 01, 05, 05, 09, 16, 1a, 05, 09, 01, 05, 0a, 01, 1c, 01, 00, 2c, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 03, 00, 0d, 00, 18, 30, 05, 1a, 01, 03, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 16, 03, 00, 02, 00, 12, 00, 13, 13, 00, 17, 00, 18, 30, 0d, 11, 02, 00, 00, 00, 17, 00, 18, 03, 01, 05, 01, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 7
@@ -47,7 +47,7 @@ Number of expressions: 7
 - expression 5 operands: lhs = Counter(1), rhs = Counter(2)
 - expression 6 operands: lhs = Counter(0), rhs = Counter(1)
 Number of file 0 mappings: 10
-- Code(Counter(0)) at (prev + 27, 1) to (start + 0, 44)
+- Code(Counter(0)) at (prev + 28, 1) to (start + 0, 44)
 - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
     = ((c2 + c3) + c4)
 - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
@@ -68,7 +68,7 @@ Number of file 0 mappings: 10
     = ((c2 + c3) + c4)
 
 Function name: non_control_flow::assign_and
-Raw bytes (64): 0x[01, 01, 04, 07, 0e, 09, 0d, 01, 05, 01, 05, 08, 01, 0c, 01, 00, 21, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02]
+Raw bytes (64): 0x[01, 01, 04, 07, 0e, 09, 0d, 01, 05, 01, 05, 08, 01, 0d, 01, 00, 21, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 4
@@ -77,7 +77,7 @@ Number of expressions: 4
 - expression 2 operands: lhs = Counter(0), rhs = Counter(1)
 - expression 3 operands: lhs = Counter(0), rhs = Counter(1)
 Number of file 0 mappings: 8
-- Code(Counter(0)) at (prev + 12, 1) to (start + 0, 33)
+- Code(Counter(0)) at (prev + 13, 1) to (start + 0, 33)
 - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
     = ((c2 + c3) + (c0 - c1))
 - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
@@ -93,7 +93,7 @@ Number of file 0 mappings: 8
     = ((c2 + c3) + (c0 - c1))
 
 Function name: non_control_flow::assign_or
-Raw bytes (64): 0x[01, 01, 04, 07, 0d, 05, 09, 01, 05, 01, 05, 08, 01, 11, 01, 00, 20, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 00, 02, 00, 0d, 00, 0e, 0e, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02]
+Raw bytes (64): 0x[01, 01, 04, 07, 0d, 05, 09, 01, 05, 01, 05, 08, 01, 12, 01, 00, 20, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 02, 00, 0d, 00, 13, 30, 05, 0e, 01, 00, 02, 00, 0d, 00, 0e, 0e, 00, 12, 00, 13, 30, 09, 0d, 02, 00, 00, 00, 12, 00, 13, 03, 01, 05, 01, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 4
@@ -102,7 +102,7 @@ Number of expressions: 4
 - expression 2 operands: lhs = Counter(0), rhs = Counter(1)
 - expression 3 operands: lhs = Counter(0), rhs = Counter(1)
 Number of file 0 mappings: 8
-- Code(Counter(0)) at (prev + 17, 1) to (start + 0, 32)
+- Code(Counter(0)) at (prev + 18, 1) to (start + 0, 32)
 - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
     = ((c1 + c2) + c3)
 - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
@@ -119,15 +119,15 @@ Number of file 0 mappings: 8
     = ((c1 + c2) + c3)
 
 Function name: non_control_flow::foo
-Raw bytes (9): 0x[01, 01, 00, 01, 01, 25, 01, 02, 02]
+Raw bytes (9): 0x[01, 01, 00, 01, 01, 26, 01, 02, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 0
 Number of file 0 mappings: 1
-- Code(Counter(0)) at (prev + 37, 1) to (start + 2, 2)
+- Code(Counter(0)) at (prev + 38, 1) to (start + 2, 2)
 
 Function name: non_control_flow::func_call
-Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 29, 01, 01, 0a, 28, 00, 02, 01, 09, 00, 0f, 30, 05, 02, 01, 02, 00, 00, 09, 00, 0a, 05, 00, 0e, 00, 0f, 30, 09, 0d, 02, 00, 00, 00, 0e, 00, 0f, 07, 01, 01, 00, 02]
+Raw bytes (52): 0x[01, 01, 03, 01, 05, 0b, 02, 09, 0d, 06, 01, 2a, 01, 01, 0a, 28, 00, 02, 01, 09, 00, 0f, 30, 05, 02, 01, 02, 00, 00, 09, 00, 0a, 05, 00, 0e, 00, 0f, 30, 09, 0d, 02, 00, 00, 00, 0e, 00, 0f, 07, 01, 01, 00, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 3
@@ -135,7 +135,7 @@ Number of expressions: 3
 - expression 1 operands: lhs = Expression(2, Add), rhs = Expression(0, Sub)
 - expression 2 operands: lhs = Counter(2), rhs = Counter(3)
 Number of file 0 mappings: 6
-- Code(Counter(0)) at (prev + 41, 1) to (start + 1, 10)
+- Code(Counter(0)) at (prev + 42, 1) to (start + 1, 10)
 - MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 9) to (start + 0, 15)
 - MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 9) to (start + 0, 10)
     true  = c1
@@ -148,7 +148,7 @@ Number of file 0 mappings: 6
     = ((c2 + c3) + (c0 - c1))
 
 Function name: non_control_flow::right_comb_tree
-Raw bytes (139): 0x[01, 01, 13, 07, 1a, 0b, 19, 0f, 15, 13, 11, 09, 0d, 01, 05, 01, 05, 05, 19, 05, 19, 4a, 15, 05, 19, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 0e, 01, 20, 01, 00, 41, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 05, 00, 0d, 00, 2a, 30, 05, 1a, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 13, 00, 14, 30, 4a, 19, 02, 03, 00, 00, 13, 00, 14, 4a, 00, 19, 00, 1a, 30, 46, 15, 03, 04, 00, 00, 19, 00, 1a, 46, 00, 1f, 00, 20, 30, 42, 11, 04, 05, 00, 00, 1f, 00, 20, 42, 00, 24, 00, 27, 30, 09, 0d, 05, 00, 00, 00, 24, 00, 27, 03, 01, 05, 01, 02]
+Raw bytes (139): 0x[01, 01, 13, 07, 1a, 0b, 19, 0f, 15, 13, 11, 09, 0d, 01, 05, 01, 05, 05, 19, 05, 19, 4a, 15, 05, 19, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 46, 11, 4a, 15, 05, 19, 0e, 01, 21, 01, 00, 41, 03, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 28, 00, 05, 00, 0d, 00, 2a, 30, 05, 1a, 01, 02, 00, 00, 0d, 00, 0e, 05, 00, 13, 00, 14, 30, 4a, 19, 02, 03, 00, 00, 13, 00, 14, 4a, 00, 19, 00, 1a, 30, 46, 15, 03, 04, 00, 00, 19, 00, 1a, 46, 00, 1f, 00, 20, 30, 42, 11, 04, 05, 00, 00, 1f, 00, 20, 42, 00, 24, 00, 27, 30, 09, 0d, 05, 00, 00, 00, 24, 00, 27, 03, 01, 05, 01, 02]
 Number of files: 1
 - file 0 => global file 1
 Number of expressions: 19
@@ -172,7 +172,7 @@ Number of expressions: 19
 - expression 17 operands: lhs = Expression(18, Sub), rhs = Counter(5)
 - expression 18 operands: lhs = Counter(1), rhs = Counter(6)
 Number of file 0 mappings: 14
-- Code(Counter(0)) at (prev + 32, 1) to (start + 0, 65)
+- Code(Counter(0)) at (prev + 33, 1) to (start + 0, 65)
 - Code(Expression(0, Add)) at (prev + 1, 9) to (start + 0, 10)
     = (((((c2 + c3) + c4) + c5) + c6) + (c0 - c1))
 - Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14)
diff --git a/tests/coverage/mcdc/non_control_flow.coverage b/tests/coverage/mcdc/non_control_flow.coverage
index 6ae796e8ed2..c64f61a153c 100644
--- a/tests/coverage/mcdc/non_control_flow.coverage
+++ b/tests/coverage/mcdc/non_control_flow.coverage
@@ -1,6 +1,7 @@
    LL|       |#![feature(coverage_attribute)]
    LL|       |//@ edition: 2021
    LL|       |//@ min-llvm-version: 18
+   LL|       |//@ ignore-llvm-version: 19 - 99
    LL|       |//@ compile-flags: -Zcoverage-options=mcdc
    LL|       |//@ llvm-cov-flags: --show-branches=count --show-mcdc
    LL|       |
diff --git a/tests/coverage/mcdc/non_control_flow.rs b/tests/coverage/mcdc/non_control_flow.rs
index 77e64e6625b..633d381a1aa 100644
--- a/tests/coverage/mcdc/non_control_flow.rs
+++ b/tests/coverage/mcdc/non_control_flow.rs
@@ -1,6 +1,7 @@
 #![feature(coverage_attribute)]
 //@ edition: 2021
 //@ min-llvm-version: 18
+//@ ignore-llvm-version: 19 - 99
 //@ compile-flags: -Zcoverage-options=mcdc
 //@ llvm-cov-flags: --show-branches=count --show-mcdc
 
diff --git a/tests/crashes/119716-2.rs b/tests/crashes/119716-2.rs
index 9cdc4417f5b..47bffb5c1de 100644
--- a/tests/crashes/119716-2.rs
+++ b/tests/crashes/119716-2.rs
@@ -1,4 +1,4 @@
 //@ known-bug: #119716
 #![feature(non_lifetime_binders)]
 trait Trait<T> {}
-fn f<T>() -> impl for<T> Trait<impl Trait<T>> {}
+fn f() -> impl for<T> Trait<impl Trait<T>> {}
diff --git a/tests/crashes/121127.rs b/tests/crashes/121127.rs
index 2e64bf68b82..e50dc7763fc 100644
--- a/tests/crashes/121127.rs
+++ b/tests/crashes/121127.rs
@@ -1,5 +1,5 @@
 //@ known-bug: #121127
-//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes -C debuginfo=2
+//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes -C debuginfo=2
 // Note that as of PR#123949 this only crashes with debuginfo enabled
 
 #![feature(specialization)]
diff --git a/tests/crashes/121613-2.rs b/tests/crashes/121613-2.rs
deleted file mode 100644
index ddc4f37c96a..00000000000
--- a/tests/crashes/121613-2.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-//@ known-bug: #121613
-fn main() {
-    // destructure through a qualified path
-    let <Foo as A>::Assoc { br } = StructStruct { br: 2 };
-    //~^ ERROR usage of qualified paths in this context is experimental
-    let _ = <Foo as A>::Assoc { br: 2 };
-    //~^ ERROR usage of qualified paths in this context is experimental
-    let <E>::V(..) = E::V(|a, b| a.cmp(b));
-    //~^ ERROR usage of qualified paths in this context is experimental
-}
-
-struct StructStruct {
-    br: i8,
-}
-
-struct Foo;
-
-trait A {
-    type Assoc;
-}
-
-impl A for Foo {
-    type Assoc = StructStruct;
-}
-
-enum E {
-    V(u8)
-}
diff --git a/tests/crashes/121613.rs b/tests/crashes/121613.rs
deleted file mode 100644
index ec9ba82a68c..00000000000
--- a/tests/crashes/121613.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-//@ known-bug: #121613
-fn main() {
-    let _ = <Foo as A>::Assoc { br: 2 };
-
-    let <E>::V(..) = E::V(|a, b| a.cmp(b));
-}
-
-struct StructStruct {
-    br: i8,
-}
-
-struct Foo;
-
-trait A {
-    type Assoc;
-}
-
-impl A for Foo {
-    type Assoc = StructStruct;
-}
-
-enum E {
-    V(u8),
-}
diff --git a/tests/crashes/122909.rs b/tests/crashes/122909.rs
deleted file mode 100644
index 90bba772b91..00000000000
--- a/tests/crashes/122909.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes
-//@ known-bug: #122909
-
-
-use std::sync::{Arc, Context, Weak};
-
-pub struct WeakOnce<T>();
-impl<T> WeakOnce<T> {
-    extern "rust-call" fn try_get(&self) -> Option<Arc<T>> {}
-
-    pub fn get(&self) -> Arc<T> {
-        self.try_get()
-            .unwrap_or_else(|| panic!("Singleton {} not available", std::any::type_name::<T>()))
-    }
-}
diff --git a/tests/crashes/122914.rs b/tests/crashes/122914.rs
deleted file mode 100644
index 63a84bc8099..00000000000
--- a/tests/crashes/122914.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-//@ known-bug: #122914
-use std::future::Future;
-use std::pin::Pin;
-
-impl<'a, F> Poll {
-    fn project<'_>(self: Pin<&'pin mut Future>) -> Projection<'pin, 'a, F> {
-        me.local_set.with(|| {
-            let _ = self.poll(cx);
-        })
-    }
-}
diff --git a/tests/crashes/123809.rs b/tests/crashes/123809.rs
index c7a633aed01..75abe6dc0cd 100644
--- a/tests/crashes/123809.rs
+++ b/tests/crashes/123809.rs
@@ -1,4 +1,4 @@
 //@ known-bug: #123809
-type Positive = std::pat::pattern_type!(std::pat:: is 0..);
+type Positive = std::pat::pattern_type!(std::pat is 0..);
 
 pub fn main() {}
diff --git a/tests/crashes/126272.rs b/tests/crashes/126272.rs
deleted file mode 100644
index 3412c7d8f0f..00000000000
--- a/tests/crashes/126272.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-//@ known-bug: rust-lang/rust#126272
-
-#![feature(adt_const_params)]
-#![allow(incomplete_features)]
-
-use std::marker::ConstParamTy;
-
-#[derive(Debug, PartialEq, Eq, ConstParamTy)]
-struct Foo {
-    value: i32,
-    nested: &'static Bar<std::fmt::Debug>,
-}
-
-#[derive(Debug, PartialEq, Eq, ConstParamTy)]
-struct Bar<T>(T);
-
-struct Test<const F: Foo>;
-
-fn main() {
-    let x: Test<
-        {
-            Foo {
-                value: 3,
-                nested: &Bar(4),
-            }
-        },
-    > = Test;
-}
diff --git a/tests/crashes/126896.rs b/tests/crashes/126896.rs
index 35bf9d5207a..49c539d7acc 100644
--- a/tests/crashes/126896.rs
+++ b/tests/crashes/126896.rs
@@ -1,5 +1,5 @@
 //@ known-bug: rust-lang/rust#126896
-//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes
+//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes
 
 #![feature(type_alias_impl_trait)]
 type Two<'a, 'b> = impl std::fmt::Debug;
diff --git a/tests/crashes/127222.rs b/tests/crashes/127222.rs
deleted file mode 100644
index eda0ea3d9b7..00000000000
--- a/tests/crashes/127222.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-//@ known-bug: rust-lang/rust#127222
-#[marker]
-trait Foo = PartialEq<i32> + Send;
diff --git a/tests/crashes/127299.rs b/tests/crashes/127299.rs
deleted file mode 100644
index 7eb78387997..00000000000
--- a/tests/crashes/127299.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-//@ known-bug: rust-lang/rust#127299
-trait Qux {
-    fn bar() -> i32;
-}
-
-pub struct Lint {
-    pub desc: &'static Qux,
-}
-
-static FOO: &Lint = &Lint { desc: "desc" };
-
-fn main() {}
diff --git a/tests/crashes/128094.rs b/tests/crashes/128094.rs
new file mode 100644
index 00000000000..105a1c84a65
--- /dev/null
+++ b/tests/crashes/128094.rs
@@ -0,0 +1,14 @@
+//@ known-bug: rust-lang/rust#128094
+//@ compile-flags: -Zmir-opt-level=5 --edition=2018
+
+pub enum Request {
+    TestSome(T),
+}
+
+pub async fn handle_event(event: Request) {
+    async move {
+        static instance: Request = Request { bar: 17 };
+        &instance
+    }
+    .await;
+}
diff --git a/tests/crashes/128176.rs b/tests/crashes/128176.rs
new file mode 100644
index 00000000000..70fada4f0fe
--- /dev/null
+++ b/tests/crashes/128176.rs
@@ -0,0 +1,13 @@
+//@ known-bug: rust-lang/rust#128176
+
+#![feature(generic_const_exprs)]
+#![feature(object_safe_for_dispatch)]
+trait X {
+    type Y<const N: i16>;
+}
+
+const _: () = {
+    fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
+};
+
+fn main() {}
diff --git a/tests/crashes/128190.rs b/tests/crashes/128190.rs
new file mode 100644
index 00000000000..0fa7027ae60
--- /dev/null
+++ b/tests/crashes/128190.rs
@@ -0,0 +1,7 @@
+//@ known-bug: rust-lang/rust#128190
+
+fn a(&self) {
+    15
+}
+
+reuse a as b {  struct S; }
diff --git a/tests/crashes/128327.rs b/tests/crashes/128327.rs
new file mode 100644
index 00000000000..a63f758c317
--- /dev/null
+++ b/tests/crashes/128327.rs
@@ -0,0 +1,5 @@
+//@ known-bug: rust-lang/rust#128327
+
+use std::ops::Deref;
+struct Apple((Apple, <&'static [f64] as Deref>::Target(Banana ? Citron)));
+fn main(){}
diff --git a/tests/crashes/128346.rs b/tests/crashes/128346.rs
new file mode 100644
index 00000000000..93d9c40a544
--- /dev/null
+++ b/tests/crashes/128346.rs
@@ -0,0 +1,13 @@
+//@ known-bug: rust-lang/rust#128346
+
+macro_rules! one_rep {
+    ( $($a:ident)* ) => {
+        A(
+            const ${concat($a, Z)}: i32 = 3;
+        )*
+    };
+}
+
+fn main() {
+    one_rep!(A B C);
+}
diff --git a/tests/debuginfo/pretty-std.rs b/tests/debuginfo/pretty-std.rs
index 70827d551ca..45c6dbf3439 100644
--- a/tests/debuginfo/pretty-std.rs
+++ b/tests/debuginfo/pretty-std.rs
@@ -81,10 +81,10 @@
 // cdb-check:vec,d [...] : { len=4 } [Type: [...]::Vec<u64,alloc::alloc::Global>]
 // cdb-check:    [len]            : 4 [Type: [...]]
 // cdb-check:    [capacity]       : [...] [Type: [...]]
-// cdb-check:    [0]              : 4 [Type: unsigned __int64]
-// cdb-check:    [1]              : 5 [Type: unsigned __int64]
-// cdb-check:    [2]              : 6 [Type: unsigned __int64]
-// cdb-check:    [3]              : 7 [Type: unsigned __int64]
+// cdb-check:    [0]              : 4 [Type: u64]
+// cdb-check:    [1]              : 5 [Type: u64]
+// cdb-check:    [2]              : 6 [Type: u64]
+// cdb-check:    [3]              : 7 [Type: u64]
 
 // cdb-command: dx str_slice
 // cdb-check:str_slice        : "IAMA string slice!" [Type: ref$<str$>]
@@ -141,8 +141,8 @@
 // cdb-check:    [<Raw View>]     [Type: alloc::collections::vec_deque::VecDeque<i32,alloc::alloc::Global>]
 // cdb-check:    [len]            : 0x2 [Type: unsigned [...]]
 // cdb-check:    [capacity]       : 0x8 [Type: unsigned [...]]
-// cdb-check:    [0x0]            : 90 [Type: int]
-// cdb-check:    [0x1]            : 20 [Type: int]
+// cdb-check:    [0x0]            : 90 [Type: i32]
+// cdb-check:    [0x1]            : 20 [Type: i32]
 
 #![allow(unused_variables)]
 use std::collections::{LinkedList, VecDeque};
diff --git a/tests/debuginfo/strings-and-strs.rs b/tests/debuginfo/strings-and-strs.rs
index 4a6adc2fc53..2d29ac12bd8 100644
--- a/tests/debuginfo/strings-and-strs.rs
+++ b/tests/debuginfo/strings-and-strs.rs
@@ -7,7 +7,7 @@
 // gdb-command:run
 
 // gdb-command:print plain_string
-// gdbr-check:$1 = alloc::string::String {vec: alloc::vec::Vec<u8, alloc::alloc::Global> {buf: alloc::raw_vec::RawVec<u8, alloc::alloc::Global> {ptr: core::ptr::unique::Unique<u8> {pointer: core::ptr::non_null::NonNull<u8> {pointer: 0x[...]}, _marker: core::marker::PhantomData<u8>}, cap: alloc::raw_vec::Cap (5), alloc: alloc::alloc::Global}, len: 5}}
+// gdbr-check:$1 = alloc::string::String {vec: alloc::vec::Vec<u8, alloc::alloc::Global> {buf: alloc::raw_vec::RawVec<u8, alloc::alloc::Global> {inner: alloc::raw_vec::RawVecInner<alloc::alloc::Global> {ptr: core::ptr::unique::Unique<u8> {pointer: core::ptr::non_null::NonNull<u8> {pointer: 0x[...]}, _marker: core::marker::PhantomData<u8>}, cap: alloc::raw_vec::Cap (5), alloc: alloc::alloc::Global}, _marker: core::marker::PhantomData<u8>}, len: 5}}
 
 // gdb-command:print plain_str
 // gdbr-check:$2 = "Hello"
diff --git a/tests/debuginfo/thread-names.rs b/tests/debuginfo/thread-names.rs
index 1b9ada6fc52..6b3b0c7f4b2 100644
--- a/tests/debuginfo/thread-names.rs
+++ b/tests/debuginfo/thread-names.rs
@@ -1,8 +1,8 @@
 //@ compile-flags:-g
-//@ revisions: macos windows
+//@ revisions: macos win
 // We can't set the main thread name on Linux because it renames the process (#97191)
 //@[macos] only-macos
-//@[windows] only-windows
+//@[win] only-windows
 //@ ignore-sgx
 //@ ignore-windows-gnu
 
diff --git a/tests/incremental/hashes/call_expressions.rs b/tests/incremental/hashes/call_expressions.rs
index 36b6980bcc6..71423ef6aff 100644
--- a/tests/incremental/hashes/call_expressions.rs
+++ b/tests/incremental/hashes/call_expressions.rs
@@ -162,7 +162,7 @@ pub fn change_to_ufcs() {
 }
 
 #[cfg(not(any(cfail1,cfail4)))]
-#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,typeck")]
+#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes,optimized_mir,typeck")]
 #[rustc_clean(cfg="cfail3")]
 #[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,optimized_mir,typeck")]
 #[rustc_clean(cfg="cfail6")]
diff --git a/tests/incremental/hashes/for_loops.rs b/tests/incremental/hashes/for_loops.rs
index 9cd99bf76b7..b827ad9cc6f 100644
--- a/tests/incremental/hashes/for_loops.rs
+++ b/tests/incremental/hashes/for_loops.rs
@@ -103,9 +103,9 @@ pub fn change_iterable() {
 }
 
 #[cfg(not(any(cfail1,cfail4)))]
-#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, promoted_mir, optimized_mir")]
+#[rustc_clean(cfg="cfail2", except="opt_hir_owner_nodes, promoted_mir")]
 #[rustc_clean(cfg="cfail3")]
-#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, promoted_mir, optimized_mir")]
+#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes, promoted_mir")]
 #[rustc_clean(cfg="cfail6")]
 pub fn change_iterable() {
     let mut _x = 0;
diff --git a/tests/mir-opt/building/custom/terminators.rs b/tests/mir-opt/building/custom/terminators.rs
index a8e0b4b35bf..ed08040a2a5 100644
--- a/tests/mir-opt/building/custom/terminators.rs
+++ b/tests/mir-opt/building/custom/terminators.rs
@@ -22,6 +22,18 @@ fn direct_call(x: i32) -> i32 {
     }
 }
 
+// EMIT_MIR terminators.tail_call.built.after.mir
+#[custom_mir(dialect = "built")]
+fn tail_call(x: i32) -> i32 {
+    mir! {
+        let y;
+        {
+            y = x + 42;
+            TailCall(ident(y))
+        }
+    }
+}
+
 // EMIT_MIR terminators.indirect_call.built.after.mir
 #[custom_mir(dialect = "built")]
 fn indirect_call(x: i32, f: fn(i32) -> i32) -> i32 {
diff --git a/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir b/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir
new file mode 100644
index 00000000000..4cf6e459aa8
--- /dev/null
+++ b/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir
@@ -0,0 +1,11 @@
+// MIR for `tail_call` after built
+
+fn tail_call(_1: i32) -> i32 {
+    let mut _0: i32;
+    let mut _2: i32;
+
+    bb0: {
+        _2 = Add(_1, const 42_i32);
+        tailcall ident::<i32>(Spanned { node: _2, span: $DIR/terminators.rs:32:28: 32:29 (#0) });
+    }
+}
diff --git a/tests/mir-opt/building/match/match_false_edges.full_tested_match.built.after.mir b/tests/mir-opt/building/match/match_false_edges.full_tested_match.built.after.mir
index 9ebfff18f48..a93743edfac 100644
--- a/tests/mir-opt/building/match/match_false_edges.full_tested_match.built.after.mir
+++ b/tests/mir-opt/building/match/match_false_edges.full_tested_match.built.after.mir
@@ -37,11 +37,11 @@ fn full_tested_match() -> () {
     }
 
     bb2: {
-        falseEdge -> [real: bb7, imaginary: bb3];
+        falseEdge -> [real: bb8, imaginary: bb3];
     }
 
     bb3: {
-        falseEdge -> [real: bb12, imaginary: bb5];
+        falseEdge -> [real: bb7, imaginary: bb5];
     }
 
     bb4: {
@@ -50,7 +50,7 @@ fn full_tested_match() -> () {
 
     bb5: {
         _1 = (const 3_i32, const 3_i32);
-        goto -> bb13;
+        goto -> bb14;
     }
 
     bb6: {
@@ -58,18 +58,33 @@ fn full_tested_match() -> () {
     }
 
     bb7: {
+        StorageLive(_9);
+        _9 = ((_2 as Some).0: i32);
+        StorageLive(_10);
+        _10 = _9;
+        _1 = (const 2_i32, move _10);
+        StorageDead(_10);
+        StorageDead(_9);
+        goto -> bb14;
+    }
+
+    bb8: {
         StorageLive(_6);
         _6 = &((_2 as Some).0: i32);
         _3 = &fake shallow _2;
         StorageLive(_7);
-        _7 = guard() -> [return: bb8, unwind: bb15];
+        _7 = guard() -> [return: bb10, unwind: bb16];
     }
 
-    bb8: {
-        switchInt(move _7) -> [0: bb10, otherwise: bb9];
+    bb9: {
+        goto -> bb3;
     }
 
-    bb9: {
+    bb10: {
+        switchInt(move _7) -> [0: bb12, otherwise: bb11];
+    }
+
+    bb11: {
         StorageDead(_7);
         FakeRead(ForMatchGuard, _3);
         FakeRead(ForGuardBinding, _6);
@@ -81,31 +96,20 @@ fn full_tested_match() -> () {
         StorageDead(_8);
         StorageDead(_5);
         StorageDead(_6);
-        goto -> bb13;
+        goto -> bb14;
     }
 
-    bb10: {
-        goto -> bb11;
+    bb12: {
+        goto -> bb13;
     }
 
-    bb11: {
+    bb13: {
         StorageDead(_7);
         StorageDead(_6);
-        goto -> bb3;
-    }
-
-    bb12: {
-        StorageLive(_9);
-        _9 = ((_2 as Some).0: i32);
-        StorageLive(_10);
-        _10 = _9;
-        _1 = (const 2_i32, move _10);
-        StorageDead(_10);
-        StorageDead(_9);
-        goto -> bb13;
+        goto -> bb9;
     }
 
-    bb13: {
+    bb14: {
         PlaceMention(_1);
         StorageDead(_2);
         StorageDead(_1);
@@ -113,12 +117,12 @@ fn full_tested_match() -> () {
         return;
     }
 
-    bb14: {
+    bb15: {
         FakeRead(ForMatchedPlace(None), _1);
         unreachable;
     }
 
-    bb15 (cleanup): {
+    bb16 (cleanup): {
         resume;
     }
 }
diff --git a/tests/mir-opt/building/match/match_false_edges.full_tested_match2.built.after.mir b/tests/mir-opt/building/match/match_false_edges.full_tested_match2.built.after.mir
index 4d2989ea93e..0d0ea2be1b0 100644
--- a/tests/mir-opt/building/match/match_false_edges.full_tested_match2.built.after.mir
+++ b/tests/mir-opt/building/match/match_false_edges.full_tested_match2.built.after.mir
@@ -37,7 +37,7 @@ fn full_tested_match2() -> () {
     }
 
     bb2: {
-        falseEdge -> [real: bb7, imaginary: bb5];
+        falseEdge -> [real: bb8, imaginary: bb5];
     }
 
     bb3: {
@@ -48,7 +48,7 @@ fn full_tested_match2() -> () {
         _1 = (const 2_i32, move _10);
         StorageDead(_10);
         StorageDead(_9);
-        goto -> bb13;
+        goto -> bb14;
     }
 
     bb4: {
@@ -56,7 +56,7 @@ fn full_tested_match2() -> () {
     }
 
     bb5: {
-        falseEdge -> [real: bb12, imaginary: bb3];
+        falseEdge -> [real: bb7, imaginary: bb3];
     }
 
     bb6: {
@@ -64,18 +64,27 @@ fn full_tested_match2() -> () {
     }
 
     bb7: {
+        _1 = (const 3_i32, const 3_i32);
+        goto -> bb14;
+    }
+
+    bb8: {
         StorageLive(_6);
         _6 = &((_2 as Some).0: i32);
         _3 = &fake shallow _2;
         StorageLive(_7);
-        _7 = guard() -> [return: bb8, unwind: bb15];
+        _7 = guard() -> [return: bb10, unwind: bb16];
     }
 
-    bb8: {
-        switchInt(move _7) -> [0: bb10, otherwise: bb9];
+    bb9: {
+        falseEdge -> [real: bb3, imaginary: bb5];
     }
 
-    bb9: {
+    bb10: {
+        switchInt(move _7) -> [0: bb12, otherwise: bb11];
+    }
+
+    bb11: {
         StorageDead(_7);
         FakeRead(ForMatchGuard, _3);
         FakeRead(ForGuardBinding, _6);
@@ -87,25 +96,20 @@ fn full_tested_match2() -> () {
         StorageDead(_8);
         StorageDead(_5);
         StorageDead(_6);
-        goto -> bb13;
+        goto -> bb14;
     }
 
-    bb10: {
-        goto -> bb11;
+    bb12: {
+        goto -> bb13;
     }
 
-    bb11: {
+    bb13: {
         StorageDead(_7);
         StorageDead(_6);
-        falseEdge -> [real: bb3, imaginary: bb5];
-    }
-
-    bb12: {
-        _1 = (const 3_i32, const 3_i32);
-        goto -> bb13;
+        goto -> bb9;
     }
 
-    bb13: {
+    bb14: {
         PlaceMention(_1);
         StorageDead(_2);
         StorageDead(_1);
@@ -113,12 +117,12 @@ fn full_tested_match2() -> () {
         return;
     }
 
-    bb14: {
+    bb15: {
         FakeRead(ForMatchedPlace(None), _1);
         unreachable;
     }
 
-    bb15 (cleanup): {
+    bb16 (cleanup): {
         resume;
     }
 }
diff --git a/tests/mir-opt/building/match/match_false_edges.main.built.after.mir b/tests/mir-opt/building/match/match_false_edges.main.built.after.mir
index 4ed93610706..87b7e29848f 100644
--- a/tests/mir-opt/building/match/match_false_edges.main.built.after.mir
+++ b/tests/mir-opt/building/match/match_false_edges.main.built.after.mir
@@ -43,11 +43,11 @@ fn main() -> () {
     }
 
     bb1: {
-        falseEdge -> [real: bb14, imaginary: bb4];
+        falseEdge -> [real: bb11, imaginary: bb4];
     }
 
     bb2: {
-        falseEdge -> [real: bb9, imaginary: bb1];
+        falseEdge -> [real: bb12, imaginary: bb1];
     }
 
     bb3: {
@@ -64,11 +64,11 @@ fn main() -> () {
         _14 = _2;
         _1 = const 4_i32;
         StorageDead(_14);
-        goto -> bb20;
+        goto -> bb22;
     }
 
     bb6: {
-        falseEdge -> [real: bb15, imaginary: bb5];
+        falseEdge -> [real: bb9, imaginary: bb5];
     }
 
     bb7: {
@@ -81,62 +81,70 @@ fn main() -> () {
     }
 
     bb9: {
-        StorageLive(_7);
-        _7 = &((_2 as Some).0: i32);
+        StorageLive(_11);
+        _11 = &((_2 as Some).0: i32);
         _3 = &fake shallow _2;
-        StorageLive(_8);
-        _8 = guard() -> [return: bb10, unwind: bb22];
+        StorageLive(_12);
+        StorageLive(_13);
+        _13 = (*_11);
+        _12 = guard2(move _13) -> [return: bb18, unwind: bb24];
     }
 
     bb10: {
-        switchInt(move _8) -> [0: bb12, otherwise: bb11];
+        falseEdge -> [real: bb7, imaginary: bb5];
     }
 
     bb11: {
-        StorageDead(_8);
-        FakeRead(ForMatchGuard, _3);
-        FakeRead(ForGuardBinding, _7);
-        StorageLive(_6);
-        _6 = ((_2 as Some).0: i32);
-        _1 = const 1_i32;
-        StorageDead(_6);
-        StorageDead(_7);
-        goto -> bb20;
+        StorageLive(_9);
+        _9 = _2;
+        _1 = const 2_i32;
+        StorageDead(_9);
+        goto -> bb22;
     }
 
     bb12: {
-        goto -> bb13;
+        StorageLive(_7);
+        _7 = &((_2 as Some).0: i32);
+        _3 = &fake shallow _2;
+        StorageLive(_8);
+        _8 = guard() -> [return: bb14, unwind: bb24];
     }
 
     bb13: {
-        StorageDead(_8);
-        StorageDead(_7);
         falseEdge -> [real: bb3, imaginary: bb1];
     }
 
     bb14: {
-        StorageLive(_9);
-        _9 = _2;
-        _1 = const 2_i32;
-        StorageDead(_9);
-        goto -> bb20;
+        switchInt(move _8) -> [0: bb16, otherwise: bb15];
     }
 
     bb15: {
-        StorageLive(_11);
-        _11 = &((_2 as Some).0: i32);
-        _3 = &fake shallow _2;
-        StorageLive(_12);
-        StorageLive(_13);
-        _13 = (*_11);
-        _12 = guard2(move _13) -> [return: bb16, unwind: bb22];
+        StorageDead(_8);
+        FakeRead(ForMatchGuard, _3);
+        FakeRead(ForGuardBinding, _7);
+        StorageLive(_6);
+        _6 = ((_2 as Some).0: i32);
+        _1 = const 1_i32;
+        StorageDead(_6);
+        StorageDead(_7);
+        goto -> bb22;
     }
 
     bb16: {
-        switchInt(move _12) -> [0: bb18, otherwise: bb17];
+        goto -> bb17;
     }
 
     bb17: {
+        StorageDead(_8);
+        StorageDead(_7);
+        goto -> bb13;
+    }
+
+    bb18: {
+        switchInt(move _12) -> [0: bb20, otherwise: bb19];
+    }
+
+    bb19: {
         StorageDead(_13);
         StorageDead(_12);
         FakeRead(ForMatchGuard, _3);
@@ -146,21 +154,21 @@ fn main() -> () {
         _1 = const 3_i32;
         StorageDead(_10);
         StorageDead(_11);
-        goto -> bb20;
+        goto -> bb22;
     }
 
-    bb18: {
-        goto -> bb19;
+    bb20: {
+        goto -> bb21;
     }
 
-    bb19: {
+    bb21: {
         StorageDead(_13);
         StorageDead(_12);
         StorageDead(_11);
-        falseEdge -> [real: bb7, imaginary: bb5];
+        goto -> bb10;
     }
 
-    bb20: {
+    bb22: {
         PlaceMention(_1);
         StorageDead(_2);
         StorageDead(_1);
@@ -168,12 +176,12 @@ fn main() -> () {
         return;
     }
 
-    bb21: {
+    bb23: {
         FakeRead(ForMatchedPlace(None), _1);
         unreachable;
     }
 
-    bb22 (cleanup): {
+    bb24 (cleanup): {
         resume;
     }
 }
diff --git a/tests/mir-opt/building/match/never_patterns.opt1.SimplifyCfg-initial.after.mir b/tests/mir-opt/building/match/never_patterns.opt1.SimplifyCfg-initial.after.mir
index 78356a90743..bba4d9c0149 100644
--- a/tests/mir-opt/building/match/never_patterns.opt1.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/building/match/never_patterns.opt1.SimplifyCfg-initial.after.mir
@@ -13,17 +13,17 @@ fn opt1(_1: &Result<u32, Void>) -> &u32 {
 
     bb0: {
         PlaceMention(_1);
-        _2 = discriminant((*_1));
-        switchInt(move _2) -> [0: bb2, 1: bb3, otherwise: bb1];
+        falseEdge -> [real: bb4, imaginary: bb1];
     }
 
     bb1: {
-        FakeRead(ForMatchedPlace(None), _1);
-        unreachable;
+        _2 = discriminant((*_1));
+        switchInt(move _2) -> [1: bb3, otherwise: bb2];
     }
 
     bb2: {
-        falseEdge -> [real: bb4, imaginary: bb3];
+        FakeRead(ForMatchedPlace(None), _1);
+        unreachable;
     }
 
     bb3: {
diff --git a/tests/mir-opt/building/match/never_patterns.opt2.SimplifyCfg-initial.after.mir b/tests/mir-opt/building/match/never_patterns.opt2.SimplifyCfg-initial.after.mir
index 979fbb2860d..fc0769d6f7d 100644
--- a/tests/mir-opt/building/match/never_patterns.opt2.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/building/match/never_patterns.opt2.SimplifyCfg-initial.after.mir
@@ -11,25 +11,10 @@ fn opt2(_1: &Result<u32, Void>) -> &u32 {
 
     bb0: {
         PlaceMention(_1);
-        _2 = discriminant((*_1));
-        switchInt(move _2) -> [0: bb2, 1: bb3, otherwise: bb1];
-    }
-
-    bb1: {
-        FakeRead(ForMatchedPlace(None), _1);
-        unreachable;
-    }
-
-    bb2: {
         StorageLive(_3);
         _3 = &(((*_1) as Ok).0: u32);
         _0 = &(*_3);
         StorageDead(_3);
         return;
     }
-
-    bb3: {
-        FakeRead(ForMatchedPlace(None), (((*_1) as Err).0: Void));
-        unreachable;
-    }
 }
diff --git a/tests/mir-opt/building/match/never_patterns.opt3.SimplifyCfg-initial.after.mir b/tests/mir-opt/building/match/never_patterns.opt3.SimplifyCfg-initial.after.mir
index 93ebe600b3f..86347db4d92 100644
--- a/tests/mir-opt/building/match/never_patterns.opt3.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/building/match/never_patterns.opt3.SimplifyCfg-initial.after.mir
@@ -12,24 +12,19 @@ fn opt3(_1: &Result<u32, Void>) -> &u32 {
     bb0: {
         PlaceMention(_1);
         _2 = discriminant((*_1));
-        switchInt(move _2) -> [0: bb3, 1: bb2, otherwise: bb1];
+        switchInt(move _2) -> [1: bb2, otherwise: bb1];
     }
 
     bb1: {
-        FakeRead(ForMatchedPlace(None), _1);
-        unreachable;
-    }
-
-    bb2: {
-        FakeRead(ForMatchedPlace(None), (((*_1) as Err).0: Void));
-        unreachable;
-    }
-
-    bb3: {
         StorageLive(_3);
         _3 = &(((*_1) as Ok).0: u32);
         _0 = &(*_3);
         StorageDead(_3);
         return;
     }
+
+    bb2: {
+        FakeRead(ForMatchedPlace(None), (((*_1) as Err).0: Void));
+        unreachable;
+    }
 }
diff --git a/tests/mir-opt/building/match/sort_candidates.constant_eq.SimplifyCfg-initial.after.mir b/tests/mir-opt/building/match/sort_candidates.constant_eq.SimplifyCfg-initial.after.mir
index 2b5dbacc2d9..2bce79a3ae7 100644
--- a/tests/mir-opt/building/match/sort_candidates.constant_eq.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/building/match/sort_candidates.constant_eq.SimplifyCfg-initial.after.mir
@@ -31,7 +31,7 @@ fn constant_eq(_1: &str, _2: bool) -> u32 {
     }
 
     bb2: {
-        falseEdge -> [real: bb12, imaginary: bb5];
+        falseEdge -> [real: bb15, imaginary: bb5];
     }
 
     bb3: {
@@ -39,7 +39,7 @@ fn constant_eq(_1: &str, _2: bool) -> u32 {
     }
 
     bb4: {
-        falseEdge -> [real: bb16, imaginary: bb1];
+        falseEdge -> [real: bb13, imaginary: bb1];
     }
 
     bb5: {
@@ -51,7 +51,7 @@ fn constant_eq(_1: &str, _2: bool) -> u32 {
     }
 
     bb7: {
-        falseEdge -> [real: bb15, imaginary: bb3];
+        falseEdge -> [real: bb14, imaginary: bb3];
     }
 
     bb8: {
@@ -68,43 +68,43 @@ fn constant_eq(_1: &str, _2: bool) -> u32 {
     }
 
     bb11: {
-        falseEdge -> [real: bb17, imaginary: bb10];
+        falseEdge -> [real: bb12, imaginary: bb10];
     }
 
     bb12: {
-        _6 = &fake shallow (_3.0: &str);
-        _7 = &fake shallow (_3.1: bool);
-        StorageLive(_10);
-        _10 = const true;
-        switchInt(move _10) -> [0: bb14, otherwise: bb13];
+        _0 = const 4_u32;
+        goto -> bb18;
     }
 
     bb13: {
-        StorageDead(_10);
-        FakeRead(ForMatchGuard, _6);
-        FakeRead(ForMatchGuard, _7);
-        _0 = const 1_u32;
+        _0 = const 3_u32;
         goto -> bb18;
     }
 
     bb14: {
-        StorageDead(_10);
-        falseEdge -> [real: bb3, imaginary: bb5];
+        _0 = const 2_u32;
+        goto -> bb18;
     }
 
     bb15: {
-        _0 = const 2_u32;
-        goto -> bb18;
+        _6 = &fake shallow (_3.0: &str);
+        _7 = &fake shallow (_3.1: bool);
+        StorageLive(_10);
+        _10 = const true;
+        switchInt(move _10) -> [0: bb17, otherwise: bb16];
     }
 
     bb16: {
-        _0 = const 3_u32;
+        StorageDead(_10);
+        FakeRead(ForMatchGuard, _6);
+        FakeRead(ForMatchGuard, _7);
+        _0 = const 1_u32;
         goto -> bb18;
     }
 
     bb17: {
-        _0 = const 4_u32;
-        goto -> bb18;
+        StorageDead(_10);
+        falseEdge -> [real: bb3, imaginary: bb5];
     }
 
     bb18: {
diff --git a/tests/mir-opt/building/match/sort_candidates.disjoint_ranges.SimplifyCfg-initial.after.mir b/tests/mir-opt/building/match/sort_candidates.disjoint_ranges.SimplifyCfg-initial.after.mir
index 07daa3eddfa..e521fb4509a 100644
--- a/tests/mir-opt/building/match/sort_candidates.disjoint_ranges.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/building/match/sort_candidates.disjoint_ranges.SimplifyCfg-initial.after.mir
@@ -23,7 +23,7 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 {
     }
 
     bb2: {
-        falseEdge -> [real: bb9, imaginary: bb3];
+        falseEdge -> [real: bb11, imaginary: bb3];
     }
 
     bb3: {
@@ -32,7 +32,7 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 {
     }
 
     bb4: {
-        falseEdge -> [real: bb12, imaginary: bb5];
+        falseEdge -> [real: bb10, imaginary: bb5];
     }
 
     bb5: {
@@ -40,7 +40,7 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 {
     }
 
     bb6: {
-        falseEdge -> [real: bb13, imaginary: bb1];
+        falseEdge -> [real: bb9, imaginary: bb1];
     }
 
     bb7: {
@@ -54,32 +54,32 @@ fn disjoint_ranges(_1: i32, _2: bool) -> u32 {
     }
 
     bb9: {
-        _3 = &fake shallow _1;
-        StorageLive(_8);
-        _8 = _2;
-        switchInt(move _8) -> [0: bb11, otherwise: bb10];
+        _0 = const 2_u32;
+        goto -> bb14;
     }
 
     bb10: {
-        StorageDead(_8);
-        FakeRead(ForMatchGuard, _3);
-        _0 = const 0_u32;
+        _0 = const 1_u32;
         goto -> bb14;
     }
 
     bb11: {
-        StorageDead(_8);
-        falseEdge -> [real: bb1, imaginary: bb3];
+        _3 = &fake shallow _1;
+        StorageLive(_8);
+        _8 = _2;
+        switchInt(move _8) -> [0: bb13, otherwise: bb12];
     }
 
     bb12: {
-        _0 = const 1_u32;
+        StorageDead(_8);
+        FakeRead(ForMatchGuard, _3);
+        _0 = const 0_u32;
         goto -> bb14;
     }
 
     bb13: {
-        _0 = const 2_u32;
-        goto -> bb14;
+        StorageDead(_8);
+        falseEdge -> [real: bb1, imaginary: bb3];
     }
 
     bb14: {
diff --git a/tests/mir-opt/const_prop/offset_of.rs b/tests/mir-opt/const_prop/offset_of.rs
index 264c8a3d21c..c2f5e83d686 100644
--- a/tests/mir-opt/const_prop/offset_of.rs
+++ b/tests/mir-opt/const_prop/offset_of.rs
@@ -2,7 +2,7 @@
 //@ test-mir-pass: GVN
 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
 
-#![feature(offset_of_enum, offset_of_nested)]
+#![feature(offset_of_enum)]
 
 use std::marker::PhantomData;
 use std::mem::offset_of;
diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff
index 8415789de6e..21d91d0320a 100644
--- a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff
+++ b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff
@@ -22,12 +22,11 @@
           StorageLive(_3);
           StorageLive(_4);
           _9 = const main::promoted[0];
--         _4 = _9;
+          _4 = _9;
 -         _3 = _4;
 -         _2 = move _3 as &[u32] (PointerCoercion(Unsize));
-+         _4 = const {ALLOC0<imm>: &[u32; 3]};
-+         _3 = const {ALLOC0<imm>: &[u32; 3]};
-+         _2 = const {ALLOC0<imm>: &[u32; 3]} as &[u32] (PointerCoercion(Unsize));
++         _3 = _9;
++         _2 = _9 as &[u32] (PointerCoercion(Unsize));
           StorageDead(_3);
           StorageLive(_6);
           _6 = const 1_usize;
@@ -50,6 +49,4 @@
           return;
       }
   }
-+ 
-+ ALLOC0 (size: 12, align: 4) { .. }
   
diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff
index fea7caac3cd..889114c9862 100644
--- a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff
+++ b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff
@@ -22,12 +22,11 @@
           StorageLive(_3);
           StorageLive(_4);
           _9 = const main::promoted[0];
--         _4 = _9;
+          _4 = _9;
 -         _3 = _4;
 -         _2 = move _3 as &[u32] (PointerCoercion(Unsize));
-+         _4 = const {ALLOC0<imm>: &[u32; 3]};
-+         _3 = const {ALLOC0<imm>: &[u32; 3]};
-+         _2 = const {ALLOC0<imm>: &[u32; 3]} as &[u32] (PointerCoercion(Unsize));
++         _3 = _9;
++         _2 = _9 as &[u32] (PointerCoercion(Unsize));
           StorageDead(_3);
           StorageLive(_6);
           _6 = const 1_usize;
@@ -50,6 +49,4 @@
           return;
       }
   }
-+ 
-+ ALLOC0 (size: 12, align: 4) { .. }
   
diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff
index 8415789de6e..21d91d0320a 100644
--- a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff
+++ b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff
@@ -22,12 +22,11 @@
           StorageLive(_3);
           StorageLive(_4);
           _9 = const main::promoted[0];
--         _4 = _9;
+          _4 = _9;
 -         _3 = _4;
 -         _2 = move _3 as &[u32] (PointerCoercion(Unsize));
-+         _4 = const {ALLOC0<imm>: &[u32; 3]};
-+         _3 = const {ALLOC0<imm>: &[u32; 3]};
-+         _2 = const {ALLOC0<imm>: &[u32; 3]} as &[u32] (PointerCoercion(Unsize));
++         _3 = _9;
++         _2 = _9 as &[u32] (PointerCoercion(Unsize));
           StorageDead(_3);
           StorageLive(_6);
           _6 = const 1_usize;
@@ -50,6 +49,4 @@
           return;
       }
   }
-+ 
-+ ALLOC0 (size: 12, align: 4) { .. }
   
diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff
index fea7caac3cd..889114c9862 100644
--- a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff
+++ b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff
@@ -22,12 +22,11 @@
           StorageLive(_3);
           StorageLive(_4);
           _9 = const main::promoted[0];
--         _4 = _9;
+          _4 = _9;
 -         _3 = _4;
 -         _2 = move _3 as &[u32] (PointerCoercion(Unsize));
-+         _4 = const {ALLOC0<imm>: &[u32; 3]};
-+         _3 = const {ALLOC0<imm>: &[u32; 3]};
-+         _2 = const {ALLOC0<imm>: &[u32; 3]} as &[u32] (PointerCoercion(Unsize));
++         _3 = _9;
++         _2 = _9 as &[u32] (PointerCoercion(Unsize));
           StorageDead(_3);
           StorageLive(_6);
           _6 = const 1_usize;
@@ -50,6 +49,4 @@
           return;
       }
   }
-+ 
-+ ALLOC0 (size: 12, align: 4) { .. }
   
diff --git a/tests/mir-opt/const_prop/slice_len.rs b/tests/mir-opt/const_prop/slice_len.rs
index 265a496f39a..3d1b58965ac 100644
--- a/tests/mir-opt/const_prop/slice_len.rs
+++ b/tests/mir-opt/const_prop/slice_len.rs
@@ -1,5 +1,5 @@
 //@ test-mir-pass: GVN
-//@ compile-flags: -Zmir-enable-passes=+InstSimplify -Zdump-mir-exclude-alloc-bytes
+//@ compile-flags: -Zmir-enable-passes=+InstSimplify-after-simplifycfg -Zdump-mir-exclude-alloc-bytes
 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
 // EMIT_MIR_FOR_EACH_BIT_WIDTH
 
@@ -7,7 +7,7 @@
 fn main() {
     // CHECK-LABEL: fn main(
     // CHECK: debug a => [[a:_.*]];
-    // CHECK: [[slice:_.*]] = const {{.*}} as &[u32] (PointerCoercion(Unsize));
+    // CHECK: [[slice:_.*]] = {{.*}} as &[u32] (PointerCoercion(Unsize));
     // CHECK: assert(const true,
     // CHECK: [[a]] = const 2_u32;
     let a = (&[1u32, 2, 3] as &[u32])[1];
diff --git a/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff b/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff
index e60f71f47b1..3d791734f46 100644
--- a/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff
+++ b/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff
@@ -55,17 +55,17 @@
   
       bb2: {
 +         Coverage::CounterIncrement(3);
-          falseEdge -> [real: bb6, imaginary: bb3];
+          falseEdge -> [real: bb8, imaginary: bb3];
       }
   
       bb3: {
 +         Coverage::CounterIncrement(2);
-          falseEdge -> [real: bb8, imaginary: bb4];
+          falseEdge -> [real: bb7, imaginary: bb4];
       }
   
       bb4: {
 +         Coverage::CounterIncrement(1);
-          falseEdge -> [real: bb10, imaginary: bb5];
+          falseEdge -> [real: bb6, imaginary: bb5];
       }
   
       bb5: {
@@ -78,39 +78,39 @@
       }
   
       bb6: {
-          StorageLive(_3);
-          _3 = ((_1 as D).0: u32);
-          StorageLive(_4);
-          _4 = _3;
-          _0 = consume(move _4) -> [return: bb7, unwind: bb14];
+          StorageLive(_7);
+          _7 = ((_1 as B).0: u32);
+          StorageLive(_8);
+          _8 = _7;
+          _0 = consume(move _8) -> [return: bb11, unwind: bb14];
       }
   
       bb7: {
-          StorageDead(_4);
-          StorageDead(_3);
-          goto -> bb13;
-      }
-  
-      bb8: {
           StorageLive(_5);
           _5 = ((_1 as C).0: u32);
           StorageLive(_6);
           _6 = _5;
-          _0 = consume(move _6) -> [return: bb9, unwind: bb14];
+          _0 = consume(move _6) -> [return: bb10, unwind: bb14];
+      }
+  
+      bb8: {
+          StorageLive(_3);
+          _3 = ((_1 as D).0: u32);
+          StorageLive(_4);
+          _4 = _3;
+          _0 = consume(move _4) -> [return: bb9, unwind: bb14];
       }
   
       bb9: {
-          StorageDead(_6);
-          StorageDead(_5);
+          StorageDead(_4);
+          StorageDead(_3);
           goto -> bb13;
       }
   
       bb10: {
-          StorageLive(_7);
-          _7 = ((_1 as B).0: u32);
-          StorageLive(_8);
-          _8 = _7;
-          _0 = consume(move _8) -> [return: bb11, unwind: bb14];
+          StorageDead(_6);
+          StorageDead(_5);
+          goto -> bb13;
       }
   
       bb11: {
diff --git a/tests/mir-opt/dataflow-const-prop/offset_of.rs b/tests/mir-opt/dataflow-const-prop/offset_of.rs
index 12396b31ed0..bb4a74d3712 100644
--- a/tests/mir-opt/dataflow-const-prop/offset_of.rs
+++ b/tests/mir-opt/dataflow-const-prop/offset_of.rs
@@ -1,8 +1,6 @@
 //@ test-mir-pass: DataflowConstProp
 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
 
-#![feature(offset_of_nested)]
-
 use std::marker::PhantomData;
 use std::mem::offset_of;
 
diff --git a/tests/mir-opt/dataflow-const-prop/slice_len.rs b/tests/mir-opt/dataflow-const-prop/slice_len.rs
index 5d9733f498c..64c043cca79 100644
--- a/tests/mir-opt/dataflow-const-prop/slice_len.rs
+++ b/tests/mir-opt/dataflow-const-prop/slice_len.rs
@@ -1,6 +1,6 @@
 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
 //@ test-mir-pass: DataflowConstProp
-//@ compile-flags: -Zmir-enable-passes=+InstSimplify
+//@ compile-flags: -Zmir-enable-passes=+InstSimplify-after-simplifycfg
 // EMIT_MIR_FOR_EACH_BIT_WIDTH
 
 // EMIT_MIR slice_len.main.DataflowConstProp.diff
diff --git a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff
index 3a5762e4f3d..efb28ba344b 100644
--- a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff
+++ b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-abort.diff
@@ -33,7 +33,7 @@
           _8 = const 3_usize;
           _9 = Ge(move _7, move _8);
 -         switchInt(move _9) -> [0: bb7, otherwise: bb8];
-+         switchInt(move _9) -> [0: bb10, otherwise: bb7];
++         switchInt(move _9) -> [0: bb11, otherwise: bb7];
       }
   
       bb3: {
@@ -49,48 +49,48 @@
       }
   
       bb6: {
--         switchInt((*_2)[3 of 4]) -> [47: bb11, otherwise: bb2];
-+         switchInt((*_2)[3 of 4]) -> [47: bb10, otherwise: bb2];
+-         switchInt((*_2)[3 of 4]) -> [47: bb13, otherwise: bb2];
++         switchInt((*_2)[3 of 4]) -> [47: bb11, otherwise: bb2];
       }
   
       bb7: {
 -         _0 = const false;
 -         goto -> bb14;
-+         switchInt((*_2)[0 of 3]) -> [47: bb8, otherwise: bb10];
++         switchInt((*_2)[0 of 3]) -> [47: bb8, otherwise: bb11];
       }
   
       bb8: {
 -         switchInt((*_2)[0 of 3]) -> [47: bb9, otherwise: bb7];
-+         switchInt((*_2)[1 of 3]) -> [47: bb9, otherwise: bb10];
++         switchInt((*_2)[1 of 3]) -> [47: bb9, otherwise: bb11];
       }
   
       bb9: {
 -         switchInt((*_2)[1 of 3]) -> [47: bb10, otherwise: bb7];
-+         switchInt((*_2)[2 of 3]) -> [47: bb11, 33: bb11, otherwise: bb10];
++         switchInt((*_2)[2 of 3]) -> [47: bb10, 33: bb10, otherwise: bb11];
       }
   
       bb10: {
--         switchInt((*_2)[2 of 3]) -> [47: bb12, 33: bb13, otherwise: bb7];
+-         switchInt((*_2)[2 of 3]) -> [47: bb12, 33: bb11, otherwise: bb7];
 -     }
 - 
 -     bb11: {
-          _0 = const false;
+          _0 = const true;
 -         goto -> bb14;
 +         goto -> bb12;
       }
   
 -     bb12: {
+-         _0 = const true;
+-         goto -> bb14;
+-     }
+- 
+-     bb13: {
 +     bb11: {
-          _0 = const true;
+          _0 = const false;
 -         goto -> bb14;
 +         goto -> bb12;
       }
   
--     bb13: {
--         _0 = const true;
--         goto -> bb14;
--     }
-- 
 -     bb14: {
 +     bb12: {
           StorageDead(_2);
diff --git a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff
index 21b197d2f27..c6e2d3a5512 100644
--- a/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff
+++ b/tests/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.panic-unwind.diff
@@ -33,7 +33,7 @@
           _8 = const 3_usize;
           _9 = Ge(move _7, move _8);
 -         switchInt(move _9) -> [0: bb7, otherwise: bb8];
-+         switchInt(move _9) -> [0: bb10, otherwise: bb7];
++         switchInt(move _9) -> [0: bb11, otherwise: bb7];
       }
   
       bb3: {
@@ -49,48 +49,48 @@
       }
   
       bb6: {
--         switchInt((*_2)[3 of 4]) -> [47: bb11, otherwise: bb2];
-+         switchInt((*_2)[3 of 4]) -> [47: bb10, otherwise: bb2];
+-         switchInt((*_2)[3 of 4]) -> [47: bb13, otherwise: bb2];
++         switchInt((*_2)[3 of 4]) -> [47: bb11, otherwise: bb2];
       }
   
       bb7: {
 -         _0 = const false;
 -         goto -> bb14;
-+         switchInt((*_2)[0 of 3]) -> [47: bb8, otherwise: bb10];
++         switchInt((*_2)[0 of 3]) -> [47: bb8, otherwise: bb11];
       }
   
       bb8: {
 -         switchInt((*_2)[0 of 3]) -> [47: bb9, otherwise: bb7];
-+         switchInt((*_2)[1 of 3]) -> [47: bb9, otherwise: bb10];
++         switchInt((*_2)[1 of 3]) -> [47: bb9, otherwise: bb11];
       }
   
       bb9: {
 -         switchInt((*_2)[1 of 3]) -> [47: bb10, otherwise: bb7];
-+         switchInt((*_2)[2 of 3]) -> [47: bb11, 33: bb11, otherwise: bb10];
++         switchInt((*_2)[2 of 3]) -> [47: bb10, 33: bb10, otherwise: bb11];
       }
   
       bb10: {
--         switchInt((*_2)[2 of 3]) -> [47: bb12, 33: bb13, otherwise: bb7];
+-         switchInt((*_2)[2 of 3]) -> [47: bb12, 33: bb11, otherwise: bb7];
 -     }
 - 
 -     bb11: {
-          _0 = const false;
+          _0 = const true;
 -         goto -> bb14;
 +         goto -> bb12;
       }
   
 -     bb12: {
+-         _0 = const true;
+-         goto -> bb14;
+-     }
+- 
+-     bb13: {
 +     bb11: {
-          _0 = const true;
+          _0 = const false;
 -         goto -> bb14;
 +         goto -> bb12;
       }
   
--     bb13: {
--         _0 = const true;
--         goto -> bb14;
--     }
-- 
 -     bb14: {
 +     bb12: {
           StorageDead(_2);
diff --git a/tests/mir-opt/dont_inline_type_id.rs b/tests/mir-opt/dont_inline_type_id.rs
index ab748940ac4..d389733457b 100644
--- a/tests/mir-opt/dont_inline_type_id.rs
+++ b/tests/mir-opt/dont_inline_type_id.rs
@@ -2,8 +2,7 @@
 //@ test-mir-pass: Inline
 //@ compile-flags: --crate-type=lib -C panic=abort
 
-use std::any::Any;
-use std::any::TypeId;
+use std::any::{Any, TypeId};
 
 struct A<T: ?Sized + 'static> {
     a: i32,
diff --git a/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff
index 7776ff0fde7..41ae2fd3af3 100644
--- a/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff
@@ -38,15 +38,20 @@
   
       bb2: {
           _6 = discriminant((_3.1: std::option::Option<u32>));
-          switchInt(move _6) -> [1: bb4, 0: bb1, otherwise: bb7];
+          switchInt(move _6) -> [1: bb5, 0: bb1, otherwise: bb7];
       }
   
       bb3: {
           _7 = discriminant((_3.1: std::option::Option<u32>));
-          switchInt(move _7) -> [0: bb5, 1: bb1, otherwise: bb7];
+          switchInt(move _7) -> [0: bb4, 1: bb1, otherwise: bb7];
       }
   
       bb4: {
+          _0 = const 2_u32;
+          goto -> bb6;
+      }
+  
+      bb5: {
           StorageLive(_9);
           _9 = (((_3.0: std::option::Option<u32>) as Some).0: u32);
           StorageLive(_10);
@@ -57,11 +62,6 @@
           goto -> bb6;
       }
   
-      bb5: {
-          _0 = const 2_u32;
-          goto -> bb6;
-      }
-  
       bb6: {
           StorageDead(_3);
           return;
diff --git a/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff
index b41e952d80f..302fd0bfded 100644
--- a/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch.opt3.EarlyOtherwiseBranch.diff
@@ -49,7 +49,7 @@
   
       bb2: {
 -         _6 = discriminant((_3.1: Option2<bool>));
--         switchInt(move _6) -> [0: bb5, otherwise: bb1];
+-         switchInt(move _6) -> [0: bb7, otherwise: bb1];
 -     }
 - 
 -     bb3: {
@@ -59,17 +59,11 @@
 - 
 -     bb4: {
 -         _8 = discriminant((_3.1: Option2<bool>));
--         switchInt(move _8) -> [2: bb7, otherwise: bb1];
+-         switchInt(move _8) -> [2: bb5, otherwise: bb1];
 -     }
 - 
 -     bb5: {
-          StorageLive(_10);
-          _10 = (((_3.0: Option2<u32>) as Some).0: u32);
-          StorageLive(_11);
-          _11 = (((_3.1: Option2<bool>) as Some).0: bool);
-          _0 = const 0_u32;
-          StorageDead(_11);
-          StorageDead(_10);
+          _0 = const 3_u32;
 -         goto -> bb8;
 +         goto -> bb5;
       }
@@ -83,7 +77,13 @@
   
 -     bb7: {
 +     bb4: {
-          _0 = const 3_u32;
+          StorageLive(_10);
+          _10 = (((_3.0: Option2<u32>) as Some).0: u32);
+          StorageLive(_11);
+          _11 = (((_3.1: Option2<bool>) as Some).0: bool);
+          _0 = const 0_u32;
+          StorageDead(_11);
+          StorageDead(_10);
 -         goto -> bb8;
 +         goto -> bb5;
       }
@@ -101,7 +101,7 @@
 + 
 +     bb7: {
 +         StorageDead(_13);
-+         switchInt(_9) -> [0: bb2, 1: bb3, 2: bb4, otherwise: bb6];
++         switchInt(_9) -> [0: bb4, 1: bb3, 2: bb2, otherwise: bb6];
       }
   }
   
diff --git a/tests/mir-opt/early_otherwise_branch.opt4.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch.opt4.EarlyOtherwiseBranch.diff
index 18dea56f430..eef4fb3278c 100644
--- a/tests/mir-opt/early_otherwise_branch.opt4.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch.opt4.EarlyOtherwiseBranch.diff
@@ -49,7 +49,7 @@
   
       bb2: {
 -         _6 = discriminant((_3.1: Option2<u32>));
--         switchInt(move _6) -> [0: bb5, otherwise: bb1];
+-         switchInt(move _6) -> [0: bb7, otherwise: bb1];
 -     }
 - 
 -     bb3: {
@@ -59,17 +59,11 @@
 - 
 -     bb4: {
 -         _8 = discriminant((_3.1: Option2<u32>));
--         switchInt(move _8) -> [2: bb7, otherwise: bb1];
+-         switchInt(move _8) -> [2: bb5, otherwise: bb1];
 -     }
 - 
 -     bb5: {
-          StorageLive(_10);
-          _10 = (((_3.0: Option2<u32>) as Some).0: u32);
-          StorageLive(_11);
-          _11 = (((_3.1: Option2<u32>) as Some).0: u32);
-          _0 = const 0_u32;
-          StorageDead(_11);
-          StorageDead(_10);
+          _0 = const 3_u32;
 -         goto -> bb8;
 +         goto -> bb5;
       }
@@ -83,7 +77,13 @@
   
 -     bb7: {
 +     bb4: {
-          _0 = const 3_u32;
+          StorageLive(_10);
+          _10 = (((_3.0: Option2<u32>) as Some).0: u32);
+          StorageLive(_11);
+          _11 = (((_3.1: Option2<u32>) as Some).0: u32);
+          _0 = const 0_u32;
+          StorageDead(_11);
+          StorageDead(_10);
 -         goto -> bb8;
 +         goto -> bb5;
       }
@@ -101,7 +101,7 @@
 + 
 +     bb7: {
 +         StorageDead(_13);
-+         switchInt(_9) -> [0: bb2, 1: bb3, 2: bb4, otherwise: bb6];
++         switchInt(_9) -> [0: bb4, 1: bb3, 2: bb2, otherwise: bb6];
       }
   }
   
diff --git a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff
index 4c3c717b522..cb03e2697cc 100644
--- a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt1.EarlyOtherwiseBranch.diff
@@ -52,7 +52,7 @@
   
       bb3: {
           _8 = discriminant((_4.2: std::option::Option<u32>));
-          switchInt(move _8) -> [1: bb6, 0: bb1, otherwise: bb9];
+          switchInt(move _8) -> [1: bb7, 0: bb1, otherwise: bb9];
       }
   
       bb4: {
@@ -62,10 +62,15 @@
   
       bb5: {
           _10 = discriminant((_4.2: std::option::Option<u32>));
-          switchInt(move _10) -> [0: bb7, 1: bb1, otherwise: bb9];
+          switchInt(move _10) -> [0: bb6, 1: bb1, otherwise: bb9];
       }
   
       bb6: {
+          _0 = const 2_u32;
+          goto -> bb8;
+      }
+  
+      bb7: {
           StorageLive(_13);
           _13 = (((_4.0: std::option::Option<u32>) as Some).0: u32);
           StorageLive(_14);
@@ -79,11 +84,6 @@
           goto -> bb8;
       }
   
-      bb7: {
-          _0 = const 2_u32;
-          goto -> bb8;
-      }
-  
       bb8: {
           StorageDead(_4);
           return;
diff --git a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt2.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt2.EarlyOtherwiseBranch.diff
index 0ea7a10baaa..5634df253a5 100644
--- a/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt2.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch_3_element_tuple.opt2.EarlyOtherwiseBranch.diff
@@ -64,8 +64,8 @@
 - 
 -     bb3: {
           _8 = discriminant((_4.2: Option2<u32>));
--         switchInt(move _8) -> [0: bb8, otherwise: bb1];
-+         switchInt(move _8) -> [0: bb5, otherwise: bb1];
+-         switchInt(move _8) -> [0: bb10, otherwise: bb1];
++         switchInt(move _8) -> [0: bb7, otherwise: bb1];
       }
   
 -     bb4: {
@@ -88,22 +88,13 @@
 -     bb7: {
 +     bb4: {
           _12 = discriminant((_4.2: Option2<u32>));
--         switchInt(move _12) -> [2: bb10, otherwise: bb1];
-+         switchInt(move _12) -> [2: bb7, otherwise: bb1];
+-         switchInt(move _12) -> [2: bb8, otherwise: bb1];
++         switchInt(move _12) -> [2: bb5, otherwise: bb1];
       }
   
 -     bb8: {
 +     bb5: {
-          StorageLive(_15);
-          _15 = (((_4.0: Option2<u32>) as Some).0: u32);
-          StorageLive(_16);
-          _16 = (((_4.1: Option2<u32>) as Some).0: u32);
-          StorageLive(_17);
-          _17 = (((_4.2: Option2<u32>) as Some).0: u32);
-          _0 = const 0_u32;
-          StorageDead(_17);
-          StorageDead(_16);
-          StorageDead(_15);
+          _0 = const 3_u32;
 -         goto -> bb11;
 +         goto -> bb8;
       }
@@ -117,7 +108,16 @@
   
 -     bb10: {
 +     bb7: {
-          _0 = const 3_u32;
+          StorageLive(_15);
+          _15 = (((_4.0: Option2<u32>) as Some).0: u32);
+          StorageLive(_16);
+          _16 = (((_4.1: Option2<u32>) as Some).0: u32);
+          StorageLive(_17);
+          _17 = (((_4.2: Option2<u32>) as Some).0: u32);
+          _0 = const 0_u32;
+          StorageDead(_17);
+          StorageDead(_16);
+          StorageDead(_15);
 -         goto -> bb11;
 +         goto -> bb8;
       }
diff --git a/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff
index de12fe8f120..8179d9dd115 100644
--- a/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff
@@ -94,78 +94,56 @@
       bb2: {
           _35 = deref_copy (_4.1: &ViewportPercentageLength);
           _7 = discriminant((*_35));
-          switchInt(move _7) -> [0: bb6, otherwise: bb1];
+          switchInt(move _7) -> [0: bb9, otherwise: bb1];
       }
   
       bb3: {
           _36 = deref_copy (_4.1: &ViewportPercentageLength);
           _8 = discriminant((*_36));
-          switchInt(move _8) -> [1: bb7, otherwise: bb1];
+          switchInt(move _8) -> [1: bb8, otherwise: bb1];
       }
   
       bb4: {
           _37 = deref_copy (_4.1: &ViewportPercentageLength);
           _9 = discriminant((*_37));
-          switchInt(move _9) -> [2: bb8, otherwise: bb1];
+          switchInt(move _9) -> [2: bb7, otherwise: bb1];
       }
   
       bb5: {
           _38 = deref_copy (_4.1: &ViewportPercentageLength);
           _10 = discriminant((*_38));
-          switchInt(move _10) -> [3: bb9, otherwise: bb1];
+          switchInt(move _10) -> [3: bb6, otherwise: bb1];
       }
   
       bb6: {
-          StorageLive(_12);
+          StorageLive(_27);
           _39 = deref_copy (_4.0: &ViewportPercentageLength);
-          _12 = (((*_39) as Vw).0: f32);
-          StorageLive(_13);
+          _27 = (((*_39) as Vmax).0: f32);
+          StorageLive(_28);
           _40 = deref_copy (_4.1: &ViewportPercentageLength);
-          _13 = (((*_40) as Vw).0: f32);
-          StorageLive(_14);
-          StorageLive(_15);
-          _15 = _12;
-          StorageLive(_16);
-          _16 = _13;
-          _14 = Add(move _15, move _16);
-          StorageDead(_16);
-          StorageDead(_15);
-          _3 = ViewportPercentageLength::Vw(move _14);
-          StorageDead(_14);
-          StorageDead(_13);
-          StorageDead(_12);
+          _28 = (((*_40) as Vmax).0: f32);
+          StorageLive(_29);
+          StorageLive(_30);
+          _30 = _27;
+          StorageLive(_31);
+          _31 = _28;
+          _29 = Add(move _30, move _31);
+          StorageDead(_31);
+          StorageDead(_30);
+          _3 = ViewportPercentageLength::Vmax(move _29);
+          StorageDead(_29);
+          StorageDead(_28);
+          StorageDead(_27);
           goto -> bb10;
       }
   
       bb7: {
-          StorageLive(_17);
-          _41 = deref_copy (_4.0: &ViewportPercentageLength);
-          _17 = (((*_41) as Vh).0: f32);
-          StorageLive(_18);
-          _42 = deref_copy (_4.1: &ViewportPercentageLength);
-          _18 = (((*_42) as Vh).0: f32);
-          StorageLive(_19);
-          StorageLive(_20);
-          _20 = _17;
-          StorageLive(_21);
-          _21 = _18;
-          _19 = Add(move _20, move _21);
-          StorageDead(_21);
-          StorageDead(_20);
-          _3 = ViewportPercentageLength::Vh(move _19);
-          StorageDead(_19);
-          StorageDead(_18);
-          StorageDead(_17);
-          goto -> bb10;
-      }
-  
-      bb8: {
           StorageLive(_22);
-          _43 = deref_copy (_4.0: &ViewportPercentageLength);
-          _22 = (((*_43) as Vmin).0: f32);
+          _41 = deref_copy (_4.0: &ViewportPercentageLength);
+          _22 = (((*_41) as Vmin).0: f32);
           StorageLive(_23);
-          _44 = deref_copy (_4.1: &ViewportPercentageLength);
-          _23 = (((*_44) as Vmin).0: f32);
+          _42 = deref_copy (_4.1: &ViewportPercentageLength);
+          _23 = (((*_42) as Vmin).0: f32);
           StorageLive(_24);
           StorageLive(_25);
           _25 = _22;
@@ -181,25 +159,47 @@
           goto -> bb10;
       }
   
+      bb8: {
+          StorageLive(_17);
+          _43 = deref_copy (_4.0: &ViewportPercentageLength);
+          _17 = (((*_43) as Vh).0: f32);
+          StorageLive(_18);
+          _44 = deref_copy (_4.1: &ViewportPercentageLength);
+          _18 = (((*_44) as Vh).0: f32);
+          StorageLive(_19);
+          StorageLive(_20);
+          _20 = _17;
+          StorageLive(_21);
+          _21 = _18;
+          _19 = Add(move _20, move _21);
+          StorageDead(_21);
+          StorageDead(_20);
+          _3 = ViewportPercentageLength::Vh(move _19);
+          StorageDead(_19);
+          StorageDead(_18);
+          StorageDead(_17);
+          goto -> bb10;
+      }
+  
       bb9: {
-          StorageLive(_27);
+          StorageLive(_12);
           _45 = deref_copy (_4.0: &ViewportPercentageLength);
-          _27 = (((*_45) as Vmax).0: f32);
-          StorageLive(_28);
+          _12 = (((*_45) as Vw).0: f32);
+          StorageLive(_13);
           _46 = deref_copy (_4.1: &ViewportPercentageLength);
-          _28 = (((*_46) as Vmax).0: f32);
-          StorageLive(_29);
-          StorageLive(_30);
-          _30 = _27;
-          StorageLive(_31);
-          _31 = _28;
-          _29 = Add(move _30, move _31);
-          StorageDead(_31);
-          StorageDead(_30);
-          _3 = ViewportPercentageLength::Vmax(move _29);
-          StorageDead(_29);
-          StorageDead(_28);
-          StorageDead(_27);
+          _13 = (((*_46) as Vw).0: f32);
+          StorageLive(_14);
+          StorageLive(_15);
+          _15 = _12;
+          StorageLive(_16);
+          _16 = _13;
+          _14 = Add(move _15, move _16);
+          StorageDead(_16);
+          StorageDead(_15);
+          _3 = ViewportPercentageLength::Vw(move _14);
+          StorageDead(_14);
+          StorageDead(_13);
+          StorageDead(_12);
           goto -> bb10;
       }
   
diff --git a/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff b/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff
index 350e5fe6db5..651b1de4ddd 100644
--- a/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff
+++ b/tests/mir-opt/early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff
@@ -45,12 +45,12 @@
   
       bb2: {
           _6 = discriminant((_3.1: std::option::Option<u32>));
-          switchInt(move _6) -> [0: bb6, 1: bb5, otherwise: bb1];
+          switchInt(move _6) -> [0: bb6, 1: bb7, otherwise: bb1];
       }
   
       bb3: {
           _7 = discriminant((_3.1: std::option::Option<u32>));
-          switchInt(move _7) -> [0: bb4, 1: bb7, otherwise: bb1];
+          switchInt(move _7) -> [0: bb4, 1: bb5, otherwise: bb1];
       }
   
       bb4: {
@@ -59,13 +59,10 @@
       }
   
       bb5: {
-          StorageLive(_9);
-          _9 = (((_3.0: std::option::Option<u32>) as Some).0: u32);
-          StorageLive(_10);
-          _10 = (((_3.1: std::option::Option<u32>) as Some).0: u32);
-          _0 = const 0_u32;
-          StorageDead(_10);
-          StorageDead(_9);
+          StorageLive(_12);
+          _12 = (((_3.1: std::option::Option<u32>) as Some).0: u32);
+          _0 = const 2_u32;
+          StorageDead(_12);
           goto -> bb8;
       }
   
@@ -78,10 +75,13 @@
       }
   
       bb7: {
-          StorageLive(_12);
-          _12 = (((_3.1: std::option::Option<u32>) as Some).0: u32);
-          _0 = const 2_u32;
-          StorageDead(_12);
+          StorageLive(_9);
+          _9 = (((_3.0: std::option::Option<u32>) as Some).0: u32);
+          StorageLive(_10);
+          _10 = (((_3.1: std::option::Option<u32>) as Some).0: u32);
+          _0 = const 0_u32;
+          StorageDead(_10);
+          StorageDead(_9);
           goto -> bb8;
       }
   
diff --git a/tests/mir-opt/elaborate_box_deref_in_debuginfo.pointee.ElaborateBoxDerefs.diff b/tests/mir-opt/elaborate_box_deref_in_debuginfo.pointee.ElaborateBoxDerefs.diff
new file mode 100644
index 00000000000..279c1a1990d
--- /dev/null
+++ b/tests/mir-opt/elaborate_box_deref_in_debuginfo.pointee.ElaborateBoxDerefs.diff
@@ -0,0 +1,13 @@
+- // MIR for `pointee` before ElaborateBoxDerefs
++ // MIR for `pointee` after ElaborateBoxDerefs
+  
+  fn pointee(_1: Box<i32>) -> () {
+-     debug foo => (*_1);
++     debug foo => (*(((_1.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32));
+      let mut _0: ();
+  
+      bb0: {
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/elaborate_box_deref_in_debuginfo.rs b/tests/mir-opt/elaborate_box_deref_in_debuginfo.rs
new file mode 100644
index 00000000000..0046e7104f1
--- /dev/null
+++ b/tests/mir-opt/elaborate_box_deref_in_debuginfo.rs
@@ -0,0 +1,20 @@
+// skip-filecheck
+//@ test-mir-pass: ElaborateBoxDerefs
+
+#![feature(custom_mir, core_intrinsics)]
+
+extern crate core;
+use core::intrinsics::mir::*;
+
+// EMIT_MIR elaborate_box_deref_in_debuginfo.pointee.ElaborateBoxDerefs.diff
+#[custom_mir(dialect = "built")]
+fn pointee(opt: Box<i32>) {
+    mir!(
+        debug foo => *opt;
+        {
+            Return()
+        }
+    )
+}
+
+fn main() {}
diff --git a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff
index 9d5042caae2..4e495c37fbc 100644
--- a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff
+++ b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-abort.diff
@@ -21,14 +21,14 @@
       bb0: {
           StorageLive(_2);
           StorageLive(_3);
-          _3 = &(*_1);
+          _3 = _1;
           _2 = <Q as Query>::cache::<T>(move _3) -> [return: bb1, unwind unreachable];
       }
   
       bb1: {
           StorageDead(_3);
           StorageLive(_4);
-          _4 = &(*_2);
+          _4 = _2;
 -         _0 = try_execute_query::<<Q as Query>::C>(move _4) -> [return: bb2, unwind unreachable];
 +         StorageLive(_5);
 +         _5 = _4 as &dyn Cache<V = <Q as Query>::V> (PointerCoercion(Unsize));
diff --git a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff
index 9bd3855c58f..7fdb7618212 100644
--- a/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff
+++ b/tests/mir-opt/inline/dyn_trait.get_query.Inline.panic-unwind.diff
@@ -21,14 +21,14 @@
       bb0: {
           StorageLive(_2);
           StorageLive(_3);
-          _3 = &(*_1);
+          _3 = _1;
           _2 = <Q as Query>::cache::<T>(move _3) -> [return: bb1, unwind continue];
       }
   
       bb1: {
           StorageDead(_3);
           StorageLive(_4);
-          _4 = &(*_2);
+          _4 = _2;
 -         _0 = try_execute_query::<<Q as Query>::C>(move _4) -> [return: bb2, unwind continue];
 +         StorageLive(_5);
 +         _5 = _4 as &dyn Cache<V = <Q as Query>::V> (PointerCoercion(Unsize));
diff --git a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff
index d7801b7a0cc..8df4408690b 100644
--- a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff
+++ b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-abort.diff
@@ -8,7 +8,7 @@
   
       bb0: {
           StorageLive(_2);
-          _2 = &(*_1);
+          _2 = _1;
           _0 = <dyn Cache<V = V> as Cache>::store_nocache(move _2) -> [return: bb1, unwind unreachable];
       }
   
diff --git a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff
index 7b1cf895a87..43a0621f766 100644
--- a/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff
+++ b/tests/mir-opt/inline/dyn_trait.mk_cycle.Inline.panic-unwind.diff
@@ -8,7 +8,7 @@
   
       bb0: {
           StorageLive(_2);
-          _2 = &(*_1);
+          _2 = _1;
           _0 = <dyn Cache<V = V> as Cache>::store_nocache(move _2) -> [return: bb1, unwind continue];
       }
   
diff --git a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff
index 96e16d023ba..e72c312f549 100644
--- a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff
+++ b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-abort.diff
@@ -13,7 +13,7 @@
       bb0: {
           StorageLive(_2);
           StorageLive(_3);
-          _3 = &(*_1);
+          _3 = _1;
           _2 = move _3 as &dyn Cache<V = <C as Cache>::V> (PointerCoercion(Unsize));
           StorageDead(_3);
 -         _0 = mk_cycle::<<C as Cache>::V>(move _2) -> [return: bb1, unwind unreachable];
diff --git a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff
index 06d65abcbc1..46728f9e2e6 100644
--- a/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff
+++ b/tests/mir-opt/inline/dyn_trait.try_execute_query.Inline.panic-unwind.diff
@@ -13,7 +13,7 @@
       bb0: {
           StorageLive(_2);
           StorageLive(_3);
-          _3 = &(*_1);
+          _3 = _1;
           _2 = move _3 as &dyn Cache<V = <C as Cache>::V> (PointerCoercion(Unsize));
           StorageDead(_3);
 -         _0 = mk_cycle::<<C as Cache>::V>(move _2) -> [return: bb1, unwind continue];
diff --git a/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir
index a6198ca053b..f524b054b61 100644
--- a/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir
+++ b/tests/mir-opt/inline/inline_closure_borrows_arg.foo.Inline.after.mir
@@ -26,9 +26,9 @@ fn foo(_1: T, _2: &i32) -> i32 {
         _4 = &_3;
         StorageLive(_5);
         StorageLive(_6);
-        _6 = &(*_2);
+        _6 = _2;
         StorageLive(_7);
-        _7 = &(*_2);
+        _7 = _2;
         _5 = (move _6, move _7);
         StorageLive(_8);
         _8 = move (_5.0: &i32);
diff --git a/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir b/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir
index dcce4aad444..ec3c79e2a37 100644
--- a/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir
+++ b/tests/mir-opt/inline/inline_retag.bar.Inline.after.mir
@@ -31,14 +31,14 @@ fn bar() -> bool {
         StorageLive(_4);
         _10 = const bar::promoted[1];
         Retag(_10);
-        _4 = &(*_10);
-        _3 = &(*_4);
+        _4 = _10;
+        _3 = _4;
         StorageLive(_6);
         StorageLive(_7);
         _9 = const bar::promoted[0];
         Retag(_9);
-        _7 = &(*_9);
-        _6 = &(*_7);
+        _7 = _9;
+        _6 = _7;
         Retag(_3);
         Retag(_6);
         StorageLive(_11);
diff --git a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir
index 2441e3f1c2c..d7b4302b06d 100644
--- a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir
+++ b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-abort.mir
@@ -7,7 +7,7 @@ fn test(_1: &dyn X) -> u32 {
 
     bb0: {
         StorageLive(_2);
-        _2 = &(*_1);
+        _2 = _1;
         _0 = <dyn X as X>::y(move _2) -> [return: bb1, unwind unreachable];
     }
 
diff --git a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir
index da18a5adc37..0d6f3e61f71 100644
--- a/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir
+++ b/tests/mir-opt/inline/inline_trait_method.test.Inline.after.panic-unwind.mir
@@ -7,7 +7,7 @@ fn test(_1: &dyn X) -> u32 {
 
     bb0: {
         StorageLive(_2);
-        _2 = &(*_1);
+        _2 = _1;
         _0 = <dyn X as X>::y(move _2) -> [return: bb1, unwind continue];
     }
 
diff --git a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir
index f0d1cfe0359..af79c7ce196 100644
--- a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir
+++ b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-abort.mir
@@ -12,8 +12,8 @@ fn test2(_1: &dyn X) -> bool {
     bb0: {
         StorageLive(_2);
         StorageLive(_3);
-        _3 = &(*_1);
-        _2 = move _3 as &dyn X (PointerCoercion(Unsize));
+        _3 = _1;
+        _2 = move _3;
         StorageDead(_3);
         _0 = <dyn X as X>::y(move _2) -> [return: bb1, unwind unreachable];
     }
diff --git a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir
index f37b0814301..bf5a56b8e62 100644
--- a/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir
+++ b/tests/mir-opt/inline/inline_trait_method_2.test2.Inline.after.panic-unwind.mir
@@ -12,8 +12,8 @@ fn test2(_1: &dyn X) -> bool {
     bb0: {
         StorageLive(_2);
         StorageLive(_3);
-        _3 = &(*_1);
-        _2 = move _3 as &dyn X (PointerCoercion(Unsize));
+        _3 = _1;
+        _2 = move _3;
         StorageDead(_3);
         _0 = <dyn X as X>::y(move _2) -> [return: bb1, unwind continue];
     }
diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir
index 7cc65efe07b..8c457037ec9 100644
--- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir
+++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.a.Inline.after.mir
@@ -14,11 +14,11 @@ fn a(_1: &mut [T]) -> &mut [T] {
         StorageLive(_2);
         StorageLive(_3);
         StorageLive(_4);
-        _4 = &mut (*_1);
+        _4 = _1;
         _3 = _4;
-        _2 = &mut (*_3);
+        _2 = _3;
         StorageDead(_4);
-        _0 = &mut (*_2);
+        _0 = _2;
         StorageDead(_3);
         StorageDead(_2);
         return;
diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
index 408cc5bb341..e27d9fe38c7 100644
--- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
+++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
@@ -16,7 +16,7 @@ fn b(_1: &mut Box<T>) -> &mut T {
         StorageLive(_2);
         StorageLive(_3);
         StorageLive(_4);
-        _4 = &mut (*_1);
+        _4 = _1;
         StorageLive(_5);
         StorageLive(_6);
         _5 = (*_4);
@@ -24,9 +24,9 @@ fn b(_1: &mut Box<T>) -> &mut T {
         _3 = &mut (*_6);
         StorageDead(_6);
         StorageDead(_5);
-        _2 = &mut (*_3);
+        _2 = _3;
         StorageDead(_4);
-        _0 = &mut (*_2);
+        _0 = _2;
         StorageDead(_3);
         StorageDead(_2);
         return;
diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir
index bad7f31ae9b..da0464c64d6 100644
--- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir
+++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.c.Inline.after.mir
@@ -12,9 +12,9 @@ fn c(_1: &[T]) -> &[T] {
     bb0: {
         StorageLive(_2);
         StorageLive(_3);
-        _3 = &(*_1);
+        _3 = _1;
         _2 = _3;
-        _0 = &(*_2);
+        _0 = _2;
         StorageDead(_3);
         StorageDead(_2);
         return;
diff --git a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
index 4d20f6c4419..25eaedfc842 100644
--- a/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
+++ b/tests/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
@@ -14,7 +14,7 @@ fn d(_1: &Box<T>) -> &T {
     bb0: {
         StorageLive(_2);
         StorageLive(_3);
-        _3 = &(*_1);
+        _3 = _1;
         StorageLive(_4);
         StorageLive(_5);
         _4 = (*_3);
@@ -22,7 +22,7 @@ fn d(_1: &Box<T>) -> &T {
         _2 = &(*_5);
         StorageDead(_5);
         StorageDead(_4);
-        _0 = &(*_2);
+        _0 = _2;
         StorageDead(_3);
         StorageDead(_2);
         return;
diff --git a/tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify.diff b/tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify-after-simplifycfg.diff
index 5c09963d433..fea5f4f02ce 100644
--- a/tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/bool_compare.eq_false.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `eq_false` before InstSimplify
-+ // MIR for `eq_false` after InstSimplify
+- // MIR for `eq_false` before InstSimplify-after-simplifycfg
++ // MIR for `eq_false` after InstSimplify-after-simplifycfg
   
   fn eq_false(_1: bool) -> u32 {
       debug x => _1;
diff --git a/tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify.diff b/tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify-after-simplifycfg.diff
index a80133b0eb0..9a509ccfa67 100644
--- a/tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/bool_compare.eq_true.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `eq_true` before InstSimplify
-+ // MIR for `eq_true` after InstSimplify
+- // MIR for `eq_true` before InstSimplify-after-simplifycfg
++ // MIR for `eq_true` after InstSimplify-after-simplifycfg
   
   fn eq_true(_1: bool) -> u32 {
       debug x => _1;
diff --git a/tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify.diff b/tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify-after-simplifycfg.diff
index 8235d5263bb..e4ec4c80579 100644
--- a/tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/bool_compare.false_eq.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `false_eq` before InstSimplify
-+ // MIR for `false_eq` after InstSimplify
+- // MIR for `false_eq` before InstSimplify-after-simplifycfg
++ // MIR for `false_eq` after InstSimplify-after-simplifycfg
   
   fn false_eq(_1: bool) -> u32 {
       debug x => _1;
diff --git a/tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify.diff b/tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify-after-simplifycfg.diff
index 77d076c6c14..3aea55f4db4 100644
--- a/tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/bool_compare.false_ne.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `false_ne` before InstSimplify
-+ // MIR for `false_ne` after InstSimplify
+- // MIR for `false_ne` before InstSimplify-after-simplifycfg
++ // MIR for `false_ne` after InstSimplify-after-simplifycfg
   
   fn false_ne(_1: bool) -> u32 {
       debug x => _1;
diff --git a/tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify.diff b/tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify-after-simplifycfg.diff
index 2362b11297e..b6e891088a1 100644
--- a/tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/bool_compare.ne_false.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `ne_false` before InstSimplify
-+ // MIR for `ne_false` after InstSimplify
+- // MIR for `ne_false` before InstSimplify-after-simplifycfg
++ // MIR for `ne_false` after InstSimplify-after-simplifycfg
   
   fn ne_false(_1: bool) -> u32 {
       debug x => _1;
diff --git a/tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify.diff b/tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify-after-simplifycfg.diff
index 6ccbd2fb7a1..974738bb3a9 100644
--- a/tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/bool_compare.ne_true.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `ne_true` before InstSimplify
-+ // MIR for `ne_true` after InstSimplify
+- // MIR for `ne_true` before InstSimplify-after-simplifycfg
++ // MIR for `ne_true` after InstSimplify-after-simplifycfg
   
   fn ne_true(_1: bool) -> u32 {
       debug x => _1;
diff --git a/tests/mir-opt/instsimplify/bool_compare.rs b/tests/mir-opt/instsimplify/bool_compare.rs
index d1d903f9ef2..3911f81fe5c 100644
--- a/tests/mir-opt/instsimplify/bool_compare.rs
+++ b/tests/mir-opt/instsimplify/bool_compare.rs
@@ -1,55 +1,55 @@
-//@ test-mir-pass: InstSimplify
+//@ test-mir-pass: InstSimplify-after-simplifycfg
 
-// EMIT_MIR bool_compare.eq_true.InstSimplify.diff
+// EMIT_MIR bool_compare.eq_true.InstSimplify-after-simplifycfg.diff
 fn eq_true(x: bool) -> u32 {
     // CHECK-LABEL: fn eq_true(
     // CHECK-NOT: Eq(
     if x == true { 0 } else { 1 }
 }
 
-// EMIT_MIR bool_compare.true_eq.InstSimplify.diff
+// EMIT_MIR bool_compare.true_eq.InstSimplify-after-simplifycfg.diff
 fn true_eq(x: bool) -> u32 {
     // CHECK-LABEL: fn true_eq(
     // CHECK-NOT: Eq(
     if true == x { 0 } else { 1 }
 }
 
-// EMIT_MIR bool_compare.ne_true.InstSimplify.diff
+// EMIT_MIR bool_compare.ne_true.InstSimplify-after-simplifycfg.diff
 fn ne_true(x: bool) -> u32 {
     // CHECK-LABEL: fn ne_true(
     // CHECK: Not(
     if x != true { 0 } else { 1 }
 }
 
-// EMIT_MIR bool_compare.true_ne.InstSimplify.diff
+// EMIT_MIR bool_compare.true_ne.InstSimplify-after-simplifycfg.diff
 fn true_ne(x: bool) -> u32 {
     // CHECK-LABEL: fn true_ne(
     // CHECK: Not(
     if true != x { 0 } else { 1 }
 }
 
-// EMIT_MIR bool_compare.eq_false.InstSimplify.diff
+// EMIT_MIR bool_compare.eq_false.InstSimplify-after-simplifycfg.diff
 fn eq_false(x: bool) -> u32 {
     // CHECK-LABEL: fn eq_false(
     // CHECK: Not(
     if x == false { 0 } else { 1 }
 }
 
-// EMIT_MIR bool_compare.false_eq.InstSimplify.diff
+// EMIT_MIR bool_compare.false_eq.InstSimplify-after-simplifycfg.diff
 fn false_eq(x: bool) -> u32 {
     // CHECK-LABEL: fn false_eq(
     // CHECK: Not(
     if false == x { 0 } else { 1 }
 }
 
-// EMIT_MIR bool_compare.ne_false.InstSimplify.diff
+// EMIT_MIR bool_compare.ne_false.InstSimplify-after-simplifycfg.diff
 fn ne_false(x: bool) -> u32 {
     // CHECK-LABEL: fn ne_false(
     // CHECK-NOT: Ne(
     if x != false { 0 } else { 1 }
 }
 
-// EMIT_MIR bool_compare.false_ne.InstSimplify.diff
+// EMIT_MIR bool_compare.false_ne.InstSimplify-after-simplifycfg.diff
 fn false_ne(x: bool) -> u32 {
     // CHECK-LABEL: fn false_ne(
     // CHECK-NOT: Ne(
diff --git a/tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify.diff b/tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify-after-simplifycfg.diff
index 18675329a2e..240835bf7f2 100644
--- a/tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/bool_compare.true_eq.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `true_eq` before InstSimplify
-+ // MIR for `true_eq` after InstSimplify
+- // MIR for `true_eq` before InstSimplify-after-simplifycfg
++ // MIR for `true_eq` after InstSimplify-after-simplifycfg
   
   fn true_eq(_1: bool) -> u32 {
       debug x => _1;
diff --git a/tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify.diff b/tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify-after-simplifycfg.diff
index dc91cf8a5c4..1e2b2c27f57 100644
--- a/tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/bool_compare.true_ne.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `true_ne` before InstSimplify
-+ // MIR for `true_ne` after InstSimplify
+- // MIR for `true_ne` before InstSimplify-after-simplifycfg
++ // MIR for `true_ne` after InstSimplify-after-simplifycfg
   
   fn true_ne(_1: bool) -> u32 {
       debug x => _1;
diff --git a/tests/mir-opt/instsimplify/casts.redundant.InstSimplify.diff b/tests/mir-opt/instsimplify/casts.redundant.InstSimplify-after-simplifycfg.diff
index e7451d55777..7001589d9e3 100644
--- a/tests/mir-opt/instsimplify/casts.redundant.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/casts.redundant.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `redundant` before InstSimplify
-+ // MIR for `redundant` after InstSimplify
+- // MIR for `redundant` before InstSimplify-after-simplifycfg
++ // MIR for `redundant` after InstSimplify-after-simplifycfg
   
   fn redundant(_1: *const &u8) -> *const &u8 {
       debug x => _1;
diff --git a/tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify.diff b/tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify-after-simplifycfg.diff
index e87ac762dfe..e1045db9730 100644
--- a/tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/casts.roundtrip.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `roundtrip` before InstSimplify
-+ // MIR for `roundtrip` after InstSimplify
+- // MIR for `roundtrip` before InstSimplify-after-simplifycfg
++ // MIR for `roundtrip` after InstSimplify-after-simplifycfg
   
   fn roundtrip(_1: *const u8) -> *const u8 {
       debug x => _1;
diff --git a/tests/mir-opt/instsimplify/casts.rs b/tests/mir-opt/instsimplify/casts.rs
index 15ceea76713..24dbb67b42d 100644
--- a/tests/mir-opt/instsimplify/casts.rs
+++ b/tests/mir-opt/instsimplify/casts.rs
@@ -1,4 +1,4 @@
-//@ test-mir-pass: InstSimplify
+//@ test-mir-pass: InstSimplify-after-simplifycfg
 //@ compile-flags: -Zinline-mir
 #![crate_type = "lib"]
 #![feature(core_intrinsics)]
@@ -8,7 +8,7 @@ fn generic_cast<T, U>(x: *const T) -> *const U {
     x as *const U
 }
 
-// EMIT_MIR casts.redundant.InstSimplify.diff
+// EMIT_MIR casts.redundant.InstSimplify-after-simplifycfg.diff
 pub fn redundant<'a, 'b: 'a>(x: *const &'a u8) -> *const &'a u8 {
     // CHECK-LABEL: fn redundant(
     // CHECK: inlined generic_cast
@@ -16,7 +16,7 @@ pub fn redundant<'a, 'b: 'a>(x: *const &'a u8) -> *const &'a u8 {
     generic_cast::<&'a u8, &'b u8>(x) as *const &'a u8
 }
 
-// EMIT_MIR casts.roundtrip.InstSimplify.diff
+// EMIT_MIR casts.roundtrip.InstSimplify-after-simplifycfg.diff
 pub fn roundtrip(x: *const u8) -> *const u8 {
     // CHECK-LABEL: fn roundtrip(
     // CHECK: _4 = _1;
@@ -25,7 +25,7 @@ pub fn roundtrip(x: *const u8) -> *const u8 {
     x as *mut u8 as *const u8
 }
 
-// EMIT_MIR casts.roundtrip.InstSimplify.diff
+// EMIT_MIR casts.roundtrip.InstSimplify-after-simplifycfg.diff
 pub fn cast_thin_via_aggregate(x: *const u8) -> *const () {
     // CHECK-LABEL: fn cast_thin_via_aggregate(
     // CHECK: _2 = _1;
diff --git a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify.panic-abort.diff b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff
index 3e7d0ce51e2..a7de09ca386 100644
--- a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify.panic-abort.diff
+++ b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-abort.diff
@@ -1,5 +1,5 @@
-- // MIR for `norm2` before InstSimplify
-+ // MIR for `norm2` after InstSimplify
+- // MIR for `norm2` before InstSimplify-after-simplifycfg
++ // MIR for `norm2` after InstSimplify-after-simplifycfg
   
   fn norm2(_1: [f32; 2]) -> f32 {
       debug x => _1;
diff --git a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify.panic-unwind.diff b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff
index 4833c1089e3..c15f7e47fe3 100644
--- a/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify.panic-unwind.diff
+++ b/tests/mir-opt/instsimplify/combine_array_len.norm2.InstSimplify-after-simplifycfg.panic-unwind.diff
@@ -1,5 +1,5 @@
-- // MIR for `norm2` before InstSimplify
-+ // MIR for `norm2` after InstSimplify
+- // MIR for `norm2` before InstSimplify-after-simplifycfg
++ // MIR for `norm2` after InstSimplify-after-simplifycfg
   
   fn norm2(_1: [f32; 2]) -> f32 {
       debug x => _1;
diff --git a/tests/mir-opt/instsimplify/combine_array_len.rs b/tests/mir-opt/instsimplify/combine_array_len.rs
index f12284f6482..91f43f75689 100644
--- a/tests/mir-opt/instsimplify/combine_array_len.rs
+++ b/tests/mir-opt/instsimplify/combine_array_len.rs
@@ -1,7 +1,7 @@
 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
-//@ test-mir-pass: InstSimplify
+//@ test-mir-pass: InstSimplify-after-simplifycfg
 
-// EMIT_MIR combine_array_len.norm2.InstSimplify.diff
+// EMIT_MIR combine_array_len.norm2.InstSimplify-after-simplifycfg.diff
 fn norm2(x: [f32; 2]) -> f32 {
     // CHECK-LABEL: fn norm2(
     // CHECK-NOT: Len(
diff --git a/tests/mir-opt/instsimplify/combine_clone_of_primitives.rs b/tests/mir-opt/instsimplify/combine_clone_of_primitives.rs
index 7b1f3d14f4f..4f7288333d1 100644
--- a/tests/mir-opt/instsimplify/combine_clone_of_primitives.rs
+++ b/tests/mir-opt/instsimplify/combine_clone_of_primitives.rs
@@ -1,7 +1,7 @@
-//@ test-mir-pass: InstSimplify
+//@ test-mir-pass: InstSimplify-after-simplifycfg
 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
 
-// EMIT_MIR combine_clone_of_primitives.{impl#0}-clone.InstSimplify.diff
+// EMIT_MIR combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.diff
 #[derive(Clone)]
 struct MyThing<T> {
     v: T,
diff --git a/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-abort.diff b/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-abort.diff
index 48586f8b334..c6f858d89eb 100644
--- a/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-abort.diff
+++ b/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-abort.diff
@@ -1,5 +1,5 @@
-- // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone` before InstSimplify
-+ // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone` after InstSimplify
+- // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone` before InstSimplify-after-simplifycfg
++ // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone` after InstSimplify-after-simplifycfg
   
   fn <impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone(_1: &MyThing<T>) -> MyThing<T> {
       debug self => _1;
diff --git a/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff b/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-unwind.diff
index a57266e9c12..691ab1f0e7f 100644
--- a/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify.panic-unwind.diff
+++ b/tests/mir-opt/instsimplify/combine_clone_of_primitives.{impl#0}-clone.InstSimplify-after-simplifycfg.panic-unwind.diff
@@ -1,5 +1,5 @@
-- // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone` before InstSimplify
-+ // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone` after InstSimplify
+- // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone` before InstSimplify-after-simplifycfg
++ // MIR for `<impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone` after InstSimplify-after-simplifycfg
   
   fn <impl at $DIR/combine_clone_of_primitives.rs:5:10: 5:15>::clone(_1: &MyThing<T>) -> MyThing<T> {
       debug self => _1;
diff --git a/tests/mir-opt/instsimplify/combine_transmutes.adt_transmutes.InstSimplify.diff b/tests/mir-opt/instsimplify/combine_transmutes.adt_transmutes.InstSimplify-after-simplifycfg.diff
index 17730e66291..9844aa2a64e 100644
--- a/tests/mir-opt/instsimplify/combine_transmutes.adt_transmutes.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/combine_transmutes.adt_transmutes.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `adt_transmutes` before InstSimplify
-+ // MIR for `adt_transmutes` after InstSimplify
+- // MIR for `adt_transmutes` before InstSimplify-after-simplifycfg
++ // MIR for `adt_transmutes` after InstSimplify-after-simplifycfg
   
   fn adt_transmutes() -> () {
       let mut _0: ();
diff --git a/tests/mir-opt/instsimplify/combine_transmutes.identity_transmutes.InstSimplify.diff b/tests/mir-opt/instsimplify/combine_transmutes.identity_transmutes.InstSimplify-after-simplifycfg.diff
index 58ae5919071..589f7159b9b 100644
--- a/tests/mir-opt/instsimplify/combine_transmutes.identity_transmutes.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/combine_transmutes.identity_transmutes.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `identity_transmutes` before InstSimplify
-+ // MIR for `identity_transmutes` after InstSimplify
+- // MIR for `identity_transmutes` before InstSimplify-after-simplifycfg
++ // MIR for `identity_transmutes` after InstSimplify-after-simplifycfg
   
   fn identity_transmutes() -> () {
       let mut _0: ();
diff --git a/tests/mir-opt/instsimplify/combine_transmutes.integer_transmutes.InstSimplify.diff b/tests/mir-opt/instsimplify/combine_transmutes.integer_transmutes.InstSimplify-after-simplifycfg.diff
index 8eff802dd3c..b7baa89dc80 100644
--- a/tests/mir-opt/instsimplify/combine_transmutes.integer_transmutes.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/combine_transmutes.integer_transmutes.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `integer_transmutes` before InstSimplify
-+ // MIR for `integer_transmutes` after InstSimplify
+- // MIR for `integer_transmutes` before InstSimplify-after-simplifycfg
++ // MIR for `integer_transmutes` after InstSimplify-after-simplifycfg
   
   fn integer_transmutes() -> () {
       let mut _0: ();
diff --git a/tests/mir-opt/instsimplify/combine_transmutes.rs b/tests/mir-opt/instsimplify/combine_transmutes.rs
index c3622c20697..23f10b71f3c 100644
--- a/tests/mir-opt/instsimplify/combine_transmutes.rs
+++ b/tests/mir-opt/instsimplify/combine_transmutes.rs
@@ -1,4 +1,4 @@
-//@ test-mir-pass: InstSimplify
+//@ test-mir-pass: InstSimplify-after-simplifycfg
 //@ compile-flags: -C panic=abort
 #![crate_type = "lib"]
 #![feature(core_intrinsics)]
@@ -7,7 +7,7 @@
 use std::intrinsics::mir::*;
 use std::mem::{transmute, ManuallyDrop, MaybeUninit};
 
-// EMIT_MIR combine_transmutes.identity_transmutes.InstSimplify.diff
+// EMIT_MIR combine_transmutes.identity_transmutes.InstSimplify-after-simplifycfg.diff
 pub unsafe fn identity_transmutes() {
     // CHECK-LABEL: fn identity_transmutes(
     // CHECK-NOT: as i32 (Transmute);
@@ -19,7 +19,7 @@ pub unsafe fn identity_transmutes() {
 }
 
 #[custom_mir(dialect = "runtime", phase = "initial")]
-// EMIT_MIR combine_transmutes.integer_transmutes.InstSimplify.diff
+// EMIT_MIR combine_transmutes.integer_transmutes.InstSimplify-after-simplifycfg.diff
 pub unsafe fn integer_transmutes() {
     // CHECK-LABEL: fn integer_transmutes(
     // CHECK-NOT: _i32 as u32 (Transmute);
@@ -43,7 +43,7 @@ pub unsafe fn integer_transmutes() {
     }
 }
 
-// EMIT_MIR combine_transmutes.adt_transmutes.InstSimplify.diff
+// EMIT_MIR combine_transmutes.adt_transmutes.InstSimplify-after-simplifycfg.diff
 pub unsafe fn adt_transmutes() {
     // CHECK-LABEL: fn adt_transmutes(
     // CHECK: as u8 (Transmute);
diff --git a/tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify.diff b/tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify-after-simplifycfg.diff
index e2b45c882d6..7596aa20308 100644
--- a/tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/duplicate_switch_targets.assert_zero.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `assert_zero` before InstSimplify
-+ // MIR for `assert_zero` after InstSimplify
+- // MIR for `assert_zero` before InstSimplify-after-simplifycfg
++ // MIR for `assert_zero` after InstSimplify-after-simplifycfg
   
   fn assert_zero(_1: u8) -> u8 {
       let mut _0: u8;
diff --git a/tests/mir-opt/instsimplify/duplicate_switch_targets.rs b/tests/mir-opt/instsimplify/duplicate_switch_targets.rs
index a47d9d5a71d..d610ba5f690 100644
--- a/tests/mir-opt/instsimplify/duplicate_switch_targets.rs
+++ b/tests/mir-opt/instsimplify/duplicate_switch_targets.rs
@@ -1,11 +1,11 @@
-//@ test-mir-pass: InstSimplify
+//@ test-mir-pass: InstSimplify-after-simplifycfg
 
 #![feature(custom_mir, core_intrinsics)]
 #![crate_type = "lib"]
 
 use std::intrinsics::mir::*;
 
-// EMIT_MIR duplicate_switch_targets.assert_zero.InstSimplify.diff
+// EMIT_MIR duplicate_switch_targets.assert_zero.InstSimplify-after-simplifycfg.diff
 #[custom_mir(dialect = "runtime", phase = "post-cleanup")]
 pub unsafe fn assert_zero(x: u8) -> u8 {
     // CHECK-LABEL: fn assert_zero(
diff --git a/tests/mir-opt/instsimplify/intrinsic_asserts.generic.InstSimplify.diff b/tests/mir-opt/instsimplify/intrinsic_asserts.generic.InstSimplify-after-simplifycfg.diff
index 2ecacb5e39f..d35844b21d1 100644
--- a/tests/mir-opt/instsimplify/intrinsic_asserts.generic.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/intrinsic_asserts.generic.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `generic` before InstSimplify
-+ // MIR for `generic` after InstSimplify
+- // MIR for `generic` before InstSimplify-after-simplifycfg
++ // MIR for `generic` after InstSimplify-after-simplifycfg
   
   fn generic() -> () {
       let mut _0: ();
diff --git a/tests/mir-opt/instsimplify/intrinsic_asserts.generic_ref.InstSimplify.diff b/tests/mir-opt/instsimplify/intrinsic_asserts.generic_ref.InstSimplify-after-simplifycfg.diff
index d29af0945f7..6ddd8481ca7 100644
--- a/tests/mir-opt/instsimplify/intrinsic_asserts.generic_ref.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/intrinsic_asserts.generic_ref.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `generic_ref` before InstSimplify
-+ // MIR for `generic_ref` after InstSimplify
+- // MIR for `generic_ref` before InstSimplify-after-simplifycfg
++ // MIR for `generic_ref` after InstSimplify-after-simplifycfg
   
   fn generic_ref() -> () {
       let mut _0: ();
diff --git a/tests/mir-opt/instsimplify/intrinsic_asserts.panics.InstSimplify.diff b/tests/mir-opt/instsimplify/intrinsic_asserts.panics.InstSimplify-after-simplifycfg.diff
index 1be386acfcc..1b7aa124c36 100644
--- a/tests/mir-opt/instsimplify/intrinsic_asserts.panics.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/intrinsic_asserts.panics.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `panics` before InstSimplify
-+ // MIR for `panics` after InstSimplify
+- // MIR for `panics` before InstSimplify-after-simplifycfg
++ // MIR for `panics` after InstSimplify-after-simplifycfg
   
   fn panics() -> () {
       let mut _0: ();
diff --git a/tests/mir-opt/instsimplify/intrinsic_asserts.removable.InstSimplify.diff b/tests/mir-opt/instsimplify/intrinsic_asserts.removable.InstSimplify-after-simplifycfg.diff
index f2e69783842..20e046d8e19 100644
--- a/tests/mir-opt/instsimplify/intrinsic_asserts.removable.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/intrinsic_asserts.removable.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `removable` before InstSimplify
-+ // MIR for `removable` after InstSimplify
+- // MIR for `removable` before InstSimplify-after-simplifycfg
++ // MIR for `removable` after InstSimplify-after-simplifycfg
   
   fn removable() -> () {
       let mut _0: ();
diff --git a/tests/mir-opt/instsimplify/intrinsic_asserts.rs b/tests/mir-opt/instsimplify/intrinsic_asserts.rs
index c031c978162..c71e08b9f1f 100644
--- a/tests/mir-opt/instsimplify/intrinsic_asserts.rs
+++ b/tests/mir-opt/instsimplify/intrinsic_asserts.rs
@@ -1,10 +1,10 @@
-//@ test-mir-pass: InstSimplify
+//@ test-mir-pass: InstSimplify-after-simplifycfg
 
 #![crate_type = "lib"]
 #![feature(core_intrinsics)]
 
 // All these assertions pass, so all the intrinsic calls should be deleted.
-// EMIT_MIR intrinsic_asserts.removable.InstSimplify.diff
+// EMIT_MIR intrinsic_asserts.removable.InstSimplify-after-simplifycfg.diff
 pub fn removable() {
     // CHECK-LABEL: fn removable(
     // CHECK-NOT: assert_inhabited
@@ -18,7 +18,7 @@ pub fn removable() {
 enum Never {}
 
 // These assertions all diverge, so their target blocks should become None.
-// EMIT_MIR intrinsic_asserts.panics.InstSimplify.diff
+// EMIT_MIR intrinsic_asserts.panics.InstSimplify-after-simplifycfg.diff
 pub fn panics() {
     // CHECK-LABEL: fn panics(
     // CHECK: assert_inhabited::<Never>() -> unwind
@@ -30,7 +30,7 @@ pub fn panics() {
 }
 
 // Whether or not these asserts pass isn't known, so they shouldn't be modified.
-// EMIT_MIR intrinsic_asserts.generic.InstSimplify.diff
+// EMIT_MIR intrinsic_asserts.generic.InstSimplify-after-simplifycfg.diff
 pub fn generic<T>() {
     // CHECK-LABEL: fn generic(
     // CHECK: assert_inhabited::<T>() -> [return:
@@ -42,7 +42,7 @@ pub fn generic<T>() {
 }
 
 // Whether or not these asserts pass isn't known, so they shouldn't be modified.
-// EMIT_MIR intrinsic_asserts.generic_ref.InstSimplify.diff
+// EMIT_MIR intrinsic_asserts.generic_ref.InstSimplify-after-simplifycfg.diff
 pub fn generic_ref<T>() {
     // CHECK-LABEL: fn generic_ref(
     // CHECK: assert_mem_uninitialized_valid::<&T>() -> [return:
diff --git a/tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify.diff b/tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify-after-simplifycfg.diff
index 52b3d1e1d40..ca26f0240f9 100644
--- a/tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/ref_of_deref.pointers.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `pointers` before InstSimplify
-+ // MIR for `pointers` after InstSimplify
+- // MIR for `pointers` before InstSimplify-after-simplifycfg
++ // MIR for `pointers` after InstSimplify-after-simplifycfg
   
   fn pointers(_1: *const [i32], _2: *mut i32) -> () {
       debug const_ptr => _1;
diff --git a/tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify.diff b/tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify-after-simplifycfg.diff
index ca0828a225a..928ee3acaa0 100644
--- a/tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/ref_of_deref.references.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `references` before InstSimplify
-+ // MIR for `references` after InstSimplify
+- // MIR for `references` before InstSimplify-after-simplifycfg
++ // MIR for `references` after InstSimplify-after-simplifycfg
   
   fn references(_1: &i32, _2: &mut [i32]) -> () {
       debug const_ref => _1;
diff --git a/tests/mir-opt/instsimplify/ref_of_deref.rs b/tests/mir-opt/instsimplify/ref_of_deref.rs
index 37e164bc17f..dc0f5f8198b 100644
--- a/tests/mir-opt/instsimplify/ref_of_deref.rs
+++ b/tests/mir-opt/instsimplify/ref_of_deref.rs
@@ -1,11 +1,11 @@
-//@ test-mir-pass: InstSimplify
+//@ test-mir-pass: InstSimplify-after-simplifycfg
 #![crate_type = "lib"]
 #![feature(raw_ref_op)]
 
 // For each of these, only 2 of the 6 should simplify,
 // as the others have the wrong types.
 
-// EMIT_MIR ref_of_deref.references.InstSimplify.diff
+// EMIT_MIR ref_of_deref.references.InstSimplify-after-simplifycfg.diff
 // CHECK-LABEL: references
 pub fn references(const_ref: &i32, mut_ref: &mut [i32]) {
     // CHECK: _3 = _1;
@@ -22,7 +22,7 @@ pub fn references(const_ref: &i32, mut_ref: &mut [i32]) {
     let _f = &raw mut *mut_ref;
 }
 
-// EMIT_MIR ref_of_deref.pointers.InstSimplify.diff
+// EMIT_MIR ref_of_deref.pointers.InstSimplify-after-simplifycfg.diff
 // CHECK-LABEL: pointers
 pub unsafe fn pointers(const_ptr: *const [i32], mut_ptr: *mut i32) {
     // CHECK: _3 = &(*_1);
diff --git a/tests/mir-opt/instsimplify/ub_check.rs b/tests/mir-opt/instsimplify/ub_check.rs
index 5f13f5ba059..ee72511c132 100644
--- a/tests/mir-opt/instsimplify/ub_check.rs
+++ b/tests/mir-opt/instsimplify/ub_check.rs
@@ -1,7 +1,7 @@
-//@ test-mir-pass: InstSimplify
+//@ test-mir-pass: InstSimplify-after-simplifycfg
 //@ compile-flags: -Cdebug-assertions=no -Zinline-mir
 
-// EMIT_MIR ub_check.unwrap_unchecked.InstSimplify.diff
+// EMIT_MIR ub_check.unwrap_unchecked.InstSimplify-after-simplifycfg.diff
 pub fn unwrap_unchecked(x: Option<i32>) -> i32 {
     // CHECK-LABEL: fn unwrap_unchecked(
     // CHECK-NOT: UbChecks()
diff --git a/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify.diff b/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify-after-simplifycfg.diff
index 4d8d6589842..7ef77e76d12 100644
--- a/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify.diff
+++ b/tests/mir-opt/instsimplify/ub_check.unwrap_unchecked.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `unwrap_unchecked` before InstSimplify
-+ // MIR for `unwrap_unchecked` after InstSimplify
+- // MIR for `unwrap_unchecked` before InstSimplify-after-simplifycfg
++ // MIR for `unwrap_unchecked` after InstSimplify-after-simplifycfg
   
   fn unwrap_unchecked(_1: Option<i32>) -> i32 {
       debug x => _1;
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 1f88339b586..861ee1d3d3d 100644
--- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff
+++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff
@@ -5,7 +5,7 @@
       debug x => _1;
       let mut _0: ();
       let _2: &[T];
-      let mut _3: &[T; 3];
+      let _3: &[T; 3];
       let _4: [T; 3];
       let mut _5: usize;
       let mut _6: bool;
@@ -23,12 +23,10 @@
       }
   
       bb0: {
-          StorageLive(_3);
           StorageLive(_4);
           _4 = [_1, _1, _1];
           _3 = &_4;
-          _2 = move _3 as &[T] (PointerCoercion(Unsize));
-          StorageDead(_3);
+          _2 = _3 as &[T] (PointerCoercion(Unsize));
           nop;
           nop;
           goto -> bb2;
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 19a581ba3f0..f27be953384 100644
--- a/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff
+++ b/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff
@@ -5,7 +5,7 @@
       debug x => _1;
       let mut _0: ();
       let _2: &[T];
-      let mut _3: &[T; 3];
+      let _3: &[T; 3];
       let _4: [T; 3];
       let mut _5: usize;
       let mut _6: bool;
@@ -23,12 +23,10 @@
       }
   
       bb0: {
-          StorageLive(_3);
           StorageLive(_4);
           _4 = [_1, _1, _1];
           _3 = &_4;
-          _2 = move _3 as &[T] (PointerCoercion(Unsize));
-          StorageDead(_3);
+          _2 = _3 as &[T] (PointerCoercion(Unsize));
           nop;
           nop;
           goto -> bb2;
diff --git a/tests/mir-opt/issue_78192.f.InstSimplify.diff b/tests/mir-opt/issue_78192.f.InstSimplify-after-simplifycfg.diff
index 10e3dd20362..53957bb3cb1 100644
--- a/tests/mir-opt/issue_78192.f.InstSimplify.diff
+++ b/tests/mir-opt/issue_78192.f.InstSimplify-after-simplifycfg.diff
@@ -1,5 +1,5 @@
-- // MIR for `f` before InstSimplify
-+ // MIR for `f` after InstSimplify
+- // MIR for `f` before InstSimplify-after-simplifycfg
++ // MIR for `f` after InstSimplify-after-simplifycfg
   
   fn f(_1: &T) -> *const T {
       debug a => _1;
@@ -17,8 +17,7 @@
           StorageLive(_4);
           _4 = &raw const (*_1);
           _3 = &_4;
--         _2 = &(*_3);
-+         _2 = _3;
+          _2 = _3;
           StorageDead(_3);
           _0 = (*_2);
           StorageDead(_4);
diff --git a/tests/mir-opt/issue_78192.rs b/tests/mir-opt/issue_78192.rs
index 857b1dec951..a82f0e3a665 100644
--- a/tests/mir-opt/issue_78192.rs
+++ b/tests/mir-opt/issue_78192.rs
@@ -9,4 +9,4 @@ fn main() {
     f(&2);
 }
 
-// EMIT_MIR issue_78192.f.InstSimplify.diff
+// EMIT_MIR issue_78192.f.InstSimplify-after-simplifycfg.diff
diff --git a/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-abort.diff
index bbbfe90691f..8009721fa5c 100644
--- a/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-abort.diff
+++ b/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-abort.diff
@@ -24,7 +24,7 @@
   
       bb1: {
           _4 = discriminant(_1);
-          switchInt(move _4) -> [0: bb4, 1: bb5, 2: bb6, 3: bb3, otherwise: bb2];
+          switchInt(move _4) -> [0: bb6, 1: bb5, 2: bb4, 3: bb3, otherwise: bb2];
       }
   
       bb2: {
@@ -39,11 +39,11 @@
       }
   
       bb4: {
-          StorageLive(_5);
-          _5 = DFA::B;
-          _1 = move _5;
+          StorageLive(_7);
+          _7 = DFA::D;
+          _1 = move _7;
           _3 = const ();
-          StorageDead(_5);
+          StorageDead(_7);
           goto -> bb1;
       }
   
@@ -57,11 +57,11 @@
       }
   
       bb6: {
-          StorageLive(_7);
-          _7 = DFA::D;
-          _1 = move _7;
+          StorageLive(_5);
+          _5 = DFA::B;
+          _1 = move _5;
           _3 = const ();
-          StorageDead(_7);
+          StorageDead(_5);
           goto -> bb1;
       }
   }
diff --git a/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-unwind.diff
index bbbfe90691f..8009721fa5c 100644
--- a/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-unwind.diff
+++ b/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-unwind.diff
@@ -24,7 +24,7 @@
   
       bb1: {
           _4 = discriminant(_1);
-          switchInt(move _4) -> [0: bb4, 1: bb5, 2: bb6, 3: bb3, otherwise: bb2];
+          switchInt(move _4) -> [0: bb6, 1: bb5, 2: bb4, 3: bb3, otherwise: bb2];
       }
   
       bb2: {
@@ -39,11 +39,11 @@
       }
   
       bb4: {
-          StorageLive(_5);
-          _5 = DFA::B;
-          _1 = move _5;
+          StorageLive(_7);
+          _7 = DFA::D;
+          _1 = move _7;
           _3 = const ();
-          StorageDead(_5);
+          StorageDead(_7);
           goto -> bb1;
       }
   
@@ -57,11 +57,11 @@
       }
   
       bb6: {
-          StorageLive(_7);
-          _7 = DFA::D;
-          _1 = move _7;
+          StorageLive(_5);
+          _5 = DFA::B;
+          _1 = move _5;
           _3 = const ();
-          StorageDead(_7);
+          StorageDead(_5);
           goto -> bb1;
       }
   }
diff --git a/tests/mir-opt/jump_threading.rs b/tests/mir-opt/jump_threading.rs
index e5d8525dcac..6486a321e69 100644
--- a/tests/mir-opt/jump_threading.rs
+++ b/tests/mir-opt/jump_threading.rs
@@ -93,19 +93,19 @@ fn dfa() {
     // CHECK:     {{_.*}} = DFA::A;
     // CHECK:     goto -> bb1;
     // CHECK: bb1: {
-    // CHECK:     switchInt({{.*}}) -> [0: bb4, 1: bb5, 2: bb6, 3: bb3, otherwise: bb2];
+    // CHECK:     switchInt({{.*}}) -> [0: bb6, 1: bb5, 2: bb4, 3: bb3, otherwise: bb2];
     // CHECK: bb2: {
     // CHECK:     unreachable;
     // CHECK: bb3: {
     // CHECK:     return;
     // CHECK: bb4: {
-    // CHECK:     {{_.*}} = DFA::B;
+    // CHECK:     {{_.*}} = DFA::D;
     // CHECK:     goto -> bb1;
     // CHECK: bb5: {
     // CHECK:     {{_.*}} = DFA::C;
     // CHECK:     goto -> bb1;
     // CHECK: bb6: {
-    // CHECK:     {{_.*}} = DFA::D;
+    // CHECK:     {{_.*}} = DFA::B;
     // CHECK:     goto -> bb1;
     let mut state = DFA::A;
     loop {
diff --git a/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff
index 4f29e5244d7..3c4a84bc243 100644
--- a/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff
+++ b/tests/mir-opt/match_arm_scopes.complicated_match.panic-abort.SimplifyCfg-initial.after-ElaborateDrops.after.diff
@@ -33,17 +33,17 @@
       bb0: {
           PlaceMention(_2);
 -         switchInt((_2.0: bool)) -> [0: bb2, otherwise: bb1];
-+         switchInt((_2.0: bool)) -> [0: bb5, otherwise: bb1];
++         switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb1];
       }
   
       bb1: {
 -         switchInt((_2.1: bool)) -> [0: bb4, otherwise: bb3];
-+         switchInt((_2.1: bool)) -> [0: bb10, otherwise: bb2];
++         switchInt((_2.1: bool)) -> [0: bb5, otherwise: bb2];
       }
   
       bb2: {
--         falseEdge -> [real: bb8, imaginary: bb1];
-+         switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb17];
+-         falseEdge -> [real: bb9, imaginary: bb1];
++         switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb4];
       }
   
       bb3: {
@@ -51,11 +51,11 @@
 -     }
 - 
 -     bb4: {
--         falseEdge -> [real: bb13, imaginary: bb3];
+-         falseEdge -> [real: bb8, imaginary: bb3];
 -     }
 - 
 -     bb5: {
--         falseEdge -> [real: bb20, imaginary: bb6];
+-         falseEdge -> [real: bb7, imaginary: bb6];
 -     }
 - 
 -     bb6: {
@@ -63,20 +63,38 @@
           _15 = (_2.1: bool);
           StorageLive(_16);
           _16 = move (_2.2: std::string::String);
--         goto -> bb19;
-+         goto -> bb16;
+-         goto -> bb20;
++         goto -> bb17;
       }
   
 -     bb7: {
 +     bb4: {
-          _0 = const 1_i32;
--         drop(_7) -> [return: bb18, unwind: bb25];
-+         drop(_7) -> [return: bb15, unwind: bb22];
+          StorageLive(_15);
+          _15 = (_2.1: bool);
+          StorageLive(_16);
+          _16 = move (_2.2: std::string::String);
+-         goto -> bb20;
++         goto -> bb17;
       }
   
 -     bb8: {
 +     bb5: {
           StorageLive(_6);
+          _6 = &(_2.0: bool);
+          StorageLive(_8);
+          _8 = &(_2.2: std::string::String);
+-         _3 = &fake shallow (_2.0: bool);
+-         _4 = &fake shallow (_2.1: bool);
+          StorageLive(_12);
+          StorageLive(_13);
+          _13 = _1;
+-         switchInt(move _13) -> [0: bb16, otherwise: bb15];
++         switchInt(move _13) -> [0: bb13, otherwise: bb12];
+      }
+  
+-     bb9: {
++     bb6: {
+          StorageLive(_6);
           _6 = &(_2.1: bool);
           StorageLive(_8);
           _8 = &(_2.2: std::string::String);
@@ -85,12 +103,19 @@
           StorageLive(_9);
           StorageLive(_10);
           _10 = _1;
--         switchInt(move _10) -> [0: bb10, otherwise: bb9];
-+         switchInt(move _10) -> [0: bb7, otherwise: bb6];
+-         switchInt(move _10) -> [0: bb12, otherwise: bb11];
++         switchInt(move _10) -> [0: bb9, otherwise: bb8];
       }
   
--     bb9: {
-+     bb6: {
+-     bb10: {
++     bb7: {
+          _0 = const 1_i32;
+-         drop(_7) -> [return: bb19, unwind: bb25];
++         drop(_7) -> [return: bb16, unwind: bb22];
+      }
+  
+-     bb11: {
++     bb8: {
           _0 = const 3_i32;
           StorageDead(_10);
           StorageDead(_9);
@@ -98,15 +123,15 @@
 +         goto -> bb20;
       }
   
--     bb10: {
-+     bb7: {
+-     bb12: {
++     bb9: {
           _9 = (*_6);
--         switchInt(move _9) -> [0: bb12, otherwise: bb11];
-+         switchInt(move _9) -> [0: bb9, otherwise: bb8];
+-         switchInt(move _9) -> [0: bb14, otherwise: bb13];
++         switchInt(move _9) -> [0: bb11, otherwise: bb10];
       }
   
--     bb11: {
-+     bb8: {
+-     bb13: {
++     bb10: {
           StorageDead(_10);
           StorageDead(_9);
 -         FakeRead(ForMatchGuard, _3);
@@ -117,12 +142,12 @@
           _5 = (_2.1: bool);
           StorageLive(_7);
           _7 = move (_2.2: std::string::String);
--         goto -> bb7;
-+         goto -> bb4;
+-         goto -> bb10;
++         goto -> bb7;
       }
   
--     bb12: {
-+     bb9: {
+-     bb14: {
++     bb11: {
           StorageDead(_10);
           StorageDead(_9);
           StorageDead(_8);
@@ -131,23 +156,8 @@
 +         goto -> bb1;
       }
   
--     bb13: {
-+     bb10: {
-          StorageLive(_6);
-          _6 = &(_2.0: bool);
-          StorageLive(_8);
-          _8 = &(_2.2: std::string::String);
--         _3 = &fake shallow (_2.0: bool);
--         _4 = &fake shallow (_2.1: bool);
-          StorageLive(_12);
-          StorageLive(_13);
-          _13 = _1;
--         switchInt(move _13) -> [0: bb15, otherwise: bb14];
-+         switchInt(move _13) -> [0: bb12, otherwise: bb11];
-      }
-  
--     bb14: {
-+     bb11: {
+-     bb15: {
++     bb12: {
           _0 = const 3_i32;
           StorageDead(_13);
           StorageDead(_12);
@@ -155,15 +165,15 @@
 +         goto -> bb20;
       }
   
--     bb15: {
-+     bb12: {
+-     bb16: {
++     bb13: {
           _12 = (*_6);
--         switchInt(move _12) -> [0: bb17, otherwise: bb16];
-+         switchInt(move _12) -> [0: bb14, otherwise: bb13];
+-         switchInt(move _12) -> [0: bb18, otherwise: bb17];
++         switchInt(move _12) -> [0: bb15, otherwise: bb14];
       }
   
--     bb16: {
-+     bb13: {
+-     bb17: {
++     bb14: {
           StorageDead(_13);
           StorageDead(_12);
 -         FakeRead(ForMatchGuard, _3);
@@ -174,12 +184,12 @@
           _5 = (_2.0: bool);
           StorageLive(_7);
           _7 = move (_2.2: std::string::String);
--         goto -> bb7;
-+         goto -> bb4;
+-         goto -> bb10;
++         goto -> bb7;
       }
   
--     bb17: {
-+     bb14: {
+-     bb18: {
++     bb15: {
           StorageDead(_13);
           StorageDead(_12);
           StorageDead(_8);
@@ -188,8 +198,8 @@
 +         goto -> bb2;
       }
   
--     bb18: {
-+     bb15: {
+-     bb19: {
++     bb16: {
           StorageDead(_7);
           StorageDead(_5);
           StorageDead(_8);
@@ -198,23 +208,13 @@
 +         goto -> bb19;
       }
   
--     bb19: {
-+     bb16: {
+-     bb20: {
++     bb17: {
           _0 = const 2_i32;
 -         drop(_16) -> [return: bb21, unwind: bb25];
 +         drop(_16) -> [return: bb18, unwind: bb22];
       }
   
--     bb20: {
-+     bb17: {
-          StorageLive(_15);
-          _15 = (_2.1: bool);
-          StorageLive(_16);
-          _16 = move (_2.2: std::string::String);
--         goto -> bb19;
-+         goto -> bb16;
-      }
-  
 -     bb21: {
 +     bb18: {
           StorageDead(_16);
diff --git a/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff b/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff
index 4f29e5244d7..3c4a84bc243 100644
--- a/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff
+++ b/tests/mir-opt/match_arm_scopes.complicated_match.panic-unwind.SimplifyCfg-initial.after-ElaborateDrops.after.diff
@@ -33,17 +33,17 @@
       bb0: {
           PlaceMention(_2);
 -         switchInt((_2.0: bool)) -> [0: bb2, otherwise: bb1];
-+         switchInt((_2.0: bool)) -> [0: bb5, otherwise: bb1];
++         switchInt((_2.0: bool)) -> [0: bb6, otherwise: bb1];
       }
   
       bb1: {
 -         switchInt((_2.1: bool)) -> [0: bb4, otherwise: bb3];
-+         switchInt((_2.1: bool)) -> [0: bb10, otherwise: bb2];
++         switchInt((_2.1: bool)) -> [0: bb5, otherwise: bb2];
       }
   
       bb2: {
--         falseEdge -> [real: bb8, imaginary: bb1];
-+         switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb17];
+-         falseEdge -> [real: bb9, imaginary: bb1];
++         switchInt((_2.0: bool)) -> [0: bb3, otherwise: bb4];
       }
   
       bb3: {
@@ -51,11 +51,11 @@
 -     }
 - 
 -     bb4: {
--         falseEdge -> [real: bb13, imaginary: bb3];
+-         falseEdge -> [real: bb8, imaginary: bb3];
 -     }
 - 
 -     bb5: {
--         falseEdge -> [real: bb20, imaginary: bb6];
+-         falseEdge -> [real: bb7, imaginary: bb6];
 -     }
 - 
 -     bb6: {
@@ -63,20 +63,38 @@
           _15 = (_2.1: bool);
           StorageLive(_16);
           _16 = move (_2.2: std::string::String);
--         goto -> bb19;
-+         goto -> bb16;
+-         goto -> bb20;
++         goto -> bb17;
       }
   
 -     bb7: {
 +     bb4: {
-          _0 = const 1_i32;
--         drop(_7) -> [return: bb18, unwind: bb25];
-+         drop(_7) -> [return: bb15, unwind: bb22];
+          StorageLive(_15);
+          _15 = (_2.1: bool);
+          StorageLive(_16);
+          _16 = move (_2.2: std::string::String);
+-         goto -> bb20;
++         goto -> bb17;
       }
   
 -     bb8: {
 +     bb5: {
           StorageLive(_6);
+          _6 = &(_2.0: bool);
+          StorageLive(_8);
+          _8 = &(_2.2: std::string::String);
+-         _3 = &fake shallow (_2.0: bool);
+-         _4 = &fake shallow (_2.1: bool);
+          StorageLive(_12);
+          StorageLive(_13);
+          _13 = _1;
+-         switchInt(move _13) -> [0: bb16, otherwise: bb15];
++         switchInt(move _13) -> [0: bb13, otherwise: bb12];
+      }
+  
+-     bb9: {
++     bb6: {
+          StorageLive(_6);
           _6 = &(_2.1: bool);
           StorageLive(_8);
           _8 = &(_2.2: std::string::String);
@@ -85,12 +103,19 @@
           StorageLive(_9);
           StorageLive(_10);
           _10 = _1;
--         switchInt(move _10) -> [0: bb10, otherwise: bb9];
-+         switchInt(move _10) -> [0: bb7, otherwise: bb6];
+-         switchInt(move _10) -> [0: bb12, otherwise: bb11];
++         switchInt(move _10) -> [0: bb9, otherwise: bb8];
       }
   
--     bb9: {
-+     bb6: {
+-     bb10: {
++     bb7: {
+          _0 = const 1_i32;
+-         drop(_7) -> [return: bb19, unwind: bb25];
++         drop(_7) -> [return: bb16, unwind: bb22];
+      }
+  
+-     bb11: {
++     bb8: {
           _0 = const 3_i32;
           StorageDead(_10);
           StorageDead(_9);
@@ -98,15 +123,15 @@
 +         goto -> bb20;
       }
   
--     bb10: {
-+     bb7: {
+-     bb12: {
++     bb9: {
           _9 = (*_6);
--         switchInt(move _9) -> [0: bb12, otherwise: bb11];
-+         switchInt(move _9) -> [0: bb9, otherwise: bb8];
+-         switchInt(move _9) -> [0: bb14, otherwise: bb13];
++         switchInt(move _9) -> [0: bb11, otherwise: bb10];
       }
   
--     bb11: {
-+     bb8: {
+-     bb13: {
++     bb10: {
           StorageDead(_10);
           StorageDead(_9);
 -         FakeRead(ForMatchGuard, _3);
@@ -117,12 +142,12 @@
           _5 = (_2.1: bool);
           StorageLive(_7);
           _7 = move (_2.2: std::string::String);
--         goto -> bb7;
-+         goto -> bb4;
+-         goto -> bb10;
++         goto -> bb7;
       }
   
--     bb12: {
-+     bb9: {
+-     bb14: {
++     bb11: {
           StorageDead(_10);
           StorageDead(_9);
           StorageDead(_8);
@@ -131,23 +156,8 @@
 +         goto -> bb1;
       }
   
--     bb13: {
-+     bb10: {
-          StorageLive(_6);
-          _6 = &(_2.0: bool);
-          StorageLive(_8);
-          _8 = &(_2.2: std::string::String);
--         _3 = &fake shallow (_2.0: bool);
--         _4 = &fake shallow (_2.1: bool);
-          StorageLive(_12);
-          StorageLive(_13);
-          _13 = _1;
--         switchInt(move _13) -> [0: bb15, otherwise: bb14];
-+         switchInt(move _13) -> [0: bb12, otherwise: bb11];
-      }
-  
--     bb14: {
-+     bb11: {
+-     bb15: {
++     bb12: {
           _0 = const 3_i32;
           StorageDead(_13);
           StorageDead(_12);
@@ -155,15 +165,15 @@
 +         goto -> bb20;
       }
   
--     bb15: {
-+     bb12: {
+-     bb16: {
++     bb13: {
           _12 = (*_6);
--         switchInt(move _12) -> [0: bb17, otherwise: bb16];
-+         switchInt(move _12) -> [0: bb14, otherwise: bb13];
+-         switchInt(move _12) -> [0: bb18, otherwise: bb17];
++         switchInt(move _12) -> [0: bb15, otherwise: bb14];
       }
   
--     bb16: {
-+     bb13: {
+-     bb17: {
++     bb14: {
           StorageDead(_13);
           StorageDead(_12);
 -         FakeRead(ForMatchGuard, _3);
@@ -174,12 +184,12 @@
           _5 = (_2.0: bool);
           StorageLive(_7);
           _7 = move (_2.2: std::string::String);
--         goto -> bb7;
-+         goto -> bb4;
+-         goto -> bb10;
++         goto -> bb7;
       }
   
--     bb17: {
-+     bb14: {
+-     bb18: {
++     bb15: {
           StorageDead(_13);
           StorageDead(_12);
           StorageDead(_8);
@@ -188,8 +198,8 @@
 +         goto -> bb2;
       }
   
--     bb18: {
-+     bb15: {
+-     bb19: {
++     bb16: {
           StorageDead(_7);
           StorageDead(_5);
           StorageDead(_8);
@@ -198,23 +208,13 @@
 +         goto -> bb19;
       }
   
--     bb19: {
-+     bb16: {
+-     bb20: {
++     bb17: {
           _0 = const 2_i32;
 -         drop(_16) -> [return: bb21, unwind: bb25];
 +         drop(_16) -> [return: bb18, unwind: bb22];
       }
   
--     bb20: {
-+     bb17: {
-          StorageLive(_15);
-          _15 = (_2.1: bool);
-          StorageLive(_16);
-          _16 = move (_2.2: std::string::String);
--         goto -> bb19;
-+         goto -> bb16;
-      }
-  
 -     bb21: {
 +     bb18: {
           StorageDead(_16);
diff --git a/tests/mir-opt/matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff
index 1f20349fdec..fc34ce7125e 100644
--- a/tests/mir-opt/matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff
+++ b/tests/mir-opt/matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff
@@ -5,37 +5,42 @@
       debug i => _1;
       let mut _0: u128;
       let mut _2: i128;
++     let mut _3: i128;
   
       bb0: {
           _2 = discriminant(_1);
-          switchInt(move _2) -> [1: bb3, 2: bb4, 3: bb5, 340282366920938463463374607431768211455: bb2, otherwise: bb1];
-      }
-  
-      bb1: {
-          unreachable;
-      }
-  
-      bb2: {
-          _0 = const core::num::<impl u128>::MAX;
-          goto -> bb6;
-      }
-  
-      bb3: {
-          _0 = const 1_u128;
-          goto -> bb6;
-      }
-  
-      bb4: {
-          _0 = const 2_u128;
-          goto -> bb6;
-      }
-  
-      bb5: {
-          _0 = const 3_u128;
-          goto -> bb6;
-      }
-  
-      bb6: {
+-         switchInt(move _2) -> [1: bb5, 2: bb4, 3: bb3, 340282366920938463463374607431768211455: bb2, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+-         unreachable;
+-     }
+- 
+-     bb2: {
+-         _0 = const core::num::<impl u128>::MAX;
+-         goto -> bb6;
+-     }
+- 
+-     bb3: {
+-         _0 = const 3_u128;
+-         goto -> bb6;
+-     }
+- 
+-     bb4: {
+-         _0 = const 2_u128;
+-         goto -> bb6;
+-     }
+- 
+-     bb5: {
+-         _0 = const 1_u128;
+-         goto -> bb6;
+-     }
+- 
+-     bb6: {
++         StorageLive(_3);
++         _3 = move _2;
++         _0 = _3 as u128 (IntToInt);
++         StorageDead(_3);
           return;
       }
   }
diff --git a/tests/mir-opt/matches_reduce_branches.match_i16_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_i16_i8.MatchBranchSimplification.diff
deleted file mode 100644
index 4b435310916..00000000000
--- a/tests/mir-opt/matches_reduce_branches.match_i16_i8.MatchBranchSimplification.diff
+++ /dev/null
@@ -1,37 +0,0 @@
-- // MIR for `match_i16_i8` before MatchBranchSimplification
-+ // MIR for `match_i16_i8` after MatchBranchSimplification
-  
-  fn match_i16_i8(_1: EnumAi16) -> i8 {
-      debug i => _1;
-      let mut _0: i8;
-      let mut _2: i16;
-  
-      bb0: {
-          _2 = discriminant(_1);
-          switchInt(move _2) -> [65535: bb3, 2: bb4, 65533: bb2, otherwise: bb1];
-      }
-  
-      bb1: {
-          unreachable;
-      }
-  
-      bb2: {
-          _0 = const -3_i8;
-          goto -> bb5;
-      }
-  
-      bb3: {
-          _0 = const -1_i8;
-          goto -> bb5;
-      }
-  
-      bb4: {
-          _0 = const 2_i8;
-          goto -> bb5;
-      }
-  
-      bb5: {
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/matches_reduce_branches.match_i8_i16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_i8_i16.MatchBranchSimplification.diff
deleted file mode 100644
index 8a390736add..00000000000
--- a/tests/mir-opt/matches_reduce_branches.match_i8_i16.MatchBranchSimplification.diff
+++ /dev/null
@@ -1,37 +0,0 @@
-- // MIR for `match_i8_i16` before MatchBranchSimplification
-+ // MIR for `match_i8_i16` after MatchBranchSimplification
-  
-  fn match_i8_i16(_1: EnumAi8) -> i16 {
-      debug i => _1;
-      let mut _0: i16;
-      let mut _2: i8;
-  
-      bb0: {
-          _2 = discriminant(_1);
-          switchInt(move _2) -> [255: bb3, 2: bb4, 253: bb2, otherwise: bb1];
-      }
-  
-      bb1: {
-          unreachable;
-      }
-  
-      bb2: {
-          _0 = const -3_i16;
-          goto -> bb5;
-      }
-  
-      bb3: {
-          _0 = const -1_i16;
-          goto -> bb5;
-      }
-  
-      bb4: {
-          _0 = const 2_i16;
-          goto -> bb5;
-      }
-  
-      bb5: {
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/matches_reduce_branches.match_i8_i16_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_i8_i16_failed.MatchBranchSimplification.diff
deleted file mode 100644
index b0217792294..00000000000
--- a/tests/mir-opt/matches_reduce_branches.match_i8_i16_failed.MatchBranchSimplification.diff
+++ /dev/null
@@ -1,37 +0,0 @@
-- // MIR for `match_i8_i16_failed` before MatchBranchSimplification
-+ // MIR for `match_i8_i16_failed` after MatchBranchSimplification
-  
-  fn match_i8_i16_failed(_1: EnumAi8) -> i16 {
-      debug i => _1;
-      let mut _0: i16;
-      let mut _2: i8;
-  
-      bb0: {
-          _2 = discriminant(_1);
-          switchInt(move _2) -> [255: bb3, 2: bb4, 253: bb2, otherwise: bb1];
-      }
-  
-      bb1: {
-          unreachable;
-      }
-  
-      bb2: {
-          _0 = const 3_i16;
-          goto -> bb5;
-      }
-  
-      bb3: {
-          _0 = const -1_i16;
-          goto -> bb5;
-      }
-  
-      bb4: {
-          _0 = const 2_i16;
-          goto -> bb5;
-      }
-  
-      bb5: {
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..7f8c2ab8d37
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16.MatchBranchSimplification.diff
@@ -0,0 +1,52 @@
+- // MIR for `match_sext_i8_i16` before MatchBranchSimplification
++ // MIR for `match_sext_i8_i16` after MatchBranchSimplification
+  
+  fn match_sext_i8_i16(_1: EnumAi8) -> i16 {
+      debug i => _1;
+      let mut _0: i16;
+      let mut _2: i8;
++     let mut _3: i8;
+  
+      bb0: {
+          _2 = discriminant(_1);
+-         switchInt(move _2) -> [128: bb6, 255: bb5, 0: bb4, 1: bb3, 127: bb2, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+-         unreachable;
+-     }
+- 
+-     bb2: {
+-         _0 = const 127_i16;
+-         goto -> bb7;
+-     }
+- 
+-     bb3: {
+-         _0 = const 1_i16;
+-         goto -> bb7;
+-     }
+- 
+-     bb4: {
+-         _0 = const 0_i16;
+-         goto -> bb7;
+-     }
+- 
+-     bb5: {
+-         _0 = const -1_i16;
+-         goto -> bb7;
+-     }
+- 
+-     bb6: {
+-         _0 = const -128_i16;
+-         goto -> bb7;
+-     }
+- 
+-     bb7: {
++         StorageLive(_3);
++         _3 = move _2;
++         _0 = _3 as i16 (IntToInt);
++         StorageDead(_3);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16_failed.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..94ec2293222
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_sext_i8_i16_failed.MatchBranchSimplification.diff
@@ -0,0 +1,47 @@
+- // MIR for `match_sext_i8_i16_failed` before MatchBranchSimplification
++ // MIR for `match_sext_i8_i16_failed` after MatchBranchSimplification
+  
+  fn match_sext_i8_i16_failed(_1: EnumAi8) -> i16 {
+      debug i => _1;
+      let mut _0: i16;
+      let mut _2: i8;
+  
+      bb0: {
+          _2 = discriminant(_1);
+          switchInt(move _2) -> [128: bb6, 255: bb5, 0: bb4, 1: bb3, 127: bb2, otherwise: bb1];
+      }
+  
+      bb1: {
+          unreachable;
+      }
+  
+      bb2: {
+          _0 = const 127_i16;
+          goto -> bb7;
+      }
+  
+      bb3: {
+          _0 = const 1_i16;
+          goto -> bb7;
+      }
+  
+      bb4: {
+          _0 = const 0_i16;
+          goto -> bb7;
+      }
+  
+      bb5: {
+          _0 = const 255_i16;
+          goto -> bb7;
+      }
+  
+      bb6: {
+          _0 = const -128_i16;
+          goto -> bb7;
+      }
+  
+      bb7: {
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..86d0d0ba6cf
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16.MatchBranchSimplification.diff
@@ -0,0 +1,52 @@
+- // MIR for `match_sext_i8_u16` before MatchBranchSimplification
++ // MIR for `match_sext_i8_u16` after MatchBranchSimplification
+  
+  fn match_sext_i8_u16(_1: EnumAi8) -> u16 {
+      debug i => _1;
+      let mut _0: u16;
+      let mut _2: i8;
++     let mut _3: i8;
+  
+      bb0: {
+          _2 = discriminant(_1);
+-         switchInt(move _2) -> [128: bb6, 255: bb5, 0: bb4, 1: bb3, 127: bb2, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+-         unreachable;
+-     }
+- 
+-     bb2: {
+-         _0 = const 127_u16;
+-         goto -> bb7;
+-     }
+- 
+-     bb3: {
+-         _0 = const 1_u16;
+-         goto -> bb7;
+-     }
+- 
+-     bb4: {
+-         _0 = const 0_u16;
+-         goto -> bb7;
+-     }
+- 
+-     bb5: {
+-         _0 = const u16::MAX;
+-         goto -> bb7;
+-     }
+- 
+-     bb6: {
+-         _0 = const 65408_u16;
+-         goto -> bb7;
+-     }
+- 
+-     bb7: {
++         StorageLive(_3);
++         _3 = move _2;
++         _0 = _3 as u16 (IntToInt);
++         StorageDead(_3);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16_failed.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..281f373bf87
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_sext_i8_u16_failed.MatchBranchSimplification.diff
@@ -0,0 +1,47 @@
+- // MIR for `match_sext_i8_u16_failed` before MatchBranchSimplification
++ // MIR for `match_sext_i8_u16_failed` after MatchBranchSimplification
+  
+  fn match_sext_i8_u16_failed(_1: EnumAi8) -> u16 {
+      debug i => _1;
+      let mut _0: u16;
+      let mut _2: i8;
+  
+      bb0: {
+          _2 = discriminant(_1);
+          switchInt(move _2) -> [128: bb6, 255: bb5, 0: bb4, 1: bb3, 127: bb2, otherwise: bb1];
+      }
+  
+      bb1: {
+          unreachable;
+      }
+  
+      bb2: {
+          _0 = const 127_u16;
+          goto -> bb7;
+      }
+  
+      bb3: {
+          _0 = const 1_u16;
+          goto -> bb7;
+      }
+  
+      bb4: {
+          _0 = const 0_u16;
+          goto -> bb7;
+      }
+  
+      bb5: {
+          _0 = const 255_u16;
+          goto -> bb7;
+      }
+  
+      bb6: {
+          _0 = const 65408_u16;
+          goto -> bb7;
+      }
+  
+      bb7: {
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..d3d27be2070
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8.MatchBranchSimplification.diff
@@ -0,0 +1,77 @@
+- // MIR for `match_trunc_i16_i8` before MatchBranchSimplification
++ // MIR for `match_trunc_i16_i8` after MatchBranchSimplification
+  
+  fn match_trunc_i16_i8(_1: EnumAi16) -> i8 {
+      debug i => _1;
+      let mut _0: i8;
+      let mut _2: i16;
++     let mut _3: i16;
+  
+      bb0: {
+          _2 = discriminant(_1);
+-         switchInt(move _2) -> [128: bb11, 255: bb10, 0: bb9, 1: bb8, 127: bb7, 65408: bb6, 65535: bb5, 65280: bb4, 65281: bb3, 65407: bb2, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+-         unreachable;
+-     }
+- 
+-     bb2: {
+-         _0 = const i8::MAX;
+-         goto -> bb12;
+-     }
+- 
+-     bb3: {
+-         _0 = const 1_i8;
+-         goto -> bb12;
+-     }
+- 
+-     bb4: {
+-         _0 = const 0_i8;
+-         goto -> bb12;
+-     }
+- 
+-     bb5: {
+-         _0 = const -1_i8;
+-         goto -> bb12;
+-     }
+- 
+-     bb6: {
+-         _0 = const i8::MIN;
+-         goto -> bb12;
+-     }
+- 
+-     bb7: {
+-         _0 = const i8::MAX;
+-         goto -> bb12;
+-     }
+- 
+-     bb8: {
+-         _0 = const 1_i8;
+-         goto -> bb12;
+-     }
+- 
+-     bb9: {
+-         _0 = const 0_i8;
+-         goto -> bb12;
+-     }
+- 
+-     bb10: {
+-         _0 = const -1_i8;
+-         goto -> bb12;
+-     }
+- 
+-     bb11: {
+-         _0 = const i8::MIN;
+-         goto -> bb12;
+-     }
+- 
+-     bb12: {
++         StorageLive(_3);
++         _3 = move _2;
++         _0 = _3 as i8 (IntToInt);
++         StorageDead(_3);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8_failed.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..7f663baefba
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_i8_failed.MatchBranchSimplification.diff
@@ -0,0 +1,72 @@
+- // MIR for `match_trunc_i16_i8_failed` before MatchBranchSimplification
++ // MIR for `match_trunc_i16_i8_failed` after MatchBranchSimplification
+  
+  fn match_trunc_i16_i8_failed(_1: EnumAi16) -> i8 {
+      debug i => _1;
+      let mut _0: i8;
+      let mut _2: i16;
+  
+      bb0: {
+          _2 = discriminant(_1);
+          switchInt(move _2) -> [128: bb11, 255: bb10, 0: bb9, 1: bb8, 127: bb7, 65408: bb6, 65535: bb5, 65280: bb4, 65281: bb3, 65407: bb2, otherwise: bb1];
+      }
+  
+      bb1: {
+          unreachable;
+      }
+  
+      bb2: {
+          _0 = const -127_i8;
+          goto -> bb12;
+      }
+  
+      bb3: {
+          _0 = const 1_i8;
+          goto -> bb12;
+      }
+  
+      bb4: {
+          _0 = const 0_i8;
+          goto -> bb12;
+      }
+  
+      bb5: {
+          _0 = const -1_i8;
+          goto -> bb12;
+      }
+  
+      bb6: {
+          _0 = const i8::MIN;
+          goto -> bb12;
+      }
+  
+      bb7: {
+          _0 = const i8::MAX;
+          goto -> bb12;
+      }
+  
+      bb8: {
+          _0 = const 1_i8;
+          goto -> bb12;
+      }
+  
+      bb9: {
+          _0 = const 0_i8;
+          goto -> bb12;
+      }
+  
+      bb10: {
+          _0 = const -1_i8;
+          goto -> bb12;
+      }
+  
+      bb11: {
+          _0 = const i8::MIN;
+          goto -> bb12;
+      }
+  
+      bb12: {
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..5fe899148eb
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8.MatchBranchSimplification.diff
@@ -0,0 +1,77 @@
+- // MIR for `match_trunc_i16_u8` before MatchBranchSimplification
++ // MIR for `match_trunc_i16_u8` after MatchBranchSimplification
+  
+  fn match_trunc_i16_u8(_1: EnumAi16) -> u8 {
+      debug i => _1;
+      let mut _0: u8;
+      let mut _2: i16;
++     let mut _3: i16;
+  
+      bb0: {
+          _2 = discriminant(_1);
+-         switchInt(move _2) -> [128: bb11, 255: bb10, 0: bb9, 1: bb8, 127: bb7, 65408: bb6, 65535: bb5, 65280: bb4, 65281: bb3, 65407: bb2, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+-         unreachable;
+-     }
+- 
+-     bb2: {
+-         _0 = const 127_u8;
+-         goto -> bb12;
+-     }
+- 
+-     bb3: {
+-         _0 = const 1_u8;
+-         goto -> bb12;
+-     }
+- 
+-     bb4: {
+-         _0 = const 0_u8;
+-         goto -> bb12;
+-     }
+- 
+-     bb5: {
+-         _0 = const u8::MAX;
+-         goto -> bb12;
+-     }
+- 
+-     bb6: {
+-         _0 = const 128_u8;
+-         goto -> bb12;
+-     }
+- 
+-     bb7: {
+-         _0 = const 127_u8;
+-         goto -> bb12;
+-     }
+- 
+-     bb8: {
+-         _0 = const 1_u8;
+-         goto -> bb12;
+-     }
+- 
+-     bb9: {
+-         _0 = const 0_u8;
+-         goto -> bb12;
+-     }
+- 
+-     bb10: {
+-         _0 = const u8::MAX;
+-         goto -> bb12;
+-     }
+- 
+-     bb11: {
+-         _0 = const 128_u8;
+-         goto -> bb12;
+-     }
+- 
+-     bb12: {
++         StorageLive(_3);
++         _3 = move _2;
++         _0 = _3 as u8 (IntToInt);
++         StorageDead(_3);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8_failed.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..1c0ffb30c5b
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_trunc_i16_u8_failed.MatchBranchSimplification.diff
@@ -0,0 +1,72 @@
+- // MIR for `match_trunc_i16_u8_failed` before MatchBranchSimplification
++ // MIR for `match_trunc_i16_u8_failed` after MatchBranchSimplification
+  
+  fn match_trunc_i16_u8_failed(_1: EnumAi16) -> u8 {
+      debug i => _1;
+      let mut _0: u8;
+      let mut _2: i16;
+  
+      bb0: {
+          _2 = discriminant(_1);
+          switchInt(move _2) -> [128: bb11, 255: bb10, 0: bb9, 1: bb8, 127: bb7, 65408: bb6, 65535: bb5, 65280: bb4, 65281: bb3, 65407: bb2, otherwise: bb1];
+      }
+  
+      bb1: {
+          unreachable;
+      }
+  
+      bb2: {
+          _0 = const -127_i8 as u8 (IntToInt);
+          goto -> bb12;
+      }
+  
+      bb3: {
+          _0 = const 1_u8;
+          goto -> bb12;
+      }
+  
+      bb4: {
+          _0 = const 0_u8;
+          goto -> bb12;
+      }
+  
+      bb5: {
+          _0 = const u8::MAX;
+          goto -> bb12;
+      }
+  
+      bb6: {
+          _0 = const 128_u8;
+          goto -> bb12;
+      }
+  
+      bb7: {
+          _0 = const 127_u8;
+          goto -> bb12;
+      }
+  
+      bb8: {
+          _0 = const 1_u8;
+          goto -> bb12;
+      }
+  
+      bb9: {
+          _0 = const 0_u8;
+          goto -> bb12;
+      }
+  
+      bb10: {
+          _0 = const u8::MAX;
+          goto -> bb12;
+      }
+  
+      bb11: {
+          _0 = const 128_u8;
+          goto -> bb12;
+      }
+  
+      bb12: {
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..85f97a13cac
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8.MatchBranchSimplification.diff
@@ -0,0 +1,67 @@
+- // MIR for `match_trunc_u16_i8` before MatchBranchSimplification
++ // MIR for `match_trunc_u16_i8` after MatchBranchSimplification
+  
+  fn match_trunc_u16_i8(_1: EnumAu16) -> i8 {
+      debug i => _1;
+      let mut _0: i8;
+      let mut _2: u16;
++     let mut _3: u16;
+  
+      bb0: {
+          _2 = discriminant(_1);
+-         switchInt(move _2) -> [0: bb9, 127: bb8, 128: bb7, 255: bb6, 65280: bb5, 65407: bb4, 65408: bb3, 65535: bb2, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+-         unreachable;
+-     }
+- 
+-     bb2: {
+-         _0 = const -1_i8;
+-         goto -> bb10;
+-     }
+- 
+-     bb3: {
+-         _0 = const i8::MIN;
+-         goto -> bb10;
+-     }
+- 
+-     bb4: {
+-         _0 = const i8::MAX;
+-         goto -> bb10;
+-     }
+- 
+-     bb5: {
+-         _0 = const 0_i8;
+-         goto -> bb10;
+-     }
+- 
+-     bb6: {
+-         _0 = const -1_i8;
+-         goto -> bb10;
+-     }
+- 
+-     bb7: {
+-         _0 = const i8::MIN;
+-         goto -> bb10;
+-     }
+- 
+-     bb8: {
+-         _0 = const i8::MAX;
+-         goto -> bb10;
+-     }
+- 
+-     bb9: {
+-         _0 = const 0_i8;
+-         goto -> bb10;
+-     }
+- 
+-     bb10: {
++         StorageLive(_3);
++         _3 = move _2;
++         _0 = _3 as i8 (IntToInt);
++         StorageDead(_3);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8_failed.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..cf6c86a71ad
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_i8_failed.MatchBranchSimplification.diff
@@ -0,0 +1,62 @@
+- // MIR for `match_trunc_u16_i8_failed` before MatchBranchSimplification
++ // MIR for `match_trunc_u16_i8_failed` after MatchBranchSimplification
+  
+  fn match_trunc_u16_i8_failed(_1: EnumAu16) -> i8 {
+      debug i => _1;
+      let mut _0: i8;
+      let mut _2: u16;
+  
+      bb0: {
+          _2 = discriminant(_1);
+          switchInt(move _2) -> [0: bb9, 127: bb8, 128: bb7, 255: bb6, 65280: bb5, 65407: bb4, 65408: bb3, 65535: bb2, otherwise: bb1];
+      }
+  
+      bb1: {
+          unreachable;
+      }
+  
+      bb2: {
+          _0 = const 1_i8;
+          goto -> bb10;
+      }
+  
+      bb3: {
+          _0 = const i8::MIN;
+          goto -> bb10;
+      }
+  
+      bb4: {
+          _0 = const i8::MAX;
+          goto -> bb10;
+      }
+  
+      bb5: {
+          _0 = const 0_i8;
+          goto -> bb10;
+      }
+  
+      bb6: {
+          _0 = const -1_i8;
+          goto -> bb10;
+      }
+  
+      bb7: {
+          _0 = const i8::MIN;
+          goto -> bb10;
+      }
+  
+      bb8: {
+          _0 = const i8::MAX;
+          goto -> bb10;
+      }
+  
+      bb9: {
+          _0 = const 0_i8;
+          goto -> bb10;
+      }
+  
+      bb10: {
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..768d838eaa6
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8.MatchBranchSimplification.diff
@@ -0,0 +1,67 @@
+- // MIR for `match_trunc_u16_u8` before MatchBranchSimplification
++ // MIR for `match_trunc_u16_u8` after MatchBranchSimplification
+  
+  fn match_trunc_u16_u8(_1: EnumAu16) -> u8 {
+      debug i => _1;
+      let mut _0: u8;
+      let mut _2: u16;
++     let mut _3: u16;
+  
+      bb0: {
+          _2 = discriminant(_1);
+-         switchInt(move _2) -> [0: bb9, 127: bb8, 128: bb7, 255: bb6, 65280: bb5, 65407: bb4, 65408: bb3, 65535: bb2, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+-         unreachable;
+-     }
+- 
+-     bb2: {
+-         _0 = const u8::MAX;
+-         goto -> bb10;
+-     }
+- 
+-     bb3: {
+-         _0 = const 128_u8;
+-         goto -> bb10;
+-     }
+- 
+-     bb4: {
+-         _0 = const 127_u8;
+-         goto -> bb10;
+-     }
+- 
+-     bb5: {
+-         _0 = const 0_u8;
+-         goto -> bb10;
+-     }
+- 
+-     bb6: {
+-         _0 = const u8::MAX;
+-         goto -> bb10;
+-     }
+- 
+-     bb7: {
+-         _0 = const 128_u8;
+-         goto -> bb10;
+-     }
+- 
+-     bb8: {
+-         _0 = const 127_u8;
+-         goto -> bb10;
+-     }
+- 
+-     bb9: {
+-         _0 = const 0_u8;
+-         goto -> bb10;
+-     }
+- 
+-     bb10: {
++         StorageLive(_3);
++         _3 = move _2;
++         _0 = _3 as u8 (IntToInt);
++         StorageDead(_3);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8_failed.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..109e97bb578
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_trunc_u16_u8_failed.MatchBranchSimplification.diff
@@ -0,0 +1,62 @@
+- // MIR for `match_trunc_u16_u8_failed` before MatchBranchSimplification
++ // MIR for `match_trunc_u16_u8_failed` after MatchBranchSimplification
+  
+  fn match_trunc_u16_u8_failed(_1: EnumAu16) -> u8 {
+      debug i => _1;
+      let mut _0: u8;
+      let mut _2: u16;
+  
+      bb0: {
+          _2 = discriminant(_1);
+          switchInt(move _2) -> [0: bb9, 127: bb8, 128: bb7, 255: bb6, 65280: bb5, 65407: bb4, 65408: bb3, 65535: bb2, otherwise: bb1];
+      }
+  
+      bb1: {
+          unreachable;
+      }
+  
+      bb2: {
+          _0 = const 127_u8;
+          goto -> bb10;
+      }
+  
+      bb3: {
+          _0 = const 128_u8;
+          goto -> bb10;
+      }
+  
+      bb4: {
+          _0 = const 127_u8;
+          goto -> bb10;
+      }
+  
+      bb5: {
+          _0 = const 0_u8;
+          goto -> bb10;
+      }
+  
+      bb6: {
+          _0 = const u8::MAX;
+          goto -> bb10;
+      }
+  
+      bb7: {
+          _0 = const 128_u8;
+          goto -> bb10;
+      }
+  
+      bb8: {
+          _0 = const 127_u8;
+          goto -> bb10;
+      }
+  
+      bb9: {
+          _0 = const 0_u8;
+          goto -> bb10;
+      }
+  
+      bb10: {
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i16.MatchBranchSimplification.diff
deleted file mode 100644
index 72ad60956ab..00000000000
--- a/tests/mir-opt/matches_reduce_branches.match_u8_i16.MatchBranchSimplification.diff
+++ /dev/null
@@ -1,32 +0,0 @@
-- // MIR for `match_u8_i16` before MatchBranchSimplification
-+ // MIR for `match_u8_i16` after MatchBranchSimplification
-  
-  fn match_u8_i16(_1: EnumAu8) -> i16 {
-      debug i => _1;
-      let mut _0: i16;
-      let mut _2: u8;
-  
-      bb0: {
-          _2 = discriminant(_1);
-          switchInt(move _2) -> [1: bb3, 2: bb2, otherwise: bb1];
-      }
-  
-      bb1: {
-          unreachable;
-      }
-  
-      bb2: {
-          _0 = const 2_i16;
-          goto -> bb4;
-      }
-  
-      bb3: {
-          _0 = const 1_i16;
-          goto -> bb4;
-      }
-  
-      bb4: {
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i16_2.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i16_2.MatchBranchSimplification.diff
deleted file mode 100644
index 3333cd765a8..00000000000
--- a/tests/mir-opt/matches_reduce_branches.match_u8_i16_2.MatchBranchSimplification.diff
+++ /dev/null
@@ -1,26 +0,0 @@
-- // MIR for `match_u8_i16_2` before MatchBranchSimplification
-+ // MIR for `match_u8_i16_2` after MatchBranchSimplification
-  
-  fn match_u8_i16_2(_1: EnumAu8) -> i16 {
-      let mut _0: i16;
-      let mut _2: u8;
-  
-      bb0: {
-          _2 = discriminant(_1);
-          switchInt(_2) -> [1: bb3, 2: bb1, otherwise: bb2];
-      }
-  
-      bb1: {
-          _0 = const 2_i16;
-          goto -> bb3;
-      }
-  
-      bb2: {
-          unreachable;
-      }
-  
-      bb3: {
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i16_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i16_failed.MatchBranchSimplification.diff
deleted file mode 100644
index 6da19e46dab..00000000000
--- a/tests/mir-opt/matches_reduce_branches.match_u8_i16_failed.MatchBranchSimplification.diff
+++ /dev/null
@@ -1,32 +0,0 @@
-- // MIR for `match_u8_i16_failed` before MatchBranchSimplification
-+ // MIR for `match_u8_i16_failed` after MatchBranchSimplification
-  
-  fn match_u8_i16_failed(_1: EnumAu8) -> i16 {
-      debug i => _1;
-      let mut _0: i16;
-      let mut _2: u8;
-  
-      bb0: {
-          _2 = discriminant(_1);
-          switchInt(move _2) -> [1: bb3, 2: bb2, otherwise: bb1];
-      }
-  
-      bb1: {
-          unreachable;
-      }
-  
-      bb2: {
-          _0 = const 3_i16;
-          goto -> bb4;
-      }
-  
-      bb3: {
-          _0 = const 1_i16;
-          goto -> bb4;
-      }
-  
-      bb4: {
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i16_fallback.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i16_fallback.MatchBranchSimplification.diff
deleted file mode 100644
index 8fa497fe890..00000000000
--- a/tests/mir-opt/matches_reduce_branches.match_u8_i16_fallback.MatchBranchSimplification.diff
+++ /dev/null
@@ -1,31 +0,0 @@
-- // MIR for `match_u8_i16_fallback` before MatchBranchSimplification
-+ // MIR for `match_u8_i16_fallback` after MatchBranchSimplification
-  
-  fn match_u8_i16_fallback(_1: u8) -> i16 {
-      debug i => _1;
-      let mut _0: i16;
-  
-      bb0: {
-          switchInt(_1) -> [1: bb2, 2: bb3, otherwise: bb1];
-      }
-  
-      bb1: {
-          _0 = const 3_i16;
-          goto -> bb4;
-      }
-  
-      bb2: {
-          _0 = const 1_i16;
-          goto -> bb4;
-      }
-  
-      bb3: {
-          _0 = const 2_i16;
-          goto -> bb4;
-      }
-  
-      bb4: {
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..d63eed7c019
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8.MatchBranchSimplification.diff
@@ -0,0 +1,47 @@
+- // MIR for `match_u8_i8` before MatchBranchSimplification
++ // MIR for `match_u8_i8` after MatchBranchSimplification
+  
+  fn match_u8_i8(_1: EnumAu8) -> i8 {
+      debug i => _1;
+      let mut _0: i8;
+      let mut _2: u8;
++     let mut _3: u8;
+  
+      bb0: {
+          _2 = discriminant(_1);
+-         switchInt(move _2) -> [0: bb5, 127: bb4, 128: bb3, 255: bb2, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+-         unreachable;
+-     }
+- 
+-     bb2: {
+-         _0 = const -1_i8;
+-         goto -> bb6;
+-     }
+- 
+-     bb3: {
+-         _0 = const i8::MIN;
+-         goto -> bb6;
+-     }
+- 
+-     bb4: {
+-         _0 = const i8::MAX;
+-         goto -> bb6;
+-     }
+- 
+-     bb5: {
+-         _0 = const 0_i8;
+-         goto -> bb6;
+-     }
+- 
+-     bb6: {
++         StorageLive(_3);
++         _3 = move _2;
++         _0 = _3 as i8 (IntToInt);
++         StorageDead(_3);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_2.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_2.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..98dee1835a8
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_2.MatchBranchSimplification.diff
@@ -0,0 +1,80 @@
+- // MIR for `match_u8_i8_2` before MatchBranchSimplification
++ // MIR for `match_u8_i8_2` after MatchBranchSimplification
+  
+  fn match_u8_i8_2(_1: EnumAu8) -> (i8, i8) {
+      debug i => _1;
+      let mut _0: (i8, i8);
+      let _2: i8;
+      let _4: ();
+      let mut _5: u8;
+      let mut _6: i8;
+      let mut _7: i8;
++     let mut _8: u8;
+      scope 1 {
+          debug a => _2;
+          let _3: i8;
+          scope 2 {
+              debug b => _3;
+          }
+      }
+  
+      bb0: {
+          StorageLive(_2);
+          StorageLive(_3);
+          StorageLive(_4);
+          _5 = discriminant(_1);
+-         switchInt(move _5) -> [0: bb5, 127: bb4, 128: bb3, 255: bb2, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+-         unreachable;
+-     }
+- 
+-     bb2: {
+-         _2 = const -1_i8;
+-         _3 = const -1_i8;
++         StorageLive(_8);
++         _8 = move _5;
++         _2 = _8 as i8 (IntToInt);
++         _3 = _8 as i8 (IntToInt);
+          _4 = ();
+-         goto -> bb6;
+-     }
+- 
+-     bb3: {
+-         _2 = const i8::MIN;
+-         _3 = const i8::MIN;
+-         _4 = ();
+-         goto -> bb6;
+-     }
+- 
+-     bb4: {
+-         _2 = const i8::MAX;
+-         _3 = const i8::MAX;
+-         _4 = ();
+-         goto -> bb6;
+-     }
+- 
+-     bb5: {
+-         _2 = const 0_i8;
+-         _3 = const 0_i8;
+-         _4 = ();
+-         goto -> bb6;
+-     }
+- 
+-     bb6: {
++         StorageDead(_8);
+          StorageDead(_4);
+          StorageLive(_6);
+          _6 = _2;
+          StorageLive(_7);
+          _7 = _3;
+          _0 = (move _6, move _7);
+          StorageDead(_7);
+          StorageDead(_6);
+          StorageDead(_3);
+          StorageDead(_2);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_2_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_2_failed.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..901dda58617
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_2_failed.MatchBranchSimplification.diff
@@ -0,0 +1,74 @@
+- // MIR for `match_u8_i8_2_failed` before MatchBranchSimplification
++ // MIR for `match_u8_i8_2_failed` after MatchBranchSimplification
+  
+  fn match_u8_i8_2_failed(_1: EnumAu8) -> (i8, i8) {
+      debug i => _1;
+      let mut _0: (i8, i8);
+      let _2: i8;
+      let _4: ();
+      let mut _5: u8;
+      let mut _6: i8;
+      let mut _7: i8;
+      scope 1 {
+          debug a => _2;
+          let _3: i8;
+          scope 2 {
+              debug b => _3;
+          }
+      }
+  
+      bb0: {
+          StorageLive(_2);
+          StorageLive(_3);
+          StorageLive(_4);
+          _5 = discriminant(_1);
+          switchInt(move _5) -> [0: bb5, 127: bb4, 128: bb3, 255: bb2, otherwise: bb1];
+      }
+  
+      bb1: {
+          unreachable;
+      }
+  
+      bb2: {
+          _2 = const -1_i8;
+          _3 = const 1_i8;
+          _4 = ();
+          goto -> bb6;
+      }
+  
+      bb3: {
+          _2 = const i8::MIN;
+          _3 = const i8::MIN;
+          _4 = ();
+          goto -> bb6;
+      }
+  
+      bb4: {
+          _2 = const i8::MAX;
+          _3 = const i8::MAX;
+          _4 = ();
+          goto -> bb6;
+      }
+  
+      bb5: {
+          _2 = const 0_i8;
+          _3 = const 0_i8;
+          _4 = ();
+          goto -> bb6;
+      }
+  
+      bb6: {
+          StorageDead(_4);
+          StorageLive(_6);
+          _6 = _2;
+          StorageLive(_7);
+          _7 = _3;
+          _0 = (move _6, move _7);
+          StorageDead(_7);
+          StorageDead(_6);
+          StorageDead(_3);
+          StorageDead(_2);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..ac96be55312
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed.MatchBranchSimplification.diff
@@ -0,0 +1,42 @@
+- // MIR for `match_u8_i8_failed` before MatchBranchSimplification
++ // MIR for `match_u8_i8_failed` after MatchBranchSimplification
+  
+  fn match_u8_i8_failed(_1: EnumAu8) -> i8 {
+      debug i => _1;
+      let mut _0: i8;
+      let mut _2: u8;
+  
+      bb0: {
+          _2 = discriminant(_1);
+          switchInt(move _2) -> [0: bb5, 127: bb4, 128: bb3, 255: bb2, otherwise: bb1];
+      }
+  
+      bb1: {
+          unreachable;
+      }
+  
+      bb2: {
+          _0 = const 1_i8;
+          goto -> bb6;
+      }
+  
+      bb3: {
+          _0 = const i8::MIN;
+          goto -> bb6;
+      }
+  
+      bb4: {
+          _0 = const i8::MAX;
+          goto -> bb6;
+      }
+  
+      bb5: {
+          _0 = const 0_i8;
+          goto -> bb6;
+      }
+  
+      bb6: {
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_1.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_1.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..9ebf2cf27cb
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_1.MatchBranchSimplification.diff
@@ -0,0 +1,42 @@
+- // MIR for `match_u8_i8_failed_len_1` before MatchBranchSimplification
++ // MIR for `match_u8_i8_failed_len_1` after MatchBranchSimplification
+  
+  fn match_u8_i8_failed_len_1(_1: EnumAu8) -> i8 {
+      let mut _0: i8;
+      let mut _2: u8;
+  
+      bb0: {
+          _2 = discriminant(_1);
+          switchInt(_2) -> [0: bb1, 127: bb2, 128: bb3, 255: bb4, otherwise: bb5];
+      }
+  
+      bb1: {
+          _0 = const 0_i8;
+          goto -> bb6;
+      }
+  
+      bb2: {
+          _0 = const i8::MAX;
+          _0 = const i8::MAX;
+          goto -> bb6;
+      }
+  
+      bb3: {
+          _0 = const i8::MIN;
+          goto -> bb6;
+      }
+  
+      bb4: {
+          _0 = const -1_i8;
+          goto -> bb6;
+      }
+  
+      bb5: {
+          unreachable;
+      }
+  
+      bb6: {
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_2.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_2.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..554856777eb
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_failed_len_2.MatchBranchSimplification.diff
@@ -0,0 +1,42 @@
+- // MIR for `match_u8_i8_failed_len_2` before MatchBranchSimplification
++ // MIR for `match_u8_i8_failed_len_2` after MatchBranchSimplification
+  
+  fn match_u8_i8_failed_len_2(_1: EnumAu8) -> i8 {
+      let mut _0: i8;
+      let mut _2: u8;
+  
+      bb0: {
+          _2 = discriminant(_1);
+          switchInt(_2) -> [0: bb1, 127: bb2, 128: bb3, 255: bb4, otherwise: bb5];
+      }
+  
+      bb1: {
+          _0 = const 0_i8;
+          goto -> bb6;
+      }
+  
+      bb2: {
+          _0 = const i8::MAX;
+          goto -> bb6;
+      }
+  
+      bb3: {
+          _0 = const i8::MIN;
+          goto -> bb6;
+      }
+  
+      bb4: {
+          _0 = const -1_i8;
+          _0 = const -1_i8;
+          goto -> bb6;
+      }
+  
+      bb5: {
+          unreachable;
+      }
+  
+      bb6: {
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_i8_fallback.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_i8_fallback.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..356655021f7
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_u8_i8_fallback.MatchBranchSimplification.diff
@@ -0,0 +1,38 @@
+- // MIR for `match_u8_i8_fallback` before MatchBranchSimplification
++ // MIR for `match_u8_i8_fallback` after MatchBranchSimplification
+  
+  fn match_u8_i8_fallback(_1: EnumAu8) -> i8 {
+      debug i => _1;
+      let mut _0: i8;
+      let mut _2: u8;
+  
+      bb0: {
+          _2 = discriminant(_1);
+          switchInt(move _2) -> [0: bb4, 127: bb3, 128: bb2, otherwise: bb1];
+      }
+  
+      bb1: {
+          _0 = const -1_i8;
+          goto -> bb5;
+      }
+  
+      bb2: {
+          _0 = const i8::MIN;
+          goto -> bb5;
+      }
+  
+      bb3: {
+          _0 = const i8::MAX;
+          goto -> bb5;
+      }
+  
+      bb4: {
+          _0 = const 0_i8;
+          goto -> bb5;
+      }
+  
+      bb5: {
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_u16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_u16.MatchBranchSimplification.diff
deleted file mode 100644
index 043fdb197a3..00000000000
--- a/tests/mir-opt/matches_reduce_branches.match_u8_u16.MatchBranchSimplification.diff
+++ /dev/null
@@ -1,37 +0,0 @@
-- // MIR for `match_u8_u16` before MatchBranchSimplification
-+ // MIR for `match_u8_u16` after MatchBranchSimplification
-  
-  fn match_u8_u16(_1: EnumBu8) -> u16 {
-      debug i => _1;
-      let mut _0: u16;
-      let mut _2: u8;
-  
-      bb0: {
-          _2 = discriminant(_1);
-          switchInt(move _2) -> [1: bb3, 2: bb4, 5: bb2, otherwise: bb1];
-      }
-  
-      bb1: {
-          unreachable;
-      }
-  
-      bb2: {
-          _0 = const 5_u16;
-          goto -> bb5;
-      }
-  
-      bb3: {
-          _0 = const 1_u16;
-          goto -> bb5;
-      }
-  
-      bb4: {
-          _0 = const 2_u16;
-          goto -> bb5;
-      }
-  
-      bb5: {
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/matches_reduce_branches.match_u8_u16_2.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_u8_u16_2.MatchBranchSimplification.diff
deleted file mode 100644
index b47de6a52b7..00000000000
--- a/tests/mir-opt/matches_reduce_branches.match_u8_u16_2.MatchBranchSimplification.diff
+++ /dev/null
@@ -1,37 +0,0 @@
-- // MIR for `match_u8_u16_2` before MatchBranchSimplification
-+ // MIR for `match_u8_u16_2` after MatchBranchSimplification
-  
-  fn match_u8_u16_2(_1: EnumBu8) -> i16 {
-      let mut _0: i16;
-      let mut _2: u8;
-  
-      bb0: {
-          _2 = discriminant(_1);
-          switchInt(_2) -> [1: bb1, 2: bb2, 5: bb3, otherwise: bb4];
-      }
-  
-      bb1: {
-          _0 = const 1_i16;
-          goto -> bb5;
-      }
-  
-      bb2: {
-          _0 = const 2_i16;
-          goto -> bb5;
-      }
-  
-      bb3: {
-          _0 = const 5_i16;
-          _0 = const 5_i16;
-          goto -> bb5;
-      }
-  
-      bb4: {
-          unreachable;
-      }
-  
-      bb5: {
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..e00a604fe25
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16.MatchBranchSimplification.diff
@@ -0,0 +1,47 @@
+- // MIR for `match_zext_u8_i16` before MatchBranchSimplification
++ // MIR for `match_zext_u8_i16` after MatchBranchSimplification
+  
+  fn match_zext_u8_i16(_1: EnumAu8) -> i16 {
+      debug i => _1;
+      let mut _0: i16;
+      let mut _2: u8;
++     let mut _3: u8;
+  
+      bb0: {
+          _2 = discriminant(_1);
+-         switchInt(move _2) -> [0: bb5, 127: bb4, 128: bb3, 255: bb2, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+-         unreachable;
+-     }
+- 
+-     bb2: {
+-         _0 = const 255_i16;
+-         goto -> bb6;
+-     }
+- 
+-     bb3: {
+-         _0 = const 128_i16;
+-         goto -> bb6;
+-     }
+- 
+-     bb4: {
+-         _0 = const 127_i16;
+-         goto -> bb6;
+-     }
+- 
+-     bb5: {
+-         _0 = const 0_i16;
+-         goto -> bb6;
+-     }
+- 
+-     bb6: {
++         StorageLive(_3);
++         _3 = move _2;
++         _0 = _3 as i16 (IntToInt);
++         StorageDead(_3);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16_failed.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..a19cd796c27
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_zext_u8_i16_failed.MatchBranchSimplification.diff
@@ -0,0 +1,42 @@
+- // MIR for `match_zext_u8_i16_failed` before MatchBranchSimplification
++ // MIR for `match_zext_u8_i16_failed` after MatchBranchSimplification
+  
+  fn match_zext_u8_i16_failed(_1: EnumAu8) -> i16 {
+      debug i => _1;
+      let mut _0: i16;
+      let mut _2: u8;
+  
+      bb0: {
+          _2 = discriminant(_1);
+          switchInt(move _2) -> [0: bb5, 127: bb4, 128: bb3, 255: bb2, otherwise: bb1];
+      }
+  
+      bb1: {
+          unreachable;
+      }
+  
+      bb2: {
+          _0 = const 255_i16;
+          goto -> bb6;
+      }
+  
+      bb3: {
+          _0 = const 128_i16;
+          goto -> bb6;
+      }
+  
+      bb4: {
+          _0 = const -127_i16;
+          goto -> bb6;
+      }
+  
+      bb5: {
+          _0 = const 0_i16;
+          goto -> bb6;
+      }
+  
+      bb6: {
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..befb9118907
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16.MatchBranchSimplification.diff
@@ -0,0 +1,47 @@
+- // MIR for `match_zext_u8_u16` before MatchBranchSimplification
++ // MIR for `match_zext_u8_u16` after MatchBranchSimplification
+  
+  fn match_zext_u8_u16(_1: EnumAu8) -> u16 {
+      debug i => _1;
+      let mut _0: u16;
+      let mut _2: u8;
++     let mut _3: u8;
+  
+      bb0: {
+          _2 = discriminant(_1);
+-         switchInt(move _2) -> [0: bb5, 127: bb4, 128: bb3, 255: bb2, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+-         unreachable;
+-     }
+- 
+-     bb2: {
+-         _0 = const 255_u16;
+-         goto -> bb6;
+-     }
+- 
+-     bb3: {
+-         _0 = const 128_u16;
+-         goto -> bb6;
+-     }
+- 
+-     bb4: {
+-         _0 = const 127_u16;
+-         goto -> bb6;
+-     }
+- 
+-     bb5: {
+-         _0 = const 0_u16;
+-         goto -> bb6;
+-     }
+- 
+-     bb6: {
++         StorageLive(_3);
++         _3 = move _2;
++         _0 = _3 as u16 (IntToInt);
++         StorageDead(_3);
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16_failed.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16_failed.MatchBranchSimplification.diff
new file mode 100644
index 00000000000..f781f88449d
--- /dev/null
+++ b/tests/mir-opt/matches_reduce_branches.match_zext_u8_u16_failed.MatchBranchSimplification.diff
@@ -0,0 +1,42 @@
+- // MIR for `match_zext_u8_u16_failed` before MatchBranchSimplification
++ // MIR for `match_zext_u8_u16_failed` after MatchBranchSimplification
+  
+  fn match_zext_u8_u16_failed(_1: EnumAu8) -> u16 {
+      debug i => _1;
+      let mut _0: u16;
+      let mut _2: u8;
+  
+      bb0: {
+          _2 = discriminant(_1);
+          switchInt(move _2) -> [0: bb5, 127: bb4, 128: bb3, 255: bb2, otherwise: bb1];
+      }
+  
+      bb1: {
+          unreachable;
+      }
+  
+      bb2: {
+          _0 = const 255_u16;
+          goto -> bb6;
+      }
+  
+      bb3: {
+          _0 = const 128_u16;
+          goto -> bb6;
+      }
+  
+      bb4: {
+          _0 = const 65407_u16;
+          goto -> bb6;
+      }
+  
+      bb5: {
+          _0 = const 0_u16;
+          goto -> bb6;
+      }
+  
+      bb6: {
+          return;
+      }
+  }
+  
diff --git a/tests/mir-opt/matches_reduce_branches.rs b/tests/mir-opt/matches_reduce_branches.rs
index 176d68bcd40..6787e5816a3 100644
--- a/tests/mir-opt/matches_reduce_branches.rs
+++ b/tests/mir-opt/matches_reduce_branches.rs
@@ -3,6 +3,7 @@
 #![feature(repr128)]
 #![feature(core_intrinsics)]
 #![feature(custom_mir)]
+#![allow(non_camel_case_types)]
 
 use std::intrinsics::mir::*;
 
@@ -12,6 +13,7 @@ fn foo(bar: Option<()>) {
     // CHECK: = Eq(
     // CHECK: switchInt
     // CHECK-NOT: switchInt
+    // CHECK: return
     if matches!(bar, None) {
         ()
     }
@@ -23,6 +25,7 @@ fn bar(i: i32) -> (bool, bool, bool, bool) {
     // CHECK: = Ne(
     // CHECK: = Eq(
     // CHECK-NOT: switchInt
+    // CHECK: return
     let a;
     let b;
     let c;
@@ -52,6 +55,7 @@ fn bar(i: i32) -> (bool, bool, bool, bool) {
 fn match_nested_if() -> bool {
     // CHECK-LABEL: fn match_nested_if(
     // CHECK-NOT: switchInt
+    // CHECK: return
     let val = match () {
         () if if if if true { true } else { false } { true } else { false } {
             true
@@ -66,42 +70,170 @@ fn match_nested_if() -> bool {
     val
 }
 
+// # Fold switchInt into IntToInt.
+// To simplify writing and checking these test cases, I use the first character of
+// each case to distinguish the sign of the number:
+// 'u' for unsigned, '_' for negative, and 'o' for non-negative.
+// Followed by a decimal number, and add the corresponding radix representation.
+// For example, o127_0x7f represents 127i8, and _1_0xff represents -1i8.
+
+// ## Cast but without numeric conversion.
+
 #[repr(u8)]
 enum EnumAu8 {
-    A = 1,
-    B = 2,
+    u0_0x00 = 0,
+    u127_0x7f = 127,
+    u128_0x80 = 128,
+    u255_0xff = 255,
+}
+
+#[repr(i8)]
+enum EnumAi8 {
+    _128_0x80 = -128,
+    _1_0xff = -1,
+    o0_0x00 = 0,
+    o1_0x01 = 1,
+    o127_0x7f = 127,
 }
 
-// EMIT_MIR matches_reduce_branches.match_u8_i16.MatchBranchSimplification.diff
-fn match_u8_i16(i: EnumAu8) -> i16 {
-    // CHECK-LABEL: fn match_u8_i16(
+// EMIT_MIR matches_reduce_branches.match_u8_i8.MatchBranchSimplification.diff
+fn match_u8_i8(i: EnumAu8) -> i8 {
+    // CHECK-LABEL: fn match_u8_i8(
+    // CHECK-NOT: switchInt
+    // CHECK: return
+    match i {
+        EnumAu8::u0_0x00 => 0,
+        EnumAu8::u127_0x7f => 127,
+        EnumAu8::u128_0x80 => -128,
+        EnumAu8::u255_0xff => -1,
+    }
+}
+
+// EMIT_MIR matches_reduce_branches.match_u8_i8_failed.MatchBranchSimplification.diff
+fn match_u8_i8_failed(i: EnumAu8) -> i8 {
+    // CHECK-LABEL: fn match_u8_i8_failed(
     // CHECK: switchInt
+    // CHECK: return
     match i {
-        EnumAu8::A => 1,
-        EnumAu8::B => 2,
+        EnumAu8::u0_0x00 => 0,
+        EnumAu8::u127_0x7f => 127,
+        EnumAu8::u128_0x80 => -128,
+        EnumAu8::u255_0xff => 1, // failed
     }
 }
 
-// EMIT_MIR matches_reduce_branches.match_u8_i16_2.MatchBranchSimplification.diff
+// EMIT_MIR matches_reduce_branches.match_u8_i8_2.MatchBranchSimplification.diff
+fn match_u8_i8_2(i: EnumAu8) -> (i8, i8) {
+    // CHECK-LABEL: fn match_u8_i8_2(
+    // CHECK-NOT: switchInt
+    // CHECK: IntToInt
+    // CHECK: IntToInt
+    // CHECK: return
+    let a: i8;
+    let b: i8;
+    match i {
+        EnumAu8::u0_0x00 => {
+            a = 0;
+            b = 0;
+            ()
+        }
+        EnumAu8::u127_0x7f => {
+            a = 127;
+            b = 127;
+            ()
+        }
+        EnumAu8::u128_0x80 => {
+            a = -128;
+            b = -128;
+            ()
+        }
+        EnumAu8::u255_0xff => {
+            a = -1;
+            b = -1;
+            ()
+        }
+    };
+    (a, b)
+}
+
+// EMIT_MIR matches_reduce_branches.match_u8_i8_2_failed.MatchBranchSimplification.diff
+fn match_u8_i8_2_failed(i: EnumAu8) -> (i8, i8) {
+    // CHECK-LABEL: fn match_u8_i8_2_failed(
+    // CHECK: switchInt
+    // CHECK: return
+    let a: i8;
+    let b: i8;
+    match i {
+        EnumAu8::u0_0x00 => {
+            a = 0;
+            b = 0;
+            ()
+        }
+        EnumAu8::u127_0x7f => {
+            a = 127;
+            b = 127;
+            ()
+        }
+        EnumAu8::u128_0x80 => {
+            a = -128;
+            b = -128;
+            ()
+        }
+        EnumAu8::u255_0xff => {
+            a = -1;
+            b = 1; // failed
+            ()
+        }
+    };
+    (a, b)
+}
+
+// EMIT_MIR matches_reduce_branches.match_u8_i8_fallback.MatchBranchSimplification.diff
+fn match_u8_i8_fallback(i: EnumAu8) -> i8 {
+    // CHECK-LABEL: fn match_u8_i8_fallback(
+    // CHECK: switchInt
+    // CHECK: return
+    match i {
+        EnumAu8::u0_0x00 => 0,
+        EnumAu8::u127_0x7f => 127,
+        EnumAu8::u128_0x80 => -128,
+        _ => -1,
+    }
+}
+
+// EMIT_MIR matches_reduce_branches.match_u8_i8_failed_len_1.MatchBranchSimplification.diff
 // Check for different instruction lengths
 #[custom_mir(dialect = "built")]
-fn match_u8_i16_2(i: EnumAu8) -> i16 {
-    // CHECK-LABEL: fn match_u8_i16_2(
+fn match_u8_i8_failed_len_1(i: EnumAu8) -> i8 {
+    // CHECK-LABEL: fn match_u8_i8_failed_len_1(
     // CHECK: switchInt
+    // CHECK: return
     mir! {
         {
             let a = Discriminant(i);
             match a {
-                1 => bb1,
-                2 => bb2,
+                0 => bb1,
+                127 => bb2,
+                128 => bb3,
+                255 => bb4,
                 _ => unreachable_bb,
             }
         }
         bb1 = {
+            RET = 0;
             Goto(ret)
         }
         bb2 = {
-            RET = 2;
+            RET = 127;
+            RET = 127;
+            Goto(ret)
+        }
+        bb3 = {
+            RET = -128;
+            Goto(ret)
+        }
+        bb4 = {
+            RET = -1;
             Goto(ret)
         }
         unreachable_bb = {
@@ -113,72 +245,39 @@ fn match_u8_i16_2(i: EnumAu8) -> i16 {
     }
 }
 
-// EMIT_MIR matches_reduce_branches.match_u8_i16_failed.MatchBranchSimplification.diff
-fn match_u8_i16_failed(i: EnumAu8) -> i16 {
-    // CHECK-LABEL: fn match_u8_i16_failed(
-    // CHECK: switchInt
-    match i {
-        EnumAu8::A => 1,
-        EnumAu8::B => 3,
-    }
-}
-
-// EMIT_MIR matches_reduce_branches.match_u8_i16_fallback.MatchBranchSimplification.diff
-fn match_u8_i16_fallback(i: u8) -> i16 {
-    // CHECK-LABEL: fn match_u8_i16_fallback(
-    // CHECK: switchInt
-    match i {
-        1 => 1,
-        2 => 2,
-        _ => 3,
-    }
-}
-
-#[repr(u8)]
-enum EnumBu8 {
-    A = 1,
-    B = 2,
-    C = 5,
-}
-
-// EMIT_MIR matches_reduce_branches.match_u8_u16.MatchBranchSimplification.diff
-fn match_u8_u16(i: EnumBu8) -> u16 {
-    // CHECK-LABEL: fn match_u8_u16(
-    // CHECK: switchInt
-    match i {
-        EnumBu8::A => 1,
-        EnumBu8::B => 2,
-        EnumBu8::C => 5,
-    }
-}
-
-// EMIT_MIR matches_reduce_branches.match_u8_u16_2.MatchBranchSimplification.diff
+// EMIT_MIR matches_reduce_branches.match_u8_i8_failed_len_2.MatchBranchSimplification.diff
 // Check for different instruction lengths
 #[custom_mir(dialect = "built")]
-fn match_u8_u16_2(i: EnumBu8) -> i16 {
-    // CHECK-LABEL: fn match_u8_u16_2(
+fn match_u8_i8_failed_len_2(i: EnumAu8) -> i8 {
+    // CHECK-LABEL: fn match_u8_i8_failed_len_2(
     // CHECK: switchInt
+    // CHECK: return
     mir! {
         {
             let a = Discriminant(i);
             match a {
-                1 => bb1,
-                2 => bb2,
-                5 => bb5,
+                0 => bb1,
+                127 => bb2,
+                128 => bb3,
+                255 => bb4,
                 _ => unreachable_bb,
             }
         }
         bb1 = {
-            RET = 1;
+            RET = 0;
             Goto(ret)
         }
         bb2 = {
-            RET = 2;
+            RET = 127;
             Goto(ret)
         }
-        bb5 = {
-            RET = 5;
-            RET = 5;
+        bb3 = {
+            RET = -128;
+            Goto(ret)
+        }
+        bb4 = {
+            RET = -1;
+            RET = -1;
             Goto(ret)
         }
         unreachable_bb = {
@@ -190,50 +289,309 @@ fn match_u8_u16_2(i: EnumBu8) -> i16 {
     }
 }
 
-#[repr(i8)]
-enum EnumAi8 {
-    A = -1,
-    B = 2,
-    C = -3,
+// ## Cast with sext.
+
+// EMIT_MIR matches_reduce_branches.match_sext_i8_i16.MatchBranchSimplification.diff
+fn match_sext_i8_i16(i: EnumAi8) -> i16 {
+    // CHECK-LABEL: fn match_sext_i8_i16(
+    // CHECK-NOT: switchInt
+    // CHECK: return
+    match i {
+        EnumAi8::_128_0x80 => -128,
+        EnumAi8::_1_0xff => -1,
+        EnumAi8::o0_0x00 => 0,
+        EnumAi8::o1_0x01 => 1,
+        EnumAi8::o127_0x7f => 127,
+    }
+}
+
+// EMIT_MIR matches_reduce_branches.match_sext_i8_i16_failed.MatchBranchSimplification.diff
+// Converting `-1i8` to `255i16` is zext.
+fn match_sext_i8_i16_failed(i: EnumAi8) -> i16 {
+    // CHECK-LABEL: fn match_sext_i8_i16_failed(
+    // CHECK: switchInt
+    // CHECK: return
+    match i {
+        EnumAi8::_128_0x80 => -128,
+        EnumAi8::_1_0xff => 255, // failed
+        EnumAi8::o0_0x00 => 0,
+        EnumAi8::o1_0x01 => 1,
+        EnumAi8::o127_0x7f => 127,
+    }
+}
+
+// EMIT_MIR matches_reduce_branches.match_sext_i8_u16.MatchBranchSimplification.diff
+fn match_sext_i8_u16(i: EnumAi8) -> u16 {
+    // CHECK-LABEL: fn match_sext_i8_u16(
+    // CHECK-NOT: switchInt
+    // CHECK: return
+    match i {
+        EnumAi8::_128_0x80 => 0xff80,
+        EnumAi8::_1_0xff => 0xffff,
+        EnumAi8::o0_0x00 => 0,
+        EnumAi8::o1_0x01 => 1,
+        EnumAi8::o127_0x7f => 127,
+    }
+}
+
+// EMIT_MIR matches_reduce_branches.match_sext_i8_u16_failed.MatchBranchSimplification.diff
+// Converting `-1i8` to `255u16` is zext.
+fn match_sext_i8_u16_failed(i: EnumAi8) -> u16 {
+    // CHECK-LABEL: fn match_sext_i8_u16_failed(
+    // CHECK: switchInt
+    // CHECK: return
+    match i {
+        EnumAi8::_128_0x80 => 0xff80,
+        EnumAi8::_1_0xff => 0x00ff, // failed
+        EnumAi8::o0_0x00 => 0,
+        EnumAi8::o1_0x01 => 1,
+        EnumAi8::o127_0x7f => 127,
+    }
+}
+
+// ## Cast with zext.
+
+// EMIT_MIR matches_reduce_branches.match_zext_u8_u16.MatchBranchSimplification.diff
+fn match_zext_u8_u16(i: EnumAu8) -> u16 {
+    // CHECK-LABEL: fn match_zext_u8_u16(
+    // CHECK-NOT: switchInt
+    // CHECK: return
+    match i {
+        EnumAu8::u0_0x00 => 0,
+        EnumAu8::u127_0x7f => 0x7f,
+        EnumAu8::u128_0x80 => 128,
+        EnumAu8::u255_0xff => 255,
+    }
 }
 
-// EMIT_MIR matches_reduce_branches.match_i8_i16.MatchBranchSimplification.diff
-fn match_i8_i16(i: EnumAi8) -> i16 {
-    // CHECK-LABEL: fn match_i8_i16(
+// EMIT_MIR matches_reduce_branches.match_zext_u8_u16_failed.MatchBranchSimplification.diff
+fn match_zext_u8_u16_failed(i: EnumAu8) -> u16 {
+    // CHECK-LABEL: fn match_zext_u8_u16_failed(
     // CHECK: switchInt
+    // CHECK: return
+    match i {
+        EnumAu8::u0_0x00 => 0,
+        EnumAu8::u127_0x7f => 0xff7f, // failed
+        EnumAu8::u128_0x80 => 128,
+        EnumAu8::u255_0xff => 255,
+    }
+}
+
+// EMIT_MIR matches_reduce_branches.match_zext_u8_i16.MatchBranchSimplification.diff
+fn match_zext_u8_i16(i: EnumAu8) -> i16 {
+    // CHECK-LABEL: fn match_zext_u8_i16(
+    // CHECK-NOT: switchInt
+    // CHECK: return
     match i {
-        EnumAi8::A => -1,
-        EnumAi8::B => 2,
-        EnumAi8::C => -3,
+        EnumAu8::u0_0x00 => 0,
+        EnumAu8::u127_0x7f => 127,
+        EnumAu8::u128_0x80 => 128,
+        EnumAu8::u255_0xff => 255,
     }
 }
 
-// EMIT_MIR matches_reduce_branches.match_i8_i16_failed.MatchBranchSimplification.diff
-fn match_i8_i16_failed(i: EnumAi8) -> i16 {
-    // CHECK-LABEL: fn match_i8_i16_failed(
+// EMIT_MIR matches_reduce_branches.match_zext_u8_i16_failed.MatchBranchSimplification.diff
+fn match_zext_u8_i16_failed(i: EnumAu8) -> i16 {
+    // CHECK-LABEL: fn match_zext_u8_i16_failed(
     // CHECK: switchInt
+    // CHECK: return
     match i {
-        EnumAi8::A => -1,
-        EnumAi8::B => 2,
-        EnumAi8::C => 3,
+        EnumAu8::u0_0x00 => 0,
+        EnumAu8::u127_0x7f => -127, // failed
+        EnumAu8::u128_0x80 => 128,
+        EnumAu8::u255_0xff => 255,
     }
 }
 
+// ## Cast with trunc.
+
+#[repr(u16)]
+enum EnumAu16 {
+    // 0x00nn
+    u0_0x0000 = 0,
+    u127_0x007f = 127,
+    u128_0x0080 = 128,
+    u255_0x00ff = 255,
+    // 0xffnn
+    u65280_0xff00 = 65280,
+    u65407_0xff7f = 65407,
+    u65408_0xff80 = 65408,
+    u65535_0xffff = 65535,
+}
+
 #[repr(i16)]
 enum EnumAi16 {
-    A = -1,
-    B = 2,
-    C = -3,
+    // 0x00nn
+    o128_0x0080 = 128,
+    o255_0x00ff = 255,
+    o0_0x0000 = 0,
+    o1_0x0001 = 1,
+    o127_0x007f = 127,
+    // 0xffnn
+    _128_0xff80 = -128,
+    _1_0xffff = -1,
+    o0_0xff00 = -256,
+    o1_0xff01 = -255,
+    o127_0xff7f = -129,
 }
 
-// EMIT_MIR matches_reduce_branches.match_i16_i8.MatchBranchSimplification.diff
-fn match_i16_i8(i: EnumAi16) -> i8 {
-    // CHECK-LABEL: fn match_i16_i8(
+// EMIT_MIR matches_reduce_branches.match_trunc_i16_i8.MatchBranchSimplification.diff
+fn match_trunc_i16_i8(i: EnumAi16) -> i8 {
+    // CHECK-LABEL: fn match_trunc_i16_i8(
+    // CHECK-NOT: switchInt
+    // CHECK: return
+    match i {
+        // 0x00nn
+        EnumAi16::o128_0x0080 => -128,
+        EnumAi16::o255_0x00ff => -1,
+        EnumAi16::o0_0x0000 => 0,
+        EnumAi16::o1_0x0001 => 1,
+        EnumAi16::o127_0x007f => 127,
+        // 0xffnn
+        EnumAi16::_128_0xff80 => -128,
+        EnumAi16::_1_0xffff => -1,
+        EnumAi16::o0_0xff00 => 0,
+        EnumAi16::o1_0xff01 => 1,
+        EnumAi16::o127_0xff7f => 127,
+    }
+}
+
+// EMIT_MIR matches_reduce_branches.match_trunc_i16_i8_failed.MatchBranchSimplification.diff
+fn match_trunc_i16_i8_failed(i: EnumAi16) -> i8 {
+    // CHECK-LABEL: fn match_trunc_i16_i8_failed(
     // CHECK: switchInt
+    // CHECK: return
     match i {
-        EnumAi16::A => -1,
-        EnumAi16::B => 2,
-        EnumAi16::C => -3,
+        // 0x00nn
+        EnumAi16::o128_0x0080 => -128,
+        EnumAi16::o255_0x00ff => -1,
+        EnumAi16::o0_0x0000 => 0,
+        EnumAi16::o1_0x0001 => 1,
+        EnumAi16::o127_0x007f => 127,
+        // 0xffnn
+        EnumAi16::_128_0xff80 => -128,
+        EnumAi16::_1_0xffff => -1,
+        EnumAi16::o0_0xff00 => 0,
+        EnumAi16::o1_0xff01 => 1,
+        EnumAi16::o127_0xff7f => -127, // failed
+    }
+}
+
+// EMIT_MIR matches_reduce_branches.match_trunc_i16_u8.MatchBranchSimplification.diff
+fn match_trunc_i16_u8(i: EnumAi16) -> u8 {
+    // CHECK-LABEL: fn match_trunc_i16_u8(
+    // CHECK-NOT: switchInt
+    // CHECK: return
+    match i {
+        // 0x00nn
+        EnumAi16::o128_0x0080 => 128,
+        EnumAi16::o255_0x00ff => 255,
+        EnumAi16::o0_0x0000 => 0,
+        EnumAi16::o1_0x0001 => 1,
+        EnumAi16::o127_0x007f => 127,
+        // 0xffnn
+        EnumAi16::_128_0xff80 => 128,
+        EnumAi16::_1_0xffff => 255,
+        EnumAi16::o0_0xff00 => 0,
+        EnumAi16::o1_0xff01 => 1,
+        EnumAi16::o127_0xff7f => 127,
+    }
+}
+
+// EMIT_MIR matches_reduce_branches.match_trunc_i16_u8_failed.MatchBranchSimplification.diff
+fn match_trunc_i16_u8_failed(i: EnumAi16) -> u8 {
+    // CHECK-LABEL: fn match_trunc_i16_u8_failed(
+    // CHECK: switchInt
+    // CHECK: return
+    match i {
+        // 0x00nn
+        EnumAi16::o128_0x0080 => 128,
+        EnumAi16::o255_0x00ff => 255,
+        EnumAi16::o0_0x0000 => 0,
+        EnumAi16::o1_0x0001 => 1,
+        EnumAi16::o127_0x007f => 127,
+        // 0xffnn
+        EnumAi16::_128_0xff80 => 128,
+        EnumAi16::_1_0xffff => 255,
+        EnumAi16::o0_0xff00 => 0,
+        EnumAi16::o1_0xff01 => 1,
+        EnumAi16::o127_0xff7f => -127i8 as u8, // failed
+    }
+}
+
+// EMIT_MIR matches_reduce_branches.match_trunc_u16_u8.MatchBranchSimplification.diff
+fn match_trunc_u16_u8(i: EnumAu16) -> u8 {
+    // CHECK-LABEL: fn match_trunc_u16_u8(
+    // CHECK-NOT: switchInt
+    // CHECK: return
+    match i {
+        // 0x00nn
+        EnumAu16::u0_0x0000 => 0,
+        EnumAu16::u127_0x007f => 127,
+        EnumAu16::u128_0x0080 => 128,
+        EnumAu16::u255_0x00ff => 255,
+        // 0xffnn
+        EnumAu16::u65280_0xff00 => 0,
+        EnumAu16::u65407_0xff7f => 127,
+        EnumAu16::u65408_0xff80 => 128,
+        EnumAu16::u65535_0xffff => 255,
+    }
+}
+
+// EMIT_MIR matches_reduce_branches.match_trunc_u16_u8_failed.MatchBranchSimplification.diff
+fn match_trunc_u16_u8_failed(i: EnumAu16) -> u8 {
+    // CHECK-LABEL: fn match_trunc_u16_u8_failed(
+    // CHECK: switchInt
+    // CHECK: return
+    match i {
+        // 0x00nn
+        EnumAu16::u0_0x0000 => 0,
+        EnumAu16::u127_0x007f => 127,
+        EnumAu16::u128_0x0080 => 128,
+        EnumAu16::u255_0x00ff => 255,
+        // 0xffnn
+        EnumAu16::u65280_0xff00 => 0,
+        EnumAu16::u65407_0xff7f => 127,
+        EnumAu16::u65408_0xff80 => 128,
+        EnumAu16::u65535_0xffff => 127, // failed
+    }
+}
+
+// EMIT_MIR matches_reduce_branches.match_trunc_u16_i8.MatchBranchSimplification.diff
+fn match_trunc_u16_i8(i: EnumAu16) -> i8 {
+    // CHECK-LABEL: fn match_trunc_u16_i8(
+    // CHECK-NOT: switchInt
+    // CHECK: return
+    match i {
+        // 0x00nn
+        EnumAu16::u0_0x0000 => 0,
+        EnumAu16::u127_0x007f => 127,
+        EnumAu16::u128_0x0080 => -128,
+        EnumAu16::u255_0x00ff => -1,
+        // 0xffnn
+        EnumAu16::u65280_0xff00 => 0,
+        EnumAu16::u65407_0xff7f => 127,
+        EnumAu16::u65408_0xff80 => -128,
+        EnumAu16::u65535_0xffff => -1,
+    }
+}
+
+// EMIT_MIR matches_reduce_branches.match_trunc_u16_i8_failed.MatchBranchSimplification.diff
+fn match_trunc_u16_i8_failed(i: EnumAu16) -> i8 {
+    // CHECK-LABEL: fn match_trunc_u16_i8_failed(
+    // CHECK: switchInt
+    // CHECK: return
+    match i {
+        // 0x00nn
+        EnumAu16::u0_0x0000 => 0,
+        EnumAu16::u127_0x007f => 127,
+        EnumAu16::u128_0x0080 => -128,
+        EnumAu16::u255_0x00ff => -1,
+        // 0xffnn
+        EnumAu16::u65280_0xff00 => 0,
+        EnumAu16::u65407_0xff7f => 127,
+        EnumAu16::u65408_0xff80 => -128,
+        EnumAu16::u65535_0xffff => 1,
     }
 }
 
@@ -248,7 +606,8 @@ enum EnumAi128 {
 // EMIT_MIR matches_reduce_branches.match_i128_u128.MatchBranchSimplification.diff
 fn match_i128_u128(i: EnumAi128) -> u128 {
     // CHECK-LABEL: fn match_i128_u128(
-    // CHECK: switchInt
+    // CHECK-NOT: switchInt
+    // CHECK: return
     match i {
         EnumAi128::A => 1,
         EnumAi128::B => 2,
@@ -262,15 +621,34 @@ fn main() {
     let _ = foo(Some(()));
     let _ = bar(0);
     let _ = match_nested_if();
-    let _ = match_u8_i16(EnumAu8::A);
-    let _ = match_u8_i16_2(EnumAu8::A);
-    let _ = match_u8_i16_failed(EnumAu8::A);
-    let _ = match_u8_i16_fallback(1);
-    let _ = match_u8_u16(EnumBu8::A);
-    let _ = match_u8_u16_2(EnumBu8::A);
-    let _ = match_i8_i16(EnumAi8::A);
-    let _ = match_i8_i16_failed(EnumAi8::A);
-    let _ = match_i8_i16(EnumAi8::A);
-    let _ = match_i16_i8(EnumAi16::A);
+
+    let _: i8 = match_u8_i8(EnumAu8::u0_0x00);
+    let _: i8 = match_u8_i8_failed(EnumAu8::u0_0x00);
+    let _: (i8, i8) = match_u8_i8_2(EnumAu8::u0_0x00);
+    let _: (i8, i8) = match_u8_i8_2_failed(EnumAu8::u0_0x00);
+    let _: i8 = match_u8_i8_fallback(EnumAu8::u0_0x00);
+    let _: i8 = match_u8_i8_failed_len_1(EnumAu8::u0_0x00);
+    let _: i8 = match_u8_i8_failed_len_2(EnumAu8::u0_0x00);
+
+    let _: i16 = match_sext_i8_i16(EnumAi8::o0_0x00);
+    let _: i16 = match_sext_i8_i16_failed(EnumAi8::o0_0x00);
+    let _: u16 = match_sext_i8_u16(EnumAi8::o0_0x00);
+    let _: u16 = match_sext_i8_u16_failed(EnumAi8::o0_0x00);
+
+    let _: u16 = match_zext_u8_u16(EnumAu8::u0_0x00);
+    let _: u16 = match_zext_u8_u16_failed(EnumAu8::u0_0x00);
+    let _: i16 = match_zext_u8_i16(EnumAu8::u0_0x00);
+    let _: i16 = match_zext_u8_i16_failed(EnumAu8::u0_0x00);
+
+    let _: i8 = match_trunc_i16_i8(EnumAi16::o0_0x0000);
+    let _: i8 = match_trunc_i16_i8_failed(EnumAi16::o0_0x0000);
+    let _: u8 = match_trunc_i16_u8(EnumAi16::o0_0x0000);
+    let _: u8 = match_trunc_i16_u8_failed(EnumAi16::o0_0x0000);
+
+    let _: i8 = match_trunc_u16_i8(EnumAu16::u0_0x0000);
+    let _: i8 = match_trunc_u16_i8_failed(EnumAu16::u0_0x0000);
+    let _: u8 = match_trunc_u16_u8(EnumAu16::u0_0x0000);
+    let _: u8 = match_trunc_u16_u8_failed(EnumAu16::u0_0x0000);
+
     let _ = match_i128_u128(EnumAi128::A);
 }
diff --git a/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff b/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff
index 157f9c98353..11a18f58e3a 100644
--- a/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff
+++ b/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff
@@ -5,27 +5,32 @@
       debug e => _1;
       let mut _0: u8;
       let mut _2: isize;
++     let mut _3: isize;
   
       bb0: {
           _2 = discriminant(_1);
-          switchInt(move _2) -> [0: bb3, 1: bb2, otherwise: bb1];
-      }
-  
-      bb1: {
-          unreachable;
-      }
-  
-      bb2: {
-          _0 = const 1_u8;
-          goto -> bb4;
-      }
-  
-      bb3: {
-          _0 = const 0_u8;
-          goto -> bb4;
-      }
-  
-      bb4: {
+-         switchInt(move _2) -> [0: bb3, 1: bb2, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+-         unreachable;
+-     }
+- 
+-     bb2: {
+-         _0 = const 1_u8;
+-         goto -> bb4;
+-     }
+- 
+-     bb3: {
+-         _0 = const 0_u8;
+-         goto -> bb4;
+-     }
+- 
+-     bb4: {
++         StorageLive(_3);
++         _3 = move _2;
++         _0 = _3 as u8 (IntToInt);
++         StorageDead(_3);
           return;
       }
   }
diff --git a/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff b/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff
index 19083771fd9..809badc41ba 100644
--- a/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff
+++ b/tests/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff
@@ -5,27 +5,32 @@
       debug e => _1;
       let mut _0: i8;
       let mut _2: isize;
++     let mut _3: isize;
   
       bb0: {
           _2 = discriminant(_1);
-          switchInt(move _2) -> [0: bb3, 1: bb2, otherwise: bb1];
-      }
-  
-      bb1: {
-          unreachable;
-      }
-  
-      bb2: {
-          _0 = const 1_i8;
-          goto -> bb4;
-      }
-  
-      bb3: {
-          _0 = const 0_i8;
-          goto -> bb4;
-      }
-  
-      bb4: {
+-         switchInt(move _2) -> [0: bb3, 1: bb2, otherwise: bb1];
+-     }
+- 
+-     bb1: {
+-         unreachable;
+-     }
+- 
+-     bb2: {
+-         _0 = const 1_i8;
+-         goto -> bb4;
+-     }
+- 
+-     bb3: {
+-         _0 = const 0_i8;
+-         goto -> bb4;
+-     }
+- 
+-     bb4: {
++         StorageLive(_3);
++         _3 = move _2;
++         _0 = _3 as i8 (IntToInt);
++         StorageDead(_3);
           return;
       }
   }
diff --git a/tests/mir-opt/or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir b/tests/mir-opt/or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir
index e357e785e33..6c76a72b775 100644
--- a/tests/mir-opt/or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/or_pattern.shortcut_second_or.SimplifyCfg-initial.after.mir
@@ -39,7 +39,7 @@ fn shortcut_second_or() -> () {
     }
 
     bb5: {
-        falseEdge -> [real: bb10, imaginary: bb6];
+        falseEdge -> [real: bb12, imaginary: bb6];
     }
 
     bb6: {
@@ -47,18 +47,19 @@ fn shortcut_second_or() -> () {
     }
 
     bb7: {
-        falseEdge -> [real: bb12, imaginary: bb8];
+        falseEdge -> [real: bb10, imaginary: bb8];
     }
 
     bb8: {
-        falseEdge -> [real: bb13, imaginary: bb3];
+        falseEdge -> [real: bb9, imaginary: bb3];
     }
 
     bb9: {
-        _0 = const ();
-        StorageDead(_4);
-        StorageDead(_3);
-        goto -> bb14;
+        StorageLive(_3);
+        _3 = (_1.0: (i32, i32));
+        StorageLive(_4);
+        _4 = (_1.1: i32);
+        goto -> bb13;
     }
 
     bb10: {
@@ -66,7 +67,7 @@ fn shortcut_second_or() -> () {
         _3 = (_1.0: (i32, i32));
         StorageLive(_4);
         _4 = (_1.1: i32);
-        goto -> bb9;
+        goto -> bb13;
     }
 
     bb11: {
@@ -74,7 +75,7 @@ fn shortcut_second_or() -> () {
         _3 = (_1.0: (i32, i32));
         StorageLive(_4);
         _4 = (_1.1: i32);
-        goto -> bb9;
+        goto -> bb13;
     }
 
     bb12: {
@@ -82,15 +83,14 @@ fn shortcut_second_or() -> () {
         _3 = (_1.0: (i32, i32));
         StorageLive(_4);
         _4 = (_1.1: i32);
-        goto -> bb9;
+        goto -> bb13;
     }
 
     bb13: {
-        StorageLive(_3);
-        _3 = (_1.0: (i32, i32));
-        StorageLive(_4);
-        _4 = (_1.1: i32);
-        goto -> bb9;
+        _0 = const ();
+        StorageDead(_4);
+        StorageDead(_3);
+        goto -> bb14;
     }
 
     bb14: {
diff --git a/tests/mir-opt/or_pattern.single_switchint.SimplifyCfg-initial.after.mir b/tests/mir-opt/or_pattern.single_switchint.SimplifyCfg-initial.after.mir
index eafe95b4a11..8b0ef7b29d7 100644
--- a/tests/mir-opt/or_pattern.single_switchint.SimplifyCfg-initial.after.mir
+++ b/tests/mir-opt/or_pattern.single_switchint.SimplifyCfg-initial.after.mir
@@ -22,7 +22,7 @@ fn single_switchint() -> () {
     }
 
     bb3: {
-        falseEdge -> [real: bb9, imaginary: bb4];
+        falseEdge -> [real: bb12, imaginary: bb4];
     }
 
     bb4: {
@@ -30,11 +30,11 @@ fn single_switchint() -> () {
     }
 
     bb5: {
-        falseEdge -> [real: bb10, imaginary: bb6];
+        falseEdge -> [real: bb11, imaginary: bb6];
     }
 
     bb6: {
-        falseEdge -> [real: bb11, imaginary: bb1];
+        falseEdge -> [real: bb10, imaginary: bb1];
     }
 
     bb7: {
@@ -43,26 +43,26 @@ fn single_switchint() -> () {
     }
 
     bb8: {
-        falseEdge -> [real: bb12, imaginary: bb7];
+        falseEdge -> [real: bb9, imaginary: bb7];
     }
 
     bb9: {
-        _1 = const 1_i32;
+        _1 = const 4_i32;
         goto -> bb13;
     }
 
     bb10: {
-        _1 = const 2_i32;
+        _1 = const 3_i32;
         goto -> bb13;
     }
 
     bb11: {
-        _1 = const 3_i32;
+        _1 = const 2_i32;
         goto -> bb13;
     }
 
     bb12: {
-        _1 = const 4_i32;
+        _1 = const 1_i32;
         goto -> bb13;
     }
 
diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff
index 465cb1a9b1f..30c122ddea0 100644
--- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff
+++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff
@@ -24,7 +24,7 @@
               let _13: std::alloc::AllocError;
               let mut _14: !;
               let mut _15: &dyn std::fmt::Debug;
-              let mut _16: &std::alloc::AllocError;
+              let _16: &std::alloc::AllocError;
               scope 7 {
               }
               scope 8 {
@@ -73,34 +73,33 @@
           StorageLive(_6);
           StorageLive(_7);
           _9 = const main::promoted[0];
--         _7 = _9;
-+         _7 = const {ALLOC1<imm>: &std::alloc::Global};
+          _7 = _9;
           StorageLive(_8);
 -         _8 = _1;
 -         _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind unreachable];
 +         _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }};
-+         _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable];
++         _6 = std::alloc::Global::alloc_impl(_9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable];
       }
   
       bb4: {
           StorageDead(_8);
           StorageDead(_7);
           StorageLive(_12);
+          StorageLive(_16);
           _12 = discriminant(_6);
           switchInt(move _12) -> [0: bb6, 1: bb5, otherwise: bb1];
       }
   
       bb5: {
           StorageLive(_15);
-          StorageLive(_16);
           _16 = &_13;
-          _15 = move _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize));
-          StorageDead(_16);
+          _15 = _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize));
           _14 = result::unwrap_failed(const "called `Result::unwrap()` on an `Err` value", move _15) -> unwind unreachable;
       }
   
       bb6: {
           _5 = move ((_6 as Ok).0: std::ptr::NonNull<[u8]>);
+          StorageDead(_16);
           StorageDead(_12);
           StorageDead(_6);
 -         StorageLive(_17);
@@ -119,11 +118,9 @@
 +         nop;
           return;
       }
-  }
++ }
 + 
 + ALLOC0 (size: 8, align: 4) {
 +     00 00 00 00 __ __ __ __                         │ ....░░░░
-+ }
-+ 
-+ ALLOC1 (size: 0, align: 1) {}
+  }
   
diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff
index 4a37c860320..93449462c3d 100644
--- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff
+++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff
@@ -81,13 +81,12 @@
           StorageLive(_6);
           StorageLive(_7);
           _9 = const main::promoted[0];
--         _7 = _9;
-+         _7 = const {ALLOC1<imm>: &std::alloc::Global};
+          _7 = _9;
           StorageLive(_8);
 -         _8 = _1;
 -         _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb5, unwind continue];
 +         _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }};
-+         _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue];
++         _6 = std::alloc::Global::alloc_impl(_9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue];
       }
   
       bb5: {
@@ -95,11 +94,9 @@
           StorageDead(_7);
           _5 = Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap(move _6) -> [return: bb1, unwind continue];
       }
-  }
++ }
 + 
 + ALLOC0 (size: 8, align: 4) {
 +     00 00 00 00 __ __ __ __                         │ ....░░░░
-+ }
-+ 
-+ ALLOC1 (size: 0, align: 1) {}
+  }
   
diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff
index 925d8997b8a..44435956ec4 100644
--- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff
+++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff
@@ -24,7 +24,7 @@
               let _13: std::alloc::AllocError;
               let mut _14: !;
               let mut _15: &dyn std::fmt::Debug;
-              let mut _16: &std::alloc::AllocError;
+              let _16: &std::alloc::AllocError;
               scope 7 {
               }
               scope 8 {
@@ -73,34 +73,33 @@
           StorageLive(_6);
           StorageLive(_7);
           _9 = const main::promoted[0];
--         _7 = _9;
-+         _7 = const {ALLOC1<imm>: &std::alloc::Global};
+          _7 = _9;
           StorageLive(_8);
 -         _8 = _1;
 -         _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb4, unwind unreachable];
 +         _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }};
-+         _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable];
++         _6 = std::alloc::Global::alloc_impl(_9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb4, unwind unreachable];
       }
   
       bb4: {
           StorageDead(_8);
           StorageDead(_7);
           StorageLive(_12);
+          StorageLive(_16);
           _12 = discriminant(_6);
           switchInt(move _12) -> [0: bb6, 1: bb5, otherwise: bb1];
       }
   
       bb5: {
           StorageLive(_15);
-          StorageLive(_16);
           _16 = &_13;
-          _15 = move _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize));
-          StorageDead(_16);
+          _15 = _16 as &dyn std::fmt::Debug (PointerCoercion(Unsize));
           _14 = result::unwrap_failed(const "called `Result::unwrap()` on an `Err` value", move _15) -> unwind unreachable;
       }
   
       bb6: {
           _5 = move ((_6 as Ok).0: std::ptr::NonNull<[u8]>);
+          StorageDead(_16);
           StorageDead(_12);
           StorageDead(_6);
 -         StorageLive(_17);
@@ -119,11 +118,9 @@
 +         nop;
           return;
       }
-  }
++ }
 + 
 + ALLOC0 (size: 16, align: 8) {
 +     00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░
-+ }
-+ 
-+ ALLOC1 (size: 0, align: 1) {}
+  }
   
diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff
index ec2e95fecb6..c958480a9c7 100644
--- a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff
+++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff
@@ -81,13 +81,12 @@
           StorageLive(_6);
           StorageLive(_7);
           _9 = const main::promoted[0];
--         _7 = _9;
-+         _7 = const {ALLOC1<imm>: &std::alloc::Global};
+          _7 = _9;
           StorageLive(_8);
 -         _8 = _1;
 -         _6 = std::alloc::Global::alloc_impl(move _7, move _8, const false) -> [return: bb5, unwind continue];
 +         _8 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }};
-+         _6 = std::alloc::Global::alloc_impl(const {ALLOC1<imm>: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue];
++         _6 = std::alloc::Global::alloc_impl(_9, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): std::ptr::alignment::AlignmentEnum) }}, const false) -> [return: bb5, unwind continue];
       }
   
       bb5: {
@@ -95,11 +94,9 @@
           StorageDead(_7);
           _5 = Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap(move _6) -> [return: bb1, unwind continue];
       }
-  }
++ }
 + 
 + ALLOC0 (size: 16, align: 8) {
 +     00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░
-+ }
-+ 
-+ ALLOC1 (size: 0, align: 1) {}
+  }
   
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 cb29473d762..e537dd6a28e 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
@@ -30,13 +30,11 @@ fn vec_move(_1: Vec<impl Sized>) -> () {
 
     bb2: {
         StorageLive(_5);
-        StorageLive(_4);
         _4 = &mut _3;
         _5 = <std::vec::IntoIter<impl Sized> as Iterator>::next(move _4) -> [return: bb3, unwind: bb9];
     }
 
     bb3: {
-        StorageDead(_4);
         _6 = discriminant(_5);
         switchInt(move _6) -> [0: bb4, 1: bb6, otherwise: bb8];
     }
diff --git a/tests/mir-opt/pre-codegen/no_inlined_clone.rs b/tests/mir-opt/pre-codegen/no_inlined_clone.rs
new file mode 100644
index 00000000000..475b230b465
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/no_inlined_clone.rs
@@ -0,0 +1,12 @@
+#![crate_type = "lib"]
+
+// EMIT_MIR no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir
+
+// CHECK-LABEL: ::clone(
+// CHECK-NOT: inlined clone::impls::<impl Clone for {{.*}}>::clone
+// CHECK: return;
+
+#[derive(Clone)]
+struct Foo {
+    a: i32,
+}
diff --git a/tests/mir-opt/pre-codegen/no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir
new file mode 100644
index 00000000000..71898daa1bf
--- /dev/null
+++ b/tests/mir-opt/pre-codegen/no_inlined_clone.{impl#0}-clone.PreCodegen.after.mir
@@ -0,0 +1,15 @@
+// MIR for `<impl at $DIR/no_inlined_clone.rs:9:10: 9:15>::clone` after PreCodegen
+
+fn <impl at $DIR/no_inlined_clone.rs:9:10: 9:15>::clone(_1: &Foo) -> Foo {
+    debug self => _1;
+    let mut _0: Foo;
+    let mut _2: i32;
+
+    bb0: {
+        StorageLive(_2);
+        _2 = ((*_1).0: i32);
+        _0 = Foo { a: move _2 };
+        StorageDead(_2);
+        return;
+    }
+}
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff
index 802bfbbcdc5..c01a12eaa4f 100644
--- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff
@@ -37,7 +37,7 @@
           _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32];
           StorageLive(_5);
           _5 = const 3_usize;
-          _6 = Len(_4);
+          _6 = const 6_usize;
           _7 = Lt(_5, _6);
           assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable];
       }
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff
index de94a557403..64028e4437b 100644
--- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff
@@ -37,7 +37,7 @@
           _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32];
           StorageLive(_5);
           _5 = const 3_usize;
-          _6 = Len(_4);
+          _6 = const 6_usize;
           _7 = Lt(_5, _6);
           assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue];
       }
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff
index 802bfbbcdc5..c01a12eaa4f 100644
--- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff
@@ -37,7 +37,7 @@
           _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32];
           StorageLive(_5);
           _5 = const 3_usize;
-          _6 = Len(_4);
+          _6 = const 6_usize;
           _7 = Lt(_5, _6);
           assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind unreachable];
       }
diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff
index de94a557403..64028e4437b 100644
--- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff
+++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff
@@ -37,7 +37,7 @@
           _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32];
           StorageLive(_5);
           _5 = const 3_usize;
-          _6 = Len(_4);
+          _6 = const 6_usize;
           _7 = Lt(_5, _6);
           assert(move _7, "index out of bounds: the length is {} but the index is {}", move _6, _5) -> [success: bb2, unwind continue];
       }
diff --git a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir
index ce79a33013d..a7fe52d8390 100644
--- a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-abort.mir
@@ -36,13 +36,11 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
 
     bb1: {
         StorageLive(_7);
-        StorageLive(_6);
         _6 = &mut _5;
         _7 = <RangeInclusive<u32> as iter::range::RangeInclusiveIteratorImpl>::spec_next(move _6) -> [return: bb2, unwind unreachable];
     }
 
     bb2: {
-        StorageDead(_6);
         _8 = discriminant(_7);
         switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb7];
     }
diff --git a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir
index 602ecb7c9b8..3e2bbcd3c91 100644
--- a/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/range_iter.inclusive_loop.PreCodegen.after.panic-unwind.mir
@@ -36,13 +36,11 @@ fn inclusive_loop(_1: u32, _2: u32, _3: impl Fn(u32)) -> () {
 
     bb1: {
         StorageLive(_7);
-        StorageLive(_6);
         _6 = &mut _5;
         _7 = <RangeInclusive<u32> as iter::range::RangeInclusiveIteratorImpl>::spec_next(move _6) -> [return: bb2, unwind: bb8];
     }
 
     bb2: {
-        StorageDead(_6);
         _8 = discriminant(_7);
         switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb7];
     }
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 dfa13230254..e382f744723 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
@@ -32,7 +32,7 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2
             debug other => _10;
             scope 3 (inlined std::cmp::impls::<impl PartialOrd for usize>::le) {
                 debug self => _4;
-                debug other => _9;
+                debug other => _6;
                 let mut _11: usize;
                 let mut _12: usize;
             }
@@ -42,7 +42,7 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2
             debug other => _16;
             scope 5 (inlined std::cmp::impls::<impl PartialOrd for usize>::le) {
                 debug self => _7;
-                debug other => _15;
+                debug other => _5;
                 let mut _17: usize;
                 let mut _18: usize;
             }
@@ -52,7 +52,7 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2
             debug other => _22;
             scope 7 (inlined std::cmp::impls::<impl PartialOrd for usize>::le) {
                 debug self => _6;
-                debug other => _21;
+                debug other => _4;
             }
         }
         scope 8 (inlined std::cmp::impls::<impl PartialOrd for &usize>::le) {
@@ -60,7 +60,7 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2
             debug other => _26;
             scope 9 (inlined std::cmp::impls::<impl PartialOrd for usize>::le) {
                 debug self => _5;
-                debug other => _25;
+                debug other => _7;
                 let mut _27: usize;
                 let mut _28: usize;
             }
@@ -77,7 +77,8 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2
         StorageLive(_8);
         _8 = &_4;
         StorageLive(_10);
-        _9 = &((*_3).2: usize);
+        StorageLive(_9);
+        _9 = _6;
         _10 = &_9;
         _11 = ((*_3).0: usize);
         _12 = ((*_3).2: usize);
@@ -86,19 +87,22 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2
     }
 
     bb1: {
+        StorageDead(_9);
         StorageDead(_10);
         StorageDead(_8);
         goto -> bb4;
     }
 
     bb2: {
+        StorageDead(_9);
         StorageDead(_10);
         StorageDead(_8);
         StorageLive(_19);
         StorageLive(_14);
         _14 = &_7;
         StorageLive(_16);
-        _15 = &((*_3).1: usize);
+        StorageLive(_15);
+        _15 = _5;
         _16 = &_15;
         StorageLive(_17);
         _17 = ((*_3).3: usize);
@@ -111,6 +115,7 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2
     }
 
     bb3: {
+        StorageDead(_15);
         StorageDead(_16);
         StorageDead(_14);
         goto -> bb4;
@@ -121,13 +126,15 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2
         StorageLive(_20);
         _20 = &_6;
         StorageLive(_22);
-        _21 = &((*_3).0: usize);
+        StorageLive(_21);
+        _21 = _4;
         _22 = &_21;
         _23 = Le(_12, _11);
         switchInt(move _23) -> [0: bb5, otherwise: bb6];
     }
 
     bb5: {
+        StorageDead(_21);
         StorageDead(_22);
         StorageDead(_20);
         _0 = const false;
@@ -135,12 +142,14 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2
     }
 
     bb6: {
+        StorageDead(_21);
         StorageDead(_22);
         StorageDead(_20);
         StorageLive(_24);
         _24 = &_5;
         StorageLive(_26);
-        _25 = &((*_3).3: usize);
+        StorageLive(_25);
+        _25 = _7;
         _26 = &_25;
         StorageLive(_27);
         _27 = ((*_3).1: usize);
@@ -149,6 +158,7 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2
         _0 = Le(move _27, move _28);
         StorageDead(_28);
         StorageDead(_27);
+        StorageDead(_25);
         StorageDead(_26);
         StorageDead(_24);
         goto -> bb7;
@@ -160,6 +170,7 @@ fn variant_a::{closure#0}(_1: &mut {closure@$DIR/slice_filter.rs:7:25: 7:39}, _2
     }
 
     bb8: {
+        StorageDead(_15);
         StorageDead(_16);
         StorageDead(_14);
         _0 = const true;
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir
index d7f09fafeeb..58e9b45a4a0 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-abort.mir
@@ -20,7 +20,7 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
     }
 
     bb0: {
-        StorageLive(_7);
+        StorageLive(_8);
         StorageLive(_4);
         StorageLive(_3);
         _3 = PtrMetadata(_1);
@@ -36,7 +36,7 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
 
     bb2: {
         StorageDead(_3);
-        StorageLive(_8);
+        StorageLive(_7);
         StorageLive(_5);
         _5 = &raw mut (*_1);
         StorageLive(_6);
@@ -45,14 +45,14 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
         StorageDead(_6);
         StorageDead(_5);
         _8 = &mut (*_7);
-        _0 = Option::<&mut u32>::Some(move _8);
-        StorageDead(_8);
+        _0 = Option::<&mut u32>::Some(_8);
+        StorageDead(_7);
         goto -> bb3;
     }
 
     bb3: {
         StorageDead(_4);
-        StorageDead(_7);
+        StorageDead(_8);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir
index d7f09fafeeb..58e9b45a4a0 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir
@@ -20,7 +20,7 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
     }
 
     bb0: {
-        StorageLive(_7);
+        StorageLive(_8);
         StorageLive(_4);
         StorageLive(_3);
         _3 = PtrMetadata(_1);
@@ -36,7 +36,7 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
 
     bb2: {
         StorageDead(_3);
-        StorageLive(_8);
+        StorageLive(_7);
         StorageLive(_5);
         _5 = &raw mut (*_1);
         StorageLive(_6);
@@ -45,14 +45,14 @@ fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
         StorageDead(_6);
         StorageDead(_5);
         _8 = &mut (*_7);
-        _0 = Option::<&mut u32>::Some(move _8);
-        StorageDead(_8);
+        _0 = Option::<&mut u32>::Some(_8);
+        StorageDead(_7);
         goto -> bb3;
     }
 
     bb3: {
         StorageDead(_4);
-        StorageDead(_7);
+        StorageDead(_8);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir
index 2f13cfa4dab..ee80726a675 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-abort.mir
@@ -35,6 +35,7 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
     bb0: {
         _3 = move (_2.0: usize);
         _4 = move (_2.1: usize);
+        StorageLive(_11);
         StorageLive(_5);
         _5 = &raw mut (*_1);
         StorageLive(_8);
@@ -56,6 +57,7 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
         StorageDead(_8);
         StorageDead(_5);
         _0 = &mut (*_11);
+        StorageDead(_11);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir
index 2f13cfa4dab..ee80726a675 100644
--- a/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/slice_index.slice_get_unchecked_mut_range.PreCodegen.after.panic-unwind.mir
@@ -35,6 +35,7 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
     bb0: {
         _3 = move (_2.0: usize);
         _4 = move (_2.1: usize);
+        StorageLive(_11);
         StorageLive(_5);
         _5 = &raw mut (*_1);
         StorageLive(_8);
@@ -56,6 +57,7 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
         StorageDead(_8);
         StorageDead(_5);
         _0 = &mut (*_11);
+        StorageDead(_11);
         return;
     }
 }
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 d5fdb2e08cc..4c766c6497a 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
@@ -108,13 +108,11 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
 
     bb4: {
         StorageLive(_15);
-        StorageLive(_14);
         _14 = &mut _13;
         _15 = <Enumerate<std::slice::Iter<'_, T>> as Iterator>::next(move _14) -> [return: bb5, unwind: bb11];
     }
 
     bb5: {
-        StorageDead(_14);
         _16 = discriminant(_15);
         switchInt(move _16) -> [0: bb6, 1: bb8, otherwise: bb10];
     }
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 cc2beac06f2..03de9fd938e 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
@@ -98,13 +98,11 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
 
     bb4: {
         StorageLive(_14);
-        StorageLive(_13);
         _13 = &mut _12;
         _14 = <std::slice::Iter<'_, T> as Iterator>::next(move _13) -> [return: bb5, unwind unreachable];
     }
 
     bb5: {
-        StorageDead(_13);
         _15 = discriminant(_14);
         switchInt(move _15) -> [0: bb6, 1: bb8, otherwise: bb10];
     }
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 d66edb28570..c7c722274f2 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
@@ -98,13 +98,11 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
 
     bb4: {
         StorageLive(_14);
-        StorageLive(_13);
         _13 = &mut _12;
         _14 = <std::slice::Iter<'_, T> as Iterator>::next(move _13) -> [return: bb5, unwind: bb11];
     }
 
     bb5: {
-        StorageDead(_13);
         _15 = discriminant(_14);
         switchInt(move _15) -> [0: bb6, 1: bb8, otherwise: bb10];
     }
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 485dc9179ce..c76e5315db9 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
@@ -3,16 +3,14 @@
 fn outer(_1: u8) -> u8 {
     debug v => _1;                       // in scope 0 at $DIR/spans.rs:10:14: 10:15
     let mut _0: u8;                      // return place in scope 0 at $DIR/spans.rs:10:24: 10:26
-    let mut _2: &u8;                     // in scope 0 at $DIR/spans.rs:11:11: 11:13
+    let _2: &u8;                         // in scope 0 at $DIR/spans.rs:11:11: 11:13
     scope 1 (inlined inner) {            // at $DIR/spans.rs:11:5: 11:14
         debug x => _2;                   // in scope 1 at $DIR/spans.rs:14:14: 14:15
     }
 
     bb0: {
-        StorageLive(_2);                 // scope 0 at $DIR/spans.rs:11:11: 11:13
         _2 = &_1;                        // scope 0 at $DIR/spans.rs:11:11: 11:13
         _0 = _1;                         // scope 1 at $DIR/spans.rs:15:5: 15:7
-        StorageDead(_2);                 // scope 0 at $DIR/spans.rs:11:13: 11:14
         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 485dc9179ce..c76e5315db9 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
@@ -3,16 +3,14 @@
 fn outer(_1: u8) -> u8 {
     debug v => _1;                       // in scope 0 at $DIR/spans.rs:10:14: 10:15
     let mut _0: u8;                      // return place in scope 0 at $DIR/spans.rs:10:24: 10:26
-    let mut _2: &u8;                     // in scope 0 at $DIR/spans.rs:11:11: 11:13
+    let _2: &u8;                         // in scope 0 at $DIR/spans.rs:11:11: 11:13
     scope 1 (inlined inner) {            // at $DIR/spans.rs:11:5: 11:14
         debug x => _2;                   // in scope 1 at $DIR/spans.rs:14:14: 14:15
     }
 
     bb0: {
-        StorageLive(_2);                 // scope 0 at $DIR/spans.rs:11:11: 11:13
         _2 = &_1;                        // scope 0 at $DIR/spans.rs:11:11: 11:13
         _0 = _1;                         // scope 1 at $DIR/spans.rs:15:5: 15:7
-        StorageDead(_2);                 // scope 0 at $DIR/spans.rs:11:13: 11:14
         return;                          // scope 0 at $DIR/spans.rs:12:2: 12:2
     }
 }
diff --git a/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-abort.mir
index 1c9ed25d7f2..0fe4fd37072 100644
--- a/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-abort.mir
@@ -5,61 +5,93 @@ fn vec_deref_to_slice(_1: &Vec<u8>) -> &[u8] {
     let mut _0: &[u8];
     scope 1 (inlined <Vec<u8> as Deref>::deref) {
         debug self => _1;
-        let mut _4: *const u8;
-        let mut _5: usize;
+        let mut _7: usize;
         scope 2 (inlined Vec::<u8>::as_ptr) {
             debug self => _1;
             let mut _2: &alloc::raw_vec::RawVec<u8>;
             scope 3 (inlined alloc::raw_vec::RawVec::<u8>::ptr) {
                 debug self => _2;
-                let mut _3: std::ptr::NonNull<u8>;
-                scope 4 (inlined Unique::<u8>::as_ptr) {
-                    debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _3;
-                    debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
-                    scope 5 (inlined NonNull::<u8>::as_ptr) {
+                let mut _3: &alloc::raw_vec::RawVecInner;
+                scope 4 (inlined alloc::raw_vec::RawVecInner::ptr::<u8>) {
+                    debug self => _3;
+                    let mut _6: std::ptr::NonNull<u8>;
+                    scope 5 (inlined alloc::raw_vec::RawVecInner::non_null::<u8>) {
                         debug self => _3;
+                        let mut _4: std::ptr::NonNull<u8>;
+                        scope 6 (inlined Unique::<u8>::cast::<u8>) {
+                            debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _4;
+                            debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
+                            scope 7 (inlined NonNull::<u8>::cast::<u8>) {
+                                debug self => _4;
+                                scope 8 (inlined NonNull::<u8>::as_ptr) {
+                                    debug self => _4;
+                                    let mut _5: *const u8;
+                                }
+                            }
+                        }
+                        scope 9 (inlined #[track_caller] <Unique<u8> as Into<NonNull<u8>>>::into) {
+                            debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _6;
+                            debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
+                            scope 10 (inlined <NonNull<u8> as From<Unique<u8>>>::from) {
+                                debug ((unique: Unique<u8>).0: std::ptr::NonNull<u8>) => _6;
+                                debug ((unique: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
+                                scope 11 (inlined Unique::<u8>::as_non_null_ptr) {
+                                    debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _6;
+                                    debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
+                                }
+                            }
+                        }
+                    }
+                    scope 12 (inlined NonNull::<u8>::as_ptr) {
+                        debug self => _6;
                     }
                 }
             }
         }
-        scope 6 (inlined std::slice::from_raw_parts::<'_, u8>) {
-            debug data => _4;
-            debug len => _5;
-            let _6: *const [u8];
-            scope 7 (inlined core::ub_checks::check_language_ub) {
-                scope 8 (inlined core::ub_checks::check_language_ub::runtime) {
+        scope 13 (inlined std::slice::from_raw_parts::<'_, u8>) {
+            debug data => _5;
+            debug len => _7;
+            let _8: *const [u8];
+            scope 14 (inlined core::ub_checks::check_language_ub) {
+                scope 15 (inlined core::ub_checks::check_language_ub::runtime) {
                 }
             }
-            scope 9 (inlined std::mem::size_of::<u8>) {
+            scope 16 (inlined std::mem::size_of::<u8>) {
             }
-            scope 10 (inlined align_of::<u8>) {
+            scope 17 (inlined align_of::<u8>) {
             }
-            scope 11 (inlined slice_from_raw_parts::<u8>) {
-                debug data => _4;
-                debug len => _5;
-                scope 12 (inlined std::ptr::from_raw_parts::<[u8], u8>) {
-                    debug data_pointer => _4;
-                    debug metadata => _5;
+            scope 18 (inlined slice_from_raw_parts::<u8>) {
+                debug data => _5;
+                debug len => _7;
+                scope 19 (inlined std::ptr::from_raw_parts::<[u8], u8>) {
+                    debug data_pointer => _5;
+                    debug metadata => _7;
                 }
             }
         }
     }
 
     bb0: {
-        StorageLive(_4);
         StorageLive(_2);
         _2 = &((*_1).0: alloc::raw_vec::RawVec<u8>);
         StorageLive(_3);
-        _3 = ((((*_1).0: alloc::raw_vec::RawVec<u8>).0: std::ptr::Unique<u8>).0: std::ptr::NonNull<u8>);
-        _4 = (_3.0: *const u8);
+        _3 = &(((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner);
+        StorageLive(_6);
+        StorageLive(_4);
+        _4 = (((((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique<u8>).0: std::ptr::NonNull<u8>);
+        _5 = (_4.0: *const u8);
+        _6 = NonNull::<u8> { pointer: _5 };
+        StorageDead(_4);
+        StorageDead(_6);
         StorageDead(_3);
         StorageDead(_2);
-        StorageLive(_5);
-        _5 = ((*_1).1: usize);
-        _6 = *const [u8] from (_4, _5);
-        StorageDead(_5);
-        StorageDead(_4);
-        _0 = &(*_6);
+        StorageLive(_7);
+        _7 = ((*_1).1: usize);
+        StorageLive(_8);
+        _8 = *const [u8] from (_5, _7);
+        _0 = &(*_8);
+        StorageDead(_8);
+        StorageDead(_7);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-unwind.mir
index 1c9ed25d7f2..0fe4fd37072 100644
--- a/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/vec_deref.vec_deref_to_slice.PreCodegen.after.panic-unwind.mir
@@ -5,61 +5,93 @@ fn vec_deref_to_slice(_1: &Vec<u8>) -> &[u8] {
     let mut _0: &[u8];
     scope 1 (inlined <Vec<u8> as Deref>::deref) {
         debug self => _1;
-        let mut _4: *const u8;
-        let mut _5: usize;
+        let mut _7: usize;
         scope 2 (inlined Vec::<u8>::as_ptr) {
             debug self => _1;
             let mut _2: &alloc::raw_vec::RawVec<u8>;
             scope 3 (inlined alloc::raw_vec::RawVec::<u8>::ptr) {
                 debug self => _2;
-                let mut _3: std::ptr::NonNull<u8>;
-                scope 4 (inlined Unique::<u8>::as_ptr) {
-                    debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _3;
-                    debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
-                    scope 5 (inlined NonNull::<u8>::as_ptr) {
+                let mut _3: &alloc::raw_vec::RawVecInner;
+                scope 4 (inlined alloc::raw_vec::RawVecInner::ptr::<u8>) {
+                    debug self => _3;
+                    let mut _6: std::ptr::NonNull<u8>;
+                    scope 5 (inlined alloc::raw_vec::RawVecInner::non_null::<u8>) {
                         debug self => _3;
+                        let mut _4: std::ptr::NonNull<u8>;
+                        scope 6 (inlined Unique::<u8>::cast::<u8>) {
+                            debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _4;
+                            debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
+                            scope 7 (inlined NonNull::<u8>::cast::<u8>) {
+                                debug self => _4;
+                                scope 8 (inlined NonNull::<u8>::as_ptr) {
+                                    debug self => _4;
+                                    let mut _5: *const u8;
+                                }
+                            }
+                        }
+                        scope 9 (inlined #[track_caller] <Unique<u8> as Into<NonNull<u8>>>::into) {
+                            debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _6;
+                            debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
+                            scope 10 (inlined <NonNull<u8> as From<Unique<u8>>>::from) {
+                                debug ((unique: Unique<u8>).0: std::ptr::NonNull<u8>) => _6;
+                                debug ((unique: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
+                                scope 11 (inlined Unique::<u8>::as_non_null_ptr) {
+                                    debug ((self: Unique<u8>).0: std::ptr::NonNull<u8>) => _6;
+                                    debug ((self: Unique<u8>).1: std::marker::PhantomData<u8>) => const PhantomData::<u8>;
+                                }
+                            }
+                        }
+                    }
+                    scope 12 (inlined NonNull::<u8>::as_ptr) {
+                        debug self => _6;
                     }
                 }
             }
         }
-        scope 6 (inlined std::slice::from_raw_parts::<'_, u8>) {
-            debug data => _4;
-            debug len => _5;
-            let _6: *const [u8];
-            scope 7 (inlined core::ub_checks::check_language_ub) {
-                scope 8 (inlined core::ub_checks::check_language_ub::runtime) {
+        scope 13 (inlined std::slice::from_raw_parts::<'_, u8>) {
+            debug data => _5;
+            debug len => _7;
+            let _8: *const [u8];
+            scope 14 (inlined core::ub_checks::check_language_ub) {
+                scope 15 (inlined core::ub_checks::check_language_ub::runtime) {
                 }
             }
-            scope 9 (inlined std::mem::size_of::<u8>) {
+            scope 16 (inlined std::mem::size_of::<u8>) {
             }
-            scope 10 (inlined align_of::<u8>) {
+            scope 17 (inlined align_of::<u8>) {
             }
-            scope 11 (inlined slice_from_raw_parts::<u8>) {
-                debug data => _4;
-                debug len => _5;
-                scope 12 (inlined std::ptr::from_raw_parts::<[u8], u8>) {
-                    debug data_pointer => _4;
-                    debug metadata => _5;
+            scope 18 (inlined slice_from_raw_parts::<u8>) {
+                debug data => _5;
+                debug len => _7;
+                scope 19 (inlined std::ptr::from_raw_parts::<[u8], u8>) {
+                    debug data_pointer => _5;
+                    debug metadata => _7;
                 }
             }
         }
     }
 
     bb0: {
-        StorageLive(_4);
         StorageLive(_2);
         _2 = &((*_1).0: alloc::raw_vec::RawVec<u8>);
         StorageLive(_3);
-        _3 = ((((*_1).0: alloc::raw_vec::RawVec<u8>).0: std::ptr::Unique<u8>).0: std::ptr::NonNull<u8>);
-        _4 = (_3.0: *const u8);
+        _3 = &(((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner);
+        StorageLive(_6);
+        StorageLive(_4);
+        _4 = (((((*_1).0: alloc::raw_vec::RawVec<u8>).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique<u8>).0: std::ptr::NonNull<u8>);
+        _5 = (_4.0: *const u8);
+        _6 = NonNull::<u8> { pointer: _5 };
+        StorageDead(_4);
+        StorageDead(_6);
         StorageDead(_3);
         StorageDead(_2);
-        StorageLive(_5);
-        _5 = ((*_1).1: usize);
-        _6 = *const [u8] from (_4, _5);
-        StorageDead(_5);
-        StorageDead(_4);
-        _0 = &(*_6);
+        StorageLive(_7);
+        _7 = ((*_1).1: usize);
+        StorageLive(_8);
+        _8 = *const [u8] from (_5, _7);
+        _0 = &(*_8);
+        StorageDead(_8);
+        StorageDead(_7);
         return;
     }
 }
diff --git a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff
index 8d87438a47a..998b89919d1 100644
--- a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff
+++ b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-abort.diff
@@ -8,9 +8,9 @@
       bb0: {
           StorageLive(_1);
 -         _1 = const <T as MyTrait>::ASSOC_INT;
--         switchInt(_1) -> [7: bb2, 42: bb3, otherwise: bb1];
+-         switchInt(_1) -> [7: bb3, 42: bb2, otherwise: bb1];
 +         nop;
-+         switchInt(const <T as MyTrait>::ASSOC_INT) -> [7: bb2, 42: bb3, otherwise: bb1];
++         switchInt(const <T as MyTrait>::ASSOC_INT) -> [7: bb3, 42: bb2, otherwise: bb1];
       }
   
       bb1: {
@@ -19,12 +19,12 @@
       }
   
       bb2: {
-          _0 = const "hello";
+          _0 = const "towel";
           goto -> bb4;
       }
   
       bb3: {
-          _0 = const "towel";
+          _0 = const "hello";
           goto -> bb4;
       }
   
diff --git a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff
index 8d87438a47a..998b89919d1 100644
--- a/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff
+++ b/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff
@@ -8,9 +8,9 @@
       bb0: {
           StorageLive(_1);
 -         _1 = const <T as MyTrait>::ASSOC_INT;
--         switchInt(_1) -> [7: bb2, 42: bb3, otherwise: bb1];
+-         switchInt(_1) -> [7: bb3, 42: bb2, otherwise: bb1];
 +         nop;
-+         switchInt(const <T as MyTrait>::ASSOC_INT) -> [7: bb2, 42: bb3, otherwise: bb1];
++         switchInt(const <T as MyTrait>::ASSOC_INT) -> [7: bb3, 42: bb2, otherwise: bb1];
       }
   
       bb1: {
@@ -19,12 +19,12 @@
       }
   
       bb2: {
-          _0 = const "hello";
+          _0 = const "towel";
           goto -> bb4;
       }
   
       bb3: {
-          _0 = const "towel";
+          _0 = const "hello";
           goto -> bb4;
       }
   
diff --git a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff
index f192f3feb96..30f66ef6b82 100644
--- a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff
+++ b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-abort.diff
@@ -20,8 +20,8 @@
   
       bb1: {
           StorageDead(_2);
--         switchInt(_1) -> [7: bb3, 42: bb4, otherwise: bb2];
-+         switchInt(const <T as MyTrait>::ASSOC_INT) -> [7: bb3, 42: bb4, otherwise: bb2];
+-         switchInt(_1) -> [7: bb4, 42: bb3, otherwise: bb2];
++         switchInt(const <T as MyTrait>::ASSOC_INT) -> [7: bb4, 42: bb3, otherwise: bb2];
       }
   
       bb2: {
@@ -30,12 +30,12 @@
       }
   
       bb3: {
-          _0 = const "hello";
+          _0 = const "towel";
           goto -> bb5;
       }
   
       bb4: {
-          _0 = const "towel";
+          _0 = const "hello";
           goto -> bb5;
       }
   
diff --git a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff
index 261faf415f3..ed12ad4b93e 100644
--- a/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff
+++ b/tests/mir-opt/single_use_consts.match_const_debug.SingleUseConsts.panic-unwind.diff
@@ -20,8 +20,8 @@
   
       bb1: {
           StorageDead(_2);
--         switchInt(_1) -> [7: bb3, 42: bb4, otherwise: bb2];
-+         switchInt(const <T as MyTrait>::ASSOC_INT) -> [7: bb3, 42: bb4, otherwise: bb2];
+-         switchInt(_1) -> [7: bb4, 42: bb3, otherwise: bb2];
++         switchInt(const <T as MyTrait>::ASSOC_INT) -> [7: bb4, 42: bb3, otherwise: bb2];
       }
   
       bb2: {
@@ -30,12 +30,12 @@
       }
   
       bb3: {
-          _0 = const "hello";
+          _0 = const "towel";
           goto -> bb5;
       }
   
       bb4: {
-          _0 = const "towel";
+          _0 = const "hello";
           goto -> bb5;
       }
   
diff --git a/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UnreachableEnumBranching.diff b/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UnreachableEnumBranching.diff
index 098b620dfaa..c0ea9fae7df 100644
--- a/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UnreachableEnumBranching.diff
+++ b/tests/mir-opt/uninhabited_fallthrough_elimination.eliminate_fallthrough.UnreachableEnumBranching.diff
@@ -8,8 +8,8 @@
   
       bb0: {
           _2 = discriminant(_1);
--         switchInt(move _2) -> [1: bb3, 2: bb2, otherwise: bb1];
-+         switchInt(move _2) -> [1: bb3, 2: bb2, otherwise: bb5];
+-         switchInt(move _2) -> [1: bb2, 2: bb3, otherwise: bb1];
++         switchInt(move _2) -> [1: bb2, 2: bb3, otherwise: bb5];
       }
   
       bb1: {
@@ -18,12 +18,12 @@
       }
   
       bb2: {
-          _0 = const 1_u32;
+          _0 = const 2_u32;
           goto -> bb4;
       }
   
       bb3: {
-          _0 = const 2_u32;
+          _0 = const 1_u32;
           goto -> bb4;
       }
   
diff --git a/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UnreachableEnumBranching.diff b/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UnreachableEnumBranching.diff
index 995e32b033f..2082e8046ad 100644
--- a/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UnreachableEnumBranching.diff
+++ b/tests/mir-opt/uninhabited_fallthrough_elimination.keep_fallthrough.UnreachableEnumBranching.diff
@@ -8,8 +8,8 @@
   
       bb0: {
           _2 = discriminant(_1);
--         switchInt(move _2) -> [0: bb2, 1: bb3, otherwise: bb1];
-+         switchInt(move _2) -> [0: bb5, 1: bb3, 2: bb1, otherwise: bb5];
+-         switchInt(move _2) -> [0: bb3, 1: bb2, otherwise: bb1];
++         switchInt(move _2) -> [0: bb5, 1: bb2, 2: bb1, otherwise: bb5];
       }
   
       bb1: {
@@ -18,12 +18,12 @@
       }
   
       bb2: {
-          _0 = const 1_u32;
+          _0 = const 2_u32;
           goto -> bb4;
       }
   
       bb3: {
-          _0 = const 2_u32;
+          _0 = const 1_u32;
           goto -> bb4;
       }
   
diff --git a/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-abort.diff b/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-abort.diff
index da7a2bd10e0..1e1ddfae0eb 100644
--- a/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-abort.diff
+++ b/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-abort.diff
@@ -19,14 +19,16 @@
   
       bb1: {
           _2 = discriminant(_1);
--         switchInt(move _2) -> [0: bb4, 1: bb3, otherwise: bb2];
-+         _5 = Eq(_2, const 0_isize);
+-         switchInt(move _2) -> [1: bb3, otherwise: bb2];
++         _5 = Ne(_2, const 1_isize);
 +         assume(move _5);
-+         goto -> bb4;
++         goto -> bb2;
       }
   
       bb2: {
-          unreachable;
+          _0 = const ();
+          StorageDead(_1);
+          return;
       }
   
       bb3: {
@@ -35,11 +37,5 @@
 -         StorageLive(_4);
           unreachable;
       }
-  
-      bb4: {
-          _0 = const ();
-          StorageDead(_1);
-          return;
-      }
   }
   
diff --git a/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff b/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff
index a2121fc684f..809d24aa15a 100644
--- a/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff
+++ b/tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff
@@ -19,14 +19,16 @@
   
       bb1: {
           _2 = discriminant(_1);
--         switchInt(move _2) -> [0: bb4, 1: bb3, otherwise: bb2];
-+         _5 = Eq(_2, const 0_isize);
+-         switchInt(move _2) -> [1: bb3, otherwise: bb2];
++         _5 = Ne(_2, const 1_isize);
 +         assume(move _5);
-+         goto -> bb4;
++         goto -> bb2;
       }
   
       bb2: {
-          unreachable;
+          _0 = const ();
+          StorageDead(_1);
+          return;
       }
   
       bb3: {
@@ -35,11 +37,5 @@
 -         StorageLive(_4);
           unreachable;
       }
-  
-      bb4: {
-          _0 = const ();
-          StorageDead(_1);
-          return;
-      }
   }
   
diff --git a/tests/mir-opt/unreachable.rs b/tests/mir-opt/unreachable.rs
index 881e3542f0a..f7f4815ae7c 100644
--- a/tests/mir-opt/unreachable.rs
+++ b/tests/mir-opt/unreachable.rs
@@ -45,18 +45,16 @@ fn as_match() {
     // CHECK: bb0: {
     // CHECK: {{_.*}} = empty()
     // CHECK: bb1: {
-    // CHECK: [[eq:_.*]] = Eq({{.*}}, const 0_isize);
+    // CHECK: [[eq:_.*]] = Ne({{.*}}, const 1_isize);
     // CHECK-NEXT: assume(move [[eq]]);
-    // CHECK-NEXT: goto -> bb4;
+    // CHECK-NEXT: goto -> bb2;
     // CHECK: bb2: {
-    // CHECK-NEXT: unreachable;
+    // CHECK: return;
     // CHECK: bb3: {
     // CHECK-NEXT: unreachable;
-    // CHECK: bb4: {
-    // CHECK: return;
     match empty() {
-        None => {}
         Some(_x) => match _x {},
+        None => {}
     }
 }
 
diff --git a/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-abort.diff
index e5dab5d52a6..ed54a38f70b 100644
--- a/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-abort.diff
+++ b/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-abort.diff
@@ -30,8 +30,8 @@
           StorageLive(_4);
           _4 = &(_1.1: Test3);
           _5 = discriminant((*_4));
--         switchInt(move _5) -> [0: bb3, 1: bb4, 2: bb5, 3: bb2, otherwise: bb1];
-+         switchInt(move _5) -> [0: bb1, 1: bb1, 2: bb5, 3: bb2, otherwise: bb1];
+-         switchInt(move _5) -> [0: bb5, 1: bb4, 2: bb3, 3: bb2, otherwise: bb1];
++         switchInt(move _5) -> [0: bb1, 1: bb1, 2: bb3, 3: bb2, otherwise: bb1];
       }
   
       bb1: {
@@ -47,7 +47,10 @@
       }
   
       bb3: {
-          _3 = const "A(Empty)";
+          StorageLive(_7);
+          _7 = const "C";
+          _3 = &(*_7);
+          StorageDead(_7);
           goto -> bb6;
       }
   
@@ -60,10 +63,7 @@
       }
   
       bb5: {
-          StorageLive(_7);
-          _7 = const "C";
-          _3 = &(*_7);
-          StorageDead(_7);
+          _3 = const "A(Empty)";
           goto -> bb6;
       }
   
@@ -72,8 +72,8 @@
           StorageDead(_3);
           StorageLive(_9);
           _10 = discriminant((_1.1: Test3));
--         switchInt(move _10) -> [0: bb8, 1: bb9, 2: bb10, 3: bb7, otherwise: bb1];
-+         switchInt(move _10) -> [0: bb1, 1: bb1, 2: bb10, 3: bb7, otherwise: bb1];
+-         switchInt(move _10) -> [0: bb10, 1: bb9, 2: bb8, 3: bb7, otherwise: bb1];
++         switchInt(move _10) -> [0: bb1, 1: bb1, 2: bb8, 3: bb7, otherwise: bb1];
       }
   
       bb7: {
@@ -85,7 +85,10 @@
       }
   
       bb8: {
-          _9 = const "A(Empty)";
+          StorageLive(_12);
+          _12 = const "C";
+          _9 = &(*_12);
+          StorageDead(_12);
           goto -> bb11;
       }
   
@@ -98,10 +101,7 @@
       }
   
       bb10: {
-          StorageLive(_12);
-          _12 = const "C";
-          _9 = &(*_12);
-          StorageDead(_12);
+          _9 = const "A(Empty)";
           goto -> bb11;
       }
   
diff --git a/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-unwind.diff
index e5dab5d52a6..ed54a38f70b 100644
--- a/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-unwind.diff
+++ b/tests/mir-opt/unreachable_enum_branching.byref.UnreachableEnumBranching.panic-unwind.diff
@@ -30,8 +30,8 @@
           StorageLive(_4);
           _4 = &(_1.1: Test3);
           _5 = discriminant((*_4));
--         switchInt(move _5) -> [0: bb3, 1: bb4, 2: bb5, 3: bb2, otherwise: bb1];
-+         switchInt(move _5) -> [0: bb1, 1: bb1, 2: bb5, 3: bb2, otherwise: bb1];
+-         switchInt(move _5) -> [0: bb5, 1: bb4, 2: bb3, 3: bb2, otherwise: bb1];
++         switchInt(move _5) -> [0: bb1, 1: bb1, 2: bb3, 3: bb2, otherwise: bb1];
       }
   
       bb1: {
@@ -47,7 +47,10 @@
       }
   
       bb3: {
-          _3 = const "A(Empty)";
+          StorageLive(_7);
+          _7 = const "C";
+          _3 = &(*_7);
+          StorageDead(_7);
           goto -> bb6;
       }
   
@@ -60,10 +63,7 @@
       }
   
       bb5: {
-          StorageLive(_7);
-          _7 = const "C";
-          _3 = &(*_7);
-          StorageDead(_7);
+          _3 = const "A(Empty)";
           goto -> bb6;
       }
   
@@ -72,8 +72,8 @@
           StorageDead(_3);
           StorageLive(_9);
           _10 = discriminant((_1.1: Test3));
--         switchInt(move _10) -> [0: bb8, 1: bb9, 2: bb10, 3: bb7, otherwise: bb1];
-+         switchInt(move _10) -> [0: bb1, 1: bb1, 2: bb10, 3: bb7, otherwise: bb1];
+-         switchInt(move _10) -> [0: bb10, 1: bb9, 2: bb8, 3: bb7, otherwise: bb1];
++         switchInt(move _10) -> [0: bb1, 1: bb1, 2: bb8, 3: bb7, otherwise: bb1];
       }
   
       bb7: {
@@ -85,7 +85,10 @@
       }
   
       bb8: {
-          _9 = const "A(Empty)";
+          StorageLive(_12);
+          _12 = const "C";
+          _9 = &(*_12);
+          StorageDead(_12);
           goto -> bb11;
       }
   
@@ -98,10 +101,7 @@
       }
   
       bb10: {
-          StorageLive(_12);
-          _12 = const "C";
-          _9 = &(*_12);
-          StorageDead(_12);
+          _9 = const "A(Empty)";
           goto -> bb11;
       }
   
diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-abort.diff
index 02b9f02f4c0..be934ac688b 100644
--- a/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-abort.diff
+++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-abort.diff
@@ -14,7 +14,7 @@
           StorageLive(_2);
           _2 = Test1::C;
           _3 = discriminant(_2);
--         switchInt(move _3) -> [0: bb2, 1: bb3, otherwise: bb1];
+-         switchInt(move _3) -> [0: bb3, 1: bb2, otherwise: bb1];
 +         switchInt(move _3) -> [0: bb5, 1: bb5, 2: bb1, otherwise: bb5];
       }
   
@@ -27,11 +27,6 @@
       }
   
       bb2: {
-          _1 = const "A(Empty)";
-          goto -> bb4;
-      }
-  
-      bb3: {
           StorageLive(_4);
           _4 = const "B(Empty)";
           _1 = &(*_4);
@@ -39,6 +34,11 @@
           goto -> bb4;
       }
   
+      bb3: {
+          _1 = const "A(Empty)";
+          goto -> bb4;
+      }
+  
       bb4: {
           StorageDead(_2);
           StorageDead(_1);
diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-unwind.diff
index 02b9f02f4c0..be934ac688b 100644
--- a/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-unwind.diff
+++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t1.UnreachableEnumBranching.panic-unwind.diff
@@ -14,7 +14,7 @@
           StorageLive(_2);
           _2 = Test1::C;
           _3 = discriminant(_2);
--         switchInt(move _3) -> [0: bb2, 1: bb3, otherwise: bb1];
+-         switchInt(move _3) -> [0: bb3, 1: bb2, otherwise: bb1];
 +         switchInt(move _3) -> [0: bb5, 1: bb5, 2: bb1, otherwise: bb5];
       }
   
@@ -27,11 +27,6 @@
       }
   
       bb2: {
-          _1 = const "A(Empty)";
-          goto -> bb4;
-      }
-  
-      bb3: {
           StorageLive(_4);
           _4 = const "B(Empty)";
           _1 = &(*_4);
@@ -39,6 +34,11 @@
           goto -> bb4;
       }
   
+      bb3: {
+          _1 = const "A(Empty)";
+          goto -> bb4;
+      }
+  
       bb4: {
           StorageDead(_2);
           StorageDead(_1);
diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-abort.diff
index d3376442376..120061841a0 100644
--- a/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-abort.diff
+++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-abort.diff
@@ -14,7 +14,7 @@
           StorageLive(_2);
           _2 = Test3::C;
           _3 = discriminant(_2);
--         switchInt(move _3) -> [0: bb2, 1: bb3, otherwise: bb1];
+-         switchInt(move _3) -> [0: bb3, 1: bb2, otherwise: bb1];
 +         switchInt(move _3) -> [0: bb5, 1: bb5, otherwise: bb1];
       }
   
@@ -27,11 +27,6 @@
       }
   
       bb2: {
-          _1 = const "A(Empty)";
-          goto -> bb4;
-      }
-  
-      bb3: {
           StorageLive(_4);
           _4 = const "B(Empty)";
           _1 = &(*_4);
@@ -39,6 +34,11 @@
           goto -> bb4;
       }
   
+      bb3: {
+          _1 = const "A(Empty)";
+          goto -> bb4;
+      }
+  
       bb4: {
           StorageDead(_2);
           StorageDead(_1);
diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-unwind.diff
index d3376442376..120061841a0 100644
--- a/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-unwind.diff
+++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t3.UnreachableEnumBranching.panic-unwind.diff
@@ -14,7 +14,7 @@
           StorageLive(_2);
           _2 = Test3::C;
           _3 = discriminant(_2);
--         switchInt(move _3) -> [0: bb2, 1: bb3, otherwise: bb1];
+-         switchInt(move _3) -> [0: bb3, 1: bb2, otherwise: bb1];
 +         switchInt(move _3) -> [0: bb5, 1: bb5, otherwise: bb1];
       }
   
@@ -27,11 +27,6 @@
       }
   
       bb2: {
-          _1 = const "A(Empty)";
-          goto -> bb4;
-      }
-  
-      bb3: {
           StorageLive(_4);
           _4 = const "B(Empty)";
           _1 = &(*_4);
@@ -39,6 +34,11 @@
           goto -> bb4;
       }
   
+      bb3: {
+          _1 = const "A(Empty)";
+          goto -> bb4;
+      }
+  
       bb4: {
           StorageDead(_2);
           StorageDead(_1);
diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-abort.diff
index 8f0d5b7cd99..b86814d6119 100644
--- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-abort.diff
+++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-abort.diff
@@ -14,7 +14,7 @@
           StorageLive(_2);
           _2 = Test4::C;
           _3 = discriminant(_2);
-          switchInt(move _3) -> [0: bb2, 1: bb3, otherwise: bb1];
+          switchInt(move _3) -> [0: bb3, 1: bb2, otherwise: bb1];
       }
   
       bb1: {
@@ -26,11 +26,6 @@
       }
   
       bb2: {
-          _1 = const "A(i32)";
-          goto -> bb4;
-      }
-  
-      bb3: {
           StorageLive(_4);
           _4 = const "B(i32)";
           _1 = &(*_4);
@@ -38,6 +33,11 @@
           goto -> bb4;
       }
   
+      bb3: {
+          _1 = const "A(i32)";
+          goto -> bb4;
+      }
+  
       bb4: {
           StorageDead(_2);
           StorageDead(_1);
diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-unwind.diff
index 8f0d5b7cd99..b86814d6119 100644
--- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-unwind.diff
+++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4.UnreachableEnumBranching.panic-unwind.diff
@@ -14,7 +14,7 @@
           StorageLive(_2);
           _2 = Test4::C;
           _3 = discriminant(_2);
-          switchInt(move _3) -> [0: bb2, 1: bb3, otherwise: bb1];
+          switchInt(move _3) -> [0: bb3, 1: bb2, otherwise: bb1];
       }
   
       bb1: {
@@ -26,11 +26,6 @@
       }
   
       bb2: {
-          _1 = const "A(i32)";
-          goto -> bb4;
-      }
-  
-      bb3: {
           StorageLive(_4);
           _4 = const "B(i32)";
           _1 = &(*_4);
@@ -38,6 +33,11 @@
           goto -> bb4;
       }
   
+      bb3: {
+          _1 = const "A(i32)";
+          goto -> bb4;
+      }
+  
       bb4: {
           StorageDead(_2);
           StorageDead(_1);
diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-abort.diff
index b1ecd008582..424ac6ba651 100644
--- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-abort.diff
+++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-abort.diff
@@ -15,8 +15,8 @@
           StorageLive(_2);
           _2 = Test4::C;
           _3 = discriminant(_2);
--         switchInt(move _3) -> [0: bb2, 1: bb3, 2: bb4, otherwise: bb1];
-+         switchInt(move _3) -> [0: bb2, 1: bb3, 2: bb4, 3: bb1, otherwise: bb6];
+-         switchInt(move _3) -> [0: bb4, 1: bb3, 2: bb2, otherwise: bb1];
++         switchInt(move _3) -> [0: bb4, 1: bb3, 2: bb2, 3: bb1, otherwise: bb6];
       }
   
       bb1: {
@@ -28,7 +28,10 @@
       }
   
       bb2: {
-          _1 = const "A(i32)";
+          StorageLive(_5);
+          _5 = const "C";
+          _1 = &(*_5);
+          StorageDead(_5);
           goto -> bb5;
       }
   
@@ -41,10 +44,7 @@
       }
   
       bb4: {
-          StorageLive(_5);
-          _5 = const "C";
-          _1 = &(*_5);
-          StorageDead(_5);
+          _1 = const "A(i32)";
           goto -> bb5;
       }
   
diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-unwind.diff
index b1ecd008582..424ac6ba651 100644
--- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-unwind.diff
+++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default.UnreachableEnumBranching.panic-unwind.diff
@@ -15,8 +15,8 @@
           StorageLive(_2);
           _2 = Test4::C;
           _3 = discriminant(_2);
--         switchInt(move _3) -> [0: bb2, 1: bb3, 2: bb4, otherwise: bb1];
-+         switchInt(move _3) -> [0: bb2, 1: bb3, 2: bb4, 3: bb1, otherwise: bb6];
+-         switchInt(move _3) -> [0: bb4, 1: bb3, 2: bb2, otherwise: bb1];
++         switchInt(move _3) -> [0: bb4, 1: bb3, 2: bb2, 3: bb1, otherwise: bb6];
       }
   
       bb1: {
@@ -28,7 +28,10 @@
       }
   
       bb2: {
-          _1 = const "A(i32)";
+          StorageLive(_5);
+          _5 = const "C";
+          _1 = &(*_5);
+          StorageDead(_5);
           goto -> bb5;
       }
   
@@ -41,10 +44,7 @@
       }
   
       bb4: {
-          StorageLive(_5);
-          _5 = const "C";
-          _1 = &(*_5);
-          StorageDead(_5);
+          _1 = const "A(i32)";
           goto -> bb5;
       }
   
diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff
index 28c6d4fb675..4cd6d3f5683 100644
--- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff
+++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-abort.diff
@@ -16,8 +16,8 @@
           StorageLive(_2);
           _2 = Test4::C;
           _3 = discriminant(_2);
--         switchInt(move _3) -> [0: bb2, 1: bb5, 2: bb6, otherwise: bb1];
-+         switchInt(move _3) -> [0: bb2, 1: bb5, 2: bb6, 3: bb1, otherwise: bb8];
+-         switchInt(move _3) -> [0: bb2, 1: bb4, 2: bb3, otherwise: bb1];
++         switchInt(move _3) -> [0: bb2, 1: bb4, 2: bb3, 3: bb1, otherwise: bb8];
       }
   
       bb1: {
@@ -29,23 +29,18 @@
       }
   
       bb2: {
-          switchInt(((_2 as A).0: i32)) -> [1: bb3, 2: bb4, otherwise: bb1];
+          switchInt(((_2 as A).0: i32)) -> [1: bb6, 2: bb5, otherwise: bb1];
       }
   
       bb3: {
-          _1 = const "A(1)";
+          StorageLive(_6);
+          _6 = const "C";
+          _1 = &(*_6);
+          StorageDead(_6);
           goto -> bb7;
       }
   
       bb4: {
-          StorageLive(_4);
-          _4 = const "A(2)";
-          _1 = &(*_4);
-          StorageDead(_4);
-          goto -> bb7;
-      }
-  
-      bb5: {
           StorageLive(_5);
           _5 = const "B(i32)";
           _1 = &(*_5);
@@ -53,11 +48,16 @@
           goto -> bb7;
       }
   
+      bb5: {
+          StorageLive(_4);
+          _4 = const "A(2)";
+          _1 = &(*_4);
+          StorageDead(_4);
+          goto -> bb7;
+      }
+  
       bb6: {
-          StorageLive(_6);
-          _6 = const "C";
-          _1 = &(*_6);
-          StorageDead(_6);
+          _1 = const "A(1)";
           goto -> bb7;
       }
   
diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff
index 28c6d4fb675..4cd6d3f5683 100644
--- a/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff
+++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t4_unreachable_default_2.UnreachableEnumBranching.panic-unwind.diff
@@ -16,8 +16,8 @@
           StorageLive(_2);
           _2 = Test4::C;
           _3 = discriminant(_2);
--         switchInt(move _3) -> [0: bb2, 1: bb5, 2: bb6, otherwise: bb1];
-+         switchInt(move _3) -> [0: bb2, 1: bb5, 2: bb6, 3: bb1, otherwise: bb8];
+-         switchInt(move _3) -> [0: bb2, 1: bb4, 2: bb3, otherwise: bb1];
++         switchInt(move _3) -> [0: bb2, 1: bb4, 2: bb3, 3: bb1, otherwise: bb8];
       }
   
       bb1: {
@@ -29,23 +29,18 @@
       }
   
       bb2: {
-          switchInt(((_2 as A).0: i32)) -> [1: bb3, 2: bb4, otherwise: bb1];
+          switchInt(((_2 as A).0: i32)) -> [1: bb6, 2: bb5, otherwise: bb1];
       }
   
       bb3: {
-          _1 = const "A(1)";
+          StorageLive(_6);
+          _6 = const "C";
+          _1 = &(*_6);
+          StorageDead(_6);
           goto -> bb7;
       }
   
       bb4: {
-          StorageLive(_4);
-          _4 = const "A(2)";
-          _1 = &(*_4);
-          StorageDead(_4);
-          goto -> bb7;
-      }
-  
-      bb5: {
           StorageLive(_5);
           _5 = const "B(i32)";
           _1 = &(*_5);
@@ -53,11 +48,16 @@
           goto -> bb7;
       }
   
+      bb5: {
+          StorageLive(_4);
+          _4 = const "A(2)";
+          _1 = &(*_4);
+          StorageDead(_4);
+          goto -> bb7;
+      }
+  
       bb6: {
-          StorageLive(_6);
-          _6 = const "C";
-          _1 = &(*_6);
-          StorageDead(_6);
+          _1 = const "A(1)";
           goto -> bb7;
       }
   
diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-abort.diff
index f36a7efd80d..2de1f77eeec 100644
--- a/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-abort.diff
+++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-abort.diff
@@ -15,8 +15,8 @@
           StorageLive(_2);
           _2 = Test5::<T>::C;
           _3 = discriminant(_2);
--         switchInt(move _3) -> [255: bb2, 0: bb3, 5: bb4, otherwise: bb1];
-+         switchInt(move _3) -> [255: bb2, 0: bb3, 5: bb4, 3: bb1, otherwise: bb7];
+-         switchInt(move _3) -> [255: bb4, 0: bb3, 5: bb2, otherwise: bb1];
++         switchInt(move _3) -> [255: bb4, 0: bb3, 5: bb2, 3: bb1, otherwise: bb7];
       }
   
       bb1: {
@@ -28,7 +28,10 @@
       }
   
       bb2: {
-          _1 = const "A(T)";
+          StorageLive(_5);
+          _5 = const "C";
+          _1 = &(*_5);
+          StorageDead(_5);
           goto -> bb5;
       }
   
@@ -41,10 +44,7 @@
       }
   
       bb4: {
-          StorageLive(_5);
-          _5 = const "C";
-          _1 = &(*_5);
-          StorageDead(_5);
+          _1 = const "A(T)";
           goto -> bb5;
       }
   
diff --git a/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-unwind.diff
index 20e31c24c84..5afb78c58a3 100644
--- a/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-unwind.diff
+++ b/tests/mir-opt/unreachable_enum_branching.otherwise_t5_unreachable_default.UnreachableEnumBranching.panic-unwind.diff
@@ -15,8 +15,8 @@
           StorageLive(_2);
           _2 = Test5::<T>::C;
           _3 = discriminant(_2);
--         switchInt(move _3) -> [255: bb2, 0: bb3, 5: bb4, otherwise: bb1];
-+         switchInt(move _3) -> [255: bb2, 0: bb3, 5: bb4, 3: bb1, otherwise: bb8];
+-         switchInt(move _3) -> [255: bb4, 0: bb3, 5: bb2, otherwise: bb1];
++         switchInt(move _3) -> [255: bb4, 0: bb3, 5: bb2, 3: bb1, otherwise: bb8];
       }
   
       bb1: {
@@ -28,7 +28,10 @@
       }
   
       bb2: {
-          _1 = const "A(T)";
+          StorageLive(_5);
+          _5 = const "C";
+          _1 = &(*_5);
+          StorageDead(_5);
           goto -> bb5;
       }
   
@@ -41,10 +44,7 @@
       }
   
       bb4: {
-          StorageLive(_5);
-          _5 = const "C";
-          _1 = &(*_5);
-          StorageDead(_5);
+          _1 = const "A(T)";
           goto -> bb5;
       }
   
diff --git a/tests/mir-opt/unreachable_enum_branching.rs b/tests/mir-opt/unreachable_enum_branching.rs
index 6005dc546dc..7647f9bf077 100644
--- a/tests/mir-opt/unreachable_enum_branching.rs
+++ b/tests/mir-opt/unreachable_enum_branching.rs
@@ -49,7 +49,7 @@ struct Plop {
 fn simple() {
     // CHECK-LABEL: fn simple(
     // CHECK: [[discr:_.*]] = discriminant(
-    // CHECK: switchInt(move [[discr]]) -> [0: [[unreachable:bb.*]], 1: [[unreachable]], 2: bb2, otherwise: [[unreachable]]];
+    // CHECK: switchInt(move [[discr]]) -> [0: [[unreachable:bb.*]], 1: [[unreachable]], 2: bb1, otherwise: [[unreachable]]];
     // CHECK: [[unreachable]]: {
     // CHECK-NEXT: unreachable;
     match Test1::C {
@@ -120,7 +120,7 @@ fn otherwise_t3() {
 fn otherwise_t4_unreachable_default() {
     // CHECK-LABEL: fn otherwise_t4_unreachable_default(
     // CHECK: [[discr:_.*]] = discriminant(
-    // CHECK: switchInt(move [[discr]]) -> [0: bb2, 1: bb3, 2: bb4, 3: bb1, otherwise: [[unreachable:bb.*]]];
+    // CHECK: switchInt(move [[discr]]) -> [0: {{bb.*}}, 1: {{bb.*}}, 2: {{bb.*}}, 3: {{bb.*}}, otherwise: [[unreachable:bb.*]]];
     // CHECK: [[unreachable]]: {
     // CHECK-NEXT: unreachable;
     match Test4::C {
@@ -135,7 +135,7 @@ fn otherwise_t4_unreachable_default() {
 fn otherwise_t4_unreachable_default_2() {
     // CHECK-LABEL: fn otherwise_t4_unreachable_default_2(
     // CHECK: [[discr:_.*]] = discriminant(
-    // CHECK: switchInt(move [[discr]]) -> [0: bb2, 1: bb5, 2: bb6, 3: bb1, otherwise: [[unreachable:bb.*]]];
+    // CHECK: switchInt(move [[discr]]) -> [0: {{bb.*}}, 1: {{bb.*}}, 2: {{bb.*}}, 3: {{bb.*}}, otherwise: [[unreachable:bb.*]]];
     // CHECK: [[unreachable]]: {
     // CHECK-NEXT: unreachable;
     match Test4::C {
@@ -151,7 +151,7 @@ fn otherwise_t4_unreachable_default_2() {
 fn otherwise_t4() {
     // CHECK-LABEL: fn otherwise_t4(
     // CHECK: [[discr:_.*]] = discriminant(
-    // CHECK: switchInt(move [[discr]]) -> [0: bb2, 1: bb3, otherwise: [[unreachable:bb.*]]];
+    // CHECK: switchInt(move [[discr]]) -> [0: {{bb.*}}, 1: {{bb.*}}, otherwise: [[unreachable:bb.*]]];
     // CHECK: [[unreachable]]: {
     // CHECK-NOT: unreachable;
     // CHECK: }
@@ -166,7 +166,7 @@ fn otherwise_t4() {
 fn otherwise_t5_unreachable_default<T>() {
     // CHECK-LABEL: fn otherwise_t5_unreachable_default(
     // CHECK: [[discr:_.*]] = discriminant(
-    // CHECK: switchInt(move [[discr]]) -> [255: bb2, 0: bb3, 5: bb4, 3: bb1, otherwise: [[unreachable:bb.*]]];
+    // CHECK: switchInt(move [[discr]]) -> [255: {{bb.*}}, 0: {{bb.*}}, 5: {{bb.*}}, 3: {{bb.*}}, otherwise: [[unreachable:bb.*]]];
     // CHECK: [[unreachable]]: {
     // CHECK-NEXT: unreachable;
     match Test5::<T>::C {
@@ -183,7 +183,7 @@ fn byref() {
     let plop = Plop { xx: 51, test3: Test3::C };
 
     // CHECK: [[ref_discr:_.*]] = discriminant((*
-    // CHECK: switchInt(move [[ref_discr]]) -> [0: [[unreachable:bb.*]], 1: [[unreachable]], 2: bb5, 3: bb2, otherwise: [[unreachable]]];
+    // CHECK: switchInt(move [[ref_discr]]) -> [0: [[unreachable:bb.*]], 1: [[unreachable]], 2: {{bb.*}}, 3: {{bb.*}}, otherwise: [[unreachable]]];
     match &plop.test3 {
         Test3::A(_) => "A(Empty)",
         Test3::B(_) => "B(Empty)",
@@ -195,7 +195,7 @@ fn byref() {
     // CHECK-NEXT: unreachable;
 
     // CHECK: [[discr:_.*]] = discriminant(
-    // CHECK: switchInt(move [[discr]]) -> [0: [[unreachable]], 1: [[unreachable]], 2: bb10, 3: bb7, otherwise: [[unreachable]]];
+    // CHECK: switchInt(move [[discr]]) -> [0: [[unreachable]], 1: [[unreachable]], 2: {{bb.*}}, 3: {{bb.*}}, otherwise: [[unreachable]]];
     match plop.test3 {
         Test3::A(_) => "A(Empty)",
         Test3::B(_) => "B(Empty)",
diff --git a/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-abort.diff b/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-abort.diff
index a85fc0da992..5c08648fac3 100644
--- a/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-abort.diff
+++ b/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-abort.diff
@@ -14,40 +14,40 @@
           StorageLive(_2);
           _2 = Test1::C;
           _3 = discriminant(_2);
--         switchInt(move _3) -> [0: bb3, 1: bb4, 2: bb2, otherwise: bb1];
-+         switchInt(move _3) -> [0: bb1, 1: bb1, 2: bb2, otherwise: bb1];
+-         switchInt(move _3) -> [0: bb3, 1: bb2, otherwise: bb1];
++         switchInt(move _3) -> [0: bb5, 1: bb5, 2: bb1, otherwise: bb5];
       }
   
       bb1: {
-          unreachable;
-      }
-  
-      bb2: {
           StorageLive(_5);
           _5 = const "C";
           _1 = &(*_5);
           StorageDead(_5);
-          goto -> bb5;
-      }
-  
-      bb3: {
-          _1 = const "A(Empty)";
-          goto -> bb5;
+          goto -> bb4;
       }
   
-      bb4: {
+      bb2: {
           StorageLive(_4);
           _4 = const "B(Empty)";
           _1 = &(*_4);
           StorageDead(_4);
-          goto -> bb5;
+          goto -> bb4;
       }
   
-      bb5: {
+      bb3: {
+          _1 = const "A(Empty)";
+          goto -> bb4;
+      }
+  
+      bb4: {
           StorageDead(_2);
           StorageDead(_1);
           _0 = const ();
           return;
++     }
++ 
++     bb5: {
++         unreachable;
       }
   }
   
diff --git a/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-unwind.diff b/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-unwind.diff
index a85fc0da992..5c08648fac3 100644
--- a/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-unwind.diff
+++ b/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-unwind.diff
@@ -14,40 +14,40 @@
           StorageLive(_2);
           _2 = Test1::C;
           _3 = discriminant(_2);
--         switchInt(move _3) -> [0: bb3, 1: bb4, 2: bb2, otherwise: bb1];
-+         switchInt(move _3) -> [0: bb1, 1: bb1, 2: bb2, otherwise: bb1];
+-         switchInt(move _3) -> [0: bb3, 1: bb2, otherwise: bb1];
++         switchInt(move _3) -> [0: bb5, 1: bb5, 2: bb1, otherwise: bb5];
       }
   
       bb1: {
-          unreachable;
-      }
-  
-      bb2: {
           StorageLive(_5);
           _5 = const "C";
           _1 = &(*_5);
           StorageDead(_5);
-          goto -> bb5;
-      }
-  
-      bb3: {
-          _1 = const "A(Empty)";
-          goto -> bb5;
+          goto -> bb4;
       }
   
-      bb4: {
+      bb2: {
           StorageLive(_4);
           _4 = const "B(Empty)";
           _1 = &(*_4);
           StorageDead(_4);
-          goto -> bb5;
+          goto -> bb4;
       }
   
-      bb5: {
+      bb3: {
+          _1 = const "A(Empty)";
+          goto -> bb4;
+      }
+  
+      bb4: {
           StorageDead(_2);
           StorageDead(_1);
           _0 = const ();
           return;
++     }
++ 
++     bb5: {
++         unreachable;
       }
   }
   
diff --git a/tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs b/tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs
index fec4a4bb90b..024ce975cd6 100644
--- a/tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs
+++ b/tests/run-make/CURRENT_RUSTC_VERSION/rmake.rs
@@ -3,8 +3,6 @@
 // Check that the `CURRENT_RUSTC_VERSION` placeholder is correctly replaced by the current
 // `rustc` version and the `since` property in feature stability gating is properly respected.
 
-use std::path::PathBuf;
-
 use run_make_support::{aux_build, rfs, rustc, source_root};
 
 fn main() {
diff --git a/tests/run-make/arguments-non-c-like-enum/rmake.rs b/tests/run-make/arguments-non-c-like-enum/rmake.rs
index 036691e8509..f8e077e0a79 100644
--- a/tests/run-make/arguments-non-c-like-enum/rmake.rs
+++ b/tests/run-make/arguments-non-c-like-enum/rmake.rs
@@ -4,8 +4,6 @@
 use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib_name};
 
 pub fn main() {
-    use std::path::Path;
-
     rustc().input("nonclike.rs").crate_type("staticlib").run();
     cc().input("test.c")
         .input(static_lib_name("nonclike"))
diff --git a/tests/run-make/branch-protection-check-IBT/_rmake.rs b/tests/run-make/branch-protection-check-IBT/_rmake.rs
index d66ecf9c005..91151408785 100644
--- a/tests/run-make/branch-protection-check-IBT/_rmake.rs
+++ b/tests/run-make/branch-protection-check-IBT/_rmake.rs
@@ -8,9 +8,7 @@
 //@ ignore-test
 // FIXME(jieyouxu): see the FIXME in the Makefile
 
-use run_make_support::llvm_readobj;
-use run_make_support::rustc;
-use run_make_support::{cwd, env_var};
+use run_make_support::{cwd, env_var, llvm_readobj, rustc};
 
 fn main() {
     let llvm_components = env_var("LLVM_COMPONENTS");
diff --git a/tests/run-make/c-link-to-rust-staticlib/rmake.rs b/tests/run-make/c-link-to-rust-staticlib/rmake.rs
index ee35350da66..6d045012e95 100644
--- a/tests/run-make/c-link-to-rust-staticlib/rmake.rs
+++ b/tests/run-make/c-link-to-rust-staticlib/rmake.rs
@@ -5,7 +5,6 @@
 
 use run_make_support::rfs::remove_file;
 use run_make_support::{cc, extra_c_flags, run, rustc, static_lib_name};
-use std::fs;
 
 fn main() {
     rustc().input("foo.rs").run();
diff --git a/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs b/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs
index 196c6440747..0a959c3bd88 100644
--- a/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs
+++ b/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs
@@ -1,9 +1,7 @@
 #![crate_type = "staticlib"]
 #![feature(c_variadic)]
 
-use std::ffi::VaList;
-use std::ffi::{c_char, c_double, c_int, c_long, c_longlong};
-use std::ffi::{CStr, CString};
+use std::ffi::{c_char, c_double, c_int, c_long, c_longlong, CStr, CString, VaList};
 
 macro_rules! continue_if {
     ($cond:expr) => {
diff --git a/tests/run-make/cdylib-dylib-linkage/Makefile b/tests/run-make/cdylib-dylib-linkage/Makefile
deleted file mode 100644
index db8393d3c05..00000000000
--- a/tests/run-make/cdylib-dylib-linkage/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-# This test checks that cdylibs can link against dylibs as dependencies, after this restriction was disabled.
-# See https://github.com/rust-lang/rust/commit/72aaa3a414d17aa0c4f19feafa5bab5f84b60e63
-
-# ignore-cross-compile
-include ../tools.mk
-
-TARGET_SYSROOT := $(shell $(RUSTC) --print sysroot)/lib/rustlib/$(TARGET)/lib
-
-ifdef IS_MSVC
-LIBSTD := $(wildcard $(TARGET_SYSROOT)/libstd-*.dll.lib)
-else
-LIBSTD := $(wildcard $(TARGET_SYSROOT)/$(call DYLIB_GLOB,std))
-STD := $(basename $(patsubst lib%,%, $(notdir $(LIBSTD))))
-endif
-
-all: $(call RUN_BINFILE,foo)
-	$(call RUN,foo)
-
-ifdef IS_MSVC
-CLIBS := $(TMPDIR)/foo.dll.lib $(TMPDIR)/bar.dll.lib $(LIBSTD)
-$(call RUN_BINFILE,foo): $(call DYLIB,foo)
-	$(CC) $(CFLAGS) foo.c $(CLIBS) $(call OUT_EXE,foo)
-else
-CLIBS := -lfoo -lbar -l$(STD) -L $(TMPDIR) -L $(TARGET_SYSROOT)
-$(call RUN_BINFILE,foo): $(call DYLIB,foo)
-	$(CC) $(CFLAGS) foo.c $(CLIBS) -o $(call RUN_BINFILE,foo)
-endif
-
-$(call DYLIB,foo):
-	$(RUSTC) -C prefer-dynamic bar.rs
-	$(RUSTC) foo.rs
diff --git a/tests/run-make/cdylib-dylib-linkage/rmake.rs b/tests/run-make/cdylib-dylib-linkage/rmake.rs
new file mode 100644
index 00000000000..a8fd8e2d168
--- /dev/null
+++ b/tests/run-make/cdylib-dylib-linkage/rmake.rs
@@ -0,0 +1,41 @@
+// Previously, rustc mandated that cdylibs could only link against rlibs as dependencies,
+// making linkage between cdylibs and dylibs impossible. After this was changed in #68448,
+// this test attempts to link both `foo` (a cdylib) and `bar` (a dylib) and checks that
+// both compilation and execution are successful.
+// See https://github.com/rust-lang/rust/pull/68448
+
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed
+
+use run_make_support::{
+    bin_name, cc, dynamic_lib_extension, dynamic_lib_name, filename_contains, has_extension,
+    has_prefix, has_suffix, is_msvc, msvc_import_dynamic_lib_name, path, run, rustc,
+    shallow_find_files, target,
+};
+
+fn main() {
+    rustc().arg("-Cprefer-dynamic").input("bar.rs").run();
+    rustc().input("foo.rs").run();
+    let sysroot = rustc().print("sysroot").run().stdout_utf8();
+    let sysroot = sysroot.trim();
+    let target_sysroot = path(sysroot).join("lib/rustlib").join(target()).join("lib");
+    if is_msvc() {
+        let mut libs = shallow_find_files(&target_sysroot, |path| {
+            has_prefix(path, "libstd-") && has_suffix(path, ".dll.lib")
+        });
+        libs.push(path(msvc_import_dynamic_lib_name("foo")));
+        libs.push(path(msvc_import_dynamic_lib_name("bar")));
+        cc().input("foo.c").args(&libs).out_exe("foo").run();
+    } else {
+        let stdlibs = shallow_find_files(&target_sysroot, |path| {
+            has_extension(path, dynamic_lib_extension()) && filename_contains(path, "std")
+        });
+        cc().input("foo.c")
+            .args(&[dynamic_lib_name("foo"), dynamic_lib_name("bar")])
+            .arg(stdlibs.get(0).unwrap())
+            .library_search_path(&target_sysroot)
+            .output(bin_name("foo"))
+            .run();
+    }
+    run("foo");
+}
diff --git a/tests/run-make/comment-section/rmake.rs b/tests/run-make/comment-section/rmake.rs
index a16adea7162..1557f50dbd0 100644
--- a/tests/run-make/comment-section/rmake.rs
+++ b/tests/run-make/comment-section/rmake.rs
@@ -7,12 +7,7 @@
 // FIXME(jieyouxu): check cross-compile setup
 //@ ignore-cross-compile
 
-use std::path::PathBuf;
-
-use run_make_support::llvm_readobj;
-use run_make_support::rfs;
-use run_make_support::rustc;
-use run_make_support::{cwd, env_var, run_in_tmpdir};
+use run_make_support::{cwd, env_var, llvm_readobj, rfs, rustc};
 
 fn main() {
     let target = env_var("TARGET");
diff --git a/tests/run-make/compiler-builtins/rmake.rs b/tests/run-make/compiler-builtins/rmake.rs
index 43d1d69b245..42ed07d9daf 100644
--- a/tests/run-make/compiler-builtins/rmake.rs
+++ b/tests/run-make/compiler-builtins/rmake.rs
@@ -14,15 +14,14 @@
 
 #![deny(warnings)]
 
+use std::collections::HashSet;
+use std::path::PathBuf;
+
 use run_make_support::object::read::archive::ArchiveFile;
 use run_make_support::object::read::Object;
-use run_make_support::object::ObjectSection;
-use run_make_support::object::ObjectSymbol;
-use run_make_support::object::RelocationTarget;
+use run_make_support::object::{ObjectSection, ObjectSymbol, RelocationTarget};
 use run_make_support::rfs::{read, read_dir};
 use run_make_support::{cmd, env_var, object};
-use std::collections::HashSet;
-use std::path::PathBuf;
 
 fn main() {
     let target_dir = PathBuf::from("target");
diff --git a/tests/run-make/compressed-debuginfo/rmake.rs b/tests/run-make/compressed-debuginfo/rmake.rs
index 3a656f28c22..5ba1a1852d5 100644
--- a/tests/run-make/compressed-debuginfo/rmake.rs
+++ b/tests/run-make/compressed-debuginfo/rmake.rs
@@ -5,7 +5,7 @@
 
 // FIXME: This test isn't comprehensive and isn't covering all possible combinations.
 
-use run_make_support::{assert_contains, cmd, llvm_readobj, run_in_tmpdir, rustc};
+use run_make_support::{assert_contains, llvm_readobj, run_in_tmpdir, rustc};
 
 fn check_compression(compression: &str, to_find: &str) {
     run_in_tmpdir(|| {
diff --git a/tests/run-make/const_fn_mir/rmake.rs b/tests/run-make/const_fn_mir/rmake.rs
index 1ba93421855..0c33b1ce34e 100644
--- a/tests/run-make/const_fn_mir/rmake.rs
+++ b/tests/run-make/const_fn_mir/rmake.rs
@@ -2,7 +2,7 @@
 
 //@ needs-unwind
 
-use run_make_support::{cwd, diff, rustc};
+use run_make_support::{diff, rustc};
 
 fn main() {
     rustc().input("main.rs").emit("mir").output("dump-actual.mir").run();
diff --git a/tests/run-make/issue-36710/foo.cpp b/tests/run-make/cpp-global-destructors/foo.cpp
index 8f878c2c272..8f878c2c272 100644
--- a/tests/run-make/issue-36710/foo.cpp
+++ b/tests/run-make/cpp-global-destructors/foo.cpp
diff --git a/tests/run-make/issue-36710/foo.rs b/tests/run-make/cpp-global-destructors/foo.rs
index f30a35e27c0..f30a35e27c0 100644
--- a/tests/run-make/issue-36710/foo.rs
+++ b/tests/run-make/cpp-global-destructors/foo.rs
diff --git a/tests/run-make/cpp-global-destructors/rmake.rs b/tests/run-make/cpp-global-destructors/rmake.rs
new file mode 100644
index 00000000000..9bc5c84e10d
--- /dev/null
+++ b/tests/run-make/cpp-global-destructors/rmake.rs
@@ -0,0 +1,26 @@
+// Some start files were missed when originally writing the logic to swap in musl start files.
+// This caused #36710. After the fix in #50105, this test checks that linking to C++ code
+// with global destructors works.
+// See https://github.com/rust-lang/rust/pull/50105
+
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed
+
+//@ ignore-none
+// Reason: no-std is not supported.
+//@ ignore-wasm32
+//@ ignore-wasm64
+// Reason: compiling C++ to WASM may cause problems.
+
+// Neither of these are tested in full CI.
+//@ ignore-nvptx64-nvidia-cuda
+// Reason: can't find crate "std"
+//@ ignore-sgx
+
+use run_make_support::{build_native_static_lib_cxx, run, rustc};
+
+fn main() {
+    build_native_static_lib_cxx("foo");
+    rustc().input("foo.rs").arg("-lfoo").extra_rs_cxx_flags().run();
+    run("foo");
+}
diff --git a/tests/run-make/issue-69368/a.rs b/tests/run-make/crate-circular-deps-link/a.rs
index a54f429550e..a54f429550e 100644
--- a/tests/run-make/issue-69368/a.rs
+++ b/tests/run-make/crate-circular-deps-link/a.rs
diff --git a/tests/run-make/issue-69368/b.rs b/tests/run-make/crate-circular-deps-link/b.rs
index 4d6af026656..4d6af026656 100644
--- a/tests/run-make/issue-69368/b.rs
+++ b/tests/run-make/crate-circular-deps-link/b.rs
diff --git a/tests/run-make/issue-69368/c.rs b/tests/run-make/crate-circular-deps-link/c.rs
index 9d72657aa59..9d72657aa59 100644
--- a/tests/run-make/issue-69368/c.rs
+++ b/tests/run-make/crate-circular-deps-link/c.rs
diff --git a/tests/run-make/crate-circular-deps-link/rmake.rs b/tests/run-make/crate-circular-deps-link/rmake.rs
new file mode 100644
index 00000000000..7cc28ac93e1
--- /dev/null
+++ b/tests/run-make/crate-circular-deps-link/rmake.rs
@@ -0,0 +1,20 @@
+// Test that previously triggered a linker failure with root cause
+// similar to one found in the issue #69368.
+//
+// The crate that provides oom lang item is missing some other lang
+// items. Necessary to prevent the use of start-group / end-group.
+//
+// The weak lang items are defined in a separate compilation units,
+// so that linker could omit them if not used.
+//
+// The crates that need those weak lang items are dependencies of
+// crates that provide them.
+// See https://github.com/rust-lang/rust/issues/69371
+
+use run_make_support::rustc;
+
+fn main() {
+    rustc().input("a.rs").run();
+    rustc().input("b.rs").run();
+    rustc().input("c.rs").run();
+}
diff --git a/tests/run-make/crate-hash-rustc-version/rmake.rs b/tests/run-make/crate-hash-rustc-version/rmake.rs
index 97b3dd3931e..c7c36cfdf11 100644
--- a/tests/run-make/crate-hash-rustc-version/rmake.rs
+++ b/tests/run-make/crate-hash-rustc-version/rmake.rs
@@ -4,8 +4,7 @@
 //@ ignore-cross-compile
 //@ only-unix
 
-use run_make_support::llvm;
-use run_make_support::{diff, dynamic_lib_name, is_darwin, run, run_fail, rustc};
+use run_make_support::{diff, dynamic_lib_name, is_darwin, llvm, run, run_fail, rustc};
 
 fn llvm_readobj() -> llvm::LlvmReadobj {
     let mut cmd = llvm::llvm_readobj();
diff --git a/tests/run-make/crate-loading/multiple-dep-versions-1.rs b/tests/run-make/crate-loading/multiple-dep-versions-1.rs
new file mode 100644
index 00000000000..2d351633829
--- /dev/null
+++ b/tests/run-make/crate-loading/multiple-dep-versions-1.rs
@@ -0,0 +1,6 @@
+#![crate_name = "dependency"]
+#![crate_type = "rlib"]
+pub struct Type;
+pub trait Trait {}
+impl Trait for Type {}
+pub fn do_something<X: Trait>(_: X) {}
diff --git a/tests/run-make/crate-loading/multiple-dep-versions-2.rs b/tests/run-make/crate-loading/multiple-dep-versions-2.rs
new file mode 100644
index 00000000000..a5df3dc61ed
--- /dev/null
+++ b/tests/run-make/crate-loading/multiple-dep-versions-2.rs
@@ -0,0 +1,6 @@
+#![crate_name = "dependency"]
+#![crate_type = "rlib"]
+pub struct Type(pub i32);
+pub trait Trait {}
+impl Trait for Type {}
+pub fn do_something<X: Trait>(_: X) {}
diff --git a/tests/run-make/crate-loading/multiple-dep-versions.rs b/tests/run-make/crate-loading/multiple-dep-versions.rs
new file mode 100644
index 00000000000..5a6cb03aaa4
--- /dev/null
+++ b/tests/run-make/crate-loading/multiple-dep-versions.rs
@@ -0,0 +1,8 @@
+extern crate dep_2_reexport;
+extern crate dependency;
+use dep_2_reexport::do_something;
+use dependency::Type;
+
+fn main() {
+    do_something(Type);
+}
diff --git a/tests/run-make/crate-loading/rmake.rs b/tests/run-make/crate-loading/rmake.rs
new file mode 100644
index 00000000000..d7abd5872c9
--- /dev/null
+++ b/tests/run-make/crate-loading/rmake.rs
@@ -0,0 +1,26 @@
+//@ only-linux
+//@ ignore-wasm32
+//@ ignore-wasm64
+
+use run_make_support::{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.rs")
+        .extern_("dependency", rust_lib_name("dependency"))
+        .extern_("dep_2_reexport", rust_lib_name("dependency2"))
+        .run_fail()
+        .assert_stderr_contains(
+            "you have multiple different versions of crate `dependency` in your dependency graph",
+        )
+        .assert_stderr_contains(
+            "two types coming from two different versions of the same crate are different types \
+             even if they look the same",
+        )
+        .assert_stderr_contains("this type doesn't implement the required trait")
+        .assert_stderr_contains("this type implements the required trait")
+        .assert_stderr_contains("this is the required trait");
+}
diff --git a/tests/run-make/cross-lang-lto-clang/Makefile b/tests/run-make/cross-lang-lto-clang/Makefile
deleted file mode 100644
index acf49c8f5c8..00000000000
--- a/tests/run-make/cross-lang-lto-clang/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# needs-force-clang-based-tests
-
-# This test makes sure that cross-language inlining actually works by checking
-# the generated machine code.
-
-include ../tools.mk
-
-all: cpp-executable rust-executable
-
-cpp-executable:
-	$(RUSTC) -Clinker-plugin-lto=on -o $(TMPDIR)/librustlib-xlto.a -Copt-level=2 -Ccodegen-units=1 ./rustlib.rs
-	$(CLANG) -flto=thin -fuse-ld=lld -L $(TMPDIR) -lrustlib-xlto -o $(TMPDIR)/cmain ./cmain.c -O3
-	# Make sure we don't find a call instruction to the function we expect to
-	# always be inlined.
-	"$(LLVM_BIN_DIR)"/llvm-objdump -d $(TMPDIR)/cmain | $(CGREP) -v -e "call.*rust_always_inlined"
-	# As a sanity check, make sure we do find a call instruction to a
-	# non-inlined function
-	"$(LLVM_BIN_DIR)"/llvm-objdump -d $(TMPDIR)/cmain | $(CGREP) -e "call.*rust_never_inlined"
-
-rust-executable:
-	$(CLANG) ./clib.c -flto=thin -c -o $(TMPDIR)/clib.o -O2
-	(cd $(TMPDIR); $(AR) crus ./libxyz.a ./clib.o)
-	$(RUSTC) -Clinker-plugin-lto=on -L$(TMPDIR) -Copt-level=2 -Clinker=$(CLANG) -Clink-arg=-fuse-ld=lld ./main.rs -o $(TMPDIR)/rsmain
-	"$(LLVM_BIN_DIR)"/llvm-objdump -d $(TMPDIR)/rsmain | $(CGREP) -e "call.*c_never_inlined"
-	"$(LLVM_BIN_DIR)"/llvm-objdump -d $(TMPDIR)/rsmain | $(CGREP) -v -e "call.*c_always_inlined"
diff --git a/tests/run-make/cross-lang-lto-clang/rmake.rs b/tests/run-make/cross-lang-lto-clang/rmake.rs
new file mode 100644
index 00000000000..1b15a54aacb
--- /dev/null
+++ b/tests/run-make/cross-lang-lto-clang/rmake.rs
@@ -0,0 +1,62 @@
+// This test checks that cross-language inlining actually works by checking
+// the generated machine code.
+// See https://github.com/rust-lang/rust/pull/57514
+
+//@ needs-force-clang-based-tests
+// NOTE(#126180): This test only runs on `x86_64-gnu-debug`, because that CI job sets
+// RUSTBUILD_FORCE_CLANG_BASED_TESTS and only runs tests which contain "clang" in their
+// name.
+
+use run_make_support::{clang, env_var, llvm_ar, llvm_objdump, rustc, static_lib_name};
+
+fn main() {
+    rustc()
+        .linker_plugin_lto("on")
+        .output(static_lib_name("rustlib-xlto"))
+        .opt_level("2")
+        .codegen_units(1)
+        .input("rustlib.rs")
+        .run();
+    clang()
+        .lto("thin")
+        .use_ld("lld")
+        .arg("-lrustlib-xlto")
+        .out_exe("cmain")
+        .input("cmain.c")
+        .arg("-O3")
+        .run();
+    // Make sure we don't find a call instruction to the function we expect to
+    // always be inlined.
+    llvm_objdump()
+        .disassemble()
+        .input("cmain")
+        .run()
+        .assert_stdout_not_contains_regex("call.*rust_always_inlined");
+    // As a sanity check, make sure we do find a call instruction to a
+    // non-inlined function
+    llvm_objdump()
+        .disassemble()
+        .input("cmain")
+        .run()
+        .assert_stdout_contains_regex("call.*rust_never_inlined");
+    clang().input("clib.c").lto("thin").arg("-c").out_exe("clib.o").arg("-O2").run();
+    llvm_ar().obj_to_ar().output_input(static_lib_name("xyz"), "clib.o").run();
+    rustc()
+        .linker_plugin_lto("on")
+        .opt_level("2")
+        .linker(&env_var("CLANG"))
+        .link_arg("-fuse-ld=lld")
+        .input("main.rs")
+        .output("rsmain")
+        .run();
+    llvm_objdump()
+        .disassemble()
+        .input("rsmain")
+        .run()
+        .assert_stdout_not_contains_regex("call.*c_always_inlined");
+    llvm_objdump()
+        .disassemble()
+        .input("rsmain")
+        .run()
+        .assert_stdout_contains_regex("call.*c_never_inlined");
+}
diff --git a/tests/run-make/cross-lang-lto-pgo-smoketest/clib.c b/tests/run-make/cross-lang-lto-pgo-smoketest-clang/clib.c
index 90f33f24dc4..90f33f24dc4 100644
--- a/tests/run-make/cross-lang-lto-pgo-smoketest/clib.c
+++ b/tests/run-make/cross-lang-lto-pgo-smoketest-clang/clib.c
diff --git a/tests/run-make/cross-lang-lto-pgo-smoketest/cmain.c b/tests/run-make/cross-lang-lto-pgo-smoketest-clang/cmain.c
index e3f24828be3..e3f24828be3 100644
--- a/tests/run-make/cross-lang-lto-pgo-smoketest/cmain.c
+++ b/tests/run-make/cross-lang-lto-pgo-smoketest-clang/cmain.c
diff --git a/tests/run-make/cross-lang-lto-pgo-smoketest/main.rs b/tests/run-make/cross-lang-lto-pgo-smoketest-clang/main.rs
index 8129dcb85d9..8129dcb85d9 100644
--- a/tests/run-make/cross-lang-lto-pgo-smoketest/main.rs
+++ b/tests/run-make/cross-lang-lto-pgo-smoketest-clang/main.rs
diff --git a/tests/run-make/cross-lang-lto-pgo-smoketest-clang/rmake.rs b/tests/run-make/cross-lang-lto-pgo-smoketest-clang/rmake.rs
new file mode 100644
index 00000000000..03c9af4bb89
--- /dev/null
+++ b/tests/run-make/cross-lang-lto-pgo-smoketest-clang/rmake.rs
@@ -0,0 +1,120 @@
+// This test makes sure that cross-language inlining can be used in conjunction
+// with profile-guided optimization. The test only tests that the whole workflow
+// can be executed without anything crashing. It does not test whether PGO or
+// xLTO have any specific effect on the generated code.
+// See https://github.com/rust-lang/rust/pull/61036
+
+//@ needs-force-clang-based-tests
+// NOTE(#126180): This test would only run on `x86_64-gnu-debug`, because that CI job sets
+// RUSTBUILD_FORCE_CLANG_BASED_TESTS and only runs tests which contain "clang" in their
+// name.
+
+//@ needs-profiler-support
+// FIXME(Oneirical): Except that due to the reliance on llvm-profdata, this test
+// never runs, because `x86_64-gnu-debug` does not have the `profiler_builtins` crate.
+
+//FIXME(Oneirical): There was a strange workaround for MSVC on this test
+// which added -C panic=abort to every RUSTC call. It was justified as follows:
+
+// "LLVM doesn't support instrumenting binaries that use SEH:
+// https://bugs.llvm.org/show_bug.cgi?id=41279
+// Things work fine with -Cpanic=abort though."
+
+// This isn't very pertinent, however, as the test does not get run on any
+// MSVC platforms.
+
+use run_make_support::{
+    clang, env_var, has_extension, has_prefix, llvm_ar, llvm_profdata, rfs, run, rustc,
+    shallow_find_files, static_lib_name,
+};
+
+fn main() {
+    rustc()
+        .linker_plugin_lto("on")
+        .output(static_lib_name("rustlib-xlto"))
+        .opt_level("3")
+        .codegen_units(1)
+        .input("rustlib.rs")
+        .arg("-Cprofile-generate=cpp-profdata")
+        .run();
+    clang()
+        .lto("thin")
+        .arg("-fprofile-generate=cpp-profdata")
+        .use_ld("lld")
+        .arg("-lrustlib-xlto")
+        .out_exe("cmain")
+        .input("cmain.c")
+        .arg("-O3")
+        .run();
+    run("cmain");
+    // Postprocess the profiling data so it can be used by the compiler
+    let profraw_files = shallow_find_files("cpp-profdata", |path| {
+        has_prefix(path, "default") && has_extension(path, "profraw")
+    });
+    let profraw_file = profraw_files.get(0).unwrap();
+    llvm_profdata().merge().output("cpp-profdata/merged.profdata").input(profraw_file).run();
+    rustc()
+        .linker_plugin_lto("on")
+        .profile_use("cpp-profdata/merged.profdata")
+        .output(static_lib_name("rustlib-xlto"))
+        .opt_level("3")
+        .codegen_units(1)
+        .input("rustlib.rs")
+        .run();
+    clang()
+        .lto("thin")
+        .arg("-fprofile-use=cpp-profdata/merged.profdata")
+        .use_ld("lld")
+        .arg("-lrustlib-xlto")
+        .out_exe("cmain")
+        .input("cmain.c")
+        .arg("-O3")
+        .run();
+
+    clang()
+        .input("clib.c")
+        .arg("-fprofile-generate=rs-profdata")
+        .lto("thin")
+        .arg("-c")
+        .out_exe("clib.o")
+        .arg("-O3")
+        .run();
+    llvm_ar().obj_to_ar().output_input(static_lib_name("xyz"), "clib.o").run();
+    rustc()
+        .linker_plugin_lto("on")
+        .opt_level("3")
+        .codegen_units(1)
+        .arg("-Cprofile-generate=rs-profdata")
+        .linker(&env_var("CLANG"))
+        .link_arg("-fuse-ld=lld")
+        .input("main.rs")
+        .output("rsmain")
+        .run();
+    run("rsmain");
+    // Postprocess the profiling data so it can be used by the compiler
+    let profraw_files = shallow_find_files("rs-profdata", |path| {
+        has_prefix(path, "default") && has_extension(path, "profraw")
+    });
+    let profraw_file = profraw_files.get(0).unwrap();
+    llvm_profdata().merge().output("rs-profdata/merged.profdata").input(profraw_file).run();
+    clang()
+        .input("clib.c")
+        .arg("-fprofile-use=rs-profdata/merged.profdata")
+        .arg("-c")
+        .lto("thin")
+        .out_exe("clib.o")
+        .arg("-O3")
+        .run();
+    rfs::remove_file(static_lib_name("xyz"));
+    llvm_ar().obj_to_ar().output_input(static_lib_name("xyz"), "clib.o").run();
+    rustc()
+        .linker_plugin_lto("on")
+        .opt_level("3")
+        .codegen_units(1)
+        .arg("-Cprofile-use=rs-profdata/merged.profdata")
+        .linker(&env_var("CLANG"))
+        .link_arg("-fuse-ld=lld")
+        .input("main.rs")
+        .output("rsmain")
+        .run();
+}
diff --git a/tests/run-make/cross-lang-lto-pgo-smoketest/rustlib.rs b/tests/run-make/cross-lang-lto-pgo-smoketest-clang/rustlib.rs
index 9aff29ef9bb..9aff29ef9bb 100644
--- a/tests/run-make/cross-lang-lto-pgo-smoketest/rustlib.rs
+++ b/tests/run-make/cross-lang-lto-pgo-smoketest-clang/rustlib.rs
diff --git a/tests/run-make/cross-lang-lto-pgo-smoketest/Makefile b/tests/run-make/cross-lang-lto-pgo-smoketest/Makefile
deleted file mode 100644
index 738e23f9c66..00000000000
--- a/tests/run-make/cross-lang-lto-pgo-smoketest/Makefile
+++ /dev/null
@@ -1,90 +0,0 @@
-# needs-force-clang-based-tests
-
-# FIXME(#126180): This test doesn't actually run anywhere, because the only
-# CI job that sets RUSTBUILD_FORCE_CLANG_BASED_TESTS runs very few tests.
-
-# This test makes sure that cross-language inlining can be used in conjunction
-# with profile-guided optimization. The test only tests that the whole workflow
-# can be executed without anything crashing. It does not test whether PGO or
-# xLTO have any specific effect on the generated code.
-
-include ../tools.mk
-
-COMMON_FLAGS=-Copt-level=3 -Ccodegen-units=1
-
-# LLVM doesn't support instrumenting binaries that use SEH:
-# https://bugs.llvm.org/show_bug.cgi?id=41279
-#
-# Things work fine with -Cpanic=abort though.
-ifdef IS_MSVC
-COMMON_FLAGS+= -Cpanic=abort
-endif
-
-all: cpp-executable rust-executable
-
-cpp-executable:
-	$(RUSTC) -Clinker-plugin-lto=on \
-	         -Cprofile-generate="$(TMPDIR)"/cpp-profdata \
-	         -o "$(TMPDIR)"/librustlib-xlto.a \
-	         $(COMMON_FLAGS) \
-	         ./rustlib.rs
-	$(CLANG) -flto=thin \
-	         -fprofile-generate="$(TMPDIR)"/cpp-profdata \
-	         -fuse-ld=lld \
-	         -L "$(TMPDIR)" \
-	         -lrustlib-xlto \
-	         -o "$(TMPDIR)"/cmain \
-	         -O3 \
-	         ./cmain.c
-	$(TMPDIR)/cmain
-	# Postprocess the profiling data so it can be used by the compiler
-	"$(LLVM_BIN_DIR)"/llvm-profdata merge \
-		-o "$(TMPDIR)"/cpp-profdata/merged.profdata \
-		"$(TMPDIR)"/cpp-profdata/default_*.profraw
-	$(RUSTC) -Clinker-plugin-lto=on \
-	         -Cprofile-use="$(TMPDIR)"/cpp-profdata/merged.profdata \
-	         -o "$(TMPDIR)"/librustlib-xlto.a \
-	         $(COMMON_FLAGS) \
-	         ./rustlib.rs
-	$(CLANG) -flto=thin \
-	         -fprofile-use="$(TMPDIR)"/cpp-profdata/merged.profdata \
-	         -fuse-ld=lld \
-	         -L "$(TMPDIR)" \
-	         -lrustlib-xlto \
-	         -o "$(TMPDIR)"/cmain \
-	         -O3 \
-	         ./cmain.c
-
-rust-executable:
-	exit
-	$(CLANG) ./clib.c -fprofile-generate="$(TMPDIR)"/rs-profdata -flto=thin -c -o $(TMPDIR)/clib.o -O3
-	(cd $(TMPDIR); $(AR) crus ./libxyz.a ./clib.o)
-	$(RUSTC) -Clinker-plugin-lto=on \
-	         -Cprofile-generate="$(TMPDIR)"/rs-profdata \
-	         -L$(TMPDIR) \
-	         $(COMMON_FLAGS) \
-	         -Clinker=$(CLANG) \
-	         -Clink-arg=-fuse-ld=lld \
-	         -o $(TMPDIR)/rsmain \
-	         ./main.rs
-	$(TMPDIR)/rsmain
-	# Postprocess the profiling data so it can be used by the compiler
-	"$(LLVM_BIN_DIR)"/llvm-profdata merge \
-		-o "$(TMPDIR)"/rs-profdata/merged.profdata \
-		"$(TMPDIR)"/rs-profdata/default_*.profraw
-	$(CLANG) ./clib.c \
-	         -fprofile-use="$(TMPDIR)"/rs-profdata/merged.profdata \
-	         -flto=thin \
-	         -c \
-	         -o $(TMPDIR)/clib.o \
-	         -O3
-	rm "$(TMPDIR)"/libxyz.a
-	(cd $(TMPDIR); $(AR) crus ./libxyz.a ./clib.o)
-	$(RUSTC) -Clinker-plugin-lto=on \
-	         -Cprofile-use="$(TMPDIR)"/rs-profdata/merged.profdata \
-	         -L$(TMPDIR) \
-	         $(COMMON_FLAGS) \
-	         -Clinker=$(CLANG) \
-	         -Clink-arg=-fuse-ld=lld \
-	         -o $(TMPDIR)/rsmain \
-	         ./main.rs
diff --git a/tests/run-make/cross-lang-lto-riscv-abi/rmake.rs b/tests/run-make/cross-lang-lto-riscv-abi/rmake.rs
index f40da662128..92573353a74 100644
--- a/tests/run-make/cross-lang-lto-riscv-abi/rmake.rs
+++ b/tests/run-make/cross-lang-lto-riscv-abi/rmake.rs
@@ -3,16 +3,17 @@
 //@ needs-force-clang-based-tests
 //@ needs-llvm-components riscv
 
-// FIXME(#126180): This test doesn't actually run anywhere, because the only
-// CI job that sets RUSTBUILD_FORCE_CLANG_BASED_TESTS runs very few tests.
+//@ needs-force-clang-based-tests
+// FIXME(#126180): This test can only run on `x86_64-gnu-debug`, because that CI job sets
+// RUSTBUILD_FORCE_CLANG_BASED_TESTS and only runs tests which contain "clang" in their
+// name.
+// However, this test does not run at all as its name does not contain "clang".
+
+use std::path::PathBuf;
+use std::process::{Command, Output};
+use std::{env, str};
 
 use run_make_support::{bin_name, clang, llvm_readobj, rustc};
-use std::{
-    env,
-    path::PathBuf,
-    process::{Command, Output},
-    str,
-};
 
 fn check_target(target: &str, clang_target: &str, carch: &str, is_double_float: bool) {
     eprintln!("Checking target {target}");
diff --git a/tests/run-make/cross-lang-lto-upstream-rlibs/Makefile b/tests/run-make/cross-lang-lto-upstream-rlibs/Makefile
deleted file mode 100644
index 6f1caa31a80..00000000000
--- a/tests/run-make/cross-lang-lto-upstream-rlibs/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-include ../tools.mk
-
-# ignore windows due to libLLVM being present in PATH and the PATH and library path being the same
-# (so fixing it is harder). See #57765 for context
-ifndef IS_WINDOWS
-
-# This test makes sure that we don't loose upstream object files when compiling
-# staticlibs with -C linker-plugin-lto
-
-all: staticlib.rs upstream.rs
-	$(RUSTC) upstream.rs -C linker-plugin-lto -Ccodegen-units=1
-
-	# Check No LTO
-	$(RUSTC) staticlib.rs -C linker-plugin-lto -Ccodegen-units=1 -L. -o $(TMPDIR)/staticlib.a
-	(cd $(TMPDIR); "$(LLVM_BIN_DIR)"/llvm-ar x ./staticlib.a)
-	# Make sure the upstream object file was included
-	ls $(TMPDIR)/upstream.*.rcgu.o
-
-	# Cleanup
-	rm $(TMPDIR)/*
-
-	# Check ThinLTO
-	$(RUSTC) upstream.rs -C linker-plugin-lto -Ccodegen-units=1 -Clto=thin
-	$(RUSTC) staticlib.rs -C linker-plugin-lto -Ccodegen-units=1 -Clto=thin -L. -o $(TMPDIR)/staticlib.a
-	(cd $(TMPDIR); "$(LLVM_BIN_DIR)"/llvm-ar x ./staticlib.a)
-	ls $(TMPDIR)/upstream.*.rcgu.o
-
-else
-
-all:
-
-endif
diff --git a/tests/run-make/cross-lang-lto-upstream-rlibs/rmake.rs b/tests/run-make/cross-lang-lto-upstream-rlibs/rmake.rs
new file mode 100644
index 00000000000..f0b8fa75bee
--- /dev/null
+++ b/tests/run-make/cross-lang-lto-upstream-rlibs/rmake.rs
@@ -0,0 +1,57 @@
+// When using the flag -C linker-plugin-lto, static libraries could lose their upstream object
+// files during compilation. This bug was fixed in #53031, and this test compiles a staticlib
+// dependent on upstream, checking that the upstream object file still exists after no LTO and
+// thin LTO.
+// See https://github.com/rust-lang/rust/pull/53031
+
+use run_make_support::{
+    cwd, has_extension, has_prefix, has_suffix, llvm_ar, rfs, rustc, shallow_find_files,
+    static_lib_name,
+};
+
+fn main() {
+    // The test starts with no LTO enabled.
+    rustc().input("upstream.rs").arg("-Clinker-plugin-lto").codegen_units(1).run();
+    rustc()
+        .input("staticlib.rs")
+        .arg("-Clinker-plugin-lto")
+        .codegen_units(1)
+        .output(static_lib_name("staticlib"))
+        .run();
+    llvm_ar().extract().arg(static_lib_name("staticlib")).run();
+    // Ensure the upstream object file was included.
+    assert_eq!(
+        shallow_find_files(cwd(), |path| {
+            has_prefix(path, "upstream.") && has_suffix(path, ".rcgu.o")
+        })
+        .len(),
+        1
+    );
+    // Remove all output files that are not source Rust code for cleanup.
+    for file in shallow_find_files(cwd(), |path| !has_extension(path, "rs")) {
+        rfs::remove_file(file)
+    }
+
+    // Check it again, with Thin LTO.
+    rustc()
+        .input("upstream.rs")
+        .arg("-Clinker-plugin-lto")
+        .codegen_units(1)
+        .arg("-Clto=thin")
+        .run();
+    rustc()
+        .input("staticlib.rs")
+        .arg("-Clinker-plugin-lto")
+        .codegen_units(1)
+        .arg("-Clto=thin")
+        .output(static_lib_name("staticlib"))
+        .run();
+    llvm_ar().extract().arg(static_lib_name("staticlib")).run();
+    assert_eq!(
+        shallow_find_files(cwd(), |path| {
+            has_prefix(path, "upstream.") && has_suffix(path, ".rcgu.o")
+        })
+        .len(),
+        1
+    );
+}
diff --git a/tests/run-make/cross-lang-lto/Makefile b/tests/run-make/cross-lang-lto/Makefile
deleted file mode 100644
index 92058f952a9..00000000000
--- a/tests/run-make/cross-lang-lto/Makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-
-include ../tools.mk
-
-# ignore windows due to libLLVM being present in PATH and the PATH and library path being the same
-# (so fixing it is harder). See #57765 for context
-ifndef IS_WINDOWS
-
-# This test makes sure that the object files we generate are actually
-# LLVM bitcode files (as used by linker LTO plugins) when compiling with
-# -Clinker-plugin-lto.
-
-# this only succeeds for bitcode files
-ASSERT_IS_BITCODE_OBJ=("$(LLVM_BIN_DIR)"/llvm-bcanalyzer $(1))
-EXTRACT_OBJS=(cd $(TMPDIR); rm -f ./*.o; "$(LLVM_BIN_DIR)"/llvm-ar x $(1))
-
-BUILD_LIB=$(RUSTC) lib.rs -Copt-level=2 -Clinker-plugin-lto -Ccodegen-units=1
-BUILD_EXE=$(RUSTC) main.rs -Copt-level=2 -Clinker-plugin-lto -Ccodegen-units=1 --emit=obj
-
-all: staticlib staticlib-fat-lto staticlib-thin-lto rlib exe cdylib rdylib
-
-staticlib: lib.rs
-	$(BUILD_LIB) --crate-type=staticlib -o $(TMPDIR)/liblib.a
-	$(call EXTRACT_OBJS, liblib.a)
-	for file in $(TMPDIR)/liblib.*.rcgu.o; do $(call ASSERT_IS_BITCODE_OBJ, $$file); done
-
-staticlib-fat-lto: lib.rs
-	$(BUILD_LIB) --crate-type=staticlib -o $(TMPDIR)/liblib-fat-lto.a -Clto=fat
-	$(call EXTRACT_OBJS, liblib-fat-lto.a)
-	for file in $(TMPDIR)/liblib-fat-lto.*.rcgu.o; do $(call ASSERT_IS_BITCODE_OBJ, $$file); done
-
-staticlib-thin-lto: lib.rs
-	$(BUILD_LIB) --crate-type=staticlib -o $(TMPDIR)/liblib-thin-lto.a -Clto=thin
-	$(call EXTRACT_OBJS, liblib-thin-lto.a)
-	for file in $(TMPDIR)/liblib-thin-lto.*.rcgu.o; do $(call ASSERT_IS_BITCODE_OBJ, $$file); done
-
-rlib: lib.rs
-	$(BUILD_LIB) --crate-type=rlib -o $(TMPDIR)/liblib.rlib
-	$(call EXTRACT_OBJS, liblib.rlib)
-	for file in $(TMPDIR)/liblib.*.rcgu.o; do $(call ASSERT_IS_BITCODE_OBJ, $$file); done
-
-cdylib: lib.rs
-	$(BUILD_LIB) --crate-type=cdylib --emit=obj -o $(TMPDIR)/cdylib.o
-	$(call ASSERT_IS_BITCODE_OBJ, $(TMPDIR)/cdylib.o)
-
-rdylib: lib.rs
-	$(BUILD_LIB) --crate-type=dylib --emit=obj -o $(TMPDIR)/rdylib.o
-	$(call ASSERT_IS_BITCODE_OBJ, $(TMPDIR)/rdylib.o)
-
-exe: lib.rs
-	$(BUILD_EXE) -o $(TMPDIR)/exe.o
-	$(call ASSERT_IS_BITCODE_OBJ, $(TMPDIR)/exe.o)
-
-else
-
-all:
-
-endif
diff --git a/tests/run-make/cross-lang-lto/rmake.rs b/tests/run-make/cross-lang-lto/rmake.rs
new file mode 100644
index 00000000000..dc376b561e4
--- /dev/null
+++ b/tests/run-make/cross-lang-lto/rmake.rs
@@ -0,0 +1,110 @@
+// This test checks that the object files we generate are actually
+// LLVM bitcode files (as used by linker LTO plugins) when compiling with
+// -Clinker-plugin-lto.
+// See https://github.com/rust-lang/rust/pull/50000
+
+#![feature(path_file_prefix)]
+
+use std::path::PathBuf;
+
+use run_make_support::{
+    cwd, has_extension, has_prefix, llvm_ar, llvm_bcanalyzer, path, rfs, rust_lib_name, rustc,
+    shallow_find_files, static_lib_name,
+};
+
+fn main() {
+    check_bitcode(LibBuild {
+        source: path("lib.rs"),
+        crate_type: Some("staticlib"),
+        output: path(static_lib_name("liblib")),
+        lto: None,
+        emit_obj: false,
+    });
+    check_bitcode(LibBuild {
+        source: path("lib.rs"),
+        crate_type: Some("staticlib"),
+        output: path(static_lib_name("liblib-fat-lto")),
+        lto: Some("fat"),
+        emit_obj: false,
+    });
+    check_bitcode(LibBuild {
+        source: path("lib.rs"),
+        crate_type: Some("staticlib"),
+        output: path(static_lib_name("liblib-thin-lto")),
+        lto: Some("thin"),
+        emit_obj: false,
+    });
+    check_bitcode(LibBuild {
+        source: path("lib.rs"),
+        crate_type: Some("rlib"),
+        output: path(rust_lib_name("liblib")),
+        lto: None,
+        emit_obj: false,
+    });
+    check_bitcode(LibBuild {
+        source: path("lib.rs"),
+        crate_type: Some("cdylib"),
+        output: path("cdylib.o"),
+        lto: None,
+        emit_obj: true,
+    });
+    check_bitcode(LibBuild {
+        source: path("lib.rs"),
+        crate_type: Some("dylib"),
+        output: path("rdylib.o"),
+        lto: None,
+        emit_obj: true,
+    });
+    check_bitcode(LibBuild {
+        source: path("main.rs"),
+        crate_type: None,
+        output: path("exe.o"),
+        lto: None,
+        emit_obj: true,
+    });
+}
+
+#[track_caller]
+fn check_bitcode(instructions: LibBuild) {
+    let mut rustc = rustc();
+    rustc
+        .input(instructions.source)
+        .output(&instructions.output)
+        .opt_level("2")
+        .codegen_units(1)
+        .arg("-Clinker-plugin-lto");
+    if instructions.emit_obj {
+        rustc.emit("obj");
+    }
+    if let Some(crate_type) = instructions.crate_type {
+        rustc.crate_type(crate_type);
+    }
+    if let Some(lto) = instructions.lto {
+        rustc.arg(format!("-Clto={lto}"));
+    }
+    rustc.run();
+
+    if instructions.output.extension().unwrap() != "o" {
+        // Remove all potential leftover object files, then turn the output into an object file.
+        for object in shallow_find_files(cwd(), |path| has_extension(path, "o")) {
+            rfs::remove_file(object);
+        }
+        llvm_ar().extract().arg(&instructions.output).run();
+    }
+
+    for object in shallow_find_files(cwd(), |path| {
+        has_prefix(path, instructions.output.file_prefix().unwrap().to_str().unwrap())
+            && has_extension(path, "o")
+    }) {
+        // All generated object files should be LLVM bitcode files - this will fail otherwise.
+        llvm_bcanalyzer().input(object).run();
+    }
+}
+
+struct LibBuild {
+    source: PathBuf,
+    crate_type: Option<&'static str>,
+    output: PathBuf,
+    lto: Option<&'static str>,
+    emit_obj: bool,
+}
diff --git a/tests/run-make/doctests-keep-binaries/rmake.rs b/tests/run-make/doctests-keep-binaries/rmake.rs
index 6bff5c0c8d0..246539bcf82 100644
--- a/tests/run-make/doctests-keep-binaries/rmake.rs
+++ b/tests/run-make/doctests-keep-binaries/rmake.rs
@@ -1,9 +1,10 @@
 // Check that valid binaries are persisted by running them, regardless of whether the
 // --run or --no-run option is used.
 
+use std::path::Path;
+
 use run_make_support::rfs::{create_dir, remove_dir_all};
 use run_make_support::{run, rustc, rustdoc};
-use std::path::Path;
 
 fn setup_test_env<F: FnOnce(&Path, &Path)>(callback: F) {
     let out_dir = Path::new("doctests");
diff --git a/tests/run-make/doctests-runtool/rmake.rs b/tests/run-make/doctests-runtool/rmake.rs
index 5d829b9e88b..c7be829c215 100644
--- a/tests/run-make/doctests-runtool/rmake.rs
+++ b/tests/run-make/doctests-runtool/rmake.rs
@@ -1,8 +1,9 @@
 // Tests behavior of rustdoc `--runtool`.
 
+use std::path::PathBuf;
+
 use run_make_support::rfs::{create_dir, remove_dir_all};
 use run_make_support::{rustc, rustdoc};
-use std::path::PathBuf;
 
 fn mkdir(name: &str) -> PathBuf {
     let dir = PathBuf::from(name);
diff --git a/tests/run-make/dos-device-input/rmake.rs b/tests/run-make/dos-device-input/rmake.rs
new file mode 100644
index 00000000000..dee3b86f095
--- /dev/null
+++ b/tests/run-make/dos-device-input/rmake.rs
@@ -0,0 +1,13 @@
+//@ only-windows
+// Reason: dos devices are a Windows thing
+
+use std::path::Path;
+
+use run_make_support::{rustc, static_lib_name};
+
+fn main() {
+    rustc().input(r"\\.\NUL").crate_type("staticlib").run();
+    rustc().input(r"\\?\NUL").crate_type("staticlib").run();
+
+    assert!(Path::new(&static_lib_name("rust_out")).exists());
+}
diff --git a/tests/run-make/dump-ice-to-disk/rmake.rs b/tests/run-make/dump-ice-to-disk/rmake.rs
index 2fb5c825064..48b4071e065 100644
--- a/tests/run-make/dump-ice-to-disk/rmake.rs
+++ b/tests/run-make/dump-ice-to-disk/rmake.rs
@@ -1,81 +1,197 @@
-// This test checks if internal compilation error (ICE) log files work as expected.
-// - Get the number of lines from the log files without any configuration options,
-// then check that the line count doesn't change if the backtrace gets configured to be short
-// or full.
-// - Check that disabling ICE logging results in zero files created.
-// - Check that the ICE files contain some of the expected strings.
-// See https://github.com/rust-lang/rust/pull/108714
+//! This test checks if Internal Compilation Error (ICE) dump files `rustc-ice*.txt` work as
+//! expected.
+//!
+//! - Basic sanity checks on a default ICE dump.
+//! - Get the number of lines from the dump files without any `RUST_BACKTRACE` options, then check
+//!   ICE dump file (line count) is not affected by `RUSTC_BACKTRACE` settings.
+//! - Check that disabling ICE dumping results in zero dump files created.
+//! - Check that the ICE dump contain some of the expected strings.
+//! - Check that `RUST_BACKTRACE=0` prevents ICE dump from created.
+//! - Exercise the `-Zmetrics-dir` nightly flag (#128914):
+//!     - When `-Zmetrics=dir=PATH` is present but `RUSTC_ICE` is not set, check that the ICE dump
+//!       is placed under `PATH`.
+//!     - When `RUSTC_ICE=RUSTC_ICE_PATH` and `-Zmetrics-dir=METRICS_PATH` are both provided, check
+//!       that `RUSTC_ICE_PATH` takes precedence and no ICE dump is emitted under `METRICS_PATH`.
+//!
+//! See <https://github.com/rust-lang/rust/pull/108714>.
 
-use run_make_support::{cwd, has_extension, has_prefix, rfs, rustc, shallow_find_files};
+//@ ignore-windows
+// FIXME(#128911): @jieyouxu: This test is sometimes for whatever forsaken reason flakey in
+// `i686-mingw`, and I cannot reproduce it locally. The error messages upon assertion failure in
+// this test is intentionally extremely verbose to aid debugging that issue.
+
+use std::cell::OnceCell;
+use std::path::{Path, PathBuf};
+
+use run_make_support::{
+    cwd, filename_contains, has_extension, has_prefix, rfs, run_in_tmpdir, rustc,
+    shallow_find_files,
+};
+
+#[derive(Debug)]
+struct IceDump {
+    name: &'static str,
+    path: PathBuf,
+    message: String,
+}
+
+impl IceDump {
+    fn lines_count(&self) -> usize {
+        self.message.lines().count()
+    }
+}
+
+#[track_caller]
+fn assert_ice_len_equals(left: &IceDump, right: &IceDump) {
+    let left_len = left.lines_count();
+    let right_len = right.lines_count();
+
+    if left_len != right_len {
+        eprintln!("=== {} ICE MESSAGE ({} lines) ====", left.name, left_len);
+        eprintln!("{}", left.message);
+
+        eprintln!("=== {} ICE MESSAGE ({} lines) ====", right.name, right_len);
+        eprintln!("{}", right.message);
+
+        eprintln!("====================================");
+        panic!(
+            "ICE message length mismatch: {} has {} lines but {} has {} lines",
+            left.name, left_len, right.name, right_len
+        );
+    }
+}
+
+fn find_ice_dumps_in_dir<P: AsRef<Path>>(dir: P) -> Vec<PathBuf> {
+    shallow_find_files(dir, |path| has_prefix(path, "rustc-ice") && has_extension(path, "txt"))
+}
+
+// Assert only one `rustc-ice*.txt` ICE file exists, and extract the ICE message from the ICE file.
+#[track_caller]
+fn extract_exactly_one_ice_file<P: AsRef<Path>>(name: &'static str, dir: P) -> IceDump {
+    let ice_files = find_ice_dumps_in_dir(dir);
+    assert_eq!(ice_files.len(), 1); // There should only be 1 ICE file.
+    let path = ice_files.get(0).unwrap();
+    let message = rfs::read_to_string(path);
+    IceDump { name, path: path.to_path_buf(), message }
+}
 
 fn main() {
-    rustc().input("lib.rs").arg("-Ztreat-err-as-bug=1").run_fail();
-    let default = get_text_from_ice(".").lines().count();
-    clear_ice_files();
-
-    rustc().env("RUSTC_ICE", cwd()).input("lib.rs").arg("-Ztreat-err-as-bug=1").run_fail();
-    let ice_text = get_text_from_ice(cwd());
-    let default_set = ice_text.lines().count();
-    let content = ice_text;
-    let ice_files = shallow_find_files(cwd(), |path| {
-        has_prefix(path, "rustc-ice") && has_extension(path, "txt")
+    // Establish baseline ICE message.
+    let mut default_ice_dump = OnceCell::new();
+    run_in_tmpdir(|| {
+        rustc().env("RUSTC_ICE", cwd()).input("lib.rs").arg("-Ztreat-err-as-bug=1").run_fail();
+        let dump = extract_exactly_one_ice_file("baseline", cwd());
+        // Ensure that the ICE dump path doesn't contain `:`, because they cause problems on
+        // Windows.
+        assert!(!filename_contains(&dump.path, ":"), "{} contains `:`", dump.path.display());
+        // Some of the expected strings in an ICE file should appear.
+        assert!(dump.message.contains("thread 'rustc' panicked at"));
+        assert!(dump.message.contains("stack backtrace:"));
+        default_ice_dump.set(dump).unwrap();
     });
-    assert_eq!(ice_files.len(), 1); // There should only be 1 ICE file.
-    let ice_file_name =
-        ice_files.first().and_then(|f| f.file_name()).and_then(|n| n.to_str()).unwrap();
-    // Ensure that the ICE dump path doesn't contain `:`, because they cause problems on Windows.
-    assert!(!ice_file_name.contains(":"), "{ice_file_name}");
-
-    clear_ice_files();
-    rustc()
-        .env("RUSTC_ICE", cwd())
-        .input("lib.rs")
-        .env("RUST_BACKTRACE", "short")
-        .arg("-Ztreat-err-as-bug=1")
-        .run_fail();
-    let short = get_text_from_ice(cwd()).lines().count();
-    clear_ice_files();
-    rustc()
-        .env("RUSTC_ICE", cwd())
-        .input("lib.rs")
-        .env("RUST_BACKTRACE", "full")
-        .arg("-Ztreat-err-as-bug=1")
-        .run_fail();
-    let full = get_text_from_ice(cwd()).lines().count();
-    clear_ice_files();
+    let default_ice_dump = default_ice_dump.get().unwrap();
+
+    test_backtrace_short(default_ice_dump);
+    test_backtrace_full(default_ice_dump);
+    test_backtrace_disabled(default_ice_dump);
+    test_ice_dump_disabled();
+
+    test_metrics_dir(default_ice_dump);
+}
+
+#[track_caller]
+fn test_backtrace_short(baseline: &IceDump) {
+    run_in_tmpdir(|| {
+        rustc()
+            .env("RUSTC_ICE", cwd())
+            .input("lib.rs")
+            .env("RUST_BACKTRACE", "short")
+            .arg("-Ztreat-err-as-bug=1")
+            .run_fail();
+        let dump = extract_exactly_one_ice_file("RUST_BACKTRACE=short", cwd());
+        // Backtrace length in dump shouldn't be changed by `RUST_BACKTRACE`.
+        assert_ice_len_equals(baseline, &dump);
+    });
+}
+
+#[track_caller]
+fn test_backtrace_full(baseline: &IceDump) {
+    run_in_tmpdir(|| {
+        rustc()
+            .env("RUSTC_ICE", cwd())
+            .input("lib.rs")
+            .env("RUST_BACKTRACE", "full")
+            .arg("-Ztreat-err-as-bug=1")
+            .run_fail();
+        let dump = extract_exactly_one_ice_file("RUST_BACKTRACE=full", cwd());
+        // Backtrace length in dump shouldn't be changed by `RUST_BACKTRACE`.
+        assert_ice_len_equals(baseline, &dump);
+    });
+}
 
+#[track_caller]
+fn test_backtrace_disabled(baseline: &IceDump) {
+    run_in_tmpdir(|| {
+        rustc()
+            .env("RUSTC_ICE", cwd())
+            .input("lib.rs")
+            .env("RUST_BACKTRACE", "0")
+            .arg("-Ztreat-err-as-bug=1")
+            .run_fail();
+        let dump = extract_exactly_one_ice_file("RUST_BACKTRACE=disabled", cwd());
+        // Backtrace length in dump shouldn't be changed by `RUST_BACKTRACE`.
+        assert_ice_len_equals(baseline, &dump);
+    });
+}
+
+#[track_caller]
+fn test_ice_dump_disabled() {
     // The ICE dump is explicitly disabled. Therefore, this should produce no files.
-    rustc().env("RUSTC_ICE", "0").input("lib.rs").arg("-Ztreat-err-as-bug=1").run_fail();
-    let ice_files = shallow_find_files(cwd(), |path| {
-        has_prefix(path, "rustc-ice") && has_extension(path, "txt")
+    run_in_tmpdir(|| {
+        rustc().env("RUSTC_ICE", "0").input("lib.rs").arg("-Ztreat-err-as-bug=1").run_fail();
+        let ice_files = find_ice_dumps_in_dir(cwd());
+        assert!(ice_files.is_empty(), "there should be no ICE files if `RUSTC_ICE=0` is set");
     });
-    assert!(ice_files.is_empty()); // There should be 0 ICE files.
-
-    // The line count should not change.
-    assert_eq!(short, default_set);
-    assert_eq!(short, default);
-    assert_eq!(full, default_set);
-    assert!(default > 0);
-    // Some of the expected strings in an ICE file should appear.
-    assert!(content.contains("thread 'rustc' panicked at"));
-    assert!(content.contains("stack backtrace:"));
 }
 
-fn clear_ice_files() {
-    let ice_files = shallow_find_files(cwd(), |path| {
-        has_prefix(path, "rustc-ice") && has_extension(path, "txt")
+#[track_caller]
+fn test_metrics_dir(baseline: &IceDump) {
+    test_flag_only(baseline);
+    test_flag_and_env(baseline);
+}
+
+#[track_caller]
+fn test_flag_only(baseline: &IceDump) {
+    run_in_tmpdir(|| {
+        let metrics_arg = format!("-Zmetrics-dir={}", cwd().display());
+        rustc()
+            .env_remove("RUSTC_ICE") // prevent interference from environment
+            .input("lib.rs")
+            .arg("-Ztreat-err-as-bug=1")
+            .arg(metrics_arg)
+            .run_fail();
+        let dump = extract_exactly_one_ice_file("-Zmetrics-dir only", cwd());
+        assert_ice_len_equals(baseline, &dump);
     });
-    for file in ice_files {
-        rfs::remove_file(file);
-    }
 }
 
 #[track_caller]
-fn get_text_from_ice(dir: impl AsRef<std::path::Path>) -> String {
-    let ice_files =
-        shallow_find_files(dir, |path| has_prefix(path, "rustc-ice") && has_extension(path, "txt"));
-    assert_eq!(ice_files.len(), 1); // There should only be 1 ICE file.
-    let ice_file = ice_files.get(0).unwrap();
-    let output = rfs::read_to_string(ice_file);
-    output
+fn test_flag_and_env(baseline: &IceDump) {
+    run_in_tmpdir(|| {
+        let metrics_arg = format!("-Zmetrics-dir={}", cwd().display());
+        let real_dir = cwd().join("actually_put_ice_here");
+        rfs::create_dir(&real_dir);
+        rustc()
+            .input("lib.rs")
+            .env("RUSTC_ICE", &real_dir)
+            .arg("-Ztreat-err-as-bug=1")
+            .arg(metrics_arg)
+            .run_fail();
+
+        let cwd_ice_files = find_ice_dumps_in_dir(cwd());
+        assert!(cwd_ice_files.is_empty(), "RUSTC_ICE should override -Zmetrics-dir");
+
+        let dump = extract_exactly_one_ice_file("RUSTC_ICE overrides -Zmetrics-dir", real_dir);
+        assert_ice_len_equals(baseline, &dump);
+    });
 }
diff --git a/tests/run-make/dylib-soname/rmake.rs b/tests/run-make/dylib-soname/rmake.rs
index a0215a6906e..cec0d463842 100644
--- a/tests/run-make/dylib-soname/rmake.rs
+++ b/tests/run-make/dylib-soname/rmake.rs
@@ -4,7 +4,6 @@
 //@ only-linux
 //@ ignore-cross-compile
 
-use run_make_support::regex::Regex;
 use run_make_support::{cmd, run_in_tmpdir, rustc};
 
 fn main() {
diff --git a/tests/run-make/emit-shared-files/rmake.rs b/tests/run-make/emit-shared-files/rmake.rs
index 33c12310246..8ac9073e993 100644
--- a/tests/run-make/emit-shared-files/rmake.rs
+++ b/tests/run-make/emit-shared-files/rmake.rs
@@ -5,9 +5,10 @@
 // `all-shared` should only emit files that can be shared between crates.
 // See https://github.com/rust-lang/rust/pull/83478
 
-use run_make_support::{has_extension, has_prefix, rustdoc, shallow_find_files};
 use std::path::Path;
 
+use run_make_support::{has_extension, has_prefix, rustdoc, shallow_find_files};
+
 fn main() {
     rustdoc()
         .arg("-Zunstable-options")
diff --git a/tests/run-make/extern-flag-disambiguates/rmake.rs b/tests/run-make/extern-flag-disambiguates/rmake.rs
index 2d7d7f69f66..89cda02eaea 100644
--- a/tests/run-make/extern-flag-disambiguates/rmake.rs
+++ b/tests/run-make/extern-flag-disambiguates/rmake.rs
@@ -1,6 +1,6 @@
 //@ ignore-cross-compile
 
-use run_make_support::{cwd, run, rustc};
+use run_make_support::{run, rustc};
 
 // Attempt to build this dependency tree:
 //
diff --git a/tests/run-make/fmt-write-bloat/Makefile b/tests/run-make/fmt-write-bloat/Makefile
deleted file mode 100644
index 70e04b9af51..00000000000
--- a/tests/run-make/fmt-write-bloat/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-include ../tools.mk
-
-# ignore-windows
-
-ifeq ($(shell $(RUSTC) -vV | grep 'host: $(TARGET)'),)
-
-# Don't run this test when cross compiling.
-all:
-
-else
-
-NM = nm
-
-PANIC_SYMS = panic_bounds_check Debug
-
-# Allow for debug_assert!() in debug builds of std.
-ifdef NO_DEBUG_ASSERTIONS
-PANIC_SYMS += panicking panic_fmt pad_integral Display Debug
-endif
-
-all: main.rs
-	$(RUSTC) $< -O
-	$(NM) $(call RUN_BINFILE,main) | $(CGREP) -v $(PANIC_SYMS)
-
-endif
diff --git a/tests/run-make/fmt-write-bloat/main.rs b/tests/run-make/fmt-write-bloat/main.rs
index e86c48014c3..6f206d6515a 100644
--- a/tests/run-make/fmt-write-bloat/main.rs
+++ b/tests/run-make/fmt-write-bloat/main.rs
@@ -5,7 +5,7 @@
 use core::fmt;
 use core::fmt::Write;
 
-#[link(name = "c")]
+#[cfg_attr(not(windows), link(name = "c"))]
 extern "C" {}
 
 struct Dummy;
diff --git a/tests/run-make/fmt-write-bloat/rmake.rs b/tests/run-make/fmt-write-bloat/rmake.rs
new file mode 100644
index 00000000000..6875ef9ddc0
--- /dev/null
+++ b/tests/run-make/fmt-write-bloat/rmake.rs
@@ -0,0 +1,40 @@
+//! Before #78122, writing any `fmt::Arguments` would trigger the inclusion of `usize` formatting
+//! and padding code in the resulting binary, because indexing used in `fmt::write` would generate
+//! code using `panic_bounds_check`, which prints the index and length.
+//!
+//! These bounds checks are not necessary, as `fmt::Arguments` never contains any out-of-bounds
+//! indexes. The test is a `run-make` test, because it needs to check the result after linking. A
+//! codegen or assembly test doesn't check the parts that will be pulled in from `core` by the
+//! linker.
+//!
+//! In this test, we try to check that the `usize` formatting and padding code are not present in
+//! the final binary by checking that panic symbols such as `panic_bounds_check` are **not**
+//! present.
+//!
+//! Some CI jobs try to run faster by disabling debug assertions (through setting
+//! `NO_DEBUG_ASSERTIONS=1`). If debug assertions are disabled, then we can check for the absence of
+//! additional `usize` formatting and padding related symbols.
+
+//@ ignore-windows
+// Reason:
+// - MSVC targets really need to parse the .pdb file (aka the debug information).
+//   On Windows there's an API for that (dbghelp) which maybe we can use
+// - MinGW targets have a lot of symbols included in their runtime which we can't avoid.
+//   We would need to make the symbols we're looking for more specific for this test to work.
+//@ ignore-cross-compile
+
+use run_make_support::env::no_debug_assertions;
+use run_make_support::rustc;
+use run_make_support::symbols::any_symbol_contains;
+
+fn main() {
+    rustc().input("main.rs").opt().run();
+    // panic machinery identifiers, these should not appear in the final binary
+    let mut panic_syms = vec!["panic_bounds_check", "Debug"];
+    if no_debug_assertions() {
+        // if debug assertions are allowed, we need to allow these,
+        // otherwise, add them to the list of symbols to deny.
+        panic_syms.extend_from_slice(&["panicking", "panic_fmt", "pad_integral", "Display"]);
+    }
+    assert!(!any_symbol_contains("main", &panic_syms));
+}
diff --git a/tests/run-make/foreign-double-unwind/Makefile b/tests/run-make/foreign-double-unwind/Makefile
deleted file mode 100644
index b5e52808d2f..00000000000
--- a/tests/run-make/foreign-double-unwind/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# ignore-cross-compile
-# needs-unwind
-include ../tools.mk
-
-all: foo
-	$(call RUN,foo) | $(CGREP) -v unreachable
-
-foo: foo.rs $(call NATIVE_STATICLIB,foo)
-	$(RUSTC) $< -lfoo $(EXTRARSCXXFLAGS)
-
-$(TMPDIR)/libfoo.o: foo.cpp
-	$(call COMPILE_OBJ_CXX,$@,$<)
diff --git a/tests/run-make/foreign-double-unwind/rmake.rs b/tests/run-make/foreign-double-unwind/rmake.rs
new file mode 100644
index 00000000000..9bd3b4c0fea
--- /dev/null
+++ b/tests/run-make/foreign-double-unwind/rmake.rs
@@ -0,0 +1,21 @@
+// When using foreign function interface (FFI) with C++, it is possible
+// to run into a "double unwind" if either both Rust and C++ run into a panic
+// and exception at the same time, or C++ encounters two exceptions. In this case,
+// one of the panic unwinds would be leaked and the other would be kept, leading
+// to undefined behaviour. After this was fixed in #92911, this test checks that
+// the keyword "unreachable" indicative of this bug triggering in this specific context
+// does not appear after successfully compiling and executing the program.
+// See https://github.com/rust-lang/rust/pull/92911
+
+//@ needs-unwind
+// Reason: this test exercises panic unwinding
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed
+
+use run_make_support::{build_native_static_lib_cxx, run_fail, rustc};
+
+fn main() {
+    build_native_static_lib_cxx("foo");
+    rustc().input("foo.rs").arg("-lfoo").extra_rs_cxx_flags().run();
+    run_fail("foo").assert_stdout_not_contains("unreachable");
+}
diff --git a/tests/run-make/foreign-exceptions/Makefile b/tests/run-make/foreign-exceptions/Makefile
deleted file mode 100644
index 56c41b274fb..00000000000
--- a/tests/run-make/foreign-exceptions/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# ignore-cross-compile
-# needs-unwind
-include ../tools.mk
-
-all: foo
-	$(call RUN,foo)
-
-foo: foo.rs $(call NATIVE_STATICLIB,foo)
-	$(RUSTC) $< -lfoo $(EXTRARSCXXFLAGS)
-
-$(TMPDIR)/libfoo.o: foo.cpp
-	$(call COMPILE_OBJ_CXX,$@,$<)
diff --git a/tests/run-make/foreign-exceptions/rmake.rs b/tests/run-make/foreign-exceptions/rmake.rs
new file mode 100644
index 00000000000..929319f049f
--- /dev/null
+++ b/tests/run-make/foreign-exceptions/rmake.rs
@@ -0,0 +1,19 @@
+// This test was created to check that compilation and execution still works
+// after the addition of a new feature, in #65646: the ability to unwind panics
+// and exceptions back and forth between Rust and C++. This is a basic smoke test,
+// this feature being broken in quiet or subtle ways could still result in this test
+// passing.
+// See https://github.com/rust-lang/rust/pull/65646
+
+//@ needs-unwind
+// Reason: this test exercises panic unwinding
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed
+
+use run_make_support::{build_native_static_lib_cxx, run, rustc};
+
+fn main() {
+    build_native_static_lib_cxx("foo");
+    rustc().input("foo.rs").arg("-lfoo").extra_rs_cxx_flags().run();
+    run("foo");
+}
diff --git a/tests/run-make/git_clone_sha1.sh b/tests/run-make/git_clone_sha1.sh
deleted file mode 100644
index 626e4e42761..00000000000
--- a/tests/run-make/git_clone_sha1.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash -x
-
-# Usage: $0 project_name url sha1
-# Get the crate with the specified sha1.
-#
-# all arguments are required.
-#
-# See below link for git usage:
-# https://stackoverflow.com/questions/3489173#14091182
-
-# Mandatory arguments:
-PROJECT_NAME=$1
-URL=$2
-SHA1=$3
-
-function err_exit() {
-    echo "ERROR:" $*
-    exit 1
-}
-
-git clone $URL $PROJECT_NAME || err_exit
-cd $PROJECT_NAME || err_exit
-git reset --hard $SHA1 || err_exit
diff --git a/tests/run-make/ice-dep-cannot-find-dep/rmake.rs b/tests/run-make/ice-dep-cannot-find-dep/rmake.rs
index 8ba3a0366b0..1c136773f01 100644
--- a/tests/run-make/ice-dep-cannot-find-dep/rmake.rs
+++ b/tests/run-make/ice-dep-cannot-find-dep/rmake.rs
@@ -16,7 +16,7 @@
 //       If we used `rustc` the additional '-L rmake_out' option would allow rustc to
 //       actually find the crate.
 
-use run_make_support::{bare_rustc, rfs, rust_lib_name, rustc};
+use run_make_support::{bare_rustc, rust_lib_name, rustc};
 
 fn main() {
     rustc().crate_name("a").crate_type("rlib").input("a.rs").arg("--verbose").run();
diff --git a/tests/run-make/incr-prev-body-beyond-eof/rmake.rs b/tests/run-make/incr-prev-body-beyond-eof/rmake.rs
index 14e75671df8..47dce85248a 100644
--- a/tests/run-make/incr-prev-body-beyond-eof/rmake.rs
+++ b/tests/run-make/incr-prev-body-beyond-eof/rmake.rs
@@ -13,8 +13,7 @@
 //@ ignore-nvptx64-nvidia-cuda
 // FIXME: can't find crate for `std`
 
-use run_make_support::rfs;
-use run_make_support::rustc;
+use run_make_support::{rfs, rustc};
 
 fn main() {
     rfs::create_dir("src");
diff --git a/tests/run-make/incr-test-moved-file/rmake.rs b/tests/run-make/incr-test-moved-file/rmake.rs
index f314e110a8c..0ba1b0d58fe 100644
--- a/tests/run-make/incr-test-moved-file/rmake.rs
+++ b/tests/run-make/incr-test-moved-file/rmake.rs
@@ -14,7 +14,7 @@
 //@ ignore-nvptx64-nvidia-cuda
 // FIXME: can't find crate for 'std'
 
-use run_make_support::{rfs, rust_lib_name, rustc};
+use run_make_support::{rfs, rustc};
 
 fn main() {
     rfs::create_dir("incr");
diff --git a/tests/run-make/incremental-debugger-visualizer/rmake.rs b/tests/run-make/incremental-debugger-visualizer/rmake.rs
index 985816ff5d7..07c920cc04a 100644
--- a/tests/run-make/incremental-debugger-visualizer/rmake.rs
+++ b/tests/run-make/incremental-debugger-visualizer/rmake.rs
@@ -3,7 +3,6 @@
 // See https://github.com/rust-lang/rust/pull/111641
 
 use run_make_support::{invalid_utf8_contains, invalid_utf8_not_contains, rfs, rustc};
-use std::io::Read;
 
 fn main() {
     rfs::create_file("foo.py");
diff --git a/tests/run-make/inline-always-many-cgu/rmake.rs b/tests/run-make/inline-always-many-cgu/rmake.rs
index 5a6929c855b..678b949bc70 100644
--- a/tests/run-make/inline-always-many-cgu/rmake.rs
+++ b/tests/run-make/inline-always-many-cgu/rmake.rs
@@ -1,9 +1,8 @@
-use run_make_support::regex::Regex;
-use run_make_support::rfs;
-use run_make_support::rustc;
-
 use std::ffi::OsStr;
 
+use run_make_support::regex::Regex;
+use run_make_support::{rfs, rustc};
+
 fn main() {
     rustc().input("foo.rs").emit("llvm-ir").codegen_units(2).run();
     let re = Regex::new(r"\bcall\b").unwrap();
diff --git a/tests/run-make/intrinsic-unreachable/exit-unreachable.rs b/tests/run-make/intrinsic-unreachable/exit-unreachable.rs
index d0f193d49ee..4309767e05c 100644
--- a/tests/run-make/intrinsic-unreachable/exit-unreachable.rs
+++ b/tests/run-make/intrinsic-unreachable/exit-unreachable.rs
@@ -1,7 +1,6 @@
 #![feature(core_intrinsics)]
 #![crate_type = "lib"]
 use std::arch::asm;
-
 use std::intrinsics;
 
 #[allow(unreachable_code)]
diff --git a/tests/run-make/invalid-library/rmake.rs b/tests/run-make/invalid-library/rmake.rs
index 42afb74a59e..6b3ae1d485a 100644
--- a/tests/run-make/invalid-library/rmake.rs
+++ b/tests/run-make/invalid-library/rmake.rs
@@ -4,8 +4,7 @@
 // one appearing in stderr in this scenario.
 // See https://github.com/rust-lang/rust/pull/12645
 
-use run_make_support::rfs;
-use run_make_support::{llvm_ar, rustc};
+use run_make_support::{llvm_ar, rfs, rustc};
 
 fn main() {
     rfs::create_file("lib.rmeta");
diff --git a/tests/run-make/issue-107495-archive-permissions/rmake.rs b/tests/run-make/issue-107495-archive-permissions/rmake.rs
index f47b8d7190f..f210b7c737b 100644
--- a/tests/run-make/issue-107495-archive-permissions/rmake.rs
+++ b/tests/run-make/issue-107495-archive-permissions/rmake.rs
@@ -3,12 +3,12 @@
 #[cfg(unix)]
 extern crate libc;
 
-use run_make_support::{aux_build, rfs};
-
 #[cfg(unix)]
 use std::os::unix::fs::PermissionsExt;
 use std::path::Path;
 
+use run_make_support::{aux_build, rfs};
+
 fn main() {
     #[cfg(unix)]
     unsafe {
diff --git a/tests/run-make/issue-35164/Makefile b/tests/run-make/issue-35164/Makefile
deleted file mode 100644
index 38aa6f1265f..00000000000
--- a/tests/run-make/issue-35164/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../tools.mk
-
-all:
-	$(RUSTC) main.rs --error-format json 2>&1 | $(CGREP) -e '"byte_start":23\b' '"byte_end":29\b'
diff --git a/tests/run-make/issue-36710/Makefile b/tests/run-make/issue-36710/Makefile
deleted file mode 100644
index 7b91107a234..00000000000
--- a/tests/run-make/issue-36710/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-# ignore-cross-compile
-# ignore-none no-std is not supported
-# ignore-wasm32 FIXME: don't attempt to compile C++ to WASM
-# ignore-wasm64 FIXME: don't attempt to compile C++ to WASM
-# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for `std`
-# ignore-musl FIXME: this makefile needs teaching how to use a musl toolchain
-#                    (see dist-i586-gnu-i586-i686-musl Dockerfile)
-# ignore-sgx
-
-include ../tools.mk
-
-all: foo
-	$(call RUN,foo)
-
-foo: foo.rs $(call NATIVE_STATICLIB,foo)
-	$(RUSTC) $< -lfoo $(EXTRARSCXXFLAGS) --target $(TARGET)
-
-$(TMPDIR)/libfoo.o: foo.cpp
-	$(call COMPILE_OBJ_CXX,$@,$<)
diff --git a/tests/run-make/issue-47551/Makefile b/tests/run-make/issue-47551/Makefile
deleted file mode 100644
index 3fe0a6e74e0..00000000000
--- a/tests/run-make/issue-47551/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# only-linux
-# ignore-32bit
-
-include ../tools.mk
-
-all:
-	# --target $(TARGET) ensures the right gcc flags are used for cross compilation
-	$(RUSTC) --target $(TARGET) eh_frame-terminator.rs
-	$(call RUN,eh_frame-terminator) | $(CGREP) '1122334455667788'
-	objdump --dwarf=frames $(TMPDIR)/eh_frame-terminator | $(CGREP) 'ZERO terminator'
diff --git a/tests/run-make/issue-69368/Makefile b/tests/run-make/issue-69368/Makefile
deleted file mode 100644
index b1229d1b07f..00000000000
--- a/tests/run-make/issue-69368/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-# Test that previously triggered a linker failure with root cause
-# similar to one found in the issue #69368.
-#
-# The crate that provides oom lang item is missing some other lang
-# items. Necessary to prevent the use of start-group / end-group.
-#
-# The weak lang items are defined in a separate compilation units,
-# so that linker could omit them if not used.
-#
-# The crates that need those weak lang items are dependencies of
-# crates that provide them.
-
-all:
-	$(RUSTC) a.rs
-	$(RUSTC) b.rs
-	$(RUSTC) c.rs
diff --git a/tests/run-make/issue-88756-default-output/Makefile b/tests/run-make/issue-88756-default-output/Makefile
deleted file mode 100644
index d1c3d0fe082..00000000000
--- a/tests/run-make/issue-88756-default-output/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../tools.mk
-
-all:
-	$(BARE_RUSTDOC) 2>&1 | sed -E 's@/nightly/|/beta/|/stable/|/1\.[0-9]+\.[0-9]+/@/$$CHANNEL/@g' | diff - output-default.stdout
diff --git a/tests/run-make/issue-88756-default-output/README.md b/tests/run-make/issue-88756-default-output/README.md
deleted file mode 100644
index 8cbfac4f7d2..00000000000
--- a/tests/run-make/issue-88756-default-output/README.md
+++ /dev/null
@@ -1 +0,0 @@
-This is a test to verify that the default behavior of `rustdoc` is printing out help output instead of erroring out (#88756).
diff --git a/tests/run-make/issue-88756-default-output/x.rs b/tests/run-make/issue-88756-default-output/x.rs
deleted file mode 100644
index 5df7576133a..00000000000
--- a/tests/run-make/issue-88756-default-output/x.rs
+++ /dev/null
@@ -1 +0,0 @@
-// nothing to see here
diff --git a/tests/run-make/issue-35164/main.rs b/tests/run-make/json-error-no-offset/main.rs
index 1333d63224c..1333d63224c 100644
--- a/tests/run-make/issue-35164/main.rs
+++ b/tests/run-make/json-error-no-offset/main.rs
diff --git a/tests/run-make/json-error-no-offset/rmake.rs b/tests/run-make/json-error-no-offset/rmake.rs
new file mode 100644
index 00000000000..629d9c4c16e
--- /dev/null
+++ b/tests/run-make/json-error-no-offset/rmake.rs
@@ -0,0 +1,15 @@
+// The byte positions in json format error logging used to have a small, difficult
+// to predict offset. This was changed to be the top of the file every time in #42973,
+// and this test checks that the measurements appearing in the standard error are correct.
+// See https://github.com/rust-lang/rust/issues/35164
+
+use run_make_support::rustc;
+
+fn main() {
+    rustc()
+        .input("main.rs")
+        .error_format("json")
+        .run()
+        .assert_stderr_contains(r#""byte_start":23"#)
+        .assert_stderr_contains(r#""byte_end":29"#);
+}
diff --git a/tests/run-make/issue-35164/submodule/mod.rs b/tests/run-make/json-error-no-offset/submodule/mod.rs
index a9045b242fb..a9045b242fb 100644
--- a/tests/run-make/issue-35164/submodule/mod.rs
+++ b/tests/run-make/json-error-no-offset/submodule/mod.rs
diff --git a/tests/run-make/lib-trait-for-trait-no-ice/rmake.rs b/tests/run-make/lib-trait-for-trait-no-ice/rmake.rs
index 766acfc00da..0c5e12055e8 100644
--- a/tests/run-make/lib-trait-for-trait-no-ice/rmake.rs
+++ b/tests/run-make/lib-trait-for-trait-no-ice/rmake.rs
@@ -5,9 +5,10 @@
 // the lib crate-type flag was actually followed.
 // See https://github.com/rust-lang/rust/issues/18943
 
-use run_make_support::{rust_lib_name, rustc};
 use std::path::Path;
 
+use run_make_support::{rust_lib_name, rustc};
+
 fn main() {
     rustc().input("foo.rs").crate_type("lib").run();
     assert!(Path::new(&rust_lib_name("foo")).exists());
diff --git a/tests/run-make/libtest-thread-limit/test.rs b/tests/run-make/libtest-thread-limit/test.rs
index 88e8a498ae9..87e1d519171 100644
--- a/tests/run-make/libtest-thread-limit/test.rs
+++ b/tests/run-make/libtest-thread-limit/test.rs
@@ -1,8 +1,6 @@
-use std::{
-    io::ErrorKind,
-    sync::OnceLock,
-    thread::{self, Builder, ThreadId},
-};
+use std::io::ErrorKind;
+use std::sync::OnceLock;
+use std::thread::{self, Builder, ThreadId};
 
 static THREAD_ID: OnceLock<ThreadId> = OnceLock::new();
 
diff --git a/tests/run-make/link-args-order/rmake.rs b/tests/run-make/link-args-order/rmake.rs
index d238ad23f27..b7ef8333267 100644
--- a/tests/run-make/link-args-order/rmake.rs
+++ b/tests/run-make/link-args-order/rmake.rs
@@ -3,15 +3,14 @@
 // checks that linker arguments remain intact and in the order they were originally passed in.
 // See https://github.com/rust-lang/rust/pull/70665
 
-//@ ignore-msvc
-// Reason: the ld linker does not exist on Windows.
-
-use run_make_support::rustc;
+use run_make_support::{is_msvc, rustc};
 
 fn main() {
+    let linker = if is_msvc() { "msvc" } else { "ld" };
+
     rustc()
         .input("empty.rs")
-        .linker_flavor("ld")
+        .linker_flavor(linker)
         .link_arg("a")
         .link_args("b c")
         .link_args("d e")
@@ -20,7 +19,7 @@ fn main() {
         .assert_stderr_contains(r#""a" "b" "c" "d" "e" "f""#);
     rustc()
         .input("empty.rs")
-        .linker_flavor("ld")
+        .linker_flavor(linker)
         .arg("-Zpre-link-arg=a")
         .arg("-Zpre-link-args=b c")
         .arg("-Zpre-link-args=d e")
diff --git a/tests/run-make/link-cfg/Makefile b/tests/run-make/link-cfg/Makefile
deleted file mode 100644
index a4099701144..00000000000
--- a/tests/run-make/link-cfg/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-all: $(call DYLIB,return1) $(call DYLIB,return2) $(call NATIVE_STATICLIB,return3)
-	ls $(TMPDIR)
-	$(BARE_RUSTC) --print cfg --target x86_64-unknown-linux-musl | $(CGREP) crt-static
-
-	$(RUSTC) no-deps.rs --cfg foo
-	$(call RUN,no-deps)
-	$(RUSTC) no-deps.rs --cfg bar
-	$(call RUN,no-deps)
-
-	$(RUSTC) dep.rs
-	$(RUSTC) with-deps.rs --cfg foo
-	$(call RUN,with-deps)
-	$(RUSTC) with-deps.rs --cfg bar
-	$(call RUN,with-deps)
-
-	$(RUSTC) dep-with-staticlib.rs
-	$(RUSTC) with-staticlib-deps.rs --cfg foo
-	$(call RUN,with-staticlib-deps)
-	$(RUSTC) with-staticlib-deps.rs --cfg bar
-	$(call RUN,with-staticlib-deps)
diff --git a/tests/run-make/link-cfg/rmake.rs b/tests/run-make/link-cfg/rmake.rs
new file mode 100644
index 00000000000..732de5dbd0b
--- /dev/null
+++ b/tests/run-make/link-cfg/rmake.rs
@@ -0,0 +1,43 @@
+// The `#[link(cfg(..))]` annotation means that the `#[link]`
+// directive is only active in a compilation unit if that `cfg` value is satisfied.
+// For example, when compiling an rlib, these directives are just encoded and
+// ignored for dylibs, and all staticlibs are continued to be put into the rlib as
+// usual. When placing that rlib into a staticlib, executable, or dylib, however,
+// the `cfg` is evaluated *as if it were defined in the final artifact* and the
+// library is decided to be linked or not.
+// This test exercises this new feature by testing it with no dependencies, then
+// with only dynamic libraries, then with both a staticlib and dylibs. Compilation
+// and execution should be successful.
+// See https://github.com/rust-lang/rust/pull/37545
+
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed
+
+use run_make_support::{bare_rustc, build_native_dynamic_lib, build_native_static_lib, run, rustc};
+
+fn main() {
+    build_native_dynamic_lib("return1");
+    build_native_dynamic_lib("return2");
+    build_native_static_lib("return3");
+    bare_rustc()
+        .print("cfg")
+        .target("x86_64-unknown-linux-musl")
+        .run()
+        .assert_stdout_contains("crt-static");
+    rustc().input("no-deps.rs").cfg("foo").run();
+    run("no-deps");
+    rustc().input("no-deps.rs").cfg("bar").run();
+    run("no-deps");
+
+    rustc().input("dep.rs").run();
+    rustc().input("with-deps.rs").cfg("foo").run();
+    run("with-deps");
+    rustc().input("with-deps.rs").cfg("bar").run();
+    run("with-deps");
+
+    rustc().input("dep-with-staticlib.rs").run();
+    rustc().input("with-staticlib-deps.rs").cfg("foo").run();
+    run("with-staticlib-deps");
+    rustc().input("with-staticlib-deps.rs").cfg("bar").run();
+    run("with-staticlib-deps");
+}
diff --git a/tests/run-make/link-dedup/rmake.rs b/tests/run-make/link-dedup/rmake.rs
index 9bff3a4b44c..6075f310954 100644
--- a/tests/run-make/link-dedup/rmake.rs
+++ b/tests/run-make/link-dedup/rmake.rs
@@ -5,20 +5,37 @@
 // Without the --cfg flag, there should be a single -ltesta, no more, no less.
 // See https://github.com/rust-lang/rust/pull/84794
 
-//@ ignore-msvc
+use std::fmt::Write;
 
-use run_make_support::rustc;
+use run_make_support::{is_msvc, rustc};
 
 fn main() {
     rustc().input("depa.rs").run();
     rustc().input("depb.rs").run();
     rustc().input("depc.rs").run();
+
     let output = rustc().input("empty.rs").cfg("bar").run_fail();
-    output.assert_stderr_contains(r#""-ltesta" "-ltestb" "-ltesta""#);
-    let output = rustc().input("empty.rs").run_fail();
-    output.assert_stderr_contains(r#""-ltesta""#);
-    let output = rustc().input("empty.rs").run_fail();
-    output.assert_stderr_not_contains(r#""-ltestb""#);
+    output.assert_stderr_contains(needle_from_libs(&["testa", "testb", "testa"]));
+
     let output = rustc().input("empty.rs").run_fail();
-    output.assert_stderr_not_contains(r#""-ltesta" "-ltesta" "-ltesta""#);
+    output.assert_stderr_contains(needle_from_libs(&["testa"]));
+    output.assert_stderr_not_contains(needle_from_libs(&["testb"]));
+    output.assert_stderr_not_contains(needle_from_libs(&["testa", "testa", "testa"]));
+    // Adjacent identical native libraries are no longer deduplicated if
+    // they come from different crates (https://github.com/rust-lang/rust/pull/103311)
+    // so the following will fail:
+    //output.assert_stderr_not_contains(needle_from_libs(&["testa", "testa"]));
+}
+
+fn needle_from_libs(libs: &[&str]) -> String {
+    let mut needle = String::new();
+    for lib in libs {
+        if is_msvc() {
+            let _ = needle.write_fmt(format_args!(r#""{lib}.lib" "#));
+        } else {
+            let _ = needle.write_fmt(format_args!(r#""-l{lib}" "#));
+        }
+    }
+    needle.pop(); // remove trailing space
+    needle
 }
diff --git a/tests/run-make/issue-47551/eh_frame-terminator.rs b/tests/run-make/link-eh-frame-terminator/eh_frame-terminator.rs
index 0c90d8c791c..0c90d8c791c 100644
--- a/tests/run-make/issue-47551/eh_frame-terminator.rs
+++ b/tests/run-make/link-eh-frame-terminator/eh_frame-terminator.rs
diff --git a/tests/run-make/link-eh-frame-terminator/rmake.rs b/tests/run-make/link-eh-frame-terminator/rmake.rs
new file mode 100644
index 00000000000..6bfae386ea1
--- /dev/null
+++ b/tests/run-make/link-eh-frame-terminator/rmake.rs
@@ -0,0 +1,23 @@
+// The gcc driver is supposed to add a terminator to link files, and the rustc
+// driver previously failed to do this, resulting in a segmentation fault
+// with an older version of LLVM. This test checks that the terminator is present
+// after the fix in #85395.
+// See https://github.com/rust-lang/rust/issues/47551
+
+//@ only-linux
+// Reason: the ZERO terminator is unique to the Linux architecture.
+//@ ignore-32bit
+// Reason: the usage of a large array in the test causes an out-of-memory
+// error on 32 bit systems.
+
+use run_make_support::{bin_name, llvm_objdump, run, rustc};
+
+fn main() {
+    rustc().input("eh_frame-terminator.rs").run();
+    run("eh_frame-terminator").assert_stdout_contains("1122334455667788");
+    llvm_objdump()
+        .arg("--dwarf=frames")
+        .input(bin_name("eh_frame-terminator"))
+        .run()
+        .assert_stdout_contains("ZERO terminator");
+}
diff --git a/tests/run-make/llvm-outputs/rmake.rs b/tests/run-make/llvm-outputs/rmake.rs
index 2dc3030ca91..b8ac21c98a0 100644
--- a/tests/run-make/llvm-outputs/rmake.rs
+++ b/tests/run-make/llvm-outputs/rmake.rs
@@ -1,8 +1,9 @@
 // test that directories get created when emitting llvm bitcode and IR
 
-use run_make_support::{cwd, run_in_tmpdir, rustc};
 use std::path::PathBuf;
 
+use run_make_support::{cwd, run_in_tmpdir, rustc};
+
 fn main() {
     let mut path_bc = PathBuf::new();
     let mut path_ir = PathBuf::new();
diff --git a/tests/run-make/long-linker-command-lines-cmd-exe/Makefile b/tests/run-make/long-linker-command-lines-cmd-exe/Makefile
deleted file mode 100644
index e43aab7f8e0..00000000000
--- a/tests/run-make/long-linker-command-lines-cmd-exe/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-all:
-	$(RUSTC) foo.rs -g
-	cp foo.bat $(TMPDIR)/
-	OUT_DIR="$(TMPDIR)" RUSTC="$(RUSTC_ORIGINAL)" $(call RUN,foo)
diff --git a/tests/run-make/long-linker-command-lines-cmd-exe/foo.rs b/tests/run-make/long-linker-command-lines-cmd-exe/foo.rs
index 1d5202dcdb4..a28cc7909fe 100644
--- a/tests/run-make/long-linker-command-lines-cmd-exe/foo.rs
+++ b/tests/run-make/long-linker-command-lines-cmd-exe/foo.rs
@@ -1,16 +1,3 @@
-// Like the `long-linker-command-lines` test this test attempts to blow
-// a command line limit for running the linker. Unlike that test, however,
-// this test is testing `cmd.exe` specifically rather than the OS.
-//
-// Unfortunately `cmd.exe` has a 8192 limit which is relatively small
-// in the grand scheme of things and anyone sripting rustc's linker
-// is probably using a `*.bat` script and is likely to hit this limit.
-//
-// This test uses a `foo.bat` script as the linker which just simply
-// delegates back to this program. The compiler should use a lower
-// limit for arguments before passing everything via `@`, which
-// means that everything should still succeed here.
-
 use std::env;
 use std::fs::{self, File};
 use std::io::{BufWriter, Read, Write};
@@ -18,13 +5,8 @@ use std::path::PathBuf;
 use std::process::Command;
 
 fn main() {
-    if !cfg!(windows) {
-        return;
-    }
-
-    let tmpdir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
-    let ok = tmpdir.join("ok");
-    let not_ok = tmpdir.join("not_ok");
+    let ok = PathBuf::from("ok");
+    let not_ok = PathBuf::from("not_ok");
     if env::var("YOU_ARE_A_LINKER").is_ok() {
         match env::args_os().find(|a| a.to_string_lossy().contains("@")) {
             Some(file) => {
@@ -45,7 +27,7 @@ fn main() {
     for i in (1..).map(|i| i * 10) {
         println!("attempt: {}", i);
 
-        let file = tmpdir.join("bar.rs");
+        let file = PathBuf::from("bar.rs");
         let mut f = BufWriter::new(File::create(&file).unwrap());
         let mut lib_name = String::new();
         for _ in 0..i {
@@ -63,8 +45,6 @@ fn main() {
             .arg(&file)
             .arg("-C")
             .arg(&bat_linker)
-            .arg("--out-dir")
-            .arg(&tmpdir)
             .env("YOU_ARE_A_LINKER", "1")
             .env("MY_LINKER", &me)
             .status()
diff --git a/tests/run-make/long-linker-command-lines-cmd-exe/rmake.rs b/tests/run-make/long-linker-command-lines-cmd-exe/rmake.rs
new file mode 100644
index 00000000000..60ed2c5bcd2
--- /dev/null
+++ b/tests/run-make/long-linker-command-lines-cmd-exe/rmake.rs
@@ -0,0 +1,26 @@
+// Like the `long-linker-command-lines` test this test attempts to blow
+// a command line limit for running the linker. Unlike that test, however,
+// this test is testing `cmd.exe` specifically rather than the OS.
+//
+// Unfortunately, the maximum length of the string that you can use at the
+// command prompt (`cmd.exe`) is 8191 characters.
+// Anyone scripting rustc's linker
+// is probably using a `*.bat` script and is likely to hit this limit.
+//
+// This test uses a `foo.bat` script as the linker which just simply
+// delegates back to this program. The compiler should use a lower
+// limit for arguments before passing everything via `@`, which
+// means that everything should still succeed here.
+// See https://github.com/rust-lang/rust/pull/47507
+
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed
+//@ only-windows
+// Reason: this test is specific to Windows executables
+
+use run_make_support::{run, rustc};
+
+fn main() {
+    rustc().input("foo.rs").arg("-g").run();
+    run("foo");
+}
diff --git a/tests/run-make/long-linker-command-lines/Makefile b/tests/run-make/long-linker-command-lines/Makefile
deleted file mode 100644
index b573038e344..00000000000
--- a/tests/run-make/long-linker-command-lines/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-export LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
-
-all:
-	$(RUSTC) foo.rs -g -O
-	RUSTC="$(RUSTC_ORIGINAL)" $(call RUN,foo)
diff --git a/tests/run-make/long-linker-command-lines/foo.rs b/tests/run-make/long-linker-command-lines/foo.rs
index 9d4a701ad87..5b30c06fac9 100644
--- a/tests/run-make/long-linker-command-lines/foo.rs
+++ b/tests/run-make/long-linker-command-lines/foo.rs
@@ -1,12 +1,3 @@
-// This is a test which attempts to blow out the system limit with how many
-// arguments can be passed to a process. This'll successively call rustc with
-// larger and larger argument lists in an attempt to find one that's way too
-// big for the system at hand. This file itself is then used as a "linker" to
-// detect when the process creation succeeds.
-//
-// Eventually we should see an argument that looks like `@` as we switch from
-// passing literal arguments to passing everything in the file.
-
 use std::collections::HashSet;
 use std::env;
 use std::fs::{self, File};
@@ -43,8 +34,7 @@ fn read_linker_args(path: &Path) -> String {
 }
 
 fn main() {
-    let tmpdir = PathBuf::from(env::var_os("TMPDIR").unwrap());
-    let ok = tmpdir.join("ok");
+    let ok = PathBuf::from("ok");
     if env::var("YOU_ARE_A_LINKER").is_ok() {
         if let Some(file) = env::args_os().find(|a| a.to_string_lossy().contains("@")) {
             let file = file.to_str().expect("non-utf8 file argument");
@@ -53,11 +43,11 @@ fn main() {
         return;
     }
 
-    let rustc = env::var_os("RUSTC").unwrap_or("rustc".into());
+    let rustc = env::var_os("RUSTC").unwrap();
     let me_as_linker = format!("linker={}", env::current_exe().unwrap().display());
     for i in (1..).map(|i| i * 100) {
         println!("attempt: {}", i);
-        let file = tmpdir.join("bar.rs");
+        let file = PathBuf::from("bar.rs");
         let mut expected_libs = write_test_case(&file, i);
 
         drop(fs::remove_file(&ok));
@@ -65,8 +55,6 @@ fn main() {
             .arg(&file)
             .arg("-C")
             .arg(&me_as_linker)
-            .arg("--out-dir")
-            .arg(&tmpdir)
             .env("YOU_ARE_A_LINKER", "1")
             .output()
             .unwrap();
diff --git a/tests/run-make/long-linker-command-lines/rmake.rs b/tests/run-make/long-linker-command-lines/rmake.rs
new file mode 100644
index 00000000000..e832d7f03e2
--- /dev/null
+++ b/tests/run-make/long-linker-command-lines/rmake.rs
@@ -0,0 +1,19 @@
+// This is a test which attempts to blow out the system limit with how many
+// arguments can be passed to a process. This'll successively call rustc with
+// larger and larger argument lists in an attempt to find one that's way too
+// big for the system at hand. This file itself is then used as a "linker" to
+// detect when the process creation succeeds.
+//
+// Eventually we should see an argument that looks like `@` as we switch from
+// passing literal arguments to passing everything in the file.
+// See https://github.com/rust-lang/rust/issues/41190
+
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed
+
+use run_make_support::{run, rustc};
+
+fn main() {
+    rustc().input("foo.rs").arg("-g").opt().run();
+    run("foo");
+}
diff --git a/tests/run-make/ls-metadata/rmake.rs b/tests/run-make/ls-metadata/rmake.rs
index 45299a48c11..42db97a292b 100644
--- a/tests/run-make/ls-metadata/rmake.rs
+++ b/tests/run-make/ls-metadata/rmake.rs
@@ -6,8 +6,7 @@
 
 //@ ignore-cross-compile
 
-use run_make_support::rfs;
-use run_make_support::rustc;
+use run_make_support::{rfs, rustc};
 
 fn main() {
     rustc().input("foo.rs").run();
diff --git a/tests/run-make/lto-readonly-lib/rmake.rs b/tests/run-make/lto-readonly-lib/rmake.rs
index d0ba3fb37a2..78f2b580e0d 100644
--- a/tests/run-make/lto-readonly-lib/rmake.rs
+++ b/tests/run-make/lto-readonly-lib/rmake.rs
@@ -7,7 +7,6 @@
 
 //@ ignore-cross-compile
 
-use run_make_support::rfs;
 use run_make_support::{run, rust_lib_name, rustc, test_while_readonly};
 
 fn main() {
diff --git a/tests/run-make/manual-crate-name/rmake.rs b/tests/run-make/manual-crate-name/rmake.rs
index f171f78087c..9085b6c7bc2 100644
--- a/tests/run-make/manual-crate-name/rmake.rs
+++ b/tests/run-make/manual-crate-name/rmake.rs
@@ -1,6 +1,7 @@
-use run_make_support::rustc;
 use std::path::Path;
 
+use run_make_support::rustc;
+
 fn main() {
     rustc().input("bar.rs").crate_name("foo").run();
     assert!(Path::new("libfoo.rlib").is_file());
diff --git a/tests/run-make/mte-ffi/bar.h b/tests/run-make/mte-ffi/bar.h
new file mode 100644
index 00000000000..a2292ae02a3
--- /dev/null
+++ b/tests/run-make/mte-ffi/bar.h
@@ -0,0 +1,43 @@
+#ifndef __BAR_H
+#define __BAR_H
+
+#include <sys/mman.h>
+#include <sys/auxv.h>
+#include <sys/prctl.h>
+#include <unistd.h>
+#include <stdio.h>
+
+// Set the allocation tag on the destination address using the STG instruction.
+#define set_tag(tagged_addr) do {                                      \
+    asm volatile("stg %0, [%0]" : : "r" (tagged_addr) : "memory"); \
+} while (0)
+
+int mte_enabled() {
+    return (getauxval(AT_HWCAP2)) & HWCAP2_MTE;
+}
+
+void *alloc_page() {
+    // Enable MTE with synchronous checking
+    if (prctl(PR_SET_TAGGED_ADDR_CTRL,
+              PR_TAGGED_ADDR_ENABLE | PR_MTE_TCF_SYNC | (0xfffe << PR_MTE_TAG_SHIFT),
+              0, 0, 0))
+    {
+        perror("prctl() failed");
+    }
+
+    // Using `mmap` allows us to ensure that, on systems which support MTE, the allocated
+    // memory is 16-byte aligned for MTE.
+    // This also allows us to explicitly specify whether the region should be protected by
+    // MTE or not.
+    if (mte_enabled()) {
+        void *ptr = mmap(NULL, sysconf(_SC_PAGESIZE),
+                         PROT_READ | PROT_WRITE | PROT_MTE, MAP_PRIVATE | MAP_ANONYMOUS,
+                         -1, 0);
+    } else {
+        void *ptr = mmap(NULL, sysconf(_SC_PAGESIZE),
+                         PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS,
+                         -1, 0);
+    }
+}
+
+#endif // __BAR_H
diff --git a/tests/run-make/mte-ffi/bar_float.c b/tests/run-make/mte-ffi/bar_float.c
new file mode 100644
index 00000000000..a1590f62765
--- /dev/null
+++ b/tests/run-make/mte-ffi/bar_float.c
@@ -0,0 +1,44 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include "bar.h"
+
+extern void foo(char*);
+
+void bar(char *ptr) {
+    if (((uintptr_t)ptr >> 56) != 0x1f) {
+        fprintf(stderr, "Top byte corrupted on Rust -> C FFI boundary!\n");
+        exit(1);
+    }
+}
+
+int main(void)
+{
+    float *ptr = alloc_page();
+    if (ptr == MAP_FAILED)
+    {
+        perror("mmap() failed");
+        return EXIT_FAILURE;
+    }
+
+    // Store an arbitrary tag in bits 56-59 of the pointer (where an MTE tag may be),
+    // and a different value in the ignored top 4 bits.
+    ptr = (float *)((uintptr_t)ptr | 0x1fl << 56);
+
+    if (mte_enabled()) {
+        set_tag(ptr);
+    }
+
+    ptr[0] = 2.0f;
+    ptr[1] = 1.5f;
+
+    foo(ptr); // should change the contents of the page and call `bar`
+
+    if (ptr[0] != 0.5f || ptr[1] != 0.2f) {
+        fprintf(stderr, "invalid data in memory; expected '0.5 0.2', got '%f %f'\n",
+                ptr[0], ptr[1]);
+        return EXIT_FAILURE;
+    }
+
+    return 0;
+}
diff --git a/tests/run-make/mte-ffi/bar_function.c b/tests/run-make/mte-ffi/bar_function.c
new file mode 100644
index 00000000000..1fa48d32a0c
--- /dev/null
+++ b/tests/run-make/mte-ffi/bar_function.c
@@ -0,0 +1,39 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include "bar.h"
+
+typedef void (*fp)(int (*)());
+
+extern void foo(fp);
+
+void bar(int (*ptr)()) {
+    if (((uintptr_t)ptr >> 56) != 0x2f) {
+        fprintf(stderr, "Top byte corrupted on Rust -> C FFI boundary!\n");
+        exit(1);
+    }
+
+    int r = (*ptr)();
+    if (r != 32) {
+        fprintf(stderr, "invalid return value; expected 32, got '%d'\n", r);
+        exit(1);
+    }
+}
+
+int main(void)
+{
+    fp ptr = alloc_page();
+    if (ptr == MAP_FAILED)
+    {
+        perror("mmap() failed");
+        return EXIT_FAILURE;
+    }
+
+    // Store an arbitrary tag in bits 56-59 of the pointer (where an MTE tag may be),
+    // and a different value in the ignored top 4 bits.
+    ptr = (fp)((uintptr_t)&bar | 0x1fl << 56);
+
+    foo(ptr);
+
+    return 0;
+}
diff --git a/tests/run-make/mte-ffi/bar_int.c b/tests/run-make/mte-ffi/bar_int.c
new file mode 100644
index 00000000000..d1c79e95dc9
--- /dev/null
+++ b/tests/run-make/mte-ffi/bar_int.c
@@ -0,0 +1,47 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include "bar.h"
+
+extern void foo(unsigned int *);
+
+void bar(char *ptr) {
+    if (((uintptr_t)ptr >> 56) != 0x1f) {
+        fprintf(stderr, "Top byte corrupted on Rust -> C FFI boundary!\n");
+        exit(1);
+    }
+}
+
+int main(void)
+{
+    // Construct a pointer with an arbitrary tag in bits 56-59, simulating an MTE tag.
+    // It's only necessary that the tag is preserved across FFI bounds for this test.
+    unsigned int *ptr;
+
+    ptr = alloc_page();
+    if (ptr == MAP_FAILED)
+    {
+        perror("mmap() failed");
+        return EXIT_FAILURE;
+    }
+
+    // Store an arbitrary tag in bits 56-59 of the pointer (where an MTE tag may be),
+    // and a different value in the ignored top 4 bits.
+    ptr = (unsigned int *)((uintptr_t)ptr | 0x1fl << 56);
+
+    if (mte_enabled()) {
+        set_tag(ptr);
+    }
+
+    ptr[0] = 61;
+    ptr[1] = 62;
+
+    foo(ptr); // should change the contents of the page to start with 0x63 0x64 and call `bar`
+
+    if (ptr[0] != 0x63 || ptr[1] != 0x64) {
+        fprintf(stderr, "invalid data in memory; expected '63 64', got '%d %d'\n", ptr[0], ptr[1]);
+        return EXIT_FAILURE;
+    }
+
+    return 0;
+}
diff --git a/tests/run-make/mte-ffi/bar_string.c b/tests/run-make/mte-ffi/bar_string.c
new file mode 100644
index 00000000000..5669ffd6695
--- /dev/null
+++ b/tests/run-make/mte-ffi/bar_string.c
@@ -0,0 +1,48 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include "bar.h"
+
+extern void foo(char*);
+
+void bar(char *ptr) {
+    if (((uintptr_t)ptr >> 56) != 0x2f) {
+        fprintf(stderr, "Top byte corrupted on Rust -> C FFI boundary!\n");
+        exit(1);
+    }
+
+    if (strcmp(ptr, "cd")) {
+        fprintf(stderr, "invalid data in memory; expected 'cd', got '%s'\n", ptr);
+        exit(1);
+    }
+}
+
+int main(void)
+{
+    // Construct a pointer with an arbitrary tag in bits 56-59, simulating an MTE tag.
+    // It's only necessary that the tag is preserved across FFI bounds for this test.
+    char *ptr;
+
+    ptr = alloc_page();
+    if (ptr == MAP_FAILED)
+    {
+        perror("mmap() failed");
+        return EXIT_FAILURE;
+    }
+
+    // Store an arbitrary tag in bits 56-59 of the pointer (where an MTE tag may be),
+    // and a different value in the ignored top 4 bits.
+    ptr = (unsigned int *)((uintptr_t)ptr | 0x1fl << 56);
+
+    if (mte_enabled()) {
+        set_tag(ptr);
+    }
+
+    ptr[0] = 'a';
+    ptr[1] = 'b';
+    ptr[2] = '\0';
+
+    foo(ptr);
+
+    return 0;
+}
diff --git a/tests/run-make/mte-ffi/foo_float.rs b/tests/run-make/mte-ffi/foo_float.rs
new file mode 100644
index 00000000000..c1bedd52494
--- /dev/null
+++ b/tests/run-make/mte-ffi/foo_float.rs
@@ -0,0 +1,19 @@
+#![crate_type = "cdylib"]
+#![crate_name = "foo"]
+
+use std::os::raw::c_float;
+
+extern "C" {
+    fn bar(ptr: *const c_float);
+}
+
+#[no_mangle]
+pub extern "C" fn foo(ptr: *mut c_float) {
+    assert_eq!((ptr as usize) >> 56, 0x1f);
+
+    unsafe {
+        *ptr = 0.5;
+        *ptr.wrapping_add(1) = 0.2;
+        bar(ptr);
+    }
+}
diff --git a/tests/run-make/mte-ffi/foo_function.rs b/tests/run-make/mte-ffi/foo_function.rs
new file mode 100644
index 00000000000..2c8e0b26238
--- /dev/null
+++ b/tests/run-make/mte-ffi/foo_function.rs
@@ -0,0 +1,17 @@
+#![crate_type = "cdylib"]
+#![crate_name = "foo"]
+
+extern "C" fn ret32() -> i32 {
+    32
+}
+
+#[no_mangle]
+pub extern "C" fn foo(ptr: extern "C" fn(extern "C" fn() -> i32)) {
+    assert_eq!((ptr as usize) >> 56, 0x1f);
+
+    // Store an arbitrary tag in the tag bits, and convert back to the correct pointer type.
+    let p = ((ret32 as usize) | (0x2f << 56)) as *const ();
+    let p: extern "C" fn() -> i32 = unsafe { std::mem::transmute(p) };
+
+    unsafe { ptr(p) }
+}
diff --git a/tests/run-make/mte-ffi/foo_int.rs b/tests/run-make/mte-ffi/foo_int.rs
new file mode 100644
index 00000000000..106d863cb81
--- /dev/null
+++ b/tests/run-make/mte-ffi/foo_int.rs
@@ -0,0 +1,19 @@
+#![crate_type = "cdylib"]
+#![crate_name = "foo"]
+
+use std::os::raw::c_uint;
+
+extern "C" {
+    fn bar(ptr: *const c_uint);
+}
+
+#[no_mangle]
+pub extern "C" fn foo(ptr: *mut c_uint) {
+    assert_eq!((ptr as usize) >> 56, 0x1f);
+
+    unsafe {
+        *ptr = 0x63;
+        *ptr.wrapping_add(1) = 0x64;
+        bar(ptr);
+    }
+}
diff --git a/tests/run-make/mte-ffi/foo_string.rs b/tests/run-make/mte-ffi/foo_string.rs
new file mode 100644
index 00000000000..54744802448
--- /dev/null
+++ b/tests/run-make/mte-ffi/foo_string.rs
@@ -0,0 +1,27 @@
+#![crate_type = "cdylib"]
+#![crate_name = "foo"]
+
+use std::arch::asm;
+use std::ffi::{CStr, CString};
+use std::os::raw::c_char;
+
+extern "C" {
+    fn bar(ptr: *const c_char);
+}
+
+#[no_mangle]
+pub extern "C" fn foo(ptr: *const c_char) {
+    assert_eq!((ptr as usize) >> 56, 0x1f);
+
+    let s = unsafe { CStr::from_ptr(ptr) };
+    assert_eq!(s.to_str().unwrap(), "ab");
+
+    let s = CString::from_vec_with_nul("cd\0".into()).unwrap();
+    let mut p = ((s.as_ptr() as usize) | (0x2f << 56)) as *const c_char;
+    unsafe {
+        #[cfg(target_feature = "mte")]
+        asm!("stg {p}, [{p}]", p = inout(reg) p);
+
+        bar(p);
+    }
+}
diff --git a/tests/run-make/mte-ffi/rmake.rs b/tests/run-make/mte-ffi/rmake.rs
new file mode 100644
index 00000000000..f4fafb796e3
--- /dev/null
+++ b/tests/run-make/mte-ffi/rmake.rs
@@ -0,0 +1,38 @@
+// Tests that MTE tags and values stored in the top byte of a pointer (TBI) are
+// preserved across FFI boundaries (C <-> Rust).
+// This test does not require MTE: whilst the test will use MTE if available, if it is not,
+// arbitrary tag bits are set using TBI.
+
+// This test is only valid for AArch64.
+// The linker must be explicitly specified when cross-compiling, so it is limited to
+// `aarch64-unknown-linux-gnu`.
+//@ only-aarch64-unknown-linux-gnu
+
+use run_make_support::{cc, dynamic_lib_name, extra_c_flags, run, rustc, target};
+
+fn main() {
+    run_test("int");
+    run_test("float");
+    run_test("string");
+    run_test("function");
+}
+
+fn run_test(variant: &str) {
+    let flags = {
+        let mut flags = extra_c_flags();
+        flags.push("-march=armv8.5-a+memtag");
+        flags
+    };
+    println!("{variant} test...");
+    rustc()
+        .input(format!("foo_{variant}.rs"))
+        .target(target())
+        .linker("aarch64-linux-gnu-gcc")
+        .run();
+    cc().input(format!("bar_{variant}.c"))
+        .input(dynamic_lib_name("foo"))
+        .out_exe("test")
+        .args(&flags)
+        .run();
+    run("test");
+}
diff --git a/tests/run-make/multiple-emits/rmake.rs b/tests/run-make/multiple-emits/rmake.rs
index 67c0ebb9864..8a5eb1d9d85 100644
--- a/tests/run-make/multiple-emits/rmake.rs
+++ b/tests/run-make/multiple-emits/rmake.rs
@@ -1,4 +1,4 @@
-use run_make_support::{cwd, path, rustc};
+use run_make_support::{path, rustc};
 
 fn main() {
     rustc().input("foo.rs").emit("asm,llvm-ir").output("out").run();
diff --git a/tests/run-make/naked-symbol-visibility/a_rust_dylib.rs b/tests/run-make/naked-symbol-visibility/a_rust_dylib.rs
new file mode 100644
index 00000000000..f00123f006b
--- /dev/null
+++ b/tests/run-make/naked-symbol-visibility/a_rust_dylib.rs
@@ -0,0 +1,89 @@
+#![feature(naked_functions, asm_const, linkage)]
+#![crate_type = "dylib"]
+
+use std::arch::asm;
+
+pub trait TraitWithConst {
+    const COUNT: u32;
+}
+
+struct Test;
+
+impl TraitWithConst for Test {
+    const COUNT: u32 = 1;
+}
+
+#[no_mangle]
+fn entry() {
+    private_vanilla();
+    private_naked();
+
+    public_vanilla_generic::<Test>();
+    public_naked_generic::<Test>();
+}
+
+extern "C" fn private_vanilla() -> u32 {
+    42
+}
+
+#[naked]
+extern "C" fn private_naked() -> u32 {
+    unsafe { asm!("mov rax, 42", "ret", options(noreturn)) }
+}
+
+#[no_mangle]
+pub extern "C" fn public_vanilla() -> u32 {
+    42
+}
+
+#[naked]
+#[no_mangle]
+pub extern "C" fn public_naked() -> u32 {
+    unsafe { asm!("mov rax, 42", "ret", options(noreturn)) }
+}
+
+pub extern "C" fn public_vanilla_generic<T: TraitWithConst>() -> u32 {
+    T::COUNT
+}
+
+#[naked]
+pub extern "C" fn public_naked_generic<T: TraitWithConst>() -> u32 {
+    unsafe { asm!("mov rax, {}", "ret", const T::COUNT, options(noreturn)) }
+}
+
+#[linkage = "external"]
+extern "C" fn vanilla_external_linkage() -> u32 {
+    42
+}
+
+#[naked]
+#[linkage = "external"]
+extern "C" fn naked_external_linkage() -> u32 {
+    unsafe { asm!("mov rax, 42", "ret", options(noreturn)) }
+}
+
+#[cfg(not(windows))]
+#[linkage = "weak"]
+extern "C" fn vanilla_weak_linkage() -> u32 {
+    42
+}
+
+#[naked]
+#[cfg(not(windows))]
+#[linkage = "weak"]
+extern "C" fn naked_weak_linkage() -> u32 {
+    unsafe { asm!("mov rax, 42", "ret", options(noreturn)) }
+}
+
+// functions that are declared in an `extern "C"` block are currently not exported
+// this maybe should change in the future, this is just tracking the current behavior
+// reported in https://github.com/rust-lang/rust/issues/128071
+std::arch::global_asm! {
+    ".globl function_defined_in_global_asm",
+    "function_defined_in_global_asm:",
+    "ret",
+}
+
+extern "C" {
+    pub fn function_defined_in_global_asm();
+}
diff --git a/tests/run-make/naked-symbol-visibility/rmake.rs b/tests/run-make/naked-symbol-visibility/rmake.rs
new file mode 100644
index 00000000000..07ff253788d
--- /dev/null
+++ b/tests/run-make/naked-symbol-visibility/rmake.rs
@@ -0,0 +1,98 @@
+//@ ignore-windows
+//@ only-x86_64
+use run_make_support::object::read::{File, Object, Symbol};
+use run_make_support::object::ObjectSymbol;
+use run_make_support::targets::is_windows;
+use run_make_support::{dynamic_lib_name, rfs, rustc};
+
+fn main() {
+    let rdylib_name = dynamic_lib_name("a_rust_dylib");
+    rustc().arg("-Zshare-generics=no").input("a_rust_dylib.rs").run();
+
+    let binary_data = rfs::read(&rdylib_name);
+    let rdylib = File::parse(&*binary_data).unwrap();
+
+    // naked should mirror vanilla
+    not_exported(&rdylib, "private_vanilla");
+    not_exported(&rdylib, "private_naked");
+
+    global_function(&rdylib, "public_vanilla");
+    global_function(&rdylib, "public_naked");
+
+    not_exported(&rdylib, "public_vanilla_generic");
+    not_exported(&rdylib, "public_naked_generic");
+
+    global_function(&rdylib, "vanilla_external_linkage");
+    global_function(&rdylib, "naked_external_linkage");
+
+    // FIXME: make this work on windows (gnu and msvc). See the PR
+    // https://github.com/rust-lang/rust/pull/128362 for some approaches
+    // that don't work
+    //
+    // #[linkage = "weak"] does not work well on windows, we get
+    //
+    // lib.def : error LNK2001: unresolved external symbol naked_weak_linkage␍
+    // lib.def : error LNK2001: unresolved external symbol vanilla_weak_linkage
+    //
+    // so just skip weak symbols on windows (for now)
+    if !is_windows() {
+        weak_function(&rdylib, "vanilla_weak_linkage");
+        weak_function(&rdylib, "naked_weak_linkage");
+    }
+
+    // functions that are declared in an `extern "C"` block are currently not exported
+    // this maybe should change in the future, this is just tracking the current behavior
+    // reported in https://github.com/rust-lang/rust/issues/128071
+    not_exported(&rdylib, "function_defined_in_global_asm");
+
+    // share generics should expose the generic functions
+    rustc().arg("-Zshare-generics=yes").input("a_rust_dylib.rs").run();
+    let binary_data = rfs::read(&rdylib_name);
+    let rdylib = File::parse(&*binary_data).unwrap();
+
+    global_function(&rdylib, "public_vanilla_generic");
+    global_function(&rdylib, "public_naked_generic");
+}
+
+#[track_caller]
+fn global_function(file: &File, symbol_name: &str) {
+    let symbols = find_dynamic_symbol(file, symbol_name);
+    let [symbol] = symbols.as_slice() else {
+        panic!("symbol {symbol_name} occurs {} times", symbols.len())
+    };
+
+    assert!(symbol.is_definition(), "`{symbol_name}` is not a function");
+    assert!(symbol.is_global(), "`{symbol_name}` is not marked as global");
+}
+
+#[track_caller]
+fn weak_function(file: &File, symbol_name: &str) {
+    let symbols = find_dynamic_symbol(file, symbol_name);
+    let [symbol] = symbols.as_slice() else {
+        panic!("symbol {symbol_name} occurs {} times", symbols.len())
+    };
+
+    assert!(symbol.is_definition(), "`{symbol_name}` is not a function");
+    assert!(symbol.is_weak(), "`{symbol_name}` is not marked as weak");
+}
+
+#[track_caller]
+fn not_exported(file: &File, symbol_name: &str) {
+    assert_eq!(find_dynamic_symbol(file, symbol_name).len(), 0)
+}
+
+fn find_subsequence(haystack: &[u8], needle: &[u8]) -> bool {
+    haystack.windows(needle.len()).any(|window| window == needle)
+}
+
+fn find_dynamic_symbol<'file, 'data>(
+    file: &'file File<'data>,
+    expected: &str,
+) -> Vec<Symbol<'data, 'file>> {
+    file.exports()
+        .unwrap()
+        .into_iter()
+        .filter(|e| find_subsequence(e.name(), expected.as_bytes()))
+        .filter_map(|e| file.symbol_by_name_bytes(e.name()))
+        .collect()
+}
diff --git a/tests/run-make/native-link-modifier-whole-archive/Makefile b/tests/run-make/native-link-modifier-whole-archive/Makefile
deleted file mode 100644
index 5eb7a416f91..00000000000
--- a/tests/run-make/native-link-modifier-whole-archive/Makefile
+++ /dev/null
@@ -1,52 +0,0 @@
-# ignore-cross-compile -- compiling C++ code does not work well when cross-compiling
-
-# This test case makes sure that native libraries are linked with appropriate semantics
-# when the `[+-]bundle,[+-]whole-archive` modifiers are applied to them.
-#
-# The test works by checking that the resulting executables produce the expected output,
-# part of which is emitted by otherwise unreferenced C code. If +whole-archive didn't work
-# that code would never make it into the final executable and we'd thus be missing some
-# of the output.
-
-include ../tools.mk
-
-all: $(TMPDIR)/$(call BIN,directly_linked) \
-     $(TMPDIR)/$(call BIN,directly_linked_test_plus_whole_archive) \
-     $(TMPDIR)/$(call BIN,directly_linked_test_minus_whole_archive) \
-     $(TMPDIR)/$(call BIN,indirectly_linked) \
-     $(TMPDIR)/$(call BIN,indirectly_linked_via_attr)
-	$(call RUN,directly_linked) | $(CGREP) 'static-initializer.directly_linked.'
-	$(call RUN,directly_linked_test_plus_whole_archive) --nocapture | $(CGREP) 'static-initializer.'
-	$(call RUN,directly_linked_test_minus_whole_archive) --nocapture | $(CGREP) -v 'static-initializer.'
-	$(call RUN,indirectly_linked) | $(CGREP) 'static-initializer.indirectly_linked.'
-	$(call RUN,indirectly_linked_via_attr) | $(CGREP) 'static-initializer.native_lib_in_src.'
-
-# Native lib linked directly into executable
-$(TMPDIR)/$(call BIN,directly_linked): $(call NATIVE_STATICLIB,c_static_lib_with_constructor)
-	$(RUSTC) directly_linked.rs -l static:+whole-archive=c_static_lib_with_constructor
-
-# Native lib linked into test executable, +whole-archive
-$(TMPDIR)/$(call BIN,directly_linked_test_plus_whole_archive): $(call NATIVE_STATICLIB,c_static_lib_with_constructor)
-	$(RUSTC) directly_linked_test_plus_whole_archive.rs --test -l static:+whole-archive=c_static_lib_with_constructor
-# Native lib linked into test executable, -whole-archive
-$(TMPDIR)/$(call BIN,directly_linked_test_minus_whole_archive): $(call NATIVE_STATICLIB,c_static_lib_with_constructor)
-	$(RUSTC) directly_linked_test_minus_whole_archive.rs --test -l static:-whole-archive=c_static_lib_with_constructor
-
-# Native lib linked into RLIB via `-l static:-bundle,+whole-archive`, RLIB linked into executable
-$(TMPDIR)/$(call BIN,indirectly_linked): $(TMPDIR)/librlib_with_cmdline_native_lib.rlib
-	$(RUSTC) indirectly_linked.rs
-
-# Native lib linked into RLIB via #[link] attribute, RLIB linked into executable
-$(TMPDIR)/$(call BIN,indirectly_linked_via_attr): $(TMPDIR)/libnative_lib_in_src.rlib
-	$(RUSTC) indirectly_linked_via_attr.rs
-
-# Native lib linked into rlib with via commandline
-$(TMPDIR)/librlib_with_cmdline_native_lib.rlib: $(call NATIVE_STATICLIB,c_static_lib_with_constructor)
-	$(RUSTC) rlib_with_cmdline_native_lib.rs --crate-type=rlib -l static:-bundle,+whole-archive=c_static_lib_with_constructor
-
-# Native lib linked into rlib via `#[link()]` attribute on extern block.
-$(TMPDIR)/libnative_lib_in_src.rlib: $(call NATIVE_STATICLIB,c_static_lib_with_constructor)
-	$(RUSTC) native_lib_in_src.rs --crate-type=rlib
-
-$(TMPDIR)/libc_static_lib_with_constructor.o: c_static_lib_with_constructor.cpp
-	$(call COMPILE_OBJ_CXX,$@,$<)
diff --git a/tests/run-make/native-link-modifier-whole-archive/rmake.rs b/tests/run-make/native-link-modifier-whole-archive/rmake.rs
new file mode 100644
index 00000000000..b8b814043e5
--- /dev/null
+++ b/tests/run-make/native-link-modifier-whole-archive/rmake.rs
@@ -0,0 +1,86 @@
+// This test case makes sure that native libraries are linked with appropriate semantics
+// when the `[+-]bundle,[+-]whole-archive` modifiers are applied to them.
+// The test works by checking that the resulting executables produce the expected output,
+// part of which is emitted by otherwise unreferenced C code. If +whole-archive didn't work
+// that code would never make it into the final executable and we'd thus be missing some
+// of the output.
+// See https://github.com/rust-lang/rust/issues/88085
+
+//@ ignore-cross-compile
+// Reason: compiling C++ code does not work well when cross-compiling
+// plus, the compiled binary is executed
+
+use run_make_support::{cxx, is_msvc, llvm_ar, run, run_with_args, rustc, static_lib_name};
+
+fn main() {
+    let mut cxx = cxx();
+    if is_msvc() {
+        cxx.arg("-EHs");
+    }
+    cxx.input("c_static_lib_with_constructor.cpp")
+        .arg("-c")
+        .out_exe("libc_static_lib_with_constructor")
+        .run();
+
+    let mut llvm_ar = llvm_ar();
+    llvm_ar.obj_to_ar();
+    if is_msvc() {
+        llvm_ar
+            .output_input(
+                static_lib_name("c_static_lib_with_constructor"),
+                "libc_static_lib_with_constructor.obj",
+            )
+            .run();
+    } else {
+        llvm_ar
+            .output_input(
+                static_lib_name("c_static_lib_with_constructor"),
+                "libc_static_lib_with_constructor",
+            )
+            .run();
+    }
+
+    // Native lib linked directly into executable
+    rustc()
+        .input("directly_linked.rs")
+        .arg("-lstatic:+whole-archive=c_static_lib_with_constructor")
+        .run();
+
+    // Native lib linked into test executable, +whole-archive
+    rustc()
+        .input("directly_linked_test_plus_whole_archive.rs")
+        .arg("--test")
+        .arg("-lstatic:+whole-archive=c_static_lib_with_constructor")
+        .run();
+
+    // Native lib linked into test executable, -whole-archive
+    rustc()
+        .input("directly_linked_test_minus_whole_archive.rs")
+        .arg("--test")
+        .arg("-lstatic:-whole-archive=c_static_lib_with_constructor")
+        .run();
+
+    // Native lib linked into rlib with via commandline
+    rustc()
+        .input("rlib_with_cmdline_native_lib.rs")
+        .crate_type("rlib")
+        .arg("-lstatic:-bundle,+whole-archive=c_static_lib_with_constructor")
+        .run();
+    // Native lib linked into RLIB via `-l static:-bundle,+whole-archive`
+    // RLIB linked into executable
+    rustc().input("indirectly_linked.rs").run();
+
+    // Native lib linked into rlib via `#[link()]` attribute on extern block.
+    rustc().input("native_lib_in_src.rs").crate_type("rlib").run();
+    // Native lib linked into RLIB via #[link] attribute, RLIB linked into executable
+    rustc().input("indirectly_linked_via_attr.rs").run();
+
+    run("directly_linked").assert_stdout_contains("static-initializer.directly_linked.");
+    run_with_args("directly_linked_test_plus_whole_archive", &["--nocapture"])
+        .assert_stdout_contains("static-initializer.");
+    run_with_args("directly_linked_test_minus_whole_archive", &["--nocapture"])
+        .assert_stdout_not_contains("static-initializer.");
+    run("indirectly_linked").assert_stdout_contains("static-initializer.indirectly_linked.");
+    run("indirectly_linked_via_attr")
+        .assert_stdout_contains("static-initializer.native_lib_in_src.");
+}
diff --git a/tests/run-make/no-builtins-attribute/Makefile b/tests/run-make/no-builtins-attribute/Makefile
deleted file mode 100644
index 0ce95facaea..00000000000
--- a/tests/run-make/no-builtins-attribute/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-include ../tools.mk
-
-# We want to check if `no-builtins` is also added to the function declarations in the used crate.
-
-all:
-	$(RUSTC) no_builtins.rs --emit=link
-	$(RUSTC) main.rs --emit=llvm-ir
-
-	cat "$(TMPDIR)"/main.ll | "$(LLVM_FILECHECK)" filecheck.main.txt
diff --git a/tests/run-make/no-builtins-attribute/rmake.rs b/tests/run-make/no-builtins-attribute/rmake.rs
new file mode 100644
index 00000000000..1e15b0c03f1
--- /dev/null
+++ b/tests/run-make/no-builtins-attribute/rmake.rs
@@ -0,0 +1,13 @@
+// `no_builtins` is an attribute related to LLVM's optimizations. In order to ensure that it has an
+// effect on link-time optimizations (LTO), it should be added to function declarations in a crate.
+// This test uses the `llvm-filecheck` tool to determine that this attribute is successfully
+// being added to these function declarations.
+// See https://github.com/rust-lang/rust/pull/113716
+
+use run_make_support::{llvm_filecheck, rfs, rustc};
+
+fn main() {
+    rustc().input("no_builtins.rs").emit("link").run();
+    rustc().input("main.rs").emit("llvm-ir").run();
+    llvm_filecheck().patterns("filecheck.main.txt").stdin(rfs::read("main.ll")).run();
+}
diff --git a/tests/run-make/no-duplicate-libs/main.rs b/tests/run-make/no-duplicate-libs/main.rs
index b25ef35ada6..d8d5d58bc47 100644
--- a/tests/run-make/no-duplicate-libs/main.rs
+++ b/tests/run-make/no-duplicate-libs/main.rs
@@ -1,6 +1,6 @@
-#[link(name = "foo")] // linker should drop this library, no symbols used
-#[link(name = "bar")] // symbol comes from this library
-#[link(name = "foo")] // now linker picks up `foo` b/c `bar` library needs it
+#[link(name = "foo", kind = "static")] // linker should drop this library, no symbols used
+#[link(name = "bar", kind = "static")] // symbol comes from this library
+#[link(name = "foo", kind = "static")] // now linker picks up `foo` b/c `bar` library needs it
 extern "C" {
     fn bar();
 }
diff --git a/tests/run-make/no-duplicate-libs/rmake.rs b/tests/run-make/no-duplicate-libs/rmake.rs
index 469348e266c..b67067909b2 100644
--- a/tests/run-make/no-duplicate-libs/rmake.rs
+++ b/tests/run-make/no-duplicate-libs/rmake.rs
@@ -9,9 +9,6 @@
 //@ ignore-cross-compile
 // Reason: the compiled binary is executed
 
-//@ ignore-msvc
-// Reason: native compilation results in an unresolved external symbol
-
 use run_make_support::{build_native_static_lib, run, rustc};
 
 fn main() {
diff --git a/tests/run-make/no-intermediate-extras/rmake.rs b/tests/run-make/no-intermediate-extras/rmake.rs
index 0641417504e..0b12da6a01d 100644
--- a/tests/run-make/no-intermediate-extras/rmake.rs
+++ b/tests/run-make/no-intermediate-extras/rmake.rs
@@ -5,9 +5,10 @@
 
 //@ ignore-cross-compile
 
-use run_make_support::rustc;
 use std::fs;
 
+use run_make_support::rustc;
+
 fn main() {
     rustc().crate_type("rlib").arg("--test").input("foo.rs").run();
     assert!(
diff --git a/tests/run-make/non-unicode-env/rmake.rs b/tests/run-make/non-unicode-env/rmake.rs
index 0042e4d1e17..d708192908c 100644
--- a/tests/run-make/non-unicode-env/rmake.rs
+++ b/tests/run-make/non-unicode-env/rmake.rs
@@ -1,5 +1,4 @@
-use run_make_support::rfs;
-use run_make_support::rustc;
+use run_make_support::{rfs, rustc};
 
 fn main() {
     #[cfg(unix)]
diff --git a/tests/run-make/non-unicode-in-incremental-dir/rmake.rs b/tests/run-make/non-unicode-in-incremental-dir/rmake.rs
index ef316f11036..42bd4b1b799 100644
--- a/tests/run-make/non-unicode-in-incremental-dir/rmake.rs
+++ b/tests/run-make/non-unicode-in-incremental-dir/rmake.rs
@@ -8,7 +8,7 @@ fn main() {
     match std::fs::create_dir(&non_unicode) {
         // If an error occurs, check if creating a directory with a valid Unicode name would
         // succeed.
-        Err(e) if std::fs::create_dir("valid_unicode").is_ok() => {
+        Err(_) if std::fs::create_dir("valid_unicode").is_ok() => {
             // Filesystem doesn't appear support non-Unicode paths.
             return;
         }
diff --git a/tests/run-make/obey-crate-type-flag/rmake.rs b/tests/run-make/obey-crate-type-flag/rmake.rs
index 8d6eb237982..3fef4b7e65b 100644
--- a/tests/run-make/obey-crate-type-flag/rmake.rs
+++ b/tests/run-make/obey-crate-type-flag/rmake.rs
@@ -5,10 +5,11 @@
 
 //@ ignore-cross-compile
 
+use std::path::Path;
+
 use run_make_support::{
     cwd, dynamic_lib_name, has_extension, rfs, rust_lib_name, rustc, shallow_find_files,
 };
-use std::path::Path;
 
 fn main() {
     rustc().input("test.rs").run();
diff --git a/tests/run-make/output-type-permutations/rmake.rs b/tests/run-make/output-type-permutations/rmake.rs
index c51b2153945..c0569af6e84 100644
--- a/tests/run-make/output-type-permutations/rmake.rs
+++ b/tests/run-make/output-type-permutations/rmake.rs
@@ -4,11 +4,12 @@
 // files are exactly what is expected, no more, no less.
 // See https://github.com/rust-lang/rust/pull/12020
 
+use std::path::PathBuf;
+
 use run_make_support::{
     bin_name, dynamic_lib_name, filename_not_in_denylist, rfs, rust_lib_name, rustc,
     shallow_find_files, static_lib_name,
 };
-use std::path::PathBuf;
 
 // Each test takes 4 arguments:
 // `must_exist`: output files which must be found - if any are absent, the test fails
@@ -112,7 +113,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "asm-emit".to_string(),
         },
         || {
@@ -122,7 +123,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "asm-emit2".to_string(),
         },
         || {
@@ -132,7 +133,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "asm-emit3".to_string(),
         },
         || {
@@ -143,7 +144,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "llvm-ir-emit".to_string(),
         },
         || {
@@ -153,7 +154,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "llvm-ir-emit2".to_string(),
         },
         || {
@@ -163,7 +164,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "llvm-ir-emit3".to_string(),
         },
         || {
@@ -174,7 +175,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "llvm-bc-emit".to_string(),
         },
         || {
@@ -184,7 +185,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "llvm-bc-emit2".to_string(),
         },
         || {
@@ -194,7 +195,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "llvm-bc-emit3".to_string(),
         },
         || {
@@ -205,7 +206,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "obj-emit".to_string(),
         },
         || {
@@ -215,7 +216,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "obj-emit2".to_string(),
         },
         || {
@@ -225,7 +226,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "obj-emit3".to_string(),
         },
         || {
@@ -267,7 +268,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "rlib".to_string(),
         },
         || {
@@ -277,7 +278,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "rlib2".to_string(),
         },
         || {
@@ -287,7 +288,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "rlib3".to_string(),
         },
         || {
@@ -374,7 +375,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "staticlib".to_string(),
         },
         || {
@@ -384,7 +385,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "staticlib2".to_string(),
         },
         || {
@@ -394,7 +395,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["foo"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "staticlib3".to_string(),
         },
         || {
@@ -448,7 +449,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["ir", rust_lib_name("bar")],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "rlib-ir".to_string(),
         },
         || {
@@ -465,7 +466,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["ir", "asm", "bc", "obj", "link"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "staticlib-all".to_string(),
         },
         || {
@@ -483,7 +484,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["ir", "asm", "bc", "obj", "link"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "staticlib-all2".to_string(),
         },
         || {
@@ -522,7 +523,7 @@ fn main() {
     assert_expected_output_files(
         Expectations {
             expected_files: s!["bar.bc", rust_lib_name("bar"), "foo.bc"],
-            allowed_files: s![],
+            allowed_files: vec![],
             test_dir: "rlib-emits".to_string(),
         },
         || {
diff --git a/tests/run-make/parallel-rustc-no-overwrite/rmake.rs b/tests/run-make/parallel-rustc-no-overwrite/rmake.rs
index 3f412bfefc8..aa38eb664cf 100644
--- a/tests/run-make/parallel-rustc-no-overwrite/rmake.rs
+++ b/tests/run-make/parallel-rustc-no-overwrite/rmake.rs
@@ -5,10 +5,11 @@
 // conflicts. This test uses this flag and checks for successful compilation.
 // See https://github.com/rust-lang/rust/pull/83846
 
-use run_make_support::{rfs, rustc};
 use std::sync::{Arc, Barrier};
 use std::thread;
 
+use run_make_support::{rfs, rustc};
+
 fn main() {
     rfs::create_file("lib.rs");
     let barrier = Arc::new(Barrier::new(2));
diff --git a/tests/run-make/pdb-buildinfo-cl-cmd/Makefile b/tests/run-make/pdb-buildinfo-cl-cmd/Makefile
deleted file mode 100644
index a7be301a5b0..00000000000
--- a/tests/run-make/pdb-buildinfo-cl-cmd/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-include ../tools.mk
-
-# only-windows-msvc
-
-# tests if the pdb contains the following information in the LF_BUILDINFO:
-# 1. the commandline args to compile it (cmd)
-# 2. full path to the compiler (cl)
-
-# we just do a stringsearch on the pdb, as these need to show up at least once, as the LF_BUILDINFO is created for each cgu
-# actual parsing would be better, but this is a simple and good enough solution for now
-
-all:
-	$(RUSTC_ORIGINAL) main.rs -g --crate-name my_crate_name --crate-type bin -C metadata=dc9ef878b0a48666 --out-dir $(TMPDIR)
-	cat '$(TMPDIR)/my_crate_name.pdb' | grep -F '$(RUSTC_ORIGINAL)'
-# using a file containing the string so I don't have problems with escaping quotes and spaces 
-	cat '$(TMPDIR)/my_crate_name.pdb' | grep -f 'stringlist.txt'
diff --git a/tests/run-make/pdb-buildinfo-cl-cmd/rmake.rs b/tests/run-make/pdb-buildinfo-cl-cmd/rmake.rs
new file mode 100644
index 00000000000..2ab9057b24c
--- /dev/null
+++ b/tests/run-make/pdb-buildinfo-cl-cmd/rmake.rs
@@ -0,0 +1,39 @@
+// Check if the pdb file contains the following information in the LF_BUILDINFO:
+// 1. full path to the compiler (cl)
+// 2. the commandline args to compile it (cmd)
+// This is because these used to be missing in #96475.
+// See https://github.com/rust-lang/rust/pull/113492
+
+//@ only-windows-msvc
+// Reason: pdb files are unique to this architecture
+
+use run_make_support::{assert_contains, bstr, env_var, rfs, rustc};
+
+fn main() {
+    rustc()
+        .input("main.rs")
+        .arg("-g")
+        .crate_name("my_crate_name")
+        .crate_type("bin")
+        .metadata("dc9ef878b0a48666")
+        .run();
+    let tests = [
+        &env_var("RUSTC"),
+        r#""main.rs""#,
+        r#""-g""#,
+        r#""--crate-name""#,
+        r#""my_crate_name""#,
+        r#""--crate-type""#,
+        r#""bin""#,
+        r#""-Cmetadata=dc9ef878b0a48666""#,
+    ];
+    for test in tests {
+        assert_pdb_contains(test);
+    }
+}
+
+fn assert_pdb_contains(needle: &str) {
+    let needle = needle.as_bytes();
+    use bstr::ByteSlice;
+    assert!(&rfs::read("my_crate_name.pdb").find(needle).is_some());
+}
diff --git a/tests/run-make/pdb-buildinfo-cl-cmd/stringlist.txt b/tests/run-make/pdb-buildinfo-cl-cmd/stringlist.txt
deleted file mode 100644
index 634e9f19e89..00000000000
--- a/tests/run-make/pdb-buildinfo-cl-cmd/stringlist.txt
+++ /dev/null
@@ -1 +0,0 @@
-"main.rs" "-g" "--crate-name" "my_crate_name" "--crate-type" "bin" "-C" "metadata=dc9ef878b0a48666" "--out-dir"
\ No newline at end of file
diff --git a/tests/run-make/pgo-branch-weights/rmake.rs b/tests/run-make/pgo-branch-weights/rmake.rs
index 588c5c6dc31..ef33d009dbb 100644
--- a/tests/run-make/pgo-branch-weights/rmake.rs
+++ b/tests/run-make/pgo-branch-weights/rmake.rs
@@ -10,9 +10,10 @@
 //@ needs-profiler-support
 //@ ignore-cross-compile
 
-use run_make_support::{llvm_filecheck, llvm_profdata, rfs, run_with_args, rustc};
 use std::path::Path;
 
+use run_make_support::{llvm_filecheck, llvm_profdata, rfs, run_with_args, rustc};
+
 fn main() {
     let path_prof_data_dir = Path::new("prof_data_dir");
     let path_merged_profdata = path_prof_data_dir.join("merged.profdata");
diff --git a/tests/run-make/pgo-gen-lto/Makefile b/tests/run-make/pgo-gen-lto/Makefile
deleted file mode 100644
index 54164c99522..00000000000
--- a/tests/run-make/pgo-gen-lto/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# needs-profiler-support
-# ignore-cross-compile
-
-include ../tools.mk
-
-COMPILE_FLAGS=-Copt-level=3 -Clto=fat -Cprofile-generate="$(TMPDIR)"
-
-all:
-	$(RUSTC) $(COMPILE_FLAGS) test.rs
-	$(call RUN,test) || exit 1
-	[ -e "$(TMPDIR)"/default_*.profraw ] || (echo "No .profraw file"; exit 1)
diff --git a/tests/run-make/pgo-gen-lto/rmake.rs b/tests/run-make/pgo-gen-lto/rmake.rs
new file mode 100644
index 00000000000..53d1623bf58
--- /dev/null
+++ b/tests/run-make/pgo-gen-lto/rmake.rs
@@ -0,0 +1,22 @@
+// A simple smoke test: when rustc compiles with profiling enabled, a profraw file
+// should be generated.
+// See https://github.com/rust-lang/rust/pull/48346
+
+//@ needs-profiler-support
+// Reason: this exercises LTO profiling
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed
+
+use run_make_support::{cwd, has_extension, has_prefix, run, rustc, shallow_find_files};
+
+fn main() {
+    rustc().opt_level("3").arg("-Clto=fat").profile_generate(cwd()).input("test.rs").run();
+    run("test");
+    assert_eq!(
+        shallow_find_files(cwd(), |path| {
+            has_prefix(path, "default_") && has_extension(path, "profraw")
+        })
+        .len(),
+        1
+    );
+}
diff --git a/tests/run-make/pgo-indirect-call-promotion/Makefile b/tests/run-make/pgo-indirect-call-promotion/Makefile
deleted file mode 100644
index 8d1e69c4aba..00000000000
--- a/tests/run-make/pgo-indirect-call-promotion/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-# needs-profiler-support
-# ignore-cross-compile
-
-include ../tools.mk
-
-all:
-	# We don't compile `opaque` with either optimizations or instrumentation.
-	# We don't compile `opaque` with either optimizations or instrumentation.
-	$(RUSTC) $(COMMON_FLAGS) opaque.rs
-	# Compile the test program with instrumentation
-	mkdir -p "$(TMPDIR)"/prof_data_dir
-	$(RUSTC) $(COMMON_FLAGS) interesting.rs \
-		-Cprofile-generate="$(TMPDIR)"/prof_data_dir -O -Ccodegen-units=1
-	$(RUSTC) $(COMMON_FLAGS) main.rs -Cprofile-generate="$(TMPDIR)"/prof_data_dir -O
-	# The argument below generates to the expected branch weights
-	$(call RUN,main) || exit 1
-	"$(LLVM_BIN_DIR)"/llvm-profdata merge \
-		-o "$(TMPDIR)"/prof_data_dir/merged.profdata \
-		"$(TMPDIR)"/prof_data_dir
-	$(RUSTC) $(COMMON_FLAGS) interesting.rs \
-		-Cprofile-use="$(TMPDIR)"/prof_data_dir/merged.profdata -O \
-		-Ccodegen-units=1 --emit=llvm-ir
-	cat "$(TMPDIR)"/interesting.ll | "$(LLVM_FILECHECK)" filecheck-patterns.txt
diff --git a/tests/run-make/pgo-indirect-call-promotion/rmake.rs b/tests/run-make/pgo-indirect-call-promotion/rmake.rs
new file mode 100644
index 00000000000..d0ccfd8a4d7
--- /dev/null
+++ b/tests/run-make/pgo-indirect-call-promotion/rmake.rs
@@ -0,0 +1,33 @@
+// This test checks that indirect call promotion is performed. The test
+// programs calls the same function a thousand times through a function pointer.
+// Only PGO data provides the information that it actually always is the same
+// function. We verify that the indirect call promotion pass inserts a check
+// whether it can make a direct call instead of the indirect call.
+// See https://github.com/rust-lang/rust/pull/66631
+
+//@ needs-profiler-support
+// Reason: llvm_profdata is used
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed
+
+use run_make_support::{llvm_filecheck, llvm_profdata, rfs, run, rustc};
+
+fn main() {
+    // We don't compile `opaque` with either optimizations or instrumentation.
+    rustc().input("opaque.rs").run();
+    // Compile the test program with instrumentation
+    rfs::create_dir("prof_data_dir");
+    rustc().input("interesting.rs").profile_generate("prof_data_dir").opt().codegen_units(1).run();
+    rustc().input("main.rs").profile_generate("prof_data_dir").opt().run();
+    // The argument below generates to the expected branch weights
+    run("main");
+    llvm_profdata().merge().output("prof_data_dir/merged.profdata").input("prof_data_dir").run();
+    rustc()
+        .input("interesting.rs")
+        .profile_use("prof_data_dir/merged.profdata")
+        .opt()
+        .codegen_units(1)
+        .emit("llvm-ir")
+        .run();
+    llvm_filecheck().patterns("filecheck-patterns.txt").stdin(rfs::read("interesting.ll")).run();
+}
diff --git a/tests/run-make/pretty-print-with-dep-file/rmake.rs b/tests/run-make/pretty-print-with-dep-file/rmake.rs
index d7a29ff7d19..5d422085834 100644
--- a/tests/run-make/pretty-print-with-dep-file/rmake.rs
+++ b/tests/run-make/pretty-print-with-dep-file/rmake.rs
@@ -5,9 +5,10 @@
 // does not get an unexpected dep-info file.
 // See https://github.com/rust-lang/rust/issues/112898
 
-use run_make_support::{invalid_utf8_contains, rfs, rustc};
 use std::path::Path;
 
+use run_make_support::{invalid_utf8_contains, rfs, rustc};
+
 fn main() {
     rustc().emit("dep-info").arg("-Zunpretty=expanded").input("with-dep.rs").run();
     invalid_utf8_contains("with-dep.d", "with-dep.rs");
diff --git a/tests/run-make/print-calling-conventions/Makefile b/tests/run-make/print-calling-conventions/Makefile
deleted file mode 100644
index 27b87e61086..00000000000
--- a/tests/run-make/print-calling-conventions/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../tools.mk
-
-all:
-	$(RUSTC) --print calling-conventions
diff --git a/tests/run-make/print-cfg/rmake.rs b/tests/run-make/print-cfg/rmake.rs
index d83e8a36f2c..471a99b90d9 100644
--- a/tests/run-make/print-cfg/rmake.rs
+++ b/tests/run-make/print-cfg/rmake.rs
@@ -6,7 +6,6 @@
 //! It also checks that some targets have the correct set cfgs.
 
 use std::collections::HashSet;
-use std::ffi::OsString;
 use std::iter::FromIterator;
 use std::path::PathBuf;
 
@@ -91,10 +90,8 @@ fn check(PrintCfg { target, includes, disallow }: PrintCfg) {
     // --print=cfg=PATH
     {
         let tmp_path = PathBuf::from(format!("{target}.cfg"));
-        let mut print_arg = OsString::from("--print=cfg=");
-        print_arg.push(tmp_path.as_os_str());
 
-        rustc().target(target).arg(print_arg).run();
+        rustc().target(target).print(&format!("cfg={}", tmp_path.display())).run();
 
         let output = rfs::read_to_string(&tmp_path);
 
diff --git a/tests/run-make/print-check-cfg/rmake.rs b/tests/run-make/print-check-cfg/rmake.rs
index 4a79910c8e0..f6f7f7cece6 100644
--- a/tests/run-make/print-check-cfg/rmake.rs
+++ b/tests/run-make/print-check-cfg/rmake.rs
@@ -4,7 +4,6 @@ extern crate run_make_support;
 
 use std::collections::HashSet;
 use std::iter::FromIterator;
-use std::ops::Deref;
 
 use run_make_support::rustc;
 
@@ -87,7 +86,7 @@ fn main() {
 
 fn check(CheckCfg { args, contains }: CheckCfg) {
     let output =
-        rustc().input("lib.rs").arg("-Zunstable-options").arg("--print=check-cfg").args(args).run();
+        rustc().input("lib.rs").arg("-Zunstable-options").print("check-cfg").args(args).run();
 
     let stdout = output.stdout_utf8();
 
diff --git a/tests/run-make/print-native-static-libs/rmake.rs b/tests/run-make/print-native-static-libs/rmake.rs
index b4e7c0e17ff..a51ac934c72 100644
--- a/tests/run-make/print-native-static-libs/rmake.rs
+++ b/tests/run-make/print-native-static-libs/rmake.rs
@@ -12,8 +12,6 @@
 //@ ignore-cross-compile
 //@ ignore-wasm
 
-use std::io::BufRead;
-
 use run_make_support::{is_msvc, rustc};
 
 fn main() {
diff --git a/tests/run-make/print-target-list/Makefile b/tests/run-make/print-target-list/Makefile
deleted file mode 100644
index f23c40d4281..00000000000
--- a/tests/run-make/print-target-list/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-include ../tools.mk
-
-# Checks that all the targets returned by `rustc --print target-list` are valid
-# target specifications
-all:
-	for target in $(shell $(BARE_RUSTC) --print target-list); do \
-		$(BARE_RUSTC) --target $$target --print sysroot; \
-	done
diff --git a/tests/run-make/print-target-list/rmake.rs b/tests/run-make/print-target-list/rmake.rs
new file mode 100644
index 00000000000..743ed52069d
--- /dev/null
+++ b/tests/run-make/print-target-list/rmake.rs
@@ -0,0 +1,21 @@
+// Checks that all the targets returned by `rustc --print target-list` are valid
+// target specifications
+
+use run_make_support::bare_rustc;
+
+// FIXME(127877): certain experimental targets fail with creating a 'LLVM TargetMachine'
+// in CI, so we skip them
+const EXPERIMENTAL_TARGETS: &[&str] = &["avr", "m68k", "csky", "xtensa"];
+
+fn main() {
+    let targets = bare_rustc().print("target-list").run().stdout_utf8();
+
+    for target in targets.lines() {
+        // skip experimental targets that would otherwise fail
+        if EXPERIMENTAL_TARGETS.iter().any(|experimental| target.contains(experimental)) {
+            continue;
+        }
+
+        bare_rustc().target(target).print("sysroot").run();
+    }
+}
diff --git a/tests/run-make/print-to-output/rmake.rs b/tests/run-make/print-to-output/rmake.rs
index d0cba725b36..db2a291f8e7 100644
--- a/tests/run-make/print-to-output/rmake.rs
+++ b/tests/run-make/print-to-output/rmake.rs
@@ -1,7 +1,6 @@
 //! This checks the output of some `--print` options when
 //! output to a file (instead of stdout)
 
-use std::ffi::OsString;
 use std::path::PathBuf;
 
 use run_make_support::{rfs, rustc, target};
@@ -44,10 +43,8 @@ fn check(args: Option) {
     // --print={option}=PATH
     let output = {
         let tmp_path = PathBuf::from(format!("{}.txt", args.option));
-        let mut print_arg = OsString::from(format!("--print={}=", args.option));
-        print_arg.push(tmp_path.as_os_str());
 
-        rustc().target(args.target).arg(print_arg).run();
+        rustc().target(args.target).print(&format!("{}={}", args.option, tmp_path.display())).run();
 
         rfs::read_to_string(&tmp_path)
     };
diff --git a/tests/run-make/profile/rmake.rs b/tests/run-make/profile/rmake.rs
index 8d41978baec..4c6f9c19091 100644
--- a/tests/run-make/profile/rmake.rs
+++ b/tests/run-make/profile/rmake.rs
@@ -8,9 +8,10 @@
 //@ ignore-cross-compile
 //@ needs-profiler-support
 
-use run_make_support::{run, rustc};
 use std::path::Path;
 
+use run_make_support::{run, rustc};
+
 fn main() {
     rustc().arg("-g").arg("-Zprofile").input("test.rs").run();
     run("test");
diff --git a/tests/run-make/raw-dylib-alt-calling-convention/Makefile b/tests/run-make/raw-dylib-alt-calling-convention/Makefile
deleted file mode 100644
index 14d23a5d201..00000000000
--- a/tests/run-make/raw-dylib-alt-calling-convention/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-# Test the behavior of #[link(.., kind = "raw-dylib")] with alternative calling conventions.
-
-# only-x86
-# only-windows
-
-include ../tools.mk
-
-all:
-	$(RUSTC) --crate-type lib --crate-name raw_dylib_alt_calling_convention_test lib.rs
-	$(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)"
-	$(call COMPILE_OBJ,"$(TMPDIR)"/extern.obj,extern.c)
-ifdef IS_MSVC
-	$(CC) "$(TMPDIR)"/extern.obj -link -dll -out:"$(TMPDIR)"/extern.dll -noimplib
-else
-	$(CC) "$(TMPDIR)"/extern.obj -shared -o "$(TMPDIR)"/extern.dll
-endif
-
-	"$(TMPDIR)"/driver > "$(TMPDIR)"/output.txt
-	$(RUSTC_TEST_OP) "$(TMPDIR)"/output.txt output.txt
-
-ifdef IS_MSVC
-	"$(TMPDIR)"/driver true > "$(TMPDIR)"/output.msvc.txt
-	$(RUSTC_TEST_OP) "$(TMPDIR)"/output.msvc.txt output.msvc.txt
-endif
diff --git a/tests/run-make/raw-dylib-alt-calling-convention/rmake.rs b/tests/run-make/raw-dylib-alt-calling-convention/rmake.rs
new file mode 100644
index 00000000000..1a1622f2754
--- /dev/null
+++ b/tests/run-make/raw-dylib-alt-calling-convention/rmake.rs
@@ -0,0 +1,32 @@
+// `raw-dylib` is a Windows-specific attribute which emits idata sections for the items in the
+// attached extern block,
+// so they may be linked against without linking against an import library.
+// To learn more, read https://github.com/rust-lang/rfcs/blob/master/text/2627-raw-dylib-kind.md
+// This test uses this feature alongside alternative calling conventions, checking that both
+// features are compatible and result in the expected output upon execution of the binary.
+// See https://github.com/rust-lang/rust/pull/84171
+
+//@ only-x86
+//@ only-windows
+
+use run_make_support::{build_native_dynamic_lib, diff, is_msvc, run, run_with_args, rustc};
+
+fn main() {
+    rustc()
+        .crate_type("lib")
+        .crate_name("raw_dylib_alt_calling_convention_test")
+        .input("lib.rs")
+        .run();
+    rustc().crate_type("bin").input("driver.rs").run();
+    build_native_dynamic_lib("extern");
+    let out = run("driver").stdout_utf8();
+    diff().expected_file("output.txt").actual_text("actual", out).normalize(r#"\r"#, "").run();
+    if is_msvc() {
+        let out_msvc = run_with_args("driver", &["true"]).stdout_utf8();
+        diff()
+            .expected_file("output.msvc.txt")
+            .actual_text("actual", out_msvc)
+            .normalize(r#"\r"#, "")
+            .run();
+    }
+}
diff --git a/tests/run-make/raw-dylib-c/Makefile b/tests/run-make/raw-dylib-c/Makefile
deleted file mode 100644
index af5c4a6edd7..00000000000
--- a/tests/run-make/raw-dylib-c/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-# Test the behavior of #[link(.., kind = "raw-dylib")] on windows-msvc
-
-# only-windows
-
-include ../tools.mk
-
-all:
-	$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs
-	$(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)"
-	$(RUSTC) --crate-type bin --crate-name raw_dylib_test_bin lib.rs
-	$(call COMPILE_OBJ,"$(TMPDIR)"/extern_1.obj,extern_1.c)
-	$(call COMPILE_OBJ,"$(TMPDIR)"/extern_2.obj,extern_2.c)
-ifdef IS_MSVC
-	$(CC) "$(TMPDIR)"/extern_1.obj -link -dll -out:"$(TMPDIR)"/extern_1.dll -noimplib
-	$(CC) "$(TMPDIR)"/extern_2.obj -link -dll -out:"$(TMPDIR)"/extern_2.dll -noimplib
-else
-	$(CC) "$(TMPDIR)"/extern_1.obj -shared -o "$(TMPDIR)"/extern_1.dll
-	$(CC) "$(TMPDIR)"/extern_2.obj -shared -o "$(TMPDIR)"/extern_2.dll
-endif
-	"$(TMPDIR)"/driver | tr -d '\r' > "$(TMPDIR)"/output.txt
-	"$(TMPDIR)"/raw_dylib_test_bin > "$(TMPDIR)"/output_bin.txt
-
-ifdef RUSTC_BLESS_TEST
-	cp "$(TMPDIR)"/output.txt output.txt
-else
-	$(DIFF) output.txt "$(TMPDIR)"/output.txt
-	$(DIFF) output.txt "$(TMPDIR)"/output_bin.txt
-endif
diff --git a/tests/run-make/raw-dylib-c/rmake.rs b/tests/run-make/raw-dylib-c/rmake.rs
new file mode 100644
index 00000000000..3cfd8cb400b
--- /dev/null
+++ b/tests/run-make/raw-dylib-c/rmake.rs
@@ -0,0 +1,29 @@
+// `raw-dylib` is a Windows-specific attribute which emits idata sections for the items in the
+// attached extern block,
+// so they may be linked against without linking against an import library.
+// To learn more, read https://github.com/rust-lang/rfcs/blob/master/text/2627-raw-dylib-kind.md
+// This test is the simplest of the raw-dylib tests, simply smoke-testing that the feature
+// can be used to build an executable binary with an expected output with native C files
+// compiling into dynamic libraries.
+// See https://github.com/rust-lang/rust/pull/86419
+
+//@ only-windows
+
+use run_make_support::{build_native_dynamic_lib, diff, run, rustc};
+
+fn main() {
+    rustc().crate_type("lib").crate_name("raw_dylib_test").input("lib.rs").run();
+    rustc().crate_type("bin").input("driver.rs").run();
+    rustc().crate_type("bin").crate_name("raw_dylib_test_bin").input("lib.rs").run();
+    build_native_dynamic_lib("extern_1");
+    build_native_dynamic_lib("extern_2");
+    let out_driver = run("driver").stdout_utf8();
+    let out_raw = run("raw_dylib_test_bin").stdout_utf8();
+
+    diff()
+        .expected_file("output.txt")
+        .actual_text("actual", out_driver)
+        .normalize(r#"\r"#, "")
+        .run();
+    diff().expected_file("output.txt").actual_text("actual", out_raw).normalize(r#"\r"#, "").run();
+}
diff --git a/tests/run-make/raw-dylib-import-name-type/Makefile b/tests/run-make/raw-dylib-import-name-type/Makefile
deleted file mode 100644
index 901d3e861c2..00000000000
--- a/tests/run-make/raw-dylib-import-name-type/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# Test the behavior of #[link(.., kind = "raw-dylib")] with alternative calling conventions.
-
-# only-x86
-# only-windows
-
-include ../tools.mk
-
-all:
-	$(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)"
-	$(call COMPILE_OBJ,"$(TMPDIR)"/extern.obj,extern.c)
-ifdef IS_MSVC
-	$(CC) "$(TMPDIR)"/extern.obj extern.msvc.def -link -dll -out:"$(TMPDIR)"/extern.dll -noimplib
-else
-	$(CC) "$(TMPDIR)"/extern.obj extern.gnu.def --no-leading-underscore -shared -o "$(TMPDIR)"/extern.dll
-endif
-	"$(TMPDIR)"/driver > "$(TMPDIR)"/output.txt
-	$(RUSTC_TEST_OP) "$(TMPDIR)"/output.txt output.txt
diff --git a/tests/run-make/raw-dylib-import-name-type/rmake.rs b/tests/run-make/raw-dylib-import-name-type/rmake.rs
new file mode 100644
index 00000000000..13a2c99150e
--- /dev/null
+++ b/tests/run-make/raw-dylib-import-name-type/rmake.rs
@@ -0,0 +1,37 @@
+// `raw-dylib` is a Windows-specific attribute which emits idata sections for the items in the
+// attached extern block,
+// so they may be linked against without linking against an import library.
+// To learn more, read https://github.com/rust-lang/rfcs/blob/master/text/2627-raw-dylib-kind.md
+// This test uses this feature alongside `import_name_type`, which allows for customization
+// of how Windows symbols will be named. A sanity check of this feature is done by comparison
+// with expected output.
+// See https://github.com/rust-lang/rust/pull/100732
+
+//@ only-x86
+//@ only-windows
+// Reason: this test specifically exercises a 32bit Windows calling convention.
+
+use run_make_support::{cc, diff, is_msvc, run, rustc};
+
+// NOTE: build_native_dynamic lib is not used, as the special `def` files
+// must be passed to the CC compiler.
+
+fn main() {
+    rustc().crate_type("bin").input("driver.rs").run();
+    if is_msvc() {
+        cc().arg("-c").out_exe("extern").input("extern.c").run();
+        cc().input("extern.obj")
+            .arg("extern.msvc.def")
+            .args(&["-link", "-dll", "-noimplib", "-out:extern.dll"])
+            .run();
+    } else {
+        cc().arg("-v").arg("-c").out_exe("extern.obj").input("extern.c").run();
+        cc().input("extern.obj")
+            .arg("extern.gnu.def")
+            .args(&["--no-leading-underscore", "-shared"])
+            .output("extern.dll")
+            .run();
+    };
+    let out = run("driver").stdout_utf8();
+    diff().expected_file("output.txt").actual_text("actual", out).normalize(r#"\r"#, "").run();
+}
diff --git a/tests/run-make/raw-dylib-link-ordinal/Makefile b/tests/run-make/raw-dylib-link-ordinal/Makefile
deleted file mode 100644
index 3cf1300c243..00000000000
--- a/tests/run-make/raw-dylib-link-ordinal/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# Test the behavior of #[link(.., kind = "raw-dylib")] and #[link_ordinal] on windows-msvc
-
-# only-windows
-
-include ../tools.mk
-
-all:
-	$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs
-	$(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)"
-	$(call COMPILE_OBJ,"$(TMPDIR)"/exporter.obj,exporter.c)
-ifdef IS_MSVC
-	$(CC) "$(TMPDIR)"/exporter.obj exporter.def -link -dll -out:"$(TMPDIR)"/exporter.dll -noimplib
-else
-	$(CC) "$(TMPDIR)"/exporter.obj exporter.def -shared -o "$(TMPDIR)"/exporter.dll
-endif
-	"$(TMPDIR)"/driver | tr -d '\r' > "$(TMPDIR)"/output.txt
-	$(RUSTC_TEST_OP) "$(TMPDIR)"/output.txt output.txt
diff --git a/tests/run-make/raw-dylib-link-ordinal/rmake.rs b/tests/run-make/raw-dylib-link-ordinal/rmake.rs
new file mode 100644
index 00000000000..b52181ae3f9
--- /dev/null
+++ b/tests/run-make/raw-dylib-link-ordinal/rmake.rs
@@ -0,0 +1,34 @@
+// `raw-dylib` is a Windows-specific attribute which emits idata sections for the items in the
+// attached extern block,
+// so they may be linked against without linking against an import library.
+// To learn more, read https://github.com/rust-lang/rfcs/blob/master/text/2627-raw-dylib-kind.md
+// `#[link_ordinal(n)]` allows Rust to link against DLLs that export symbols by ordinal rather
+// than by name. As long as the ordinal matches, the name of the function in Rust is not
+// required to match the name of the corresponding function in the exporting DLL.
+// This test is a sanity check for this feature, done by comparing its output against expected
+// output.
+// See https://github.com/rust-lang/rust/pull/89025
+
+//@ only-windows
+
+use run_make_support::{cc, diff, is_msvc, run, rustc};
+
+// NOTE: build_native_dynamic lib is not used, as the special `def` files
+// must be passed to the CC compiler.
+
+fn main() {
+    rustc().crate_type("lib").crate_name("raw_dylib_test").input("lib.rs").run();
+    rustc().crate_type("bin").input("driver.rs").run();
+    if is_msvc() {
+        cc().arg("-c").out_exe("exporter").input("exporter.c").run();
+        cc().input("exporter.obj")
+            .arg("exporter.def")
+            .args(&["-link", "-dll", "-noimplib", "-out:exporter.dll"])
+            .run();
+    } else {
+        cc().arg("-v").arg("-c").out_exe("exporter.obj").input("exporter.c").run();
+        cc().input("exporter.obj").arg("exporter.def").arg("-shared").output("exporter.dll").run();
+    };
+    let out = run("driver").stdout_utf8();
+    diff().expected_file("output.txt").actual_text("actual", out).normalize(r#"\r"#, "").run();
+}
diff --git a/tests/run-make/raw-dylib-stdcall-ordinal/Makefile b/tests/run-make/raw-dylib-stdcall-ordinal/Makefile
deleted file mode 100644
index 70e4de62c1a..00000000000
--- a/tests/run-make/raw-dylib-stdcall-ordinal/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# Test the behavior of #[link(.., kind = "raw-dylib")], #[link_ordinal], and alternative calling conventions on i686 windows.
-
-# only-x86
-# only-windows
-
-include ../tools.mk
-
-all:
-	$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs
-	$(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)"
-	$(call COMPILE_OBJ,"$(TMPDIR)"/exporter.obj,exporter.c)
-ifdef IS_MSVC
-	$(CC) "$(TMPDIR)"/exporter.obj exporter-msvc.def -link -dll -out:"$(TMPDIR)"/exporter.dll -noimplib
-else
-	$(CC) "$(TMPDIR)"/exporter.obj exporter-gnu.def -shared -o "$(TMPDIR)"/exporter.dll
-endif
-	"$(TMPDIR)"/driver > "$(TMPDIR)"/actual_output.txt
-	$(RUSTC_TEST_OP) "$(TMPDIR)"/actual_output.txt expected_output.txt
diff --git a/tests/run-make/raw-dylib-stdcall-ordinal/rmake.rs b/tests/run-make/raw-dylib-stdcall-ordinal/rmake.rs
new file mode 100644
index 00000000000..320ea1520d8
--- /dev/null
+++ b/tests/run-make/raw-dylib-stdcall-ordinal/rmake.rs
@@ -0,0 +1,41 @@
+// `raw-dylib` is a Windows-specific attribute which emits idata sections for the items in the
+// attached extern block,
+// so they may be linked against without linking against an import library.
+// To learn more, read https://github.com/rust-lang/rfcs/blob/master/text/2627-raw-dylib-kind.md
+// Almost identical to `raw-dylib-link-ordinal`, but with the addition of calling conventions,
+// such as stdcall.
+// See https://github.com/rust-lang/rust/pull/90782
+
+//@ only-x86
+//@ only-windows
+// Reason: this test specifically exercises a 32bit Windows calling convention.
+
+use run_make_support::{cc, diff, is_msvc, run, rustc};
+
+// NOTE: build_native_dynamic lib is not used, as the special `def` files
+// must be passed to the CC compiler.
+
+fn main() {
+    rustc().crate_type("lib").crate_name("raw_dylib_test").input("lib.rs").run();
+    rustc().crate_type("bin").input("driver.rs").run();
+    if is_msvc() {
+        cc().arg("-c").out_exe("exporter").input("exporter.c").run();
+        cc().input("exporter.obj")
+            .arg("exporter-msvc.def")
+            .args(&["-link", "-dll", "-noimplib", "-out:exporter.dll"])
+            .run();
+    } else {
+        cc().arg("-v").arg("-c").out_exe("exporter.obj").input("exporter.c").run();
+        cc().input("exporter.obj")
+            .arg("exporter-gnu.def")
+            .arg("-shared")
+            .output("exporter.dll")
+            .run();
+    };
+    let out = run("driver").stdout_utf8();
+    diff()
+        .expected_file("expected_output.txt")
+        .actual_text("actual", out)
+        .normalize(r#"\r"#, "")
+        .run();
+}
diff --git a/tests/run-make/redundant-libs/Makefile b/tests/run-make/redundant-libs/Makefile
deleted file mode 100644
index 0a48b2b2801..00000000000
--- a/tests/run-make/redundant-libs/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-# ignore-windows-msvc
-
-# rustc will remove one of the two redundant references to foo below.  Depending
-# on which one gets removed, we'll get a linker error on SOME platforms (like
-# Linux).  On these platforms, when a library is referenced, the linker will
-# only pull in the symbols needed _at that point in time_.  If a later library
-# depends on additional symbols from the library, they will not have been pulled
-# in, and you'll get undefined symbols errors.
-#
-# So in this example, we need to ensure that rustc keeps the _later_ reference
-# to foo, and not the former one.
-RUSTC_FLAGS = \
-    -l static=bar \
-    -l foo \
-    -l static=baz \
-    -l foo \
-    --print link-args
-
-all: $(call DYLIB,foo) $(call STATICLIB,bar) $(call STATICLIB,baz)
-	$(RUSTC) $(RUSTC_FLAGS) main.rs
-	$(call RUN,main)
diff --git a/tests/run-make/redundant-libs/foo.c b/tests/run-make/redundant-libs/foo.c
index 339ee86c99e..551b85d1824 100644
--- a/tests/run-make/redundant-libs/foo.c
+++ b/tests/run-make/redundant-libs/foo.c
@@ -1,2 +1,8 @@
-void foo1() {}
-void foo2() {}
+#ifdef _MSC_VER
+#define DllExport __declspec(dllexport)
+#else
+#define DllExport
+#endif
+
+DllExport void foo1() {}
+DllExport void foo2() {}
diff --git a/tests/run-make/redundant-libs/rmake.rs b/tests/run-make/redundant-libs/rmake.rs
new file mode 100644
index 00000000000..e984dee8df5
--- /dev/null
+++ b/tests/run-make/redundant-libs/rmake.rs
@@ -0,0 +1,26 @@
+// rustc will remove one of the two redundant references to foo below.  Depending
+// on which one gets removed, we'll get a linker error on SOME platforms (like
+// Linux).  On these platforms, when a library is referenced, the linker will
+// only pull in the symbols needed _at that point in time_.  If a later library
+// depends on additional symbols from the library, they will not have been pulled
+// in, and you'll get undefined symbols errors.
+//
+// So in this example, we need to ensure that rustc keeps the _later_ reference
+// to foo, and not the former one.
+
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed
+
+use run_make_support::{build_native_dynamic_lib, build_native_static_lib, run, rustc};
+
+fn main() {
+    build_native_dynamic_lib("foo");
+    build_native_static_lib("bar");
+    build_native_static_lib("baz");
+    rustc()
+        .args(&["-lstatic=bar", "-lfoo", "-lstatic=baz", "-lfoo"])
+        .input("main.rs")
+        .print("link-args")
+        .run();
+    run("main");
+}
diff --git a/tests/run-make/relro-levels/rmake.rs b/tests/run-make/relro-levels/rmake.rs
index 56545ebc5aa..91d106a03e4 100644
--- a/tests/run-make/relro-levels/rmake.rs
+++ b/tests/run-make/relro-levels/rmake.rs
@@ -2,8 +2,7 @@
 
 //@ only-linux
 
-use run_make_support::llvm_readobj;
-use run_make_support::rustc;
+use run_make_support::{llvm_readobj, rustc};
 
 fn compile(relro_level: &str) {
     rustc().arg(format!("-Crelro-level={relro_level}")).input("hello.rs").run();
diff --git a/tests/run-make/repr128-dwarf/rmake.rs b/tests/run-make/repr128-dwarf/rmake.rs
index 824ca6e1876..2fd54c186b9 100644
--- a/tests/run-make/repr128-dwarf/rmake.rs
+++ b/tests/run-make/repr128-dwarf/rmake.rs
@@ -1,13 +1,14 @@
 //@ ignore-windows
 // This test should be replaced with one in tests/debuginfo once GDB or LLDB support 128-bit enums.
 
-use gimli::{AttributeValue, EndianRcSlice, Reader, RunTimeEndian};
-use object::{Object, ObjectSection};
-use run_make_support::{gimli, object, rfs, rustc};
 use std::collections::HashMap;
 use std::path::PathBuf;
 use std::rc::Rc;
 
+use gimli::{AttributeValue, EndianRcSlice, Reader, RunTimeEndian};
+use object::{Object, ObjectSection};
+use run_make_support::{gimli, object, rfs, rustc};
+
 fn main() {
     let output = PathBuf::from("repr128");
     rustc().input("main.rs").output(&output).arg("-Cdebuginfo=2").run();
diff --git a/tests/run-make/reproducible-build-2/Makefile b/tests/run-make/reproducible-build-2/Makefile
deleted file mode 100644
index 68fcac8b47f..00000000000
--- a/tests/run-make/reproducible-build-2/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-# ignore-musl
-# ignore-windows
-# Objects are reproducible but their path is not.
-
-all:  \
-	fat_lto \
-	sysroot
-
-fat_lto:
-	rm -rf $(TMPDIR) && mkdir $(TMPDIR)
-	$(RUSTC) reproducible-build-aux.rs
-	$(RUSTC) reproducible-build.rs -C lto=fat
-	cp $(TMPDIR)/reproducible-build $(TMPDIR)/reproducible-build-a
-	$(RUSTC) reproducible-build.rs -C lto=fat
-	cmp "$(TMPDIR)/reproducible-build-a" "$(TMPDIR)/reproducible-build" || exit 1
-
-sysroot:
-	rm -rf $(TMPDIR) && mkdir $(TMPDIR)
-	$(RUSTC) reproducible-build-aux.rs
-	$(RUSTC) reproducible-build.rs --crate-type rlib --sysroot $(shell $(RUSTC) --print sysroot) --remap-path-prefix=$(shell $(RUSTC) --print sysroot)=/sysroot
-	cp -R $(shell $(RUSTC) --print sysroot) $(TMPDIR)/sysroot
-	cp $(TMPDIR)/libreproducible_build.rlib $(TMPDIR)/libfoo.rlib
-	$(RUSTC) reproducible-build.rs --crate-type rlib --sysroot $(TMPDIR)/sysroot --remap-path-prefix=$(TMPDIR)/sysroot=/sysroot
-	cmp "$(TMPDIR)/libreproducible_build.rlib" "$(TMPDIR)/libfoo.rlib" || exit 1
diff --git a/tests/run-make/reproducible-build-2/rmake.rs b/tests/run-make/reproducible-build-2/rmake.rs
new file mode 100644
index 00000000000..8b5825cad30
--- /dev/null
+++ b/tests/run-make/reproducible-build-2/rmake.rs
@@ -0,0 +1,47 @@
+// Builds with fat link-time-optimizations and the --sysroot flag used to be
+// non-deterministic - that means, compiling twice with no changes would create
+// slightly different outputs. This has been fixed by #63352 and #63505.
+// Test 1: Compile with fat-lto twice, check that both compilation outputs are identical.
+// Test 2: Compile with sysroot, then change the sysroot path from absolute to relative.
+// Outputs should be identical.
+// See https://github.com/rust-lang/rust/issues/34902
+
+//@ ignore-windows
+// Reasons:
+// 1. The object files are reproducible, but their paths are not, which causes
+// the first assertion in the test to fail.
+// 2. When the sysroot gets copied, some symlinks must be re-created,
+// which is a privileged action on Windows.
+
+use run_make_support::{rfs, rust_lib_name, rustc};
+
+fn main() {
+    // test 1: fat lto
+    rustc().input("reproducible-build-aux.rs").run();
+    rustc().input("reproducible-build.rs").arg("-Clto=fat").output("reproducible-build").run();
+    rfs::rename("reproducible-build", "reproducible-build-a");
+    rustc().input("reproducible-build.rs").arg("-Clto=fat").output("reproducible-build").run();
+    assert_eq!(rfs::read("reproducible-build"), rfs::read("reproducible-build-a"));
+
+    // test 2: sysroot
+    let sysroot = rustc().print("sysroot").run().stdout_utf8();
+    let sysroot = sysroot.trim();
+
+    rustc().input("reproducible-build-aux.rs").run();
+    rustc()
+        .input("reproducible-build.rs")
+        .crate_type("rlib")
+        .sysroot(&sysroot)
+        .arg(format!("--remap-path-prefix={sysroot}=/sysroot"))
+        .run();
+    rfs::copy_dir_all(&sysroot, "sysroot");
+    rfs::rename(rust_lib_name("reproducible_build"), rust_lib_name("foo"));
+    rustc()
+        .input("reproducible-build.rs")
+        .crate_type("rlib")
+        .sysroot("sysroot")
+        .arg("--remap-path-prefix=/sysroot=/sysroot")
+        .run();
+
+    assert_eq!(rfs::read(rust_lib_name("reproducible_build")), rfs::read(rust_lib_name("foo")));
+}
diff --git a/tests/run-make/reset-codegen-1/rmake.rs b/tests/run-make/reset-codegen-1/rmake.rs
index cc6bb7d5e39..118b3a666ad 100644
--- a/tests/run-make/reset-codegen-1/rmake.rs
+++ b/tests/run-make/reset-codegen-1/rmake.rs
@@ -7,9 +7,10 @@
 
 //@ ignore-cross-compile
 
-use run_make_support::{bin_name, rfs, rustc};
 use std::path::Path;
 
+use run_make_support::{bin_name, rustc};
+
 fn compile(output_file: &str, emit: Option<&str>) {
     let mut rustc = rustc();
     let rustc = rustc.codegen_units(4).output(output_file).input("foo.rs");
diff --git a/tests/run-make/resolve-rename/rmake.rs b/tests/run-make/resolve-rename/rmake.rs
index 16ee7b02885..21ec7f85274 100644
--- a/tests/run-make/resolve-rename/rmake.rs
+++ b/tests/run-make/resolve-rename/rmake.rs
@@ -5,8 +5,7 @@
 // the renamed library.
 // See https://github.com/rust-lang/rust/pull/49253
 
-use run_make_support::rfs;
-use run_make_support::rustc;
+use run_make_support::{rfs, rustc};
 
 fn main() {
     rustc().extra_filename("-hash").input("foo.rs").run();
diff --git a/tests/run-make/rlib-format-packed-bundled-libs-2/Makefile b/tests/run-make/rlib-format-packed-bundled-libs-2/Makefile
deleted file mode 100644
index d2a740b06b3..00000000000
--- a/tests/run-make/rlib-format-packed-bundled-libs-2/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-include ../tools.mk
-
-# ignore-cross-compile
-
-# Make sure -Zpacked_bundled_libs is compatible with verbatim.
-
-# We're using the llvm-nm instead of the system nm to ensure it is compatible
-# with the LLVM bitcode generated by rustc.
-# Except on Windows where piping/IO redirection under MSYS2 is wonky with llvm-nm.
-ifndef IS_WINDOWS
-NM = "$(LLVM_BIN_DIR)"/llvm-nm
-else
-NM = nm
-endif
-
-all:
-	# Build strange-named dep.
-	$(RUSTC) native_dep.rs --crate-type=staticlib -o $(TMPDIR)/native_dep.ext
-
-	$(RUSTC) rust_dep.rs --crate-type=rlib -Zpacked_bundled_libs
-	$(NM) $(TMPDIR)/librust_dep.rlib | $(CGREP) -e "U.*native_f1"
-	$(AR) t $(TMPDIR)/librust_dep.rlib | $(CGREP) "native_dep.ext"
-
-	# Make sure compiler doesn't use files, that it shouldn't know about.
-	rm $(TMPDIR)/native_dep.ext
-
-	$(RUSTC) main.rs --extern rust_dep=$(TMPDIR)/librust_dep.rlib -Zpacked_bundled_libs
diff --git a/tests/run-make/rlib-format-packed-bundled-libs-2/rmake.rs b/tests/run-make/rlib-format-packed-bundled-libs-2/rmake.rs
new file mode 100644
index 00000000000..5a1460963b6
--- /dev/null
+++ b/tests/run-make/rlib-format-packed-bundled-libs-2/rmake.rs
@@ -0,0 +1,28 @@
+// `-Z packed_bundled_libs` is an unstable rustc flag that makes the compiler
+// only require a native library and no supplementary object files to compile.
+// This test simply checks that this flag can be passed alongside verbatim syntax
+// in rustc flags without a compilation failure or the removal of expected symbols.
+// See https://github.com/rust-lang/rust/pull/100101
+
+use run_make_support::{llvm_ar, llvm_nm, rfs, rust_lib_name, rustc};
+
+fn main() {
+    // Build a strangely named dependency.
+    rustc().input("native_dep.rs").crate_type("staticlib").output("native_dep.ext").run();
+
+    rustc().input("rust_dep.rs").crate_type("rlib").arg("-Zpacked_bundled_libs").run();
+    llvm_nm().input(rust_lib_name("rust_dep")).run().assert_stdout_contains_regex("U.*native_f1");
+    llvm_ar()
+        .arg("t")
+        .arg(rust_lib_name("rust_dep"))
+        .run()
+        .assert_stdout_contains("native_dep.ext");
+
+    // Ensure the compiler does not use files it should not be aware of.
+    rfs::remove_file("native_dep.ext");
+    rustc()
+        .input("main.rs")
+        .extern_("rust_dep", rust_lib_name("rust_dep"))
+        .arg("-Zpacked_bundled_libs")
+        .run();
+}
diff --git a/tests/run-make/rlib-format-packed-bundled-libs-3/rmake.rs b/tests/run-make/rlib-format-packed-bundled-libs-3/rmake.rs
index d152047600f..67e839bec70 100644
--- a/tests/run-make/rlib-format-packed-bundled-libs-3/rmake.rs
+++ b/tests/run-make/rlib-format-packed-bundled-libs-3/rmake.rs
@@ -6,7 +6,7 @@
 // See https://github.com/rust-lang/rust/pull/105601
 
 use run_make_support::{
-    build_native_static_lib, is_msvc, llvm_ar, regex, rfs, rust_lib_name, rustc, static_lib_name,
+    build_native_static_lib, llvm_ar, regex, rfs, rust_lib_name, rustc, static_lib_name,
 };
 
 //@ ignore-cross-compile
diff --git a/tests/run-make/run-in-tmpdir-self-test/rmake.rs b/tests/run-make/run-in-tmpdir-self-test/rmake.rs
index 83b99bfe863..dba036f8866 100644
--- a/tests/run-make/run-in-tmpdir-self-test/rmake.rs
+++ b/tests/run-make/run-in-tmpdir-self-test/rmake.rs
@@ -3,7 +3,7 @@
 //! when returning from the closure.
 
 use std::fs;
-use std::path::{Path, PathBuf};
+use std::path::PathBuf;
 
 use run_make_support::{cwd, run_in_tmpdir};
 
diff --git a/tests/run-make/rust-lld-by-default-beta-stable/rmake.rs b/tests/run-make/rust-lld-by-default-beta-stable/rmake.rs
index fc3dffdbaf4..2417a4274e4 100644
--- a/tests/run-make/rust-lld-by-default-beta-stable/rmake.rs
+++ b/tests/run-make/rust-lld-by-default-beta-stable/rmake.rs
@@ -4,9 +4,10 @@
 //@ ignore-nightly
 //@ only-x86_64-unknown-linux-gnu
 
+use std::process::Output;
+
 use run_make_support::regex::Regex;
 use run_make_support::rustc;
-use std::process::Output;
 
 fn main() {
     // A regular compilation should not use rust-lld by default. We'll check that by asking the
diff --git a/tests/run-make/rust-lld-by-default-nightly/rmake.rs b/tests/run-make/rust-lld-by-default-nightly/rmake.rs
index f3ce9ada157..02bbe8227f0 100644
--- a/tests/run-make/rust-lld-by-default-nightly/rmake.rs
+++ b/tests/run-make/rust-lld-by-default-nightly/rmake.rs
@@ -8,7 +8,6 @@
 
 use run_make_support::regex::Regex;
 use run_make_support::rustc;
-use std::process::Output;
 
 fn main() {
     // A regular compilation should use rust-lld by default. We'll check that by asking the linker
diff --git a/tests/run-make/rust-lld-compress-debug-sections/main.rs b/tests/run-make/rust-lld-compress-debug-sections/main.rs
new file mode 100644
index 00000000000..f328e4d9d04
--- /dev/null
+++ b/tests/run-make/rust-lld-compress-debug-sections/main.rs
@@ -0,0 +1 @@
+fn main() {}
diff --git a/tests/run-make/rust-lld-compress-debug-sections/rmake.rs b/tests/run-make/rust-lld-compress-debug-sections/rmake.rs
new file mode 100644
index 00000000000..ea4997fab80
--- /dev/null
+++ b/tests/run-make/rust-lld-compress-debug-sections/rmake.rs
@@ -0,0 +1,39 @@
+// Checks the `compress-debug-sections` option on rust-lld.
+
+//@ needs-rust-lld
+//@ only-linux
+//@ ignore-cross-compile
+
+// FIXME: This test isn't comprehensive and isn't covering all possible combinations.
+
+use run_make_support::{assert_contains, llvm_readobj, run_in_tmpdir, rustc};
+
+fn check_compression(compression: &str, to_find: &str) {
+    run_in_tmpdir(|| {
+        let out = rustc()
+            .arg("-Zlinker-features=+lld")
+            .arg("-Clink-self-contained=+linker")
+            .arg("-Zunstable-options")
+            .arg("-Cdebuginfo=full")
+            .link_arg(&format!("-Wl,--compress-debug-sections={compression}"))
+            .input("main.rs")
+            .run_unchecked();
+        let stderr = out.stderr_utf8();
+        if stderr.is_empty() {
+            llvm_readobj().arg("-t").arg("main").run().assert_stdout_contains(to_find);
+        } else {
+            assert_contains(
+                stderr,
+                format!(
+                    "LLVM was not built with LLVM_ENABLE_{to_find} \
+                     or did not find {compression} at build time"
+                ),
+            );
+        }
+    });
+}
+
+fn main() {
+    check_compression("zlib", "ZLIB");
+    check_compression("zstd", "ZSTD");
+}
diff --git a/tests/run-make/rust-lld-custom-target/rmake.rs b/tests/run-make/rust-lld-custom-target/rmake.rs
index f3dc2275f62..a6f7c33793a 100644
--- a/tests/run-make/rust-lld-custom-target/rmake.rs
+++ b/tests/run-make/rust-lld-custom-target/rmake.rs
@@ -10,7 +10,6 @@
 
 use run_make_support::regex::Regex;
 use run_make_support::rustc;
-use std::process::Output;
 
 fn main() {
     // Compile to a custom target spec with rust-lld enabled by default. We'll check that by asking
diff --git a/tests/run-make/rust-lld/rmake.rs b/tests/run-make/rust-lld/rmake.rs
index 3eb60367c7f..1f311af1ed5 100644
--- a/tests/run-make/rust-lld/rmake.rs
+++ b/tests/run-make/rust-lld/rmake.rs
@@ -2,14 +2,15 @@
 // see https://github.com/rust-lang/compiler-team/issues/510 for more info
 
 //@ needs-rust-lld
-//@ ignore-msvc
 //@ ignore-s390x lld does not yet support s390x as target
 
 use run_make_support::regex::Regex;
-use run_make_support::rustc;
-use std::process::Output;
+use run_make_support::{is_msvc, rustc};
 
 fn main() {
+    // lld-link is used if msvc, otherwise a gnu-compatible lld is used.
+    let linker_version_flag = if is_msvc() { "--version" } else { "-Wl,-v" };
+
     // Opt-in to lld and the self-contained linker, to link with rust-lld. We'll check that by
     // asking the linker to display its version number with a link-arg.
     let output = rustc()
@@ -17,7 +18,7 @@ fn main() {
         .arg("-Zlinker-features=+lld")
         .arg("-Clink-self-contained=+linker")
         .arg("-Zunstable-options")
-        .link_arg("-Wl,-v")
+        .link_arg(linker_version_flag)
         .input("main.rs")
         .run();
     assert!(
@@ -26,10 +27,10 @@ fn main() {
         output.stderr_utf8()
     );
 
-    // It should not be used when we explictly opt-out of lld.
+    // It should not be used when we explicitly opt-out of lld.
     let output = rustc()
         .env("RUSTC_LOG", "rustc_codegen_ssa::back::link=info")
-        .link_arg("-Wl,-v")
+        .link_arg(linker_version_flag)
         .arg("-Zlinker-features=-lld")
         .input("main.rs")
         .run();
@@ -43,7 +44,7 @@ fn main() {
     // times to rustc.
     let output = rustc()
         .env("RUSTC_LOG", "rustc_codegen_ssa::back::link=info")
-        .link_arg("-Wl,-v")
+        .link_arg(linker_version_flag)
         .arg("-Clink-self-contained=+linker")
         .arg("-Zunstable-options")
         .arg("-Zlinker-features=-lld")
diff --git a/tests/run-make/issue-88756-default-output/output-default.stdout b/tests/run-make/rustdoc-default-output/output-default.stdout
index bc38d9e9dc6..bc38d9e9dc6 100644
--- a/tests/run-make/issue-88756-default-output/output-default.stdout
+++ b/tests/run-make/rustdoc-default-output/output-default.stdout
diff --git a/tests/run-make/rustdoc-default-output/rmake.rs b/tests/run-make/rustdoc-default-output/rmake.rs
new file mode 100644
index 00000000000..06720445a35
--- /dev/null
+++ b/tests/run-make/rustdoc-default-output/rmake.rs
@@ -0,0 +1,16 @@
+// Calling rustdoc with no arguments, which should bring up a help menu, used to
+// cause an error as rustdoc expects an input file. Fixed in #98331, this test
+// ensures the output of rustdoc's help menu is as expected.
+// See https://github.com/rust-lang/rust/issues/88756
+
+use run_make_support::{bare_rustdoc, diff};
+
+fn main() {
+    let out = bare_rustdoc().run().stdout_utf8();
+    diff()
+        .expected_file("output-default.stdout")
+        .actual_text("actual", out)
+        // replace the channel type in the URL with $CHANNEL
+        .normalize(r"nightly/|beta/|stable/|1\.[0-9]+\.[0-9]+/", "$$CHANNEL/")
+        .run();
+}
diff --git a/tests/run-make/rustdoc-determinism/rmake.rs b/tests/run-make/rustdoc-determinism/rmake.rs
index 2d4f357d681..aa8090174d9 100644
--- a/tests/run-make/rustdoc-determinism/rmake.rs
+++ b/tests/run-make/rustdoc-determinism/rmake.rs
@@ -1,9 +1,10 @@
 // Assert that the search index is generated deterministically, regardless of the
 // order that crates are documented in.
 
-use run_make_support::{diff, rustdoc};
 use std::path::Path;
 
+use run_make_support::{diff, rustdoc};
+
 fn main() {
     let foo_first = Path::new("foo_first");
     rustdoc().input("foo.rs").output(&foo_first).run();
diff --git a/tests/run-make/rustdoc-io-error/rmake.rs b/tests/run-make/rustdoc-io-error/rmake.rs
index 69afea40162..a5fae36e733 100644
--- a/tests/run-make/rustdoc-io-error/rmake.rs
+++ b/tests/run-make/rustdoc-io-error/rmake.rs
@@ -14,21 +14,20 @@
 // `mkfs.ext4 -d`, as well as mounting a loop device for the rootfs.
 //@ ignore-windows - the `set_readonly` functions doesn't work on folders.
 
-use run_make_support::{path, rustdoc};
-use std::fs;
+use run_make_support::{path, rfs, rustdoc};
 
 fn main() {
     let out_dir = path("rustdoc-io-error");
-    let output = fs::create_dir(&out_dir).unwrap();
-    let mut permissions = fs::metadata(&out_dir).unwrap().permissions();
+    rfs::create_dir(&out_dir);
+    let mut permissions = rfs::metadata(&out_dir).permissions();
     let original_permissions = permissions.clone();
 
     permissions.set_readonly(true);
-    fs::set_permissions(&out_dir, permissions).unwrap();
+    rfs::set_permissions(&out_dir, permissions);
 
     let output = rustdoc().input("foo.rs").output(&out_dir).env("RUST_BACKTRACE", "1").run_fail();
 
-    fs::set_permissions(&out_dir, original_permissions).unwrap();
+    rfs::set_permissions(&out_dir, original_permissions);
 
     output
         .assert_exit_code(1)
diff --git a/tests/run-make/rustdoc-output-path/rmake.rs b/tests/run-make/rustdoc-output-path/rmake.rs
index 28e0fd98f93..3c1ccd3a069 100644
--- a/tests/run-make/rustdoc-output-path/rmake.rs
+++ b/tests/run-make/rustdoc-output-path/rmake.rs
@@ -1,8 +1,9 @@
 // Checks that if the output folder doesn't exist, rustdoc will create it.
 
-use run_make_support::rustdoc;
 use std::path::Path;
 
+use run_make_support::rustdoc;
+
 fn main() {
     let out_dir = Path::new("foo/bar/doc");
     rustdoc().input("foo.rs").output(&out_dir).run();
diff --git a/tests/run-make/rustdoc-scrape-examples-macros/rmake.rs b/tests/run-make/rustdoc-scrape-examples-macros/rmake.rs
index bfe4a1df456..b77df7adc8d 100644
--- a/tests/run-make/rustdoc-scrape-examples-macros/rmake.rs
+++ b/tests/run-make/rustdoc-scrape-examples-macros/rmake.rs
@@ -11,8 +11,7 @@ fn main() {
     let dylib_name = rustc()
         .crate_name(proc_crate_name)
         .crate_type("dylib")
-        .arg("--print")
-        .arg("file-names")
+        .print("file-names")
         .arg("-")
         .run()
         .stdout_utf8();
diff --git a/tests/run-make/rustdoc-scrape-examples-remap/scrape.rs b/tests/run-make/rustdoc-scrape-examples-remap/scrape.rs
index 3feee78f2e1..eca07043b55 100644
--- a/tests/run-make/rustdoc-scrape-examples-remap/scrape.rs
+++ b/tests/run-make/rustdoc-scrape-examples-remap/scrape.rs
@@ -1,6 +1,7 @@
-use run_make_support::{htmldocck, rfs, rustc, rustdoc, source_root};
 use std::path::Path;
 
+use run_make_support::{htmldocck, rfs, rustc, rustdoc};
+
 pub fn scrape(extra_args: &[&str]) {
     let out_dir = Path::new("rustdoc");
     let crate_name = "foobar";
diff --git a/tests/run-make/rustdoc-test-args/rmake.rs b/tests/run-make/rustdoc-test-args/rmake.rs
index 69dea83de4f..fddb3795402 100644
--- a/tests/run-make/rustdoc-test-args/rmake.rs
+++ b/tests/run-make/rustdoc-test-args/rmake.rs
@@ -1,7 +1,8 @@
-use run_make_support::{rfs, rustdoc};
 use std::iter;
 use std::path::Path;
 
+use run_make_support::{rfs, rustdoc};
+
 fn generate_a_lot_of_cfgs(path: &Path) {
     let content = iter::repeat("--cfg=a\n").take(100_000).collect::<String>();
     rfs::write(path, content.as_bytes());
diff --git a/tests/run-make/rustdoc-themes/rmake.rs b/tests/run-make/rustdoc-themes/rmake.rs
index 981db358f29..8a961beb9f7 100644
--- a/tests/run-make/rustdoc-themes/rmake.rs
+++ b/tests/run-make/rustdoc-themes/rmake.rs
@@ -1,8 +1,9 @@
 // Test that rustdoc will properly load in a theme file and display it in the theme selector.
 
-use run_make_support::{htmldocck, rfs, rustdoc, source_root};
 use std::path::Path;
 
+use run_make_support::{htmldocck, rfs, rustdoc, source_root};
+
 fn main() {
     let out_dir = Path::new("rustdoc-themes");
     let test_css = "test.css";
diff --git a/tests/run-make/rustdoc-verify-output-files/rmake.rs b/tests/run-make/rustdoc-verify-output-files/rmake.rs
index d1ff2e330f5..a4d4050b745 100644
--- a/tests/run-make/rustdoc-verify-output-files/rmake.rs
+++ b/tests/run-make/rustdoc-verify-output-files/rmake.rs
@@ -1,7 +1,6 @@
-use run_make_support::rfs;
 use std::path::{Path, PathBuf};
 
-use run_make_support::{assert_dirs_are_equal, rustdoc};
+use run_make_support::{assert_dirs_are_equal, rfs, rustdoc};
 
 #[derive(PartialEq)]
 enum JsonOutput {
diff --git a/tests/run-make/sepcomp-cci-copies/rmake.rs b/tests/run-make/sepcomp-cci-copies/rmake.rs
index e244f546580..a66cc2872b4 100644
--- a/tests/run-make/sepcomp-cci-copies/rmake.rs
+++ b/tests/run-make/sepcomp-cci-copies/rmake.rs
@@ -4,10 +4,7 @@
 // created for each source module (see `rustc_const_eval::monomorphize::partitioning`).
 // See https://github.com/rust-lang/rust/pull/16367
 
-use run_make_support::{
-    count_regex_matches_in_files_with_extension, cwd, has_extension, regex, rfs, rustc,
-    shallow_find_files,
-};
+use run_make_support::{count_regex_matches_in_files_with_extension, regex, rustc};
 
 fn main() {
     rustc().input("cci_lib.rs").run();
diff --git a/tests/run-make/sepcomp-inlining/rmake.rs b/tests/run-make/sepcomp-inlining/rmake.rs
index b7a6bed05b8..ea4a4d210cc 100644
--- a/tests/run-make/sepcomp-inlining/rmake.rs
+++ b/tests/run-make/sepcomp-inlining/rmake.rs
@@ -5,10 +5,7 @@
 // in only one compilation unit.
 // See https://github.com/rust-lang/rust/pull/16367
 
-use run_make_support::{
-    count_regex_matches_in_files_with_extension, cwd, has_extension, regex, rfs, rustc,
-    shallow_find_files,
-};
+use run_make_support::{count_regex_matches_in_files_with_extension, regex, rustc};
 
 fn main() {
     rustc().input("foo.rs").emit("llvm-ir").codegen_units(3).arg("-Zinline-in-all-cgus").run();
diff --git a/tests/run-make/sepcomp-separate/rmake.rs b/tests/run-make/sepcomp-separate/rmake.rs
index 90017572c4c..49958044a61 100644
--- a/tests/run-make/sepcomp-separate/rmake.rs
+++ b/tests/run-make/sepcomp-separate/rmake.rs
@@ -3,10 +3,7 @@
 // wind up in three different compilation units.
 // See https://github.com/rust-lang/rust/pull/16367
 
-use run_make_support::{
-    count_regex_matches_in_files_with_extension, cwd, has_extension, regex, rfs, rustc,
-    shallow_find_files,
-};
+use run_make_support::{count_regex_matches_in_files_with_extension, regex, rustc};
 
 fn main() {
     rustc().input("foo.rs").emit("llvm-ir").codegen_units(3).run();
diff --git a/tests/run-make/share-generics-dylib/Makefile b/tests/run-make/share-generics-dylib/Makefile
deleted file mode 100644
index 9d97eca80d3..00000000000
--- a/tests/run-make/share-generics-dylib/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-# ignore-cross-compile
-# This test makes sure all generic instances get re-exported from Rust dylibs for use by
-# `-Zshare-generics`. There are two rlibs (`instance_provider_a` and `instance_provider_b`)
-# which both provide an instance of `Cell<i32>::set`. There is `instance_user_dylib` which is
-# supposed to re-export both these instances, and then there are `instance_user_a_rlib` and
-# `instance_user_b_rlib` which each rely on a specific instance to be available.
-#
-# In the end everything is linked together into `linked_leaf`. If `instance_user_dylib` does
-# not export both then we'll get an `undefined reference` error for one of the instances.
-#
-# This is regression test for https://github.com/rust-lang/rust/issues/67276.
-
-include ../tools.mk
-
-COMMON_ARGS=-Cprefer-dynamic -Zshare-generics=yes -Ccodegen-units=1 -Csymbol-mangling-version=v0
-
-all:
-	$(RUSTC) instance_provider_a.rs $(COMMON_ARGS) --crate-type=rlib
-	$(RUSTC) instance_provider_b.rs $(COMMON_ARGS) --crate-type=rlib
-	$(RUSTC) instance_user_dylib.rs $(COMMON_ARGS) --crate-type=dylib
-	$(RUSTC) instance_user_a_rlib.rs $(COMMON_ARGS) --crate-type=rlib
-	$(RUSTC) instance_user_b_rlib.rs $(COMMON_ARGS) --crate-type=rlib
-	$(RUSTC) linked_leaf.rs $(COMMON_ARGS) --crate-type=bin
diff --git a/tests/run-make/share-generics-dylib/rmake.rs b/tests/run-make/share-generics-dylib/rmake.rs
new file mode 100644
index 00000000000..e0e647fe199
--- /dev/null
+++ b/tests/run-make/share-generics-dylib/rmake.rs
@@ -0,0 +1,30 @@
+// This test makes sure all generic instances get re-exported from Rust dylibs for use by
+// `-Zshare-generics`. There are two rlibs (`instance_provider_a` and `instance_provider_b`)
+// which both provide an instance of `Cell<i32>::set`. There is `instance_user_dylib` which is
+// supposed to re-export both these instances, and then there are `instance_user_a_rlib` and
+// `instance_user_b_rlib` which each rely on a specific instance to be available.
+//
+// In the end everything is linked together into `linked_leaf`. If `instance_user_dylib` does
+// not export both then we'll get an `undefined reference` error for one of the instances.
+//
+// This is regression test for https://github.com/rust-lang/rust/issues/67276.
+
+use run_make_support::rustc;
+
+fn main() {
+    compile("rlib", "instance_provider_a.rs");
+    compile("rlib", "instance_provider_b.rs");
+    compile("dylib", "instance_user_dylib.rs");
+    compile("rlib", "instance_user_a_rlib.rs");
+    compile("rlib", "instance_user_b_rlib.rs");
+    compile("bin", "linked_leaf.rs");
+}
+
+fn compile(crate_type: &str, input: &str) {
+    rustc()
+        .input(input)
+        .crate_type(crate_type)
+        .args(&["-Cprefer-dynamic", "-Zshare-generics=yes", "-Csymbol-mangling-version=v0"])
+        .codegen_units(1)
+        .run();
+}
diff --git a/tests/run-make/simd-ffi/Makefile b/tests/run-make/simd-ffi/Makefile
deleted file mode 100644
index 29735347041..00000000000
--- a/tests/run-make/simd-ffi/Makefile
+++ /dev/null
@@ -1,47 +0,0 @@
-include ../tools.mk
-
-TARGETS =
-ifeq ($(filter arm,$(LLVM_COMPONENTS)),arm)
-# construct a fairly exhaustive list of platforms that we
-# support. These ones don't follow a pattern
-TARGETS += arm-linux-androideabi arm-unknown-linux-gnueabihf arm-unknown-linux-gnueabi
-endif
-
-ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86)
-X86_ARCHS = i686 x86_64
-else
-X86_ARCHS =
-endif
-
-# these ones do, each OS lists the architectures it supports
-LINUX=$(filter aarch64 mips,$(LLVM_COMPONENTS)) $(X86_ARCHS)
-ifeq ($(filter mips,$(LLVM_COMPONENTS)),mips)
-LINUX += mipsel
-endif
-
-WINDOWS=$(X86_ARCHS)
-# fails with: failed to get iphonesimulator SDK path: no such file or directory
-#IOS=i386 aarch64 armv7
-DARWIN=$(X86_ARCHS)
-
-$(foreach arch,$(LINUX),$(eval TARGETS += $(arch)-unknown-linux-gnu))
-$(foreach arch,$(WINDOWS),$(eval TARGETS += $(arch)-pc-windows-gnu))
-#$(foreach arch,$(IOS),$(eval TARGETS += $(arch)-apple-ios))
-$(foreach arch,$(DARWIN),$(eval TARGETS += $(arch)-apple-darwin))
-
-all: $(TARGETS)
-
-define MK_TARGETS
-# compile the rust file to the given target, but only to asm and IR
-# form, to avoid having to have an appropriate linker.
-#
-# we need some features because the integer SIMD instructions are not
-# enabled by-default for i686 and ARM; these features will be invalid
-# on some platforms, but LLVM just prints a warning so that's fine for
-# now.
-$(1): simd.rs
-	$$(RUSTC) --target=$(1) --emit=llvm-ir,asm simd.rs \
-                -C target-feature='+neon,+sse2' -C extra-filename=-$(1)
-endef
-
-$(foreach targetxxx,$(TARGETS),$(eval $(call MK_TARGETS,$(targetxxx))))
diff --git a/tests/run-make/simd-ffi/rmake.rs b/tests/run-make/simd-ffi/rmake.rs
new file mode 100644
index 00000000000..04990c8bdf4
--- /dev/null
+++ b/tests/run-make/simd-ffi/rmake.rs
@@ -0,0 +1,63 @@
+// Using SIMD types in a program with foreign-function interfaces used to result in an ICE
+// (internal compiler error). Since this was fixed in #21233, it should be checked that
+// compilation of SIMD and FFI together should be successful on all the most common
+// architectures.
+// Note that this test does not check linking or binary execution.
+// See https://github.com/rust-lang/rust/pull/21233
+
+use run_make_support::{llvm_components_contain, rustc};
+
+fn main() {
+    let mut targets = Vec::new();
+    // arm-specific targets.
+    if llvm_components_contain("arm") {
+        targets.append(&mut vec![
+            "arm-linux-androideabi".to_owned(),
+            "arm-unknown-linux-gnueabihf".to_owned(),
+            "arm-unknown-linux-gnueabi".to_owned(),
+        ]);
+    }
+    let mut x86_archs = Vec::new();
+    if llvm_components_contain("x86") {
+        x86_archs.append(&mut vec!["i686", "x86_64"]);
+    }
+    // Linux has all x86 targets, plus aarch64 and mips.
+    let mut extra_targets = x86_archs.clone();
+    if llvm_components_contain("aarch64") {
+        extra_targets.push("aarch64");
+    }
+    if llvm_components_contain("mips") {
+        extra_targets.append(&mut vec!["mips", "mipsel"]);
+    }
+
+    for target in extra_targets {
+        let linux = format!("{target}-unknown-linux-gnu");
+        targets.push(linux);
+    }
+
+    // Windows and Darwin (OSX) only receive x86 targets.
+    let extra_targets = x86_archs.clone();
+    for target in extra_targets {
+        let windows = format!("{target}-pc-windows-gnu");
+        let darwin = format!("{target}-apple-darwin");
+        targets.push(windows);
+        targets.push(darwin);
+    }
+
+    for target in targets {
+        // compile the rust file to the given target, but only to asm and IR
+        // form, to avoid having to have an appropriate linker.
+        //
+        // we need some features because the integer SIMD instructions are not
+        // enabled by-default for i686 and ARM; these features will be invalid
+        // on some platforms, but LLVM just prints a warning so that's fine for
+        // now.
+        rustc()
+            .target(&target)
+            .emit("llvm-ir,asm")
+            .input("simd.rs")
+            .arg("-Ctarget-feature=+neon,+sse")
+            .arg(&format!("-Cextra-filename=-{target}"))
+            .run();
+    }
+}
diff --git a/tests/run-make/stable-symbol-names/Makefile b/tests/run-make/stable-symbol-names/Makefile
deleted file mode 100644
index bbfb8e38881..00000000000
--- a/tests/run-make/stable-symbol-names/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-include ../tools.mk
-
-# The following command will:
-#  1. dump the symbols of a library using `nm`
-#  2. extract only those lines that we are interested in via `grep`
-#  3. from those lines, extract just the symbol name via `sed`, which:
-#    * always starts with "_ZN" and ends with "E" (`legacy` mangling)
-#    * always starts with "_R" (`v0` mangling)
-#  4. sort those symbol names for deterministic comparison
-#  5. write the result into a file
-
-dump-symbols = nm "$(TMPDIR)/lib$(1).rlib" \
-             | grep -E "$(2)" \
-             | sed -E "s/.*(_ZN.*E|_R[a-zA-Z0-9_]*).*/\1/" \
-             | sort \
-             > "$(TMPDIR)/$(1)$(3).nm"
-
-# This test
-# - compiles each of the two crates 2 times and makes sure each time we get
-#   exactly the same symbol names
-# - makes sure that both crates agree on the same symbol names for monomorphic
-#   functions
-
-all:
-	$(RUSTC) stable-symbol-names1.rs
-	$(call dump-symbols,stable_symbol_names1,generic_|mono_,_v1)
-	rm $(TMPDIR)/libstable_symbol_names1.rlib
-	$(RUSTC) stable-symbol-names1.rs
-	$(call dump-symbols,stable_symbol_names1,generic_|mono_,_v2)
-	cmp "$(TMPDIR)/stable_symbol_names1_v1.nm" "$(TMPDIR)/stable_symbol_names1_v2.nm"
-
-	$(RUSTC) stable-symbol-names2.rs
-	$(call dump-symbols,stable_symbol_names2,generic_|mono_,_v1)
-	rm $(TMPDIR)/libstable_symbol_names2.rlib
-	$(RUSTC) stable-symbol-names2.rs
-	$(call dump-symbols,stable_symbol_names2,generic_|mono_,_v2)
-	cmp "$(TMPDIR)/stable_symbol_names2_v1.nm" "$(TMPDIR)/stable_symbol_names2_v2.nm"
-
-	$(call dump-symbols,stable_symbol_names1,mono_,_cross)
-	$(call dump-symbols,stable_symbol_names2,mono_,_cross)
-	cmp "$(TMPDIR)/stable_symbol_names1_cross.nm" "$(TMPDIR)/stable_symbol_names2_cross.nm"
diff --git a/tests/run-make/stable-symbol-names/rmake.rs b/tests/run-make/stable-symbol-names/rmake.rs
new file mode 100644
index 00000000000..402f411c7f5
--- /dev/null
+++ b/tests/run-make/stable-symbol-names/rmake.rs
@@ -0,0 +1,68 @@
+// A typo in rustc caused generic symbol names to be non-deterministic -
+// that is, it was possible to compile the same file twice with no changes
+// and get outputs with different symbol names.
+// This test compiles each of the two crates twice, and checks that each output
+// contains exactly the same symbol names.
+// Additionally, both crates should agree on the same symbol names for monomorphic
+// functions.
+// See https://github.com/rust-lang/rust/issues/32554
+
+use std::collections::HashSet;
+
+use run_make_support::{llvm_readobj, regex, rfs, rust_lib_name, rustc};
+
+static LEGACY_PATTERN: std::sync::OnceLock<regex::Regex> = std::sync::OnceLock::new();
+static V0_PATTERN: std::sync::OnceLock<regex::Regex> = std::sync::OnceLock::new();
+
+fn main() {
+    LEGACY_PATTERN.set(regex::Regex::new(r"_ZN.*E").unwrap()).unwrap();
+    V0_PATTERN.set(regex::Regex::new(r"_R[a-zA-Z0-9_]*").unwrap()).unwrap();
+    // test 1: first file
+    rustc().input("stable-symbol-names1.rs").run();
+    let sym1 = process_symbols("stable_symbol_names1", "generic_|mono_");
+    rfs::remove_file(rust_lib_name("stable_symbol_names1"));
+    rustc().input("stable-symbol-names1.rs").run();
+    let sym2 = process_symbols("stable_symbol_names1", "generic_|mono_");
+    assert_eq!(sym1, sym2);
+
+    // test 2: second file
+    rustc().input("stable-symbol-names2.rs").run();
+    let sym1 = process_symbols("stable_symbol_names2", "generic_|mono_");
+    rfs::remove_file(rust_lib_name("stable_symbol_names2"));
+    rustc().input("stable-symbol-names2.rs").run();
+    let sym2 = process_symbols("stable_symbol_names2", "generic_|mono_");
+    assert_eq!(sym1, sym2);
+
+    // test 3: crossed files
+    let sym1 = process_symbols("stable_symbol_names1", "mono_");
+    let sym2 = process_symbols("stable_symbol_names2", "mono_");
+    assert_eq!(sym1, sym2);
+}
+
+#[track_caller]
+fn process_symbols(path: &str, symbol: &str) -> Vec<String> {
+    // Dump all symbols.
+    let out = llvm_readobj().input(rust_lib_name(path)).symbols().run().stdout_utf8();
+    // Extract only lines containing `symbol`.
+    let symbol_regex = regex::Regex::new(symbol).unwrap();
+    let out = out.lines().filter(|&line| symbol_regex.find(line).is_some());
+
+    // HashSet - duplicates should be excluded!
+    let mut symbols: HashSet<String> = HashSet::new();
+    // From those lines, extract just the symbol name via `regex`, which:
+    //   * always starts with "_ZN" and ends with "E" (`legacy` mangling)
+    //   * always starts with "_R" (`v0` mangling)
+    for line in out {
+        if let Some(mat) = LEGACY_PATTERN.get().unwrap().find(line) {
+            symbols.insert(mat.as_str().to_string());
+        }
+        if let Some(mat) = V0_PATTERN.get().unwrap().find(line) {
+            symbols.insert(mat.as_str().to_string());
+        }
+    }
+
+    let mut symbols: Vec<String> = symbols.into_iter().collect();
+    // Sort those symbol names for deterministic comparison.
+    symbols.sort();
+    symbols
+}
diff --git a/tests/run-make/static-pie/rmake.rs b/tests/run-make/static-pie/rmake.rs
index 6a92f92328e..74f86bb8163 100644
--- a/tests/run-make/static-pie/rmake.rs
+++ b/tests/run-make/static-pie/rmake.rs
@@ -7,10 +7,8 @@
 
 use std::process::Command;
 
-use run_make_support::llvm_readobj;
 use run_make_support::regex::Regex;
-use run_make_support::rustc;
-use run_make_support::{cmd, run_with_args, target};
+use run_make_support::{cmd, llvm_readobj, run_with_args, rustc, target};
 
 // Minimum major versions supporting -static-pie
 const GCC_VERSION: u32 = 8;
diff --git a/tests/run-make/staticlib-dylib-linkage/Makefile b/tests/run-make/staticlib-dylib-linkage/Makefile
deleted file mode 100644
index a1e86a7ce4b..00000000000
--- a/tests/run-make/staticlib-dylib-linkage/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-include ../tools.mk
-
-# ignore-cross-compile
-# ignore-msvc FIXME(bjorn3) can't figure out how to link with the MSVC toolchain
-# ignore-wasm wasm doesn't support dynamic libraries
-
-all:
-	$(RUSTC) -C prefer-dynamic bar.rs
-	$(RUSTC) foo.rs --crate-type staticlib --print native-static-libs \
-		-Z staticlib-allow-rdylib-deps 2>&1 | grep 'note: native-static-libs: ' \
-		| sed 's/note: native-static-libs: \(.*\)/\1/' > $(TMPDIR)/libs.txt
-	cat $(TMPDIR)/libs.txt
-
-ifdef IS_MSVC
-	$(CC) $(CFLAGS) /c foo.c /Fo:$(TMPDIR)/foo.o
-	$(RUSTC_LINKER) $(TMPDIR)/foo.o $(TMPDIR)/foo.lib $$(cat $(TMPDIR)/libs.txt) $(call OUT_EXE,foo)
-else
-	$(CC) $(CFLAGS) foo.c -L $(TMPDIR) -lfoo $$(cat $(TMPDIR)/libs.txt) -o $(call RUN_BINFILE,foo)
-endif
-
-	$(call RUN,foo)
diff --git a/tests/run-make/staticlib-dylib-linkage/rmake.rs b/tests/run-make/staticlib-dylib-linkage/rmake.rs
new file mode 100644
index 00000000000..8dd1ac0ffbd
--- /dev/null
+++ b/tests/run-make/staticlib-dylib-linkage/rmake.rs
@@ -0,0 +1,36 @@
+// A basic smoke test to check that rustc supports linking to a rust dylib with
+// --crate-type staticlib. bar is a dylib, on which foo is dependent - the native
+// static lib search paths are collected and used to compile foo.c, the final executable
+// which depends on both foo and bar.
+// See https://github.com/rust-lang/rust/pull/106560
+
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed.
+//@ ignore-wasm
+// Reason: WASM does not support dynamic libraries
+
+use run_make_support::{cc, is_msvc, regex, run, rustc, static_lib_name};
+
+fn main() {
+    rustc().arg("-Cprefer-dynamic").input("bar.rs").run();
+    let libs = rustc()
+        .input("foo.rs")
+        .crate_type("staticlib")
+        .print("native-static-libs")
+        .arg("-Zstaticlib-allow-rdylib-deps")
+        .run()
+        .assert_stderr_contains("note: native-static-libs: ")
+        .stderr_utf8();
+    let re = regex::Regex::new(r#"note: native-static-libs:\s*(.+)"#).unwrap();
+    let libs = re.find(&libs).unwrap().as_str().trim();
+    // remove the note
+    let (_, native_link_args) = libs.split_once("note: native-static-libs: ").unwrap();
+    // divide the command-line arguments in a vec
+    let mut native_link_args = native_link_args.split(' ').collect::<Vec<&str>>();
+    if is_msvc() {
+        // For MSVC pass the arguments on to the linker.
+        native_link_args.insert(0, "-link");
+    }
+    cc().input("foo.c").input(static_lib_name("foo")).args(native_link_args).out_exe("foo").run();
+    run("foo");
+}
diff --git a/tests/run-make/stdin-rustc/rmake.rs b/tests/run-make/stdin-rustc/rmake.rs
index d599f813563..68e9cf2fbd8 100644
--- a/tests/run-make/stdin-rustc/rmake.rs
+++ b/tests/run-make/stdin-rustc/rmake.rs
@@ -1,8 +1,9 @@
 //! This test checks rustc `-` (stdin) support
 
-use run_make_support::{is_windows, rustc};
 use std::path::PathBuf;
 
+use run_make_support::{is_windows, rustc};
+
 const HELLO_WORLD: &str = r#"
 fn main() {
     println!("Hello world!");
diff --git a/tests/run-make/stdin-rustdoc/rmake.rs b/tests/run-make/stdin-rustdoc/rmake.rs
index a72fe1bc7da..de47a24fbdd 100644
--- a/tests/run-make/stdin-rustdoc/rmake.rs
+++ b/tests/run-make/stdin-rustdoc/rmake.rs
@@ -1,8 +1,9 @@
 //! This test checks rustdoc `-` (stdin) handling
 
-use run_make_support::rustdoc;
 use std::path::PathBuf;
 
+use run_make_support::rustdoc;
+
 static INPUT: &str = r#"
 //! ```
 //! dbg!(());
diff --git a/tests/run-make/suspicious-library/rmake.rs b/tests/run-make/suspicious-library/rmake.rs
index e789607482b..1dc9bc53b67 100644
--- a/tests/run-make/suspicious-library/rmake.rs
+++ b/tests/run-make/suspicious-library/rmake.rs
@@ -3,9 +3,10 @@
 
 //@ ignore-cross-compile
 
-use run_make_support::{dynamic_lib_name, rustc};
 use std::fs::File;
 
+use run_make_support::{dynamic_lib_name, rustc};
+
 fn main() {
     rustc().input("foo.rs").arg("-Cprefer-dynamic").run();
     File::create(dynamic_lib_name("foo-something-special")).unwrap();
diff --git a/tests/run-make/symbol-visibility/Makefile b/tests/run-make/symbol-visibility/Makefile
deleted file mode 100644
index 9159af214ca..00000000000
--- a/tests/run-make/symbol-visibility/Makefile
+++ /dev/null
@@ -1,123 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-# ignore-windows-msvc
-
-NM=nm -D
-CDYLIB_NAME=liba_cdylib.so
-RDYLIB_NAME=liba_rust_dylib.so
-PROC_MACRO_NAME=liba_proc_macro.so
-EXE_NAME=an_executable
-COMBINED_CDYLIB_NAME=libcombined_rlib_dylib.so
-
-ifeq ($(UNAME),Darwin)
-NM=nm -gU
-CDYLIB_NAME=liba_cdylib.dylib
-RDYLIB_NAME=liba_rust_dylib.dylib
-PROC_MACRO_NAME=liba_proc_macro.dylib
-EXE_NAME=an_executable
-COMBINED_CDYLIB_NAME=libcombined_rlib_dylib.dylib
-endif
-
-ifdef IS_WINDOWS
-NM=nm -g
-CDYLIB_NAME=liba_cdylib.dll.a
-RDYLIB_NAME=liba_rust_dylib.dll.a
-PROC_MACRO_NAME=liba_proc_macro.dll
-EXE_NAME=an_executable.exe
-COMBINED_CDYLIB_NAME=libcombined_rlib_dylib.dll.a
-endif
-
-# `grep` regex for symbols produced by either `legacy` or `v0` mangling
-RE_ANY_RUST_SYMBOL="_ZN.*h.*E\|_R[a-zA-Z0-9_]+"
-
-all:
-	$(RUSTC) -Zshare-generics=no an_rlib.rs
-	$(RUSTC) -Zshare-generics=no a_cdylib.rs
-	$(RUSTC) -Zshare-generics=no a_rust_dylib.rs
-	$(RUSTC) -Zshare-generics=no a_proc_macro.rs
-	$(RUSTC) -Zshare-generics=no an_executable.rs
-	$(RUSTC) -Zshare-generics=no a_cdylib.rs --crate-name combined_rlib_dylib --crate-type=rlib,cdylib
-
-	# Check that a cdylib exports its public #[no_mangle] functions
-	[ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_cdylib)" -eq "1" ]
-	# Check that a cdylib exports the public #[no_mangle] functions of dependencies
-	[ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_rlib)" -eq "1" ]
-	# Check that a cdylib DOES NOT export any public Rust functions
-	[ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -v __imp_ | grep -c $(RE_ANY_RUST_SYMBOL))" -eq "0" ]
-
-	# Check that a Rust dylib exports its monomorphic functions
-	[ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_rust_dylib)" -eq "1" ]
-	[ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -v __imp_ | grep -c public_rust_function_from_rust_dylib)" -eq "1" ]
-	# Check that a Rust dylib does not export generics if -Zshare-generics=no
-	[ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -v __imp_ | grep -c public_generic_function_from_rust_dylib)" -eq "0" ]
-
-
-	# Check that a Rust dylib exports the monomorphic functions from its dependencies
-	[ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_rlib)" -eq "1" ]
-	[ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -v __imp_ | grep -c public_rust_function_from_rlib)" -eq "1" ]
-	# Check that a Rust dylib does not export generics if -Zshare-generics=no
-	[ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -v __imp_ | grep -c public_generic_function_from_rlib)" -eq "0" ]
-
-	# Check that a proc macro exports its public #[no_mangle] functions
-	# FIXME(#99978) avoid exporting #[no_mangle] symbols for proc macros
-	[ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_cdylib)" -eq "1" ]
-	# Check that a proc macro exports the public #[no_mangle] functions of dependencies
-	[ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_rlib)" -eq "1" ]
-	# Check that a proc macro DOES NOT export any public Rust functions
-	[ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -v __imp_ | grep -c $(RE_ANY_RUST_SYMBOL))" -eq "0" ]
-
-# FIXME(nbdd0121): This is broken in MinGW, see https://github.com/rust-lang/rust/pull/95604#issuecomment-1101564032
-ifndef IS_WINDOWS
-	# Check that an executable does not export any dynamic symbols
-	[ "$$($(NM) $(TMPDIR)/$(EXE_NAME) | grep -v __imp_ | grep -c public_c_function_from_rlib)" -eq "0" ]
-	[ "$$($(NM) $(TMPDIR)/$(EXE_NAME) | grep -v __imp_ | grep -c public_rust_function_from_exe)" -eq "0" ]
-endif
-
-
-	# Check the combined case, where we generate a cdylib and an rlib in the same
-	# compilation session:
-	# Check that a cdylib exports its public #[no_mangle] functions
-	[ "$$($(NM) $(TMPDIR)/$(COMBINED_CDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_cdylib)" -eq "1" ]
-	# Check that a cdylib exports the public #[no_mangle] functions of dependencies
-	[ "$$($(NM) $(TMPDIR)/$(COMBINED_CDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_rlib)" -eq "1" ]
-	# Check that a cdylib DOES NOT export any public Rust functions
-	[ "$$($(NM) $(TMPDIR)/$(COMBINED_CDYLIB_NAME) | grep -v __imp_ | grep -c $(RE_ANY_RUST_SYMBOL))" -eq "0" ]
-
-
-	$(RUSTC) -Zshare-generics=yes an_rlib.rs
-	$(RUSTC) -Zshare-generics=yes a_cdylib.rs
-	$(RUSTC) -Zshare-generics=yes a_rust_dylib.rs
-	$(RUSTC) -Zshare-generics=yes a_proc_macro.rs
-	$(RUSTC) -Zshare-generics=yes an_executable.rs
-
-	# Check that a cdylib exports its public #[no_mangle] functions
-	[ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_cdylib)" -eq "1" ]
-	# Check that a cdylib exports the public #[no_mangle] functions of dependencies
-	[ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_rlib)" -eq "1" ]
-	# Check that a cdylib DOES NOT export any public Rust functions
-	[ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -v __imp_ | grep -c $(RE_ANY_RUST_SYMBOL))" -eq "0" ]
-
-	# Check that a Rust dylib exports its monomorphic functions, including generics this time
-	[ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_rust_dylib)" -eq "1" ]
-	[ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -v __imp_ | grep -c public_rust_function_from_rust_dylib)" -eq "1" ]
-	[ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -v __imp_ | grep -c public_generic_function_from_rust_dylib)" -eq "1" ]
-
-	# Check that a Rust dylib exports the monomorphic functions from its dependencies
-	[ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_rlib)" -eq "1" ]
-	[ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -v __imp_ | grep -c public_rust_function_from_rlib)" -eq "1" ]
-	[ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -v __imp_ | grep -c public_generic_function_from_rlib)" -eq "1" ]
-
-	# Check that a proc macro exports its public #[no_mangle] functions
-	# FIXME(#99978) avoid exporting #[no_mangle] symbols for proc macros
-	[ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_cdylib)" -eq "1" ]
-	# Check that a proc macro exports the public #[no_mangle] functions of dependencies
-	[ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -v __imp_ | grep -c public_c_function_from_rlib)" -eq "1" ]
-	# Check that a proc macro DOES NOT export any public Rust functions
-	[ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -v __imp_ | grep -c $(RE_ANY_RUST_SYMBOL))" -eq "0" ]
-
-ifndef IS_WINDOWS
-	# Check that an executable does not export any dynamic symbols
-	[ "$$($(NM) $(TMPDIR)/$(EXE_NAME) | grep -v __imp_ | grep -c public_c_function_from_rlib)" -eq "0" ]
-	[ "$$($(NM) $(TMPDIR)/$(EXE_NAME) | grep -v __imp_ | grep -c public_rust_function_from_exe)" -eq "0" ]
-endif
diff --git a/tests/run-make/symbol-visibility/rmake.rs b/tests/run-make/symbol-visibility/rmake.rs
new file mode 100644
index 00000000000..f84e63ef74e
--- /dev/null
+++ b/tests/run-make/symbol-visibility/rmake.rs
@@ -0,0 +1,167 @@
+// Dynamic libraries on Rust used to export a very high amount of symbols,
+// going as far as filling the output with mangled names and generic function
+// names. After the rework of #38117, this test checks that no mangled Rust symbols
+// are exported, and that generics are only shown if explicitely requested.
+// See https://github.com/rust-lang/rust/issues/37530
+
+use run_make_support::object::read::Object;
+use run_make_support::{bin_name, dynamic_lib_name, is_msvc, object, regex, rfs, rustc};
+
+fn main() {
+    let cdylib_name = dynamic_lib_name("a_cdylib");
+    let rdylib_name = dynamic_lib_name("a_rust_dylib");
+    let exe_name = bin_name("an_executable");
+    let combined_cdylib_name = dynamic_lib_name("combined_rlib_dylib");
+    rustc().arg("-Zshare-generics=no").input("an_rlib.rs").run();
+    rustc().arg("-Zshare-generics=no").input("a_cdylib.rs").run();
+    rustc().arg("-Zshare-generics=no").input("a_rust_dylib.rs").run();
+    rustc().arg("-Zshare-generics=no").input("a_proc_macro.rs").run();
+    rustc().arg("-Zshare-generics=no").input("an_executable.rs").run();
+    rustc()
+        .arg("-Zshare-generics=no")
+        .input("a_cdylib.rs")
+        .crate_name("combined_rlib_dylib")
+        .crate_type("rlib,cdylib")
+        .run();
+
+    // Check that a cdylib exports its public #[no_mangle] functions
+    symbols_check(&cdylib_name, SymbolCheckType::StrSymbol("public_c_function_from_cdylib"), true);
+    // Check that a cdylib exports the public #[no_mangle] functions of dependencies
+    symbols_check(&cdylib_name, SymbolCheckType::StrSymbol("public_c_function_from_rlib"), true);
+    // Check that a cdylib DOES NOT export any public Rust functions
+    symbols_check(&cdylib_name, SymbolCheckType::AnyRustSymbol, false);
+
+    // Check that a Rust dylib exports its monomorphic functions
+    symbols_check(
+        &rdylib_name,
+        SymbolCheckType::StrSymbol("public_c_function_from_rust_dylib"),
+        true,
+    );
+    symbols_check(
+        &rdylib_name,
+        SymbolCheckType::StrSymbol("public_rust_function_from_rust_dylib"),
+        true,
+    );
+    // Check that a Rust dylib does not export generics if -Zshare-generics=no
+    symbols_check(
+        &rdylib_name,
+        SymbolCheckType::StrSymbol("public_generic_function_from_rust_dylib"),
+        false,
+    );
+
+    // Check that a Rust dylib exports the monomorphic functions from its dependencies
+    symbols_check(&rdylib_name, SymbolCheckType::StrSymbol("public_c_function_from_rlib"), true);
+    symbols_check(&rdylib_name, SymbolCheckType::StrSymbol("public_rust_function_from_rlib"), true);
+    // Check that a Rust dylib does not export generics if -Zshare-generics=no
+    symbols_check(
+        &rdylib_name,
+        SymbolCheckType::StrSymbol("public_generic_function_from_rlib"),
+        false,
+    );
+
+    // FIXME(nbdd0121): This is broken in MinGW, see https://github.com/rust-lang/rust/pull/95604#issuecomment-1101564032
+    if is_msvc() {
+        // Check that an executable does not export any dynamic symbols
+        symbols_check(&exe_name, SymbolCheckType::StrSymbol("public_c_function_from_rlib"), false);
+        symbols_check(
+            &exe_name,
+            SymbolCheckType::StrSymbol("public_rust_function_from_exe"),
+            false,
+        );
+    }
+
+    // Check the combined case, where we generate a cdylib and an rlib in the same
+    // compilation session:
+    // Check that a cdylib exports its public #[no_mangle] functions
+    symbols_check(
+        &combined_cdylib_name,
+        SymbolCheckType::StrSymbol("public_c_function_from_cdylib"),
+        true,
+    );
+    // Check that a cdylib exports the public #[no_mangle] functions of dependencies
+    symbols_check(
+        &combined_cdylib_name,
+        SymbolCheckType::StrSymbol("public_c_function_from_rlib"),
+        true,
+    );
+    // Check that a cdylib DOES NOT export any public Rust functions
+    symbols_check(&combined_cdylib_name, SymbolCheckType::AnyRustSymbol, false);
+
+    rustc().arg("-Zshare-generics=yes").input("an_rlib.rs").run();
+    rustc().arg("-Zshare-generics=yes").input("a_cdylib.rs").run();
+    rustc().arg("-Zshare-generics=yes").input("a_rust_dylib.rs").run();
+    rustc().arg("-Zshare-generics=yes").input("an_executable.rs").run();
+
+    // Check that a cdylib exports its public #[no_mangle] functions
+    symbols_check(&cdylib_name, SymbolCheckType::StrSymbol("public_c_function_from_cdylib"), true);
+    // Check that a cdylib exports the public #[no_mangle] functions of dependencies
+    symbols_check(&cdylib_name, SymbolCheckType::StrSymbol("public_c_function_from_rlib"), true);
+    // Check that a cdylib DOES NOT export any public Rust functions
+    symbols_check(&cdylib_name, SymbolCheckType::AnyRustSymbol, false);
+
+    // Check that a Rust dylib exports its monomorphic functions, including generics this time
+    symbols_check(
+        &rdylib_name,
+        SymbolCheckType::StrSymbol("public_c_function_from_rust_dylib"),
+        true,
+    );
+    symbols_check(
+        &rdylib_name,
+        SymbolCheckType::StrSymbol("public_rust_function_from_rust_dylib"),
+        true,
+    );
+    symbols_check(
+        &rdylib_name,
+        SymbolCheckType::StrSymbol("public_generic_function_from_rust_dylib"),
+        true,
+    );
+
+    // Check that a Rust dylib exports the monomorphic functions from its dependencies
+    symbols_check(&rdylib_name, SymbolCheckType::StrSymbol("public_c_function_from_rlib"), true);
+    symbols_check(&rdylib_name, SymbolCheckType::StrSymbol("public_rust_function_from_rlib"), true);
+    symbols_check(
+        &rdylib_name,
+        SymbolCheckType::StrSymbol("public_generic_function_from_rlib"),
+        true,
+    );
+
+    // FIXME(nbdd0121): This is broken in MinGW, see https://github.com/rust-lang/rust/pull/95604#issuecomment-1101564032
+    if is_msvc() {
+        // Check that an executable does not export any dynamic symbols
+        symbols_check(&exe_name, SymbolCheckType::StrSymbol("public_c_function_from_rlib"), false);
+        symbols_check(
+            &exe_name,
+            SymbolCheckType::StrSymbol("public_rust_function_from_exe"),
+            false,
+        );
+    }
+}
+
+#[track_caller]
+fn symbols_check(path: &str, symbol_check_type: SymbolCheckType, exists_once: bool) {
+    let binary_data = rfs::read(path);
+    let file = object::File::parse(&*binary_data).unwrap();
+    let mut found: u64 = 0;
+    for export in file.exports().unwrap() {
+        let name = std::str::from_utf8(export.name()).unwrap();
+        if has_symbol(name, symbol_check_type) {
+            found += 1;
+        }
+    }
+    assert_eq!(found, exists_once as u64);
+}
+
+fn has_symbol(name: &str, symbol_check_type: SymbolCheckType) -> bool {
+    if let SymbolCheckType::StrSymbol(expected) = symbol_check_type {
+        name.contains(expected)
+    } else {
+        let regex = regex::Regex::new(r#"_ZN.*h.*E\|_R[a-zA-Z0-9_]+"#).unwrap();
+        regex.is_match(name)
+    }
+}
+
+#[derive(Clone, Copy)]
+enum SymbolCheckType {
+    StrSymbol(&'static str),
+    AnyRustSymbol,
+}
diff --git a/tests/run-make/thumb-none-cortex-m/Makefile b/tests/run-make/thumb-none-cortex-m/Makefile
deleted file mode 100644
index e941fc4a78e..00000000000
--- a/tests/run-make/thumb-none-cortex-m/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-include ../tools.mk
-
-# How to run this
-# $ ./x.py clean
-# $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi tests/run-make
-
-# Supported targets:
-# - thumbv6m-none-eabi (Bare Cortex-M0, M0+, M1)
-# - thumbv7em-none-eabi (Bare Cortex-M4, M7)
-# - thumbv7em-none-eabihf (Bare Cortex-M4F, M7F, FPU, hardfloat)
-# - thumbv7m-none-eabi (Bare Cortex-M3)
-
-# only-thumb
-
-# For cargo setting
-RUSTC := $(RUSTC_ORIGINAL)
-LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
-# We need to be outside of 'src' dir in order to run cargo
-WORK_DIR := $(TMPDIR)
-
-HERE := $(shell pwd)
-
-CRATE := cortex-m
-CRATE_URL := https://github.com/rust-embedded/cortex-m
-CRATE_SHA1 := a448e9156e2cb1e556e5441fd65426952ef4b927 # 0.5.0
-
-# Don't make lints fatal, but they need to at least warn or they break Cargo's target info parsing.
-export RUSTFLAGS := --cap-lints=warn
-
-all:
-	env
-	mkdir -p $(WORK_DIR)
-	-cd $(WORK_DIR) && rm -rf $(CRATE)
-	cd $(WORK_DIR) && bash -x $(HERE)/../git_clone_sha1.sh $(CRATE) $(CRATE_URL) $(CRATE_SHA1)
-	# HACK(eddyb) sets `RUSTC_BOOTSTRAP=1` so Cargo can accept nightly features.
-	# These come from the top-level Rust workspace, that this crate is not a
-	# member of, but Cargo tries to load the workspace `Cargo.toml` anyway.
-	cd $(WORK_DIR) && cd $(CRATE) && env RUSTC_BOOTSTRAP=1 $(BOOTSTRAP_CARGO) build --target $(TARGET) -v
diff --git a/tests/run-make/thumb-none-cortex-m/rmake.rs b/tests/run-make/thumb-none-cortex-m/rmake.rs
new file mode 100644
index 00000000000..0ddb91d378f
--- /dev/null
+++ b/tests/run-make/thumb-none-cortex-m/rmake.rs
@@ -0,0 +1,59 @@
+//! Test building of the `cortex-m` crate, a foundational crate in the embedded ecosystem
+//! for a collection of thumb targets. This is a smoke test that verifies that both cargo
+//! and rustc work in this case.
+//!
+//! How to run this
+//! $ ./x.py clean
+//! $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi tests/run-make
+//!
+//! Supported targets:
+//! - thumbv6m-none-eabi (Bare Cortex-M0, M0+, M1)
+//! - thumbv7em-none-eabi (Bare Cortex-M4, M7)
+//! - thumbv7em-none-eabihf (Bare Cortex-M4F, M7F, FPU, hardfloat)
+//! - thumbv7m-none-eabi (Bare Cortex-M3)
+
+//@ only-thumb
+
+use std::path::PathBuf;
+
+use run_make_support::rfs::create_dir;
+use run_make_support::{cmd, env_var, target};
+
+const CRATE: &str = "cortex-m";
+const CRATE_URL: &str = "https://github.com/rust-embedded/cortex-m";
+const CRATE_SHA1: &str = "a448e9156e2cb1e556e5441fd65426952ef4b927"; // v0.5.0
+
+fn main() {
+    // FIXME: requires an internet connection https://github.com/rust-lang/rust/issues/128733
+    // See below link for git usage:
+    // https://stackoverflow.com/questions/3489173#14091182
+    cmd("git").args(["clone", CRATE_URL, CRATE]).run();
+    std::env::set_current_dir(CRATE).unwrap();
+    cmd("git").args(["reset", "--hard", CRATE_SHA1]).run();
+
+    let target_dir = PathBuf::from("target");
+    let manifest_path = PathBuf::from("Cargo.toml");
+
+    let path = env_var("PATH");
+    let rustc = env_var("RUSTC");
+    let bootstrap_cargo = env_var("BOOTSTRAP_CARGO");
+    // FIXME: extract bootstrap cargo invocations to a proper command
+    // https://github.com/rust-lang/rust/issues/128734
+    let mut cmd = cmd(bootstrap_cargo);
+    cmd.args(&[
+        "build",
+        "--manifest-path",
+        manifest_path.to_str().unwrap(),
+        "-Zbuild-std=core",
+        "--target",
+        &target(),
+    ])
+    .env("PATH", path)
+    .env("RUSTC", rustc)
+    .env("CARGO_TARGET_DIR", &target_dir)
+    // Don't make lints fatal, but they need to at least warn
+    // or they break Cargo's target info parsing.
+    .env("RUSTFLAGS", "-Copt-level=0 -Cdebug-assertions=yes --cap-lints=warn");
+
+    cmd.run();
+}
diff --git a/tests/run-make/thumb-none-qemu/Makefile b/tests/run-make/thumb-none-qemu/Makefile
deleted file mode 100644
index eea6ca34992..00000000000
--- a/tests/run-make/thumb-none-qemu/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-include ../tools.mk
-
-# only-thumb
-
-# How to run this
-# $ ./x.py clean
-# $ ./x.py test --target thumbv7m-none-eabi tests/run-make
-
-# For cargo setting
-export RUSTC := $(RUSTC_ORIGINAL)
-export LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
-# We need to be outside of 'src' dir in order to run cargo
-export WORK_DIR := $(TMPDIR)
-export HERE := $(shell pwd)
-
-## clean up unused env variables which might cause harm.
-unexport RUSTC_LINKER
-unexport RUSTC_BOOTSTRAP
-unexport RUST_BUILD_STAGE
-unexport RUST_TEST_THREADS
-unexport RUST_TEST_TMPDIR
-unexport AR
-unexport CC
-unexport CXX
-
-all:
-	bash script.sh
diff --git a/tests/run-make/thumb-none-qemu/example/.cargo/config b/tests/run-make/thumb-none-qemu/example/.cargo/config.toml
index 8b30310e7d4..7152e81b502 100644
--- a/tests/run-make/thumb-none-qemu/example/.cargo/config
+++ b/tests/run-make/thumb-none-qemu/example/.cargo/config.toml
@@ -1,6 +1,5 @@
 [target.thumbv6m-none-eabi]
-# FIXME: Should be Cortex-M0, but Qemu used by CI is too old
-runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"
+runner = "qemu-system-arm -cpu cortex-m0 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"
 
 [target.thumbv7m-none-eabi]
 runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"
@@ -12,7 +11,7 @@ runner = "qemu-system-arm -cpu cortex-m4 -machine lm3s6965evb -nographic -semiho
 runner = "qemu-system-arm -cpu cortex-m4 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"
 
 [target.thumbv8m.base-none-eabi]
-# FIXME: Should be the Cortex-M23, bt Qemu does not currently support it
+# FIXME: Should be the Cortex-M23, but Qemu does not currently support it
 runner = "qemu-system-arm -cpu cortex-m33 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"
 
 [target.thumbv8m.main-none-eabi]
diff --git a/tests/run-make/thumb-none-qemu/example/src/main.rs b/tests/run-make/thumb-none-qemu/example/src/main.rs
index 2abfde8e75f..4b8162c4120 100644
--- a/tests/run-make/thumb-none-qemu/example/src/main.rs
+++ b/tests/run-make/thumb-none-qemu/example/src/main.rs
@@ -1,11 +1,10 @@
 #![no_main]
 #![no_std]
 use core::fmt::Write;
+
 use cortex_m::asm;
 use cortex_m_rt::entry;
-use cortex_m_semihosting as semihosting;
-
-use panic_halt as _;
+use {cortex_m_semihosting as semihosting, panic_halt as _};
 
 #[entry]
 fn main() -> ! {
diff --git a/tests/run-make/thumb-none-qemu/rmake.rs b/tests/run-make/thumb-none-qemu/rmake.rs
new file mode 100644
index 00000000000..d0f42bc8808
--- /dev/null
+++ b/tests/run-make/thumb-none-qemu/rmake.rs
@@ -0,0 +1,62 @@
+//! This test runs a basic application for thumb targets, using the cortex-m crate.
+//!
+//! These targets are very bare-metal: the first instruction the core runs on
+//! power-on is already user code. The cortex-m-rt has to initialize the stack, .data,
+//! .bss, enable the FPU if present, etc.
+//!
+//! This test builds and runs the applications for various thumb targets using qemu.
+//!
+//! How to run this
+//! $ ./x.py clean
+//! $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi tests/run-make
+//!
+//! For supported targets, see `example/.cargo/config.toml`
+//!
+//! FIXME: https://github.com/rust-lang/rust/issues/128733 this test uses external
+//! dependencies, and needs an active internet connection
+//!
+//! FIXME: https://github.com/rust-lang/rust/issues/128734 extract bootstrap cargo
+//! to a proper command
+
+//@ only-thumb
+
+use std::path::PathBuf;
+
+use run_make_support::{cmd, env_var, path_helpers, target};
+
+const CRATE: &str = "example";
+
+fn main() {
+    std::env::set_current_dir(CRATE).unwrap();
+
+    let bootstrap_cargo = env_var("BOOTSTRAP_CARGO");
+    let path = env_var("PATH");
+    let rustc = env_var("RUSTC");
+
+    let target_dir = path_helpers::path("target");
+    let manifest_path = path_helpers::path("Cargo.toml");
+
+    let debug = {
+        let mut cmd = cmd(&bootstrap_cargo);
+        cmd.args(&["run", "--target", &target()])
+            .env("RUSTFLAGS", "-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x")
+            .env("CARGO_TARGET_DIR", &target_dir)
+            .env("PATH", &path)
+            .env("RUSTC", &rustc);
+        cmd.run()
+    };
+
+    debug.assert_stdout_contains("x = 42");
+
+    let release = {
+        let mut cmd = cmd(&bootstrap_cargo);
+        cmd.args(&["run", "--release", "--target", &target()])
+            .env("RUSTFLAGS", "-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x")
+            .env("CARGO_TARGET_DIR", &target_dir)
+            .env("PATH", &path)
+            .env("RUSTC", &rustc);
+        cmd.run()
+    };
+
+    release.assert_stdout_contains("x = 42");
+}
diff --git a/tests/run-make/thumb-none-qemu/script.sh b/tests/run-make/thumb-none-qemu/script.sh
deleted file mode 100644
index a8aa72af184..00000000000
--- a/tests/run-make/thumb-none-qemu/script.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-set -exuo pipefail
-
-CRATE=example
-
-env | sort
-mkdir -p $WORK_DIR
-pushd $WORK_DIR
-    rm -rf $CRATE || echo OK
-    cp -a $HERE/example .
-    pushd $CRATE
-        # HACK(eddyb) sets `RUSTC_BOOTSTRAP=1` so Cargo can accept nightly features.
-        # These come from the top-level Rust workspace, that this crate is not a
-        # member of, but Cargo tries to load the workspace `Cargo.toml` anyway.
-        env RUSTC_BOOTSTRAP=1 RUSTFLAGS="-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x" \
-            $BOOTSTRAP_CARGO run --target $TARGET           | grep "x = 42"
-        env RUSTC_BOOTSTRAP=1 RUSTFLAGS="-C linker=arm-none-eabi-ld -C link-arg=-Tlink.x" \
-            $BOOTSTRAP_CARGO run --target $TARGET --release | grep "x = 42"
-    popd
-popd
diff --git a/tests/run-make/used/rmake.rs b/tests/run-make/used/rmake.rs
index 56ef5c6b9cc..39f36b2eea8 100644
--- a/tests/run-make/used/rmake.rs
+++ b/tests/run-make/used/rmake.rs
@@ -4,12 +4,10 @@
 // It comes from #39987 which implements this RFC for the #[used] attribute:
 // https://rust-lang.github.io/rfcs/2386-used.html
 
-//@ ignore-msvc
-
-use run_make_support::{cmd, rustc};
+use run_make_support::rustc;
+use run_make_support::symbols::any_symbol_contains;
 
 fn main() {
     rustc().opt_level("3").emit("obj").input("used.rs").run();
-
-    cmd("nm").arg("used.o").run().assert_stdout_contains("FOO");
+    assert!(any_symbol_contains("used.o", &["FOO"]));
 }
diff --git a/tests/run-make/used/used.rs b/tests/run-make/used/used.rs
index dca0a5e1167..133f8121a8e 100644
--- a/tests/run-make/used/used.rs
+++ b/tests/run-make/used/used.rs
@@ -2,5 +2,3 @@
 
 #[used]
 static FOO: u32 = 0;
-
-static BAR: u32 = 0;
diff --git a/tests/run-make/volatile-intrinsics/rmake.rs b/tests/run-make/volatile-intrinsics/rmake.rs
index 66bc6f953c2..1d19b652143 100644
--- a/tests/run-make/volatile-intrinsics/rmake.rs
+++ b/tests/run-make/volatile-intrinsics/rmake.rs
@@ -1,7 +1,6 @@
 //@ ignore-cross-compile
 
-use run_make_support::rfs;
-use run_make_support::{assert_contains, run, rustc};
+use run_make_support::{assert_contains, rfs, run, rustc};
 
 fn main() {
     // The tests must pass...
diff --git a/tests/run-make/wasm-custom-section/rmake.rs b/tests/run-make/wasm-custom-section/rmake.rs
index 756a72f11b1..ff4c29a9d30 100644
--- a/tests/run-make/wasm-custom-section/rmake.rs
+++ b/tests/run-make/wasm-custom-section/rmake.rs
@@ -1,8 +1,9 @@
 //@ only-wasm32-wasip1
 
-use run_make_support::{rfs, rustc, wasmparser};
 use std::collections::HashMap;
 
+use run_make_support::{rfs, rustc, wasmparser};
+
 fn main() {
     rustc().input("foo.rs").target("wasm32-wasip1").run();
     rustc().input("bar.rs").target("wasm32-wasip1").arg("-Clto").opt().run();
diff --git a/tests/run-make/wasm-custom-sections-opt/rmake.rs b/tests/run-make/wasm-custom-sections-opt/rmake.rs
index 0be863fdb6e..063a4f2257c 100644
--- a/tests/run-make/wasm-custom-sections-opt/rmake.rs
+++ b/tests/run-make/wasm-custom-sections-opt/rmake.rs
@@ -1,9 +1,10 @@
 //@ only-wasm32-wasip1
 
-use run_make_support::{rfs, rustc, wasmparser};
 use std::collections::HashMap;
 use std::path::Path;
 
+use run_make_support::{rfs, rustc, wasmparser};
+
 fn main() {
     rustc().input("foo.rs").target("wasm32-wasip1").opt().run();
 
diff --git a/tests/run-make/wasm-export-all-symbols/rmake.rs b/tests/run-make/wasm-export-all-symbols/rmake.rs
index 9ea541a1752..4148cc29ec2 100644
--- a/tests/run-make/wasm-export-all-symbols/rmake.rs
+++ b/tests/run-make/wasm-export-all-symbols/rmake.rs
@@ -1,8 +1,9 @@
 //@ only-wasm32-wasip1
 
-use run_make_support::{rfs, rustc, wasmparser};
 use std::collections::HashMap;
 use std::path::Path;
+
+use run_make_support::{rfs, rustc, wasmparser};
 use wasmparser::ExternalKind::*;
 
 fn main() {
diff --git a/tests/run-make/wasm-import-module/rmake.rs b/tests/run-make/wasm-import-module/rmake.rs
index c240d4780b2..3b74cb20558 100644
--- a/tests/run-make/wasm-import-module/rmake.rs
+++ b/tests/run-make/wasm-import-module/rmake.rs
@@ -1,7 +1,8 @@
 //@ only-wasm32-wasip1
 
-use run_make_support::{rfs, rustc, wasmparser};
 use std::collections::HashMap;
+
+use run_make_support::{rfs, rustc, wasmparser};
 use wasmparser::TypeRef::Func;
 
 fn main() {
diff --git a/tests/run-make/wasm-override-linker/rmake.rs b/tests/run-make/wasm-override-linker/rmake.rs
index 01bc08e9901..b04edc18eef 100644
--- a/tests/run-make/wasm-override-linker/rmake.rs
+++ b/tests/run-make/wasm-override-linker/rmake.rs
@@ -2,6 +2,10 @@
 // $ RUSTBUILD_FORCE_CLANG_BASED_TESTS=1 ./x.py test tests/run-make/wasm-override-linker/
 
 //@ needs-force-clang-based-tests
+// FIXME(#126180): This test can only run on `x86_64-gnu-debug`, because that CI job sets
+// RUSTBUILD_FORCE_CLANG_BASED_TESTS and only runs tests which contain "clang" in their
+// name.
+// However, this test does not run at all as its name does not contain "clang".
 
 use run_make_support::{env_var, rustc, target};
 
diff --git a/tests/run-make/wasm-spurious-import/rmake.rs b/tests/run-make/wasm-spurious-import/rmake.rs
index 9cfd202eae1..8fde8d295c7 100644
--- a/tests/run-make/wasm-spurious-import/rmake.rs
+++ b/tests/run-make/wasm-spurious-import/rmake.rs
@@ -1,8 +1,9 @@
 //@ only-wasm32-wasip1
 
-use run_make_support::{rfs, rustc, wasmparser};
 use std::collections::HashMap;
 
+use run_make_support::{rfs, rustc, wasmparser};
+
 fn main() {
     rustc()
         .input("main.rs")
diff --git a/tests/run-make/wasm-symbols-different-module/rmake.rs b/tests/run-make/wasm-symbols-different-module/rmake.rs
index 6b69f76ee17..3cd459db02f 100644
--- a/tests/run-make/wasm-symbols-different-module/rmake.rs
+++ b/tests/run-make/wasm-symbols-different-module/rmake.rs
@@ -1,9 +1,10 @@
 //@ only-wasm32-wasip1
 
-use run_make_support::{rfs, rustc, wasmparser};
 use std::collections::{HashMap, HashSet};
 use std::path::Path;
 
+use run_make_support::{rfs, rustc, wasmparser};
+
 fn main() {
     test_file("foo.rs", &[("a", &["foo"]), ("b", &["foo"])]);
     test_file("bar.rs", &[("m1", &["f", "g"]), ("m2", &["f"])]);
diff --git a/tests/run-make/wasm-symbols-not-exported/rmake.rs b/tests/run-make/wasm-symbols-not-exported/rmake.rs
index ad31351ba95..0b9c9c6822e 100644
--- a/tests/run-make/wasm-symbols-not-exported/rmake.rs
+++ b/tests/run-make/wasm-symbols-not-exported/rmake.rs
@@ -1,8 +1,9 @@
 //@ only-wasm32-wasip1
 
-use run_make_support::{rfs, rustc, wasmparser};
 use std::path::Path;
 
+use run_make_support::{rfs, rustc, wasmparser};
+
 fn main() {
     rustc().input("foo.rs").target("wasm32-wasip1").run();
     verify_symbols(Path::new("foo.wasm"));
diff --git a/tests/run-make/wasm-symbols-not-imported/rmake.rs b/tests/run-make/wasm-symbols-not-imported/rmake.rs
index 36c600c49f5..fc22e31356a 100644
--- a/tests/run-make/wasm-symbols-not-imported/rmake.rs
+++ b/tests/run-make/wasm-symbols-not-imported/rmake.rs
@@ -1,8 +1,9 @@
 //@ only-wasm32-wasip1
 
-use run_make_support::{rfs, rustc, wasmparser};
 use std::path::Path;
 
+use run_make_support::{rfs, rustc, wasmparser};
+
 fn main() {
     rustc().input("foo.rs").target("wasm32-wasip1").run();
     verify_symbols(Path::new("foo.wasm"));
diff --git a/tests/run-make/weird-output-filenames/rmake.rs b/tests/run-make/weird-output-filenames/rmake.rs
index 3d1b5f4007c..9e451f7d7eb 100644
--- a/tests/run-make/weird-output-filenames/rmake.rs
+++ b/tests/run-make/weird-output-filenames/rmake.rs
@@ -1,6 +1,5 @@
 use run_make_support::regex::Regex;
-use run_make_support::rfs;
-use run_make_support::{cwd, rustc};
+use run_make_support::{cwd, rfs, rustc};
 
 fn main() {
     let invalid_characters = [".foo.rs", ".foo.bar", "+foo+bar.rs"];
diff --git a/tests/run-make/windows-binary-no-external-deps/rmake.rs b/tests/run-make/windows-binary-no-external-deps/rmake.rs
index 61fdb202221..1706d757c3a 100644
--- a/tests/run-make/windows-binary-no-external-deps/rmake.rs
+++ b/tests/run-make/windows-binary-no-external-deps/rmake.rs
@@ -2,10 +2,11 @@
 //! a "hello world" application by setting `PATH` to `C:\Windows\System32`.
 //@ only-windows
 
-use run_make_support::{cwd, env_var, rustc};
 use std::path::PathBuf;
 use std::process::Command;
 
+use run_make_support::{cwd, env_var, rustc};
+
 fn main() {
     rustc().input("hello.rs").run();
 
diff --git a/tests/run-make/windows-ws2_32/rmake.rs b/tests/run-make/windows-ws2_32/rmake.rs
index 6457d74f97e..1e426a8bffa 100644
--- a/tests/run-make/windows-ws2_32/rmake.rs
+++ b/tests/run-make/windows-ws2_32/rmake.rs
@@ -2,7 +2,8 @@
 
 // Tests that WS2_32.dll is not unnecessarily linked, see issue #85441
 
-use run_make_support::object::{self, read::Object};
+use run_make_support::object::read::Object;
+use run_make_support::object::{self};
 use run_make_support::{rfs, rustc};
 
 fn main() {
diff --git a/tests/run-make/zero-extend-abi-param-passing/param_passing.rs b/tests/run-make/zero-extend-abi-param-passing/param_passing.rs
index c11f3cc72bd..addde6b8ee3 100644
--- a/tests/run-make/zero-extend-abi-param-passing/param_passing.rs
+++ b/tests/run-make/zero-extend-abi-param-passing/param_passing.rs
@@ -2,7 +2,7 @@
 // LLVM optimization choices. See additional note below for an
 // example.
 
-#[link(name = "bad")]
+#[link(name = "bad", kind = "static")]
 extern "C" {
     pub fn c_read_value(a: u32, b: u32, c: u32) -> u16;
 }
diff --git a/tests/run-make/zero-extend-abi-param-passing/rmake.rs b/tests/run-make/zero-extend-abi-param-passing/rmake.rs
index aed27f7f5ab..96dbbd0627c 100644
--- a/tests/run-make/zero-extend-abi-param-passing/rmake.rs
+++ b/tests/run-make/zero-extend-abi-param-passing/rmake.rs
@@ -6,20 +6,13 @@
 // while simultaneously interfacing with a C library and using the -O3 flag.
 // See https://github.com/rust-lang/rust/issues/97463
 
-//@ ignore-msvc
-// Reason: the rustc compilation fails due to an unresolved external symbol
-
 //@ ignore-cross-compile
 // Reason: The compiled binary is executed.
-
-use run_make_support::{cc, is_msvc, llvm_ar, run, rustc, static_lib_name};
+use run_make_support::{build_native_static_lib_optimized, run, rustc};
 
 fn main() {
-    // The issue exercised by this test specifically needs needs `-O`
-    // flags (like `-O3`) to reproduce. Thus, we call `cc()` instead of
-    // the nicer `build_native_static_lib`.
-    cc().arg("-c").arg("-O3").out_exe("bad.o").input("bad.c").run();
-    llvm_ar().obj_to_ar().output_input(static_lib_name("bad"), "bad.o").run();
-    rustc().input("param_passing.rs").arg("-lbad").opt_level("3").run();
+    // The issue exercised by this test specifically needs an optimized native static lib.
+    build_native_static_lib_optimized("bad");
+    rustc().input("param_passing.rs").opt_level("3").run();
     run("param_passing");
 }
diff --git a/tests/rustdoc-gui/code-example-buttons.goml b/tests/rustdoc-gui/code-example-buttons.goml
new file mode 100644
index 00000000000..4f037ec79f5
--- /dev/null
+++ b/tests/rustdoc-gui/code-example-buttons.goml
@@ -0,0 +1,96 @@
+// This test ensures that code blocks buttons are displayed on hover and when you click on them.
+go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
+include: "utils.goml"
+
+// First we check we "hover".
+move-cursor-to: ".example-wrap"
+assert-css: (".example-wrap .copy-button", { "visibility": "visible" })
+move-cursor-to: ".search-input"
+assert-css: (".example-wrap .copy-button", { "visibility": "hidden" })
+
+// Now we check the click.
+assert-count: (".example-wrap:not(:hover) .button-holder.keep-visible", 0)
+click: ".example-wrap"
+move-cursor-to: ".search-input"
+// It should have a new class and be visible.
+wait-for-count: (".example-wrap:not(:hover) .button-holder.keep-visible", 1)
+wait-for-css: (".example-wrap:not(:hover) .button-holder.keep-visible", { "visibility": "visible" })
+// Clicking again will remove the class.
+click: ".example-wrap"
+move-cursor-to: ".search-input"
+assert-count: (".example-wrap:not(:hover) .button-holder.keep-visible", 0)
+assert-css: (".example-wrap .copy-button", { "visibility": "hidden" })
+
+// Clicking on the "copy code" button shouldn't make the buttons stick.
+click: ".example-wrap .copy-button"
+move-cursor-to: ".search-input"
+assert-count: (".example-wrap:not(:hover) .button-holder.keep-visible", 0)
+assert-css: (".example-wrap .copy-button", { "visibility": "hidden" })
+
+define-function: (
+    "check-buttons",
+    [theme, background, filter, filter_hover],
+    block {
+        call-function: ("switch-theme", {"theme": |theme|})
+
+        assert-css: (".example-wrap .test-arrow", {"visibility": "hidden"})
+        assert-css: (".example-wrap .copy-button", {"visibility": "hidden"})
+
+        move-cursor-to: ".example-wrap"
+        assert-css: (".example-wrap .test-arrow", {
+            "visibility": "visible",
+            "background-color": |background|,
+            "border-radius": "2px",
+        })
+        assert-css: (".example-wrap .test-arrow::before", {
+            "filter": |filter|,
+        })
+        assert-css: (".example-wrap .copy-button", {
+            "visibility": "visible",
+            "background-color": |background|,
+            "border-radius": "2px",
+        })
+        assert-css: (".example-wrap .copy-button::before", {
+            "filter": |filter|,
+        })
+
+        move-cursor-to: ".example-wrap .test-arrow"
+        assert-css: (".example-wrap .test-arrow:hover", {
+            "visibility": "visible",
+            "background-color": |background|,
+            "border-radius": "2px",
+        })
+        assert-css: (".example-wrap .test-arrow:hover::before", {
+            "filter": |filter_hover|,
+        })
+
+        move-cursor-to: ".example-wrap .copy-button"
+        assert-css: (".example-wrap .copy-button:hover", {
+            "visibility": "visible",
+            "background-color": |background|,
+            "border-radius": "2px",
+        })
+        assert-css: (".example-wrap .copy-button:hover::before", {
+            "filter": |filter_hover|,
+        })
+    },
+)
+
+call-function: ("check-buttons",{
+    "theme": "ayu",
+    "background": "#0f1419",
+    "filter": "invert(0.7)",
+    "filter_hover": "invert(1)",
+})
+call-function: ("check-buttons",{
+    "theme": "dark",
+    "background": "#353535",
+    "filter": "invert(0.5)",
+    "filter_hover": "invert(0.65)",
+})
+call-function: ("check-buttons",{
+    "theme": "light",
+    "background": "#fff",
+    "filter": "invert(0.5)",
+    "filter_hover": "invert(0.35)",
+})
diff --git a/tests/rustdoc-gui/copy-code.goml b/tests/rustdoc-gui/copy-code.goml
new file mode 100644
index 00000000000..9cc717bc67a
--- /dev/null
+++ b/tests/rustdoc-gui/copy-code.goml
@@ -0,0 +1,54 @@
+// Checks that the "copy code" button is not triggering JS error and its display
+// isn't broken.
+go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
+
+define-function: (
+    "check-copy-button",
+    [],
+    block {
+        // First we ensure that there are no "copy code" currently existing.
+        assert-count: (".example-wrap .copy-button", 0)
+        move-cursor-to: ".example-wrap"
+        assert-count: (".example-wrap .copy-button", 1)
+        // We now ensure it's only displayed when the example is hovered.
+        assert-css: (".example-wrap .copy-button", { "visibility": "visible" })
+        move-cursor-to: ".search-input"
+        assert-css: (".example-wrap .copy-button", { "visibility": "hidden" })
+        // Checking that the copy button has the same size as the "copy path" button.
+        compare-elements-size: (
+            "#copy-path",
+            ".example-wrap:nth-of-type(1) .copy-button",
+            ["height", "width"],
+        )
+    },
+)
+
+call-function: ("check-copy-button", {})
+// Checking that the run button and the copy button have the same height and same width.
+compare-elements-size: (
+    ".example-wrap:nth-of-type(1) .test-arrow",
+    ".example-wrap:nth-of-type(1) .copy-button",
+    ["height", "width"],
+)
+// ... and the same y position.
+compare-elements-position: (
+    ".example-wrap:nth-of-type(1) .test-arrow",
+    ".example-wrap:nth-of-type(1) .copy-button",
+    ["y"],
+)
+store-size: (".example-wrap:nth-of-type(1) .copy-button", {
+    "height": copy_height,
+    "width": copy_width,
+})
+assert: |copy_height| > 0 && |copy_width| > 0
+
+// Checking same things for the copy button when there is no run button.
+go-to: "file://" + |DOC_PATH| + "/lib2/sub_mod/struct.Foo.html"
+call-function: ("check-copy-button", {})
+// Ensure there is no run button.
+assert-count: (".example-wrap .test-arrow", 0)
+// Check it's the same size without a run button.
+assert-size: (".example-wrap:nth-of-type(1) .copy-button", {
+    "height": |copy_height|,
+    "width": |copy_width|,
+})
diff --git a/tests/rustdoc-gui/duplicate-macro-reexport.goml b/tests/rustdoc-gui/duplicate-macro-reexport.goml
index 7d01c88f31b..a838d99c4bf 100644
--- a/tests/rustdoc-gui/duplicate-macro-reexport.goml
+++ b/tests/rustdoc-gui/duplicate-macro-reexport.goml
@@ -4,11 +4,11 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/macro.a.html"
 wait-for: ".sidebar-elems .macro"
 // Check there is only one macro named "a" listed in the sidebar.
 assert-count: (
-    "//*[@class='sidebar-elems']//*[@class='block macro']//li/a[text()='a']",
+    "//*[@class='sidebar-elems']//*[@class='block macro']//li/a[normalize-space()='a']",
     1,
 )
 // Check there is only one macro named "b" listed in the sidebar.
 assert-count: (
-    "//*[@class='sidebar-elems']//*[@class='block macro']//li/a[text()='b']",
+    "//*[@class='sidebar-elems']//*[@class='block macro']//li/a[normalize-space()='b']",
     1,
 )
diff --git a/tests/rustdoc-gui/font-weight.goml b/tests/rustdoc-gui/font-weight.goml
index 602b8d6f5b3..26e9bf515a3 100644
--- a/tests/rustdoc-gui/font-weight.goml
+++ b/tests/rustdoc-gui/font-weight.goml
@@ -1,8 +1,8 @@
 // This test checks that the font weight is correctly applied.
 go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
-assert-css: ("//*[@class='rust item-decl']//a[text()='Alias']", {"font-weight": "400"})
+assert-css: ("//*[@class='rust item-decl']//a[normalize-space()='Alias']", {"font-weight": "400"})
 assert-css: (
-    "//*[@class='structfield section-header']//a[text()='Alias']",
+    "//*[@class='structfield section-header']//a[normalize-space()='Alias']",
     {"font-weight": "400"},
 )
 assert-css: ("#method\.a_method > .code-header", {"font-weight": "600"})
diff --git a/tests/rustdoc-gui/item-info.goml b/tests/rustdoc-gui/item-info.goml
index 1eb46e832b7..7a0194c6cc1 100644
--- a/tests/rustdoc-gui/item-info.goml
+++ b/tests/rustdoc-gui/item-info.goml
@@ -12,11 +12,11 @@ assert-position: (".item-info .stab", {"x": 245})
 // test for <https://github.com/rust-lang/rust/issues/118615>.
 set-window-size: (850, 800)
 store-position: (
-    "//*[@class='stab portability']//code[text()='Win32_System']",
+    "//*[@class='stab portability']//code[normalize-space()='Win32_System']",
     {"x": first_line_x, "y": first_line_y},
 )
 store-position: (
-    "//*[@class='stab portability']//code[text()='Win32_System_Diagnostics']",
+    "//*[@class='stab portability']//code[normalize-space()='Win32_System_Diagnostics']",
     {"x": second_line_x, "y": second_line_y},
 )
 assert: |first_line_x| != |second_line_x| && |first_line_x| == 516 && |second_line_x| == 272
diff --git a/tests/rustdoc-gui/label-next-to-symbol.goml b/tests/rustdoc-gui/label-next-to-symbol.goml
index 0582bd2cad3..a8363f29dd5 100644
--- a/tests/rustdoc-gui/label-next-to-symbol.goml
+++ b/tests/rustdoc-gui/label-next-to-symbol.goml
@@ -23,11 +23,12 @@ assert-css: (
 // table like view
 assert-css: (".desc.docblock-short", { "padding-left": "0px" })
 compare-elements-position-near: (
-    "//*[@class='item-name']//a[text()='replaced_function']",
+    "//*[@class='item-name']//a[normalize-space()='replaced_function']",
     ".item-name .stab.deprecated",
     {"y": 2},
 )
-compare-elements-position: (
+// "Unix" part is on second line
+compare-elements-position-false: (
     ".item-name .stab.deprecated",
     ".item-name .stab.portability",
     ["y"],
@@ -35,8 +36,8 @@ compare-elements-position: (
 
 // Ensure no wrap
 compare-elements-position: (
-    "//*[@class='item-name']//a[text()='replaced_function']/..",
-    "//*[@class='desc docblock-short'][text()='a thing with a label']",
+    "//*[@class='item-name']//a[normalize-space()='replaced_function']/..",
+    "//*[@class='desc docblock-short'][normalize-space()='a thing with a label']",
     ["y"],
 )
 
@@ -45,7 +46,7 @@ set-window-size: (600, 600)
 // staggered layout with 2em spacing
 assert-css: (".desc.docblock-short", { "padding-left": "32px" })
 compare-elements-position-near: (
-    "//*[@class='item-name']//a[text()='replaced_function']",
+    "//*[@class='item-name']//a[normalize-space()='replaced_function']",
     ".item-name .stab.deprecated",
     {"y": 2},
 )
@@ -57,13 +58,13 @@ compare-elements-position: (
 
 // Ensure wrap
 compare-elements-position-false: (
-    "//*[@class='item-name']//a[text()='replaced_function']/..",
-    "//*[@class='desc docblock-short'][text()='a thing with a label']",
+    "//*[@class='item-name']//a[normalize-space()='replaced_function']/..",
+    "//*[@class='desc docblock-short'][normalize-space()='a thing with a label']",
     ["y"],
 )
 compare-elements-position-false: (
     ".item-name .stab.deprecated",
-    "//*[@class='desc docblock-short'][text()='a thing with a label']",
+    "//*[@class='desc docblock-short'][normalize-space()='a thing with a label']",
     ["y"],
 )
 
@@ -73,7 +74,7 @@ go-to: "file://" + |DOC_PATH| + "/test_docs/cfgs/index.html"
 // This part of the tags should not be on the same line as the beginning since the width
 // is too small for that.
 compare-elements-position-false: (
-    "//*[@class='stab portability']/code[text()='appservice-api-c']",
-    "//*[@class='stab portability']/code[text()='server']",
+    "//*[@class='stab portability']/code[normalize-space()='appservice-api-c']",
+    "//*[@class='stab portability']/code[normalize-space()='server']",
     ["y"],
 )
diff --git a/tests/rustdoc-gui/notable-trait.goml b/tests/rustdoc-gui/notable-trait.goml
index 6ee810c5768..e2a8a43007e 100644
--- a/tests/rustdoc-gui/notable-trait.goml
+++ b/tests/rustdoc-gui/notable-trait.goml
@@ -9,19 +9,19 @@ define-function: (
     block {
         // Checking they have the same y position.
         compare-elements-position: (
-            "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+            "//*[@id='method.create_an_iterator_from_read']//a[normalize-space()='NotableStructWithLongName']",
             "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
             ["y"],
         )
         // Checking they don't have the same x position.
         compare-elements-position-false: (
-            "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+            "//*[@id='method.create_an_iterator_from_read']//a[normalize-space()='NotableStructWithLongName']",
             "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
             ["x"],
         )
         // The `i` should be *after* the type.
         assert-position: (
-            "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+            "//*[@id='method.create_an_iterator_from_read']//a[normalize-space()='NotableStructWithLongName']",
             {"x": |x|},
         )
         assert-position: (
@@ -70,7 +70,7 @@ call-function: ("check-notable-tooltip-position-complete", {
 // Now only the `i` should be on the next line.
 set-window-size: (1055, 600)
 compare-elements-position-false: (
-    "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+    "//*[@id='method.create_an_iterator_from_read']//a[normalize-space()='NotableStructWithLongName']",
     "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']",
     ["y", "x"],
 )
diff --git a/tests/rustdoc-gui/run-on-hover.goml b/tests/rustdoc-gui/run-on-hover.goml
deleted file mode 100644
index 087dd3374f8..00000000000
--- a/tests/rustdoc-gui/run-on-hover.goml
+++ /dev/null
@@ -1,54 +0,0 @@
-// Example code blocks sometimes have a "Run" button to run them on the
-// Playground. That button is hidden until the user hovers over the code block.
-// This test checks that it is hidden, and that it shows on hover. It also
-// checks for its color.
-include: "utils.goml"
-go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
-show-text: true
-
-define-function: (
-    "check-run-button",
-    [theme, color, background, hover_color, hover_background],
-    block {
-        call-function: ("switch-theme", {"theme": |theme|})
-        assert-css: (".test-arrow", {"visibility": "hidden"})
-        move-cursor-to: ".example-wrap"
-        assert-css: (".test-arrow", {
-            "visibility": "visible",
-            "color": |color|,
-            "background-color": |background|,
-            "font-size": "22px",
-            "border-radius": "5px",
-        })
-        move-cursor-to: ".test-arrow"
-        assert-css: (".test-arrow:hover", {
-            "visibility": "visible",
-            "color": |hover_color|,
-            "background-color": |hover_background|,
-            "font-size": "22px",
-            "border-radius": "5px",
-        })
-    },
-)
-
-call-function: ("check-run-button", {
-    "theme": "ayu",
-    "color": "#788797",
-    "background": "rgba(57, 175, 215, 0.09)",
-    "hover_color": "#c5c5c5",
-    "hover_background": "rgba(57, 175, 215, 0.37)",
-})
-call-function: ("check-run-button", {
-    "theme": "dark",
-    "color": "#dedede",
-    "background": "rgba(78, 139, 202, 0.2)",
-    "hover_color": "#dedede",
-    "hover_background": "rgb(78, 139, 202)",
-})
-call-function: ("check-run-button", {
-    "theme": "light",
-    "color": "#f5f5f5",
-    "background": "rgba(78, 139, 202, 0.2)",
-    "hover_color": "#f5f5f5",
-    "hover_background": "rgb(78, 139, 202)",
-})
diff --git a/tests/rustdoc-gui/search-result-color.goml b/tests/rustdoc-gui/search-result-color.goml
index 9825f92b453..e8da43eb896 100644
--- a/tests/rustdoc-gui/search-result-color.goml
+++ b/tests/rustdoc-gui/search-result-color.goml
@@ -20,11 +20,11 @@ define-function: (
             ALL,
         )
         assert-css: (
-            "//*[@class='desc'][text()='Just a normal struct.']",
+            "//*[@class='desc'][normalize-space()='Just a normal struct.']",
             {"color": |desc_color|},
         )
         assert-css: (
-            "//*[@class='result-name']//*[text()='test_docs::']",
+            "//*[@class='result-name']//*[normalize-space()='test_docs::']",
             {"color": |path_color|},
         )
 
@@ -85,19 +85,19 @@ define-function: (
         move-cursor-to: ".search-input"
         focus: ".search-input" // To ensure the `<a>` container isn't focused or hovered.
         assert-css: (
-            "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
+            "//*[@class='result-name']//*[normalize-space()='test_docs::']/ancestor::a",
             {"color": |path_color|, "background-color": "transparent"},
             ALL,
         )
 
         // Checking color and background on hover.
-        move-cursor-to: "//*[@class='desc'][text()='Just a normal struct.']"
+        move-cursor-to: "//*[@class='desc'][normalize-space()='Just a normal struct.']"
         assert-css: (
-            "//*[@class='result-name']//*[text()='test_docs::']",
+            "//*[@class='result-name']//*[normalize-space()='test_docs::']",
             {"color": |hover_path_color|},
         )
         assert-css: (
-            "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
+            "//*[@class='result-name']//*[normalize-space()='test_docs::']/ancestor::a",
             {"color": |hover_path_color|, "background-color": |hover_background|},
         )
     }
diff --git a/tests/rustdoc-gui/search-result-impl-disambiguation.goml b/tests/rustdoc-gui/search-result-impl-disambiguation.goml
index 3e49ac33025..bca52b46498 100644
--- a/tests/rustdoc-gui/search-result-impl-disambiguation.goml
+++ b/tests/rustdoc-gui/search-result-impl-disambiguation.goml
@@ -41,3 +41,24 @@ assert-document-property: ({
     "URL": "struct.ZyxwvutMethodDisambiguation.html#method.method_impl_disambiguation-1"
 }, ENDS_WITH)
 assert: "section:target"
+
+// Checks that, if a type has two methods with the same name,
+// and if it has multiple inherent impl blocks, that the numeric
+// impl block's disambiguator is also acted upon.
+go-to: "file://" + |DOC_PATH| + "/lib2/index.html?search=MultiImplBlockStruct->bool"
+wait-for: "#search-tabs"
+assert-count: ("a.result-method", 1)
+assert-attribute: ("a.result-method", {
+    "href": "../lib2/another_mod/struct.MultiImplBlockStruct.html#impl-MultiImplBlockStruct/method.second_fn"
+})
+click: "a.result-method"
+wait-for: "details:has(summary > #impl-MultiImplBlockStruct-1) > div section[id='method.second_fn']:target"
+
+go-to: "file://" + |DOC_PATH| + "/lib2/index.html?search=MultiImplBlockStruct->u32"
+wait-for: "#search-tabs"
+assert-count: ("a.result-method", 1)
+assert-attribute: ("a.result-method", {
+    "href": "../lib2/another_mod/struct.MultiImplBlockStruct.html#impl-MultiImplBlockTrait-for-MultiImplBlockStruct/method.second_fn"
+})
+click: "a.result-method"
+wait-for: "details:has(summary > #impl-MultiImplBlockTrait-for-MultiImplBlockStruct) > div section[id='method.second_fn-1']:target"
diff --git a/tests/rustdoc-gui/sidebar-macro-reexport.goml b/tests/rustdoc-gui/sidebar-macro-reexport.goml
index 0f7ef6c3558..cad25507fbb 100644
--- a/tests/rustdoc-gui/sidebar-macro-reexport.goml
+++ b/tests/rustdoc-gui/sidebar-macro-reexport.goml
@@ -2,4 +2,4 @@
 // displayed twice in the sidebar.
 go-to: "file://" + |DOC_PATH| + "/test_docs/macro.repro.html"
 wait-for: ".sidebar-elems .block.macro a"
-assert-count: ("//*[@class='sidebar-elems']//*[@class='block macro']//a[text()='repro']", 1)
+assert-count: ("//*[@class='sidebar-elems']//*[@class='block macro']//a[normalize-space()='repro']", 1)
diff --git a/tests/rustdoc-gui/sidebar-mobile.goml b/tests/rustdoc-gui/sidebar-mobile.goml
index b4ff483c180..4ada4837a57 100644
--- a/tests/rustdoc-gui/sidebar-mobile.goml
+++ b/tests/rustdoc-gui/sidebar-mobile.goml
@@ -25,9 +25,12 @@ click: ".sidebar-menu-toggle"
 assert-css: (".sidebar", {"left": "0px"})
 
 // Make sure the "struct Foo" header is hidden, since the mobile topbar already does it.
-assert-css: ("//nav[contains(@class, 'sidebar')]//h2/a[text()='Foo']/parent::h2", {"display": "none"})
+assert-css: ("//nav[contains(@class, 'sidebar')]//h2/a[normalize-space()='Foo']/parent::h2", {"display": "none"})
 // Make sure the global navigation is still here.
-assert-css: ("//nav[contains(@class, 'sidebar')]//h2/a[text()='In crate test_docs']/parent::h2", {"display": "block"})
+assert-css: (
+    "//nav[contains(@class, 'sidebar')]//h2/a[normalize-space()='In crate test_docs']/parent::h2",
+    {"display": "block"}
+)
 
 // Click elsewhere.
 click: "body"
diff --git a/tests/rustdoc-gui/sidebar-source-code.goml b/tests/rustdoc-gui/sidebar-source-code.goml
index ef0b5ab38b1..6afccf6a95f 100644
--- a/tests/rustdoc-gui/sidebar-source-code.goml
+++ b/tests/rustdoc-gui/sidebar-source-code.goml
@@ -66,12 +66,12 @@ click: "#sidebar-button"
 // We wait for the sidebar to be expanded.
 wait-for-css: (".src-sidebar-expanded nav.sidebar", {"width": "300px"})
 assert: "//*[@class='dir-entry' and @open]/*[text()='lib2']"
-assert: "//*[@class='dir-entry' and @open]/*[text()='another_folder']"
-assert: "//*[@class='dir-entry' and @open]/*[text()='sub_mod']"
+assert: "//*[@class='dir-entry' and @open]/*[normalize-space()='another_folder']"
+assert: "//*[@class='dir-entry' and @open]/*[normalize-space()='sub_mod']"
 // Only "another_folder" should be "open" in "lib2".
-assert: "//*[@class='dir-entry' and not(@open)]/*[text()='another_mod']"
+assert: "//*[@class='dir-entry' and not(@open)]/*[normalize-space()='another_mod']"
 // All other trees should be collapsed.
-assert-count: ("//*[@id='src-sidebar']/details[not(text()='lib2') and not(@open)]", 11)
+assert-count: ("//*[@id='src-sidebar']/details[not(normalize-space()='lib2') and not(@open)]", 11)
 
 // We now switch to mobile mode.
 set-window-size: (600, 600)
diff --git a/tests/rustdoc-gui/source-anchor-scroll.goml b/tests/rustdoc-gui/source-anchor-scroll.goml
index 940851ea146..3508b26a0bf 100644
--- a/tests/rustdoc-gui/source-anchor-scroll.goml
+++ b/tests/rustdoc-gui/source-anchor-scroll.goml
@@ -11,7 +11,7 @@ click: '//a[text() = "barbar" and @href="#5-7"]'
 assert-property: ("html", {"scrollTop": "123"})
 click: '//a[text() = "bar" and @href="#28-36"]'
 assert-property: ("html", {"scrollTop": "154"})
-click: '//a[text() = "sub_fn" and @href="#2-4"]'
+click: '//a[normalize-space() = "sub_fn" and @href="#2-4"]'
 assert-property: ("html", {"scrollTop": "51"})
 
 // We now check that clicking on lines doesn't change the scroll
diff --git a/tests/rustdoc-gui/src/lib2/another_mod/mod.rs b/tests/rustdoc-gui/src/lib2/another_mod/mod.rs
index 9a4f007a2f0..77f83d29766 100644
--- a/tests/rustdoc-gui/src/lib2/another_mod/mod.rs
+++ b/tests/rustdoc-gui/src/lib2/another_mod/mod.rs
@@ -1 +1,19 @@
-pub fn tadam() {}
+pub struct MultiImplBlockStruct;
+
+impl MultiImplBlockStruct {
+    pub fn first_fn() {}
+}
+
+impl MultiImplBlockStruct {
+    pub fn second_fn(self) -> bool { true }
+}
+
+pub trait MultiImplBlockTrait {
+    fn first_fn();
+    fn second_fn(self) -> u32;
+}
+
+impl MultiImplBlockTrait for MultiImplBlockStruct {
+    fn first_fn() {}
+    fn second_fn(self) -> u32 { 1 }
+}
diff --git a/tests/rustdoc-js/self-is-not-generic.js b/tests/rustdoc-js/self-is-not-generic.js
new file mode 100644
index 00000000000..0fdf5b4117d
--- /dev/null
+++ b/tests/rustdoc-js/self-is-not-generic.js
@@ -0,0 +1,22 @@
+// exact-check
+
+const EXPECTED = [
+    {
+        'query': 'A -> A',
+        'others': [
+            { 'path': 'self_is_not_generic::Thing', 'name': 'from' }
+        ],
+    },
+    {
+        'query': 'A -> B',
+        'others': [
+            { 'path': 'self_is_not_generic::Thing', 'name': 'try_from' }
+        ],
+    },
+    {
+        'query': 'Combine -> Combine',
+        'others': [
+            { 'path': 'self_is_not_generic::Combine', 'name': 'combine' }
+        ],
+    }
+];
diff --git a/tests/rustdoc-js/self-is-not-generic.rs b/tests/rustdoc-js/self-is-not-generic.rs
new file mode 100644
index 00000000000..d6a96acb73c
--- /dev/null
+++ b/tests/rustdoc-js/self-is-not-generic.rs
@@ -0,0 +1,11 @@
+pub trait Combine {
+    fn combine(&self, other: &Self) -> Self;
+}
+
+pub struct Thing;
+
+impl Combine for Thing {
+    fn combine(&self, other: &Self) -> Self {
+        Self
+    }
+}
diff --git a/tests/rustdoc-json/impl-trait-in-assoc-type.rs b/tests/rustdoc-json/impl-trait-in-assoc-type.rs
new file mode 100644
index 00000000000..f02e38ca393
--- /dev/null
+++ b/tests/rustdoc-json/impl-trait-in-assoc-type.rs
@@ -0,0 +1,29 @@
+// ignore-tidy-linelength
+#![feature(impl_trait_in_assoc_type)]
+
+pub struct AlwaysTrue;
+
+/// impl IntoIterator
+impl IntoIterator for AlwaysTrue {
+    //@ set Item = '$.index[*][?(@.docs=="type Item")].id'
+    /// type Item
+    type Item = bool;
+
+    //@ count '$.index[*][?(@.docs=="type IntoIter")].inner.assoc_type.default.impl_trait[*]' 1
+    //@ is    '$.index[*][?(@.docs=="type IntoIter")].inner.assoc_type.default.impl_trait[0].trait_bound.trait.name' '"Iterator"'
+    //@ count '$.index[*][?(@.docs=="type IntoIter")].inner.assoc_type.default.impl_trait[0].trait_bound.trait.args.angle_bracketed.bindings[*]' 1
+    //@ is    '$.index[*][?(@.docs=="type IntoIter")].inner.assoc_type.default.impl_trait[0].trait_bound.trait.args.angle_bracketed.bindings[0].name' '"Item"'
+    //@ is    '$.index[*][?(@.docs=="type IntoIter")].inner.assoc_type.default.impl_trait[0].trait_bound.trait.args.angle_bracketed.bindings[0].binding.equality.type.primitive' '"bool"'
+
+    //@ set IntoIter = '$.index[*][?(@.docs=="type IntoIter")].id'
+    /// type IntoIter
+    type IntoIter = impl Iterator<Item = bool>;
+
+    //@ set into_iter = '$.index[*][?(@.docs=="fn into_iter")].id'
+    /// fn into_iter
+    fn into_iter(self) -> Self::IntoIter {
+        std::iter::repeat(true)
+    }
+}
+
+//@ ismany '$.index[*][?(@.docs=="impl IntoIterator")].inner.impl.items[*]' $Item $IntoIter $into_iter
diff --git a/tests/rustdoc-json/impls/pub_for_hidden_private.rs b/tests/rustdoc-json/impls/pub_for_hidden_private.rs
new file mode 100644
index 00000000000..261ffbfeb4a
--- /dev/null
+++ b/tests/rustdoc-json/impls/pub_for_hidden_private.rs
@@ -0,0 +1,10 @@
+//@ compile-flags: --document-private-items --document-hidden-items
+
+pub trait TheTrait {}
+
+#[doc(hidden)]
+struct Value {}
+
+//@ has '$.index[*][?(@.docs=="THE IMPL")]'
+/// THE IMPL
+impl TheTrait for Value {}
diff --git a/tests/rustdoc-json/primitives/use_primitive.rs b/tests/rustdoc-json/primitives/use_primitive.rs
index e97db42705f..27394a688c4 100644
--- a/tests/rustdoc-json/primitives/use_primitive.rs
+++ b/tests/rustdoc-json/primitives/use_primitive.rs
@@ -15,6 +15,5 @@ mod usize {}
 
 //@ is "$.index[*].inner.import[?(@.name=='my_i32')].id" null
 pub use i32 as my_i32;
-
 //@ is "$.index[*].inner.import[?(@.name=='u32')].id" null
 pub use u32;
diff --git a/tests/rustdoc-json/pub_mod_in_private_mod.rs b/tests/rustdoc-json/pub_mod_in_private_mod.rs
new file mode 100644
index 00000000000..112ab9c68f0
--- /dev/null
+++ b/tests/rustdoc-json/pub_mod_in_private_mod.rs
@@ -0,0 +1,6 @@
+// See https://github.com/rust-lang/rust/issues/101105
+
+//@ !has "$.index[*][?(@.name=='nucleus')]"
+mod corpus {
+    pub mod nucleus {}
+}
diff --git a/tests/rustdoc-json/the_smallest.rs b/tests/rustdoc-json/the_smallest.rs
new file mode 100644
index 00000000000..2f6f91e6e27
--- /dev/null
+++ b/tests/rustdoc-json/the_smallest.rs
@@ -0,0 +1,5 @@
+// This test asserts that `index` is not polluted with unrelated items.
+// See https://github.com/rust-lang/rust/issues/114039
+
+//@ count "$.index[*]" 1
+fn main() {}
diff --git a/tests/rustdoc-ui/doctest/doctest-no-run-invalid-langstring-124577.rs b/tests/rustdoc-ui/doctest/doctest-no-run-invalid-langstring-124577.rs
new file mode 100644
index 00000000000..571bc94e30f
--- /dev/null
+++ b/tests/rustdoc-ui/doctest/doctest-no-run-invalid-langstring-124577.rs
@@ -0,0 +1,12 @@
+//@ compile-flags:--test
+//@ check-pass
+#![allow(rustdoc::invalid_codeblock_attributes)]
+
+// https://github.com/rust-lang/rust/pull/124577#issuecomment-2276034737
+
+// Test that invalid langstrings don't get run.
+
+/// ```{rust,ignore}
+/// panic!();
+/// ```
+pub struct Foo;
diff --git a/tests/rustdoc-ui/doctest/doctest-no-run-invalid-langstring-124577.stdout b/tests/rustdoc-ui/doctest/doctest-no-run-invalid-langstring-124577.stdout
new file mode 100644
index 00000000000..e5c27bebbdb
--- /dev/null
+++ b/tests/rustdoc-ui/doctest/doctest-no-run-invalid-langstring-124577.stdout
@@ -0,0 +1,5 @@
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
+
diff --git a/tests/rustdoc-ui/ice-unresolved-import-100241.stderr b/tests/rustdoc-ui/ice-unresolved-import-100241.stderr
index e23e0f01fab..2eebedba9a5 100644
--- a/tests/rustdoc-ui/ice-unresolved-import-100241.stderr
+++ b/tests/rustdoc-ui/ice-unresolved-import-100241.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `inner`
 LL |     pub use inner::S;
    |             ^^^^^ you might be missing crate `inner`
    |
-   = help: consider adding `extern crate inner` to use the `inner` crate
+help: consider importing the `inner` crate
+   |
+LL + extern crate inner;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/rustdoc-ui/intra-doc/.gitattributes b/tests/rustdoc-ui/intra-doc/.gitattributes
index 6c125fac52f..0ac2e3c27f4 100644
--- a/tests/rustdoc-ui/intra-doc/.gitattributes
+++ b/tests/rustdoc-ui/intra-doc/.gitattributes
@@ -1 +1 @@
-warning-crlf.rs eol=crlf
+warning-crlf.rs -text
diff --git a/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr b/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr
index a74e6b73938..e6894319213 100644
--- a/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr
+++ b/tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr
@@ -4,7 +4,10 @@ error[E0433]: failed to resolve: you might be missing crate `unresolved_crate`
 LL | use unresolved_crate::module::Name;
    |     ^^^^^^^^^^^^^^^^ you might be missing crate `unresolved_crate`
    |
-   = help: consider adding `extern crate unresolved_crate` to use the `unresolved_crate` crate
+help: consider importing the `unresolved_crate` crate
+   |
+LL + extern crate unresolved_crate;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/rustdoc-ui/intra-doc/warning-crlf.rs b/tests/rustdoc-ui/intra-doc/warning-crlf.rs
index ab096b860f8..9d3a4673c9d 100644
--- a/tests/rustdoc-ui/intra-doc/warning-crlf.rs
+++ b/tests/rustdoc-ui/intra-doc/warning-crlf.rs
@@ -1,26 +1,26 @@
-// ignore-tidy-cr
-//@ check-pass
-
-// This file checks the spans of intra-link warnings in a file with CRLF line endings. The
-// .gitattributes file in this directory should enforce it.
-
-/// [error]
-pub struct A;
-//~^^ WARNING `error`
-
-///
-/// docs [error1]
-//~^ WARNING `error1`
-
-/// docs [error2]
-///
-pub struct B;
-//~^^^ WARNING `error2`
-
-/**
- * This is a multi-line comment.
- *
- * It also has an [error].
- */
-pub struct C;
-//~^^^ WARNING `error`
+// ignore-tidy-cr

+//@ check-pass

+

+// This file checks the spans of intra-link warnings in a file with CRLF line endings. The

+// .gitattributes file in this directory should enforce it.

+

+/// [error]

+pub struct A;

+//~^^ WARNING `error`

+

+///

+/// docs [error1]

+//~^ WARNING `error1`

+

+/// docs [error2]

+///

+pub struct B;

+//~^^^ WARNING `error2`

+

+/**

+ * This is a multi-line comment.

+ *

+ * It also has an [error].

+ */

+pub struct C;

+//~^^^ WARNING `error`

diff --git a/tests/rustdoc-ui/issues/issue-61732.stderr b/tests/rustdoc-ui/issues/issue-61732.stderr
index f49d53b0d9a..0aa7d558c30 100644
--- a/tests/rustdoc-ui/issues/issue-61732.stderr
+++ b/tests/rustdoc-ui/issues/issue-61732.stderr
@@ -4,7 +4,10 @@ error[E0433]: failed to resolve: you might be missing crate `r#mod`
 LL | pub(in crate::r#mod) fn main() {}
    |               ^^^^^ you might be missing crate `r#mod`
    |
-   = help: consider adding `extern crate r#mod` to use the `r#mod` crate
+help: consider importing the `r#mod` crate
+   |
+LL + extern crate r#mod;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/rustdoc-ui/issues/issue-81662-shortness.rs b/tests/rustdoc-ui/issues/issue-81662-shortness.rs
index 02207d2a736..7df63261ce7 100644
--- a/tests/rustdoc-ui/issues/issue-81662-shortness.rs
+++ b/tests/rustdoc-ui/issues/issue-81662-shortness.rs
@@ -1,6 +1,6 @@
 //@ compile-flags:--test --error-format=short
 //@ check-stdout
-//@ error-pattern:cannot find function `foo` in this scope
+//@ error-pattern:cannot find function `foo`
 //@ normalize-stdout-test: "tests/rustdoc-ui/issues" -> "$$DIR"
 //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
 //@ failure-status: 101
diff --git a/tests/rustdoc-ui/issues/issue-81662-shortness.stdout b/tests/rustdoc-ui/issues/issue-81662-shortness.stdout
index f32f51e12f2..8fcc7ed272f 100644
--- a/tests/rustdoc-ui/issues/issue-81662-shortness.stdout
+++ b/tests/rustdoc-ui/issues/issue-81662-shortness.stdout
@@ -5,7 +5,7 @@ test $DIR/issue-81662-shortness.rs - foo (line 8) ... FAILED
 failures:
 
 ---- $DIR/issue-81662-shortness.rs - foo (line 8) stdout ----
-$DIR/issue-81662-shortness.rs:9:1: error[E0425]: cannot find function `foo` in this scope
+$DIR/issue-81662-shortness.rs:9:1: error[E0425]: cannot find function `foo` in this scope: not found in this scope
 error: aborting due to 1 previous error
 Couldn't compile the test.
 
diff --git a/tests/rustdoc-ui/remap-path-prefix-lint.rs b/tests/rustdoc-ui/remap-path-prefix-lint.rs
new file mode 100644
index 00000000000..f27863e825d
--- /dev/null
+++ b/tests/rustdoc-ui/remap-path-prefix-lint.rs
@@ -0,0 +1,10 @@
+// Regression test for remapped paths in rustdoc errors
+// <https://github.com/rust-lang/rust/issues/69264>.
+
+//@ compile-flags:-Z unstable-options --remap-path-prefix={{src-base}}=remapped_path
+//@ rustc-env:RUST_BACKTRACE=0
+
+#![deny(rustdoc::invalid_html_tags)]
+
+/// </script>
+pub struct Bar;
diff --git a/tests/rustdoc-ui/remap-path-prefix-lint.stderr b/tests/rustdoc-ui/remap-path-prefix-lint.stderr
new file mode 100644
index 00000000000..d7c1bb1965d
--- /dev/null
+++ b/tests/rustdoc-ui/remap-path-prefix-lint.stderr
@@ -0,0 +1,14 @@
+error: unopened HTML tag `script`
+  --> remapped_path/remap-path-prefix-lint.rs:9:5
+   |
+LL | /// </script>
+   |     ^^^^^^^^^
+   |
+note: the lint level is defined here
+  --> remapped_path/remap-path-prefix-lint.rs:7:9
+   |
+LL | #![deny(rustdoc::invalid_html_tags)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/q.rs b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/q.rs
new file mode 100644
index 00000000000..5d0881029cb
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/q.rs
@@ -0,0 +1,2 @@
+//@ build-aux-docs
+pub struct Quebec;
diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/t.rs b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/t.rs
new file mode 100644
index 00000000000..fab9ec4a92b
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/t.rs
@@ -0,0 +1,4 @@
+//@ aux-build:q.rs
+//@ build-aux-docs
+extern crate q;
+pub trait Tango {}
diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/s.rs b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/s.rs
new file mode 100644
index 00000000000..85c460ace64
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/s.rs
@@ -0,0 +1,16 @@
+//@ aux-build:t.rs
+//@ build-aux-docs
+//@ has q/struct.Quebec.html
+//@ has s/struct.Sierra.html
+//@ has t/trait.Tango.html
+//@ hasraw s/struct.Sierra.html 'Tango'
+//@ hasraw trait.impl/t/trait.Tango.js 'struct.Sierra.html'
+//@ hasraw search-index.js 'Tango'
+//@ hasraw search-index.js 'Sierra'
+//@ hasraw search-index.js 'Quebec'
+
+// We document multiple crates into the same output directory, which
+// merges the cross-crate information. Everything is available.
+extern crate t;
+pub struct Sierra;
+impl t::Tango for Sierra {}
diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/q.rs b/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/q.rs
new file mode 100644
index 00000000000..932a0b17206
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/q.rs
@@ -0,0 +1,5 @@
+//@ build-aux-docs
+//@ doc-flags:--enable-index-page
+//@ doc-flags:-Zunstable-options
+
+pub struct Quebec;
diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/t.rs b/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/t.rs
new file mode 100644
index 00000000000..c21a59c6518
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/t.rs
@@ -0,0 +1,7 @@
+//@ aux-build:q.rs
+//@ build-aux-docs
+//@ doc-flags:--enable-index-page
+//@ doc-flags:-Zunstable-options
+
+extern crate q;
+pub trait Tango {}
diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive/s.rs b/tests/rustdoc/cross-crate-info/cargo-transitive/s.rs
new file mode 100644
index 00000000000..68bfc34883b
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/cargo-transitive/s.rs
@@ -0,0 +1,24 @@
+//@ aux-build:t.rs
+//@ build-aux-docs
+//@ doc-flags:--enable-index-page
+//@ doc-flags:-Zunstable-options
+
+//@ has index.html
+//@ has index.html '//h1' 'List of all crates'
+//@ has index.html '//ul[@class="all-items"]//a[@href="q/index.html"]' 'q'
+//@ has index.html '//ul[@class="all-items"]//a[@href="s/index.html"]' 's'
+//@ has index.html '//ul[@class="all-items"]//a[@href="t/index.html"]' 't'
+//@ has q/struct.Quebec.html
+//@ has s/struct.Sierra.html
+//@ has t/trait.Tango.html
+//@ hasraw s/struct.Sierra.html 'Tango'
+//@ hasraw trait.impl/t/trait.Tango.js 'struct.Sierra.html'
+//@ hasraw search-index.js 'Tango'
+//@ hasraw search-index.js 'Sierra'
+//@ hasraw search-index.js 'Quebec'
+
+// We document multiple crates into the same output directory, which
+// merges the cross-crate information. Everything is available.
+extern crate t;
+pub struct Sierra;
+impl t::Tango for Sierra {}
diff --git a/tests/rustdoc/cross-crate-info/cargo-two-no-index/auxiliary/f.rs b/tests/rustdoc/cross-crate-info/cargo-two-no-index/auxiliary/f.rs
new file mode 100644
index 00000000000..abc580a388c
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/cargo-two-no-index/auxiliary/f.rs
@@ -0,0 +1,2 @@
+//@ build-aux-docs
+pub trait Foxtrot {}
diff --git a/tests/rustdoc/cross-crate-info/cargo-two-no-index/e.rs b/tests/rustdoc/cross-crate-info/cargo-two-no-index/e.rs
new file mode 100644
index 00000000000..c93298f969e
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/cargo-two-no-index/e.rs
@@ -0,0 +1,14 @@
+//@ aux-build:f.rs
+//@ build-aux-docs
+//@ has e/enum.Echo.html
+//@ has f/trait.Foxtrot.html
+//@ hasraw e/enum.Echo.html 'Foxtrot'
+//@ hasraw trait.impl/f/trait.Foxtrot.js 'enum.Echo.html'
+//@ hasraw search-index.js 'Foxtrot'
+//@ hasraw search-index.js 'Echo'
+
+// document two crates in the same way that cargo does. do not provide
+// --enable-index-page
+extern crate f;
+pub enum Echo {}
+impl f::Foxtrot for Echo {}
diff --git a/tests/rustdoc/cross-crate-info/cargo-two/auxiliary/f.rs b/tests/rustdoc/cross-crate-info/cargo-two/auxiliary/f.rs
new file mode 100644
index 00000000000..a2a7033b131
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/cargo-two/auxiliary/f.rs
@@ -0,0 +1,5 @@
+//@ build-aux-docs
+//@ doc-flags:--enable-index-page
+//@ doc-flags:-Zunstable-options
+
+pub trait Foxtrot {}
diff --git a/tests/rustdoc/cross-crate-info/cargo-two/e.rs b/tests/rustdoc/cross-crate-info/cargo-two/e.rs
new file mode 100644
index 00000000000..00f86cbc348
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/cargo-two/e.rs
@@ -0,0 +1,21 @@
+//@ aux-build:f.rs
+//@ build-aux-docs
+//@ doc-flags:--enable-index-page
+//@ doc-flags:-Zunstable-options
+
+//@ has index.html
+//@ has index.html '//h1' 'List of all crates'
+//@ has index.html '//ul[@class="all-items"]//a[@href="f/index.html"]' 'f'
+//@ has index.html '//ul[@class="all-items"]//a[@href="e/index.html"]' 'e'
+//@ has e/enum.Echo.html
+//@ has f/trait.Foxtrot.html
+//@ hasraw e/enum.Echo.html 'Foxtrot'
+//@ hasraw trait.impl/f/trait.Foxtrot.js 'enum.Echo.html'
+//@ hasraw search-index.js 'Foxtrot'
+//@ hasraw search-index.js 'Echo'
+
+// document two crates in the same way that cargo does, writing them both
+// into the same output directory
+extern crate f;
+pub enum Echo {}
+impl f::Foxtrot for Echo {}
diff --git a/tests/rustdoc/cross-crate-info/index-on-last/auxiliary/f.rs b/tests/rustdoc/cross-crate-info/index-on-last/auxiliary/f.rs
new file mode 100644
index 00000000000..abc580a388c
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/index-on-last/auxiliary/f.rs
@@ -0,0 +1,2 @@
+//@ build-aux-docs
+pub trait Foxtrot {}
diff --git a/tests/rustdoc/cross-crate-info/index-on-last/e.rs b/tests/rustdoc/cross-crate-info/index-on-last/e.rs
new file mode 100644
index 00000000000..ffee898cd96
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/index-on-last/e.rs
@@ -0,0 +1,20 @@
+//@ aux-build:f.rs
+//@ build-aux-docs
+//@ doc-flags:--enable-index-page
+//@ doc-flags:-Zunstable-options
+
+//@ has index.html
+//@ has index.html '//h1' 'List of all crates'
+//@ has index.html '//ul[@class="all-items"]//a[@href="f/index.html"]' 'f'
+//@ has index.html '//ul[@class="all-items"]//a[@href="e/index.html"]' 'e'
+//@ has e/enum.Echo.html
+//@ has f/trait.Foxtrot.html
+//@ hasraw e/enum.Echo.html 'Foxtrot'
+//@ hasraw trait.impl/f/trait.Foxtrot.js 'enum.Echo.html'
+//@ hasraw search-index.js 'Foxtrot'
+//@ hasraw search-index.js 'Echo'
+
+// only declare --enable-index-page to the last rustdoc invocation
+extern crate f;
+pub enum Echo {}
+impl f::Foxtrot for Echo {}
diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/q.rs b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/q.rs
new file mode 100644
index 00000000000..932a0b17206
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/q.rs
@@ -0,0 +1,5 @@
+//@ build-aux-docs
+//@ doc-flags:--enable-index-page
+//@ doc-flags:-Zunstable-options
+
+pub struct Quebec;
diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/r.rs b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/r.rs
new file mode 100644
index 00000000000..2c0db2abc53
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/r.rs
@@ -0,0 +1,7 @@
+//@ aux-build:s.rs
+//@ build-aux-docs
+//@ doc-flags:--enable-index-page
+//@ doc-flags:-Zunstable-options
+
+extern crate s;
+pub type Romeo = s::Sierra;
diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/s.rs b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/s.rs
new file mode 100644
index 00000000000..355d3f1aaa8
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/s.rs
@@ -0,0 +1,8 @@
+//@ aux-build:t.rs
+//@ build-aux-docs
+//@ doc-flags:--enable-index-page
+//@ doc-flags:-Zunstable-options
+
+extern crate t;
+pub struct Sierra;
+impl t::Tango for Sierra {}
diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/t.rs b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/t.rs
new file mode 100644
index 00000000000..c21a59c6518
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/t.rs
@@ -0,0 +1,7 @@
+//@ aux-build:q.rs
+//@ build-aux-docs
+//@ doc-flags:--enable-index-page
+//@ doc-flags:-Zunstable-options
+
+extern crate q;
+pub trait Tango {}
diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/i.rs b/tests/rustdoc/cross-crate-info/kitchen-sink/i.rs
new file mode 100644
index 00000000000..bcb9464795a
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/kitchen-sink/i.rs
@@ -0,0 +1,30 @@
+//@ aux-build:r.rs
+//@ aux-build:q.rs
+//@ aux-build:t.rs
+//@ aux-build:s.rs
+//@ build-aux-docs
+//@ doc-flags:--enable-index-page
+//@ doc-flags:-Zunstable-options
+
+//@ has index.html '//h1' 'List of all crates'
+//@ has index.html
+//@ has index.html '//ul[@class="all-items"]//a[@href="i/index.html"]' 'i'
+//@ has index.html '//ul[@class="all-items"]//a[@href="q/index.html"]' 'q'
+//@ has index.html '//ul[@class="all-items"]//a[@href="r/index.html"]' 'r'
+//@ has index.html '//ul[@class="all-items"]//a[@href="s/index.html"]' 's'
+//@ has index.html '//ul[@class="all-items"]//a[@href="t/index.html"]' 't'
+//@ has q/struct.Quebec.html
+//@ has r/type.Romeo.html
+//@ has s/struct.Sierra.html
+//@ has t/trait.Tango.html
+//@ hasraw s/struct.Sierra.html 'Tango'
+//@ hasraw trait.impl/t/trait.Tango.js 'struct.Sierra.html'
+//@ hasraw search-index.js 'Quebec'
+//@ hasraw search-index.js 'Romeo'
+//@ hasraw search-index.js 'Sierra'
+//@ hasraw search-index.js 'Tango'
+//@ has type.impl/s/struct.Sierra.js
+//@ hasraw type.impl/s/struct.Sierra.js 'Tango'
+//@ hasraw type.impl/s/struct.Sierra.js 'Romeo'
+
+// document everything in the default mode
diff --git a/tests/rustdoc/cross-crate-info/single-crate-baseline/q.rs b/tests/rustdoc/cross-crate-info/single-crate-baseline/q.rs
new file mode 100644
index 00000000000..c5e3dc0a0f4
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/single-crate-baseline/q.rs
@@ -0,0 +1,12 @@
+//@ build-aux-docs
+//@ doc-flags:--enable-index-page
+//@ doc-flags:-Zunstable-options
+
+//@ has index.html
+//@ has index.html '//h1' 'List of all crates'
+//@ has index.html '//ul[@class="all-items"]//a[@href="q/index.html"]' 'q'
+//@ has q/struct.Quebec.html
+//@ hasraw search-index.js 'Quebec'
+
+// there's nothing cross-crate going on here
+pub struct Quebec;
diff --git a/tests/rustdoc/cross-crate-info/single-crate-no-index/q.rs b/tests/rustdoc/cross-crate-info/single-crate-no-index/q.rs
new file mode 100644
index 00000000000..d3e71fa0ce3
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/single-crate-no-index/q.rs
@@ -0,0 +1,6 @@
+//@ build-aux-docs
+//@ has q/struct.Quebec.html
+//@ hasraw search-index.js 'Quebec'
+
+// there's nothing cross-crate going on here
+pub struct Quebec;
diff --git a/tests/rustdoc/cross-crate-info/transitive/auxiliary/q.rs b/tests/rustdoc/cross-crate-info/transitive/auxiliary/q.rs
new file mode 100644
index 00000000000..5d0881029cb
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/transitive/auxiliary/q.rs
@@ -0,0 +1,2 @@
+//@ build-aux-docs
+pub struct Quebec;
diff --git a/tests/rustdoc/cross-crate-info/transitive/auxiliary/t.rs b/tests/rustdoc/cross-crate-info/transitive/auxiliary/t.rs
new file mode 100644
index 00000000000..fab9ec4a92b
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/transitive/auxiliary/t.rs
@@ -0,0 +1,4 @@
+//@ aux-build:q.rs
+//@ build-aux-docs
+extern crate q;
+pub trait Tango {}
diff --git a/tests/rustdoc/cross-crate-info/transitive/s.rs b/tests/rustdoc/cross-crate-info/transitive/s.rs
new file mode 100644
index 00000000000..0a4e5f646dd
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/transitive/s.rs
@@ -0,0 +1,6 @@
+//@ aux-build:t.rs
+//@ build-aux-docs
+// simple test to see if we support building transitive crates
+extern crate t;
+pub struct Sierra;
+impl t::Tango for Sierra {}
diff --git a/tests/rustdoc/cross-crate-info/two/auxiliary/f.rs b/tests/rustdoc/cross-crate-info/two/auxiliary/f.rs
new file mode 100644
index 00000000000..abc580a388c
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/two/auxiliary/f.rs
@@ -0,0 +1,2 @@
+//@ build-aux-docs
+pub trait Foxtrot {}
diff --git a/tests/rustdoc/cross-crate-info/two/e.rs b/tests/rustdoc/cross-crate-info/two/e.rs
new file mode 100644
index 00000000000..9665af62706
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/two/e.rs
@@ -0,0 +1,6 @@
+//@ aux-build:f.rs
+//@ build-aux-docs
+// simple test to assert that we can do a two-level aux-build
+extern crate f;
+pub enum Echo {}
+impl f::Foxtrot for Echo {}
diff --git a/tests/rustdoc/cross-crate-info/working-dir-examples/q.rs b/tests/rustdoc/cross-crate-info/working-dir-examples/q.rs
new file mode 100644
index 00000000000..a7ab062fd9e
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/working-dir-examples/q.rs
@@ -0,0 +1,10 @@
+//@ build-aux-docs
+//@ doc-flags:--scrape-examples-output-path=examples
+//@ doc-flags:--scrape-examples-target-crate=q
+//@ doc-flags:-Zunstable-options
+
+//@ has examples
+
+// where will --scrape-examples-output-path resolve the path to be?
+// should be the root output directory
+pub struct Quebec;
diff --git a/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/auxiliary/f.rs b/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/auxiliary/f.rs
new file mode 100644
index 00000000000..f8c9adcaf9c
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/auxiliary/f.rs
@@ -0,0 +1,3 @@
+//@ build-aux-docs
+//@ unique-doc-out-dir
+pub trait Foxtrot {}
diff --git a/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/e.rs b/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/e.rs
new file mode 100644
index 00000000000..9dcec211e17
--- /dev/null
+++ b/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/e.rs
@@ -0,0 +1,14 @@
+//@ aux-build:f.rs
+//@ build-aux-docs
+//@ has e/enum.Echo.html
+//@ !has f/trait.Foxtrot.html
+//@ hasraw e/enum.Echo.html 'Foxtrot'
+//@ hasraw trait.impl/f/trait.Foxtrot.js 'enum.Echo.html'
+//@ !hasraw search-index.js 'Foxtrot'
+//@ hasraw search-index.js 'Echo'
+
+// test the fact that our test runner will document this crate somewhere
+// else
+extern crate f;
+pub enum Echo {}
+impl f::Foxtrot for Echo {}
diff --git a/tests/rustdoc/extremely_long_typename.extremely_long_typename.html b/tests/rustdoc/extremely_long_typename.extremely_long_typename.html
new file mode 100644
index 00000000000..b20e59866da
--- /dev/null
+++ b/tests/rustdoc/extremely_long_typename.extremely_long_typename.html
@@ -0,0 +1 @@
+<li><div class="item-name"><a class="struct" href="struct.CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer.html" title="struct extremely_long_typename::CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer">Create<wbr />Subscription<wbr />Payment<wbr />Settings<wbr />Payment<wbr />Method<wbr />Options<wbr />Customer<wbr />Balance<wbr />Bank<wbr />Transfer<wbr />EuBank<wbr />Transfer</a></div></li>
\ No newline at end of file
diff --git a/tests/rustdoc/extremely_long_typename.rs b/tests/rustdoc/extremely_long_typename.rs
new file mode 100644
index 00000000000..212afe2d110
--- /dev/null
+++ b/tests/rustdoc/extremely_long_typename.rs
@@ -0,0 +1,7 @@
+// ignore-tidy-linelength
+// Make sure that, if an extremely long type name is named,
+// the item table has it line wrapped.
+// There should be some reasonably-placed `<wbr>` tags in the snapshot file.
+
+// @snapshot extremely_long_typename "extremely_long_typename/index.html" '//ul[@class="item-table"]/li'
+pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer;
diff --git a/tests/rustdoc/item-desc-list-at-start.item-table.html b/tests/rustdoc/item-desc-list-at-start.item-table.html
index 72bde573cea..cff4f816529 100644
--- a/tests/rustdoc/item-desc-list-at-start.item-table.html
+++ b/tests/rustdoc/item-desc-list-at-start.item-table.html
@@ -1 +1 @@
-<ul class="item-table"><li><div class="item-name"><a class="constant" href="constant.MY_CONSTANT.html" title="constant item_desc_list_at_start::MY_CONSTANT">MY_CONSTANT</a></div><div class="desc docblock-short">Groups: <code>SamplePatternSGIS</code>, <code>SamplePatternEXT</code></div></li></ul>
\ No newline at end of file
+<ul class="item-table"><li><div class="item-name"><a class="constant" href="constant.MY_CONSTANT.html" title="constant item_desc_list_at_start::MY_CONSTANT">MY_<wbr />CONSTANT</a></div><div class="desc docblock-short">Groups: <code>SamplePatternSGIS</code>, <code>SamplePatternEXT</code></div></li></ul>
\ No newline at end of file
diff --git a/tests/rustdoc/negative-impl-no-items.rs b/tests/rustdoc/negative-impl-no-items.rs
new file mode 100644
index 00000000000..c628e542033
--- /dev/null
+++ b/tests/rustdoc/negative-impl-no-items.rs
@@ -0,0 +1,26 @@
+// This test ensures that negative impls don't have items listed inside them.
+
+#![feature(negative_impls)]
+#![crate_name = "foo"]
+
+pub struct Thing;
+
+//@ has 'foo/struct.Thing.html'
+// We check the full path to ensure there is no `<details>` element.
+//@ has - '//div[@id="trait-implementations-list"]/section[@id="impl-Iterator-for-Thing"]/h3' \
+// 'impl !Iterator for Thing'
+impl !Iterator for Thing {}
+
+// This struct will allow us to compare both paths.
+pub struct Witness;
+
+//@ has 'foo/struct.Witness.html'
+//@ has - '//div[@id="trait-implementations-list"]/details//section[@id="impl-Iterator-for-Witness"]/h3' \
+// 'impl Iterator for Witness'
+impl Iterator for Witness {
+    type Item = u8;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        None
+    }
+}
diff --git a/tests/rustdoc/playground-arg.rs b/tests/rustdoc/playground-arg.rs
index 5875451a859..e10a31017ef 100644
--- a/tests/rustdoc/playground-arg.rs
+++ b/tests/rustdoc/playground-arg.rs
@@ -10,4 +10,4 @@
 pub fn dummy() {}
 
 // ensure that `extern crate foo;` was inserted into code snips automatically:
-//@ matches foo/index.html '//a[@class="test-arrow"][@href="https://example.com/?code=%23!%5Ballow(unused)%5D%0A%23%5Ballow(unused_extern_crates)%5D%0Aextern+crate+r%23foo;%0Afn+main()+%7B%0A++++use+foo::dummy;%0A++++dummy();%0A%7D&edition=2015"]' "Run"
+//@ matches foo/index.html '//a[@class="test-arrow"][@href="https://example.com/?code=%23!%5Ballow(unused)%5D%0A%23%5Ballow(unused_extern_crates)%5D%0Aextern+crate+r%23foo;%0Afn+main()+%7B%0A++++use+foo::dummy;%0A++++dummy();%0A%7D&edition=2015"]' ""
diff --git a/tests/rustdoc/playground-syntax-error.rs b/tests/rustdoc/playground-syntax-error.rs
index f5067145e02..d989570bf58 100644
--- a/tests/rustdoc/playground-syntax-error.rs
+++ b/tests/rustdoc/playground-syntax-error.rs
@@ -17,5 +17,5 @@
 pub fn bar() {}
 
 //@ has foo/fn.bar.html
-//@ has - '//a[@class="test-arrow"]' "Run"
+//@ has - '//a[@class="test-arrow"]' ""
 //@ has - '//*[@class="docblock"]' 'foo_recursive'
diff --git a/tests/rustdoc/playground.rs b/tests/rustdoc/playground.rs
index 7880f779067..db2d1669df6 100644
--- a/tests/rustdoc/playground.rs
+++ b/tests/rustdoc/playground.rs
@@ -22,6 +22,6 @@
 //! }
 //! ```
 
-//@ matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0A++++println!(%22Hello,+world!%22);%0A%7D&edition=2015"]' "Run"
-//@ matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0A++++println!(%22Hello,+world!%22);%0A%7D&edition=2015"]' "Run"
-//@ matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(something)%5D%0A%0Afn+main()+%7B%0A++++println!(%22Hello,+world!%22);%0A%7D&version=nightly&edition=2015"]' "Run"
+//@ matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0A++++println!(%22Hello,+world!%22);%0A%7D&edition=2015"]' ""
+//@ matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0A++++println!(%22Hello,+world!%22);%0A%7D&edition=2015"]' ""
+//@ matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(something)%5D%0A%0Afn+main()+%7B%0A++++println!(%22Hello,+world!%22);%0A%7D&version=nightly&edition=2015"]' ""
diff --git a/tests/rustdoc/type-alias/impl_trait_in_assoc_type.rs b/tests/rustdoc/type-alias/impl_trait_in_assoc_type.rs
new file mode 100644
index 00000000000..2846710cbed
--- /dev/null
+++ b/tests/rustdoc/type-alias/impl_trait_in_assoc_type.rs
@@ -0,0 +1,17 @@
+#![feature(impl_trait_in_assoc_type)]
+
+pub struct AlwaysTrue;
+
+//@ has impl_trait_in_assoc_type/struct.AlwaysTrue.html
+
+impl IntoIterator for AlwaysTrue {
+    type Item = bool;
+
+    //@ has - '//*[@id="associatedtype.IntoIter"]//h4[@class="code-header"]' \
+    //  'type IntoIter = impl Iterator<Item = bool>'
+    type IntoIter = impl Iterator<Item = bool>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        std::iter::repeat(true)
+    }
+}
diff --git a/tests/rustdoc/unsafe-extern-blocks.rs b/tests/rustdoc/unsafe-extern-blocks.rs
index 22d3beea6c3..829095f300f 100644
--- a/tests/rustdoc/unsafe-extern-blocks.rs
+++ b/tests/rustdoc/unsafe-extern-blocks.rs
@@ -1,6 +1,5 @@
 // Test to ensure the feature is working as expected.
 
-#![feature(unsafe_extern_blocks)]
 #![crate_name = "foo"]
 
 // @has 'foo/index.html'
@@ -13,7 +12,7 @@
 // @count - '//ul[@class="item-table"]//sup[@title="unsafe function"]' 1
 // @has - '//ul[@class="item-table"]//sup[@title="unsafe function"]' '⚠'
 
-unsafe extern {
+unsafe extern "C" {
     // @has 'foo/static.FOO.html'
     // @has - '//pre[@class="rust item-decl"]' 'pub static FOO: i32'
     pub safe static FOO: i32;
diff --git a/tests/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent.rs b/tests/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent.rs
index 33e10a00713..c761b8e94bd 100644
--- a/tests/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent.rs
+++ b/tests/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent.rs
@@ -1,5 +1,4 @@
 //@ compile-flags: -Z unstable-options
-//@ ignore-stage1 (can be removed after beta bump, #[cfg(bootstrap)])
 #![feature(rustc_private)]
 #![deny(rustc::non_glob_import_of_type_ir_inherent)]
 
diff --git a/tests/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent.stderr b/tests/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent.stderr
index 84e3867c95b..c5c10bb070a 100644
--- a/tests/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent.stderr
+++ b/tests/ui-fulldeps/internal-lints/non_glob_import_of_type_ir_inherent.stderr
@@ -1,5 +1,5 @@
 error: non-glob import of `rustc_type_ir::inherent`
-  --> $DIR/non_glob_import_of_type_ir_inherent.rs:17:9
+  --> $DIR/non_glob_import_of_type_ir_inherent.rs:16:9
    |
 LL |     use rustc_type_ir::inherent::Predicate;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^---------
@@ -7,25 +7,25 @@ LL |     use rustc_type_ir::inherent::Predicate;
    |                                  help: try using a glob import instead: `*`
    |
 note: the lint level is defined here
-  --> $DIR/non_glob_import_of_type_ir_inherent.rs:4:9
+  --> $DIR/non_glob_import_of_type_ir_inherent.rs:3:9
    |
 LL | #![deny(rustc::non_glob_import_of_type_ir_inherent)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: non-glob import of `rustc_type_ir::inherent`
-  --> $DIR/non_glob_import_of_type_ir_inherent.rs:18:35
+  --> $DIR/non_glob_import_of_type_ir_inherent.rs:17:35
    |
 LL |     use rustc_type_ir::inherent::{AdtDef, Ty};
    |                                   ^^^^^^ help: try using a glob import instead: `*`
 
 error: non-glob import of `rustc_type_ir::inherent`
-  --> $DIR/non_glob_import_of_type_ir_inherent.rs:18:43
+  --> $DIR/non_glob_import_of_type_ir_inherent.rs:17:43
    |
 LL |     use rustc_type_ir::inherent::{AdtDef, Ty};
    |                                           ^^ help: try using a glob import instead: `*`
 
 error: non-glob import of `rustc_type_ir::inherent`
-  --> $DIR/non_glob_import_of_type_ir_inherent.rs:21:9
+  --> $DIR/non_glob_import_of_type_ir_inherent.rs:20:9
    |
 LL |     use rustc_type_ir::inherent::ParamEnv as _;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^-------------
@@ -33,31 +33,31 @@ LL |     use rustc_type_ir::inherent::ParamEnv as _;
    |                                  help: try using a glob import instead: `*`
 
 error: non-glob import of `rustc_type_ir::inherent`
-  --> $DIR/non_glob_import_of_type_ir_inherent.rs:25:9
+  --> $DIR/non_glob_import_of_type_ir_inherent.rs:24:9
    |
 LL |     use rustc_type_ir::inherent;
    |         ^^^^^^^^^^^^^^^^^^^^^^^- help: try using a glob import instead: `::*`
 
 error: non-glob import of `rustc_type_ir::inherent`
-  --> $DIR/non_glob_import_of_type_ir_inherent.rs:26:9
+  --> $DIR/non_glob_import_of_type_ir_inherent.rs:25:9
    |
 LL |     use rustc_type_ir::inherent as inh;
    |         ^^^^^^^^^^^^^^^^^^^^^^^------- help: try using a glob import instead: `::*`
 
 error: non-glob import of `rustc_type_ir::inherent`
-  --> $DIR/non_glob_import_of_type_ir_inherent.rs:27:25
+  --> $DIR/non_glob_import_of_type_ir_inherent.rs:26:25
    |
 LL |     use rustc_type_ir::{inherent as _};
    |                         ^^^^^^^^----- help: try using a glob import instead: `::*`
 
 error: non-glob import of `rustc_type_ir::inherent`
-  --> $DIR/non_glob_import_of_type_ir_inherent.rs:34:35
+  --> $DIR/non_glob_import_of_type_ir_inherent.rs:33:35
    |
 LL |     use rustc_type_ir::inherent::{self};
    |                                   ^^^^ help: try using a glob import instead: `*`
 
 error: non-glob import of `rustc_type_ir::inherent`
-  --> $DIR/non_glob_import_of_type_ir_inherent.rs:35:35
+  --> $DIR/non_glob_import_of_type_ir_inherent.rs:34:35
    |
 LL |     use rustc_type_ir::inherent::{self as innate};
    |                                   ^^^^----------
diff --git a/tests/crashes/121444.rs b/tests/ui/abi/large-byval-align.rs
index a6373a58c42..e39170df72b 100644
--- a/tests/crashes/121444.rs
+++ b/tests/ui/abi/large-byval-align.rs
@@ -1,11 +1,13 @@
-//@ known-bug: #121444
 //@ compile-flags: -Copt-level=0
-//@ edition:2021
 //@ only-x86_64
 //@ ignore-windows
+//@ min-llvm-version: 19
+//@ build-pass
+
 #[repr(align(536870912))]
 pub struct A(i64);
 
+#[allow(improper_ctypes_definitions)]
 pub extern "C" fn foo(x: A) {}
 
 fn main() {
diff --git a/tests/ui/asm/aarch64/type-check-2.rs b/tests/ui/asm/aarch64/type-check-2.rs
index ba68cdd26d9..46667ae3a65 100644
--- a/tests/ui/asm/aarch64/type-check-2.rs
+++ b/tests/ui/asm/aarch64/type-check-2.rs
@@ -15,15 +15,6 @@ fn main() {
     unsafe {
         // Inputs must be initialized
 
-        // Sym operands must point to a function or static
-
-        const C: i32 = 0;
-        static S: i32 = 0;
-        asm!("{}", sym S);
-        asm!("{}", sym main);
-        asm!("{}", sym C);
-        //~^ ERROR invalid `sym` operand
-
         // Register operands must be Copy
 
         asm!("{:v}", in(vreg) SimdNonCopy(0.0, 0.0, 0.0, 0.0));
@@ -65,12 +56,3 @@ fn main() {
         asm!("{}", in(reg) u);
     }
 }
-
-// Sym operands must point to a function or static
-
-const C: i32 = 0;
-static S: i32 = 0;
-global_asm!("{}", sym S);
-global_asm!("{}", sym main);
-global_asm!("{}", sym C);
-//~^ ERROR invalid `sym` operand
diff --git a/tests/ui/asm/aarch64/type-check-2.stderr b/tests/ui/asm/aarch64/type-check-2.stderr
index d647f6a9f06..b7723fc74d4 100644
--- a/tests/ui/asm/aarch64/type-check-2.stderr
+++ b/tests/ui/asm/aarch64/type-check-2.stderr
@@ -1,29 +1,13 @@
-error: invalid `sym` operand
-  --> $DIR/type-check-2.rs:75:19
-   |
-LL | global_asm!("{}", sym C);
-   |                   ^^^^^ is an `i32`
-   |
-   = help: `sym` operands must refer to either a function or a static
-
-error: invalid `sym` operand
-  --> $DIR/type-check-2.rs:24:20
-   |
-LL |         asm!("{}", sym C);
-   |                    ^^^^^ is an `i32`
-   |
-   = help: `sym` operands must refer to either a function or a static
-
 error: arguments for inline assembly must be copyable
-  --> $DIR/type-check-2.rs:29:31
+  --> $DIR/type-check-2.rs:20:31
    |
 LL |         asm!("{:v}", in(vreg) SimdNonCopy(0.0, 0.0, 0.0, 0.0));
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `SimdNonCopy` does not implement the Copy trait
 
-error: cannot use value of type `{closure@$DIR/type-check-2.rs:41:28: 41:36}` for inline assembly
-  --> $DIR/type-check-2.rs:41:28
+error: cannot use value of type `{closure@$DIR/type-check-2.rs:32:28: 32:36}` for inline assembly
+  --> $DIR/type-check-2.rs:32:28
    |
 LL |         asm!("{}", in(reg) |x: i32| x);
    |                            ^^^^^^^^^^
@@ -31,7 +15,7 @@ LL |         asm!("{}", in(reg) |x: i32| x);
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
 error: cannot use value of type `Vec<i32>` for inline assembly
-  --> $DIR/type-check-2.rs:43:28
+  --> $DIR/type-check-2.rs:34:28
    |
 LL |         asm!("{}", in(reg) vec![0]);
    |                            ^^^^^^^
@@ -40,7 +24,7 @@ LL |         asm!("{}", in(reg) vec![0]);
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: cannot use value of type `(i32, i32, i32)` for inline assembly
-  --> $DIR/type-check-2.rs:45:28
+  --> $DIR/type-check-2.rs:36:28
    |
 LL |         asm!("{}", in(reg) (1, 2, 3));
    |                            ^^^^^^^^^
@@ -48,7 +32,7 @@ LL |         asm!("{}", in(reg) (1, 2, 3));
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
 error: cannot use value of type `[i32; 3]` for inline assembly
-  --> $DIR/type-check-2.rs:47:28
+  --> $DIR/type-check-2.rs:38:28
    |
 LL |         asm!("{}", in(reg) [1, 2, 3]);
    |                            ^^^^^^^^^
@@ -56,7 +40,7 @@ LL |         asm!("{}", in(reg) [1, 2, 3]);
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
 error: cannot use value of type `fn() {main}` for inline assembly
-  --> $DIR/type-check-2.rs:55:31
+  --> $DIR/type-check-2.rs:46:31
    |
 LL |         asm!("{}", inout(reg) f);
    |                               ^
@@ -64,12 +48,12 @@ LL |         asm!("{}", inout(reg) f);
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
 error: cannot use value of type `&mut i32` for inline assembly
-  --> $DIR/type-check-2.rs:58:31
+  --> $DIR/type-check-2.rs:49:31
    |
 LL |         asm!("{}", inout(reg) r);
    |                               ^
    |
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
-error: aborting due to 9 previous errors
+error: aborting due to 7 previous errors
 
diff --git a/tests/ui/asm/invalid-const-operand.rs b/tests/ui/asm/invalid-const-operand.rs
new file mode 100644
index 00000000000..eff335ff6aa
--- /dev/null
+++ b/tests/ui/asm/invalid-const-operand.rs
@@ -0,0 +1,51 @@
+//@ needs-asm-support
+//@ ignore-nvptx64
+//@ ignore-spirv
+
+#![feature(asm_const)]
+
+use std::arch::{asm, global_asm};
+
+// Const operands must be integers and must be constants.
+
+global_asm!("{}", const 0);
+global_asm!("{}", const 0i32);
+global_asm!("{}", const 0i128);
+global_asm!("{}", const 0f32);
+//~^ ERROR invalid type for `const` operand
+global_asm!("{}", const 0 as *mut u8);
+//~^ ERROR invalid type for `const` operand
+
+fn main() {
+    unsafe {
+        // Const operands must be integers and must be constants.
+
+        asm!("{}", const 0);
+        asm!("{}", const 0i32);
+        asm!("{}", const 0i128);
+        asm!("{}", const 0f32);
+        //~^ ERROR invalid type for `const` operand
+        asm!("{}", const 0 as *mut u8);
+        //~^ ERROR invalid type for `const` operand
+        asm!("{}", const &0);
+        //~^ ERROR invalid type for `const` operand
+
+        // Constants must be... constant
+
+        let x = 0;
+        const fn const_foo(x: i32) -> i32 {
+            x
+        }
+        const fn const_bar<T>(x: T) -> T {
+            x
+        }
+        asm!("{}", const x);
+        //~^ ERROR attempt to use a non-constant value in a constant
+        asm!("{}", const const_foo(0));
+        asm!("{}", const const_foo(x));
+        //~^ ERROR attempt to use a non-constant value in a constant
+        asm!("{}", const const_bar(0));
+        asm!("{}", const const_bar(x));
+        //~^ ERROR attempt to use a non-constant value in a constant
+    }
+}
diff --git a/tests/ui/asm/invalid-const-operand.stderr b/tests/ui/asm/invalid-const-operand.stderr
new file mode 100644
index 00000000000..a6d742b53c2
--- /dev/null
+++ b/tests/ui/asm/invalid-const-operand.stderr
@@ -0,0 +1,86 @@
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/invalid-const-operand.rs:42:26
+   |
+LL |         asm!("{}", const x);
+   |                          ^ non-constant value
+   |
+help: consider using `const` instead of `let`
+   |
+LL |         const x: /* Type */ = 0;
+   |         ~~~~~  ++++++++++++
+
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/invalid-const-operand.rs:45:36
+   |
+LL |         asm!("{}", const const_foo(x));
+   |                                    ^ non-constant value
+   |
+help: consider using `const` instead of `let`
+   |
+LL |         const x: /* Type */ = 0;
+   |         ~~~~~  ++++++++++++
+
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/invalid-const-operand.rs:48:36
+   |
+LL |         asm!("{}", const const_bar(x));
+   |                                    ^ non-constant value
+   |
+help: consider using `const` instead of `let`
+   |
+LL |         const x: /* Type */ = 0;
+   |         ~~~~~  ++++++++++++
+
+error: invalid type for `const` operand
+  --> $DIR/invalid-const-operand.rs:14:19
+   |
+LL | global_asm!("{}", const 0f32);
+   |                   ^^^^^^----
+   |                         |
+   |                         is an `f32`
+   |
+   = help: `const` operands must be of an integer type
+
+error: invalid type for `const` operand
+  --> $DIR/invalid-const-operand.rs:16:19
+   |
+LL | global_asm!("{}", const 0 as *mut u8);
+   |                   ^^^^^^------------
+   |                         |
+   |                         is a `*mut u8`
+   |
+   = help: `const` operands must be of an integer type
+
+error: invalid type for `const` operand
+  --> $DIR/invalid-const-operand.rs:26:20
+   |
+LL |         asm!("{}", const 0f32);
+   |                    ^^^^^^----
+   |                          |
+   |                          is an `f32`
+   |
+   = help: `const` operands must be of an integer type
+
+error: invalid type for `const` operand
+  --> $DIR/invalid-const-operand.rs:28:20
+   |
+LL |         asm!("{}", const 0 as *mut u8);
+   |                    ^^^^^^------------
+   |                          |
+   |                          is a `*mut u8`
+   |
+   = help: `const` operands must be of an integer type
+
+error: invalid type for `const` operand
+  --> $DIR/invalid-const-operand.rs:30:20
+   |
+LL |         asm!("{}", const &0);
+   |                    ^^^^^^--
+   |                          |
+   |                          is a `&i32`
+   |
+   = help: `const` operands must be of an integer type
+
+error: aborting due to 8 previous errors
+
+For more information about this error, try `rustc --explain E0435`.
diff --git a/tests/ui/asm/invalid-sym-operand.rs b/tests/ui/asm/invalid-sym-operand.rs
new file mode 100644
index 00000000000..2129c20b968
--- /dev/null
+++ b/tests/ui/asm/invalid-sym-operand.rs
@@ -0,0 +1,34 @@
+//@ needs-asm-support
+//@ ignore-nvptx64
+//@ ignore-spirv
+
+use std::arch::{asm, global_asm};
+
+// Sym operands must point to a function or static
+
+const C: i32 = 0;
+static S: i32 = 0;
+global_asm!("{}", sym S);
+global_asm!("{}", sym main);
+global_asm!("{}", sym C);
+//~^ ERROR invalid `sym` operand
+
+fn main() {
+    unsafe {
+        // Sym operands must point to a function or static
+
+        let x: u64 = 0;
+        const C: i32 = 0;
+        static S: i32 = 0;
+        asm!("{}", sym S);
+        asm!("{}", sym main);
+        asm!("{}", sym C);
+        //~^ ERROR invalid `sym` operand
+        asm!("{}", sym x);
+        //~^ ERROR invalid `sym` operand
+    }
+}
+
+unsafe fn generic<T>() {
+    asm!("{}", sym generic::<T>);
+}
diff --git a/tests/ui/asm/invalid-sym-operand.stderr b/tests/ui/asm/invalid-sym-operand.stderr
new file mode 100644
index 00000000000..f0e6a17c25f
--- /dev/null
+++ b/tests/ui/asm/invalid-sym-operand.stderr
@@ -0,0 +1,26 @@
+error: invalid `sym` operand
+  --> $DIR/invalid-sym-operand.rs:27:24
+   |
+LL |         asm!("{}", sym x);
+   |                        ^ is a local variable
+   |
+   = help: `sym` operands must refer to either a function or a static
+
+error: invalid `sym` operand
+  --> $DIR/invalid-sym-operand.rs:13:19
+   |
+LL | global_asm!("{}", sym C);
+   |                   ^^^^^ is an `i32`
+   |
+   = help: `sym` operands must refer to either a function or a static
+
+error: invalid `sym` operand
+  --> $DIR/invalid-sym-operand.rs:25:20
+   |
+LL |         asm!("{}", sym C);
+   |                    ^^^^^ is an `i32`
+   |
+   = help: `sym` operands must refer to either a function or a static
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/asm/naked-functions.rs b/tests/ui/asm/naked-functions.rs
index 6d335ac2def..cb1e5c325c2 100644
--- a/tests/ui/asm/naked-functions.rs
+++ b/tests/ui/asm/naked-functions.rs
@@ -239,6 +239,9 @@ pub unsafe extern "C" fn compatible_target_feature() {
 }
 
 #[doc = "foo bar baz"]
+/// a doc comment
+// a normal comment
+#[doc(alias = "ADocAlias")]
 #[naked]
 pub unsafe extern "C" fn compatible_doc_attributes() {
     asm!("", options(noreturn, raw));
diff --git a/tests/ui/asm/parse-error.rs b/tests/ui/asm/parse-error.rs
index 9dec3a1c394..16ae0282864 100644
--- a/tests/ui/asm/parse-error.rs
+++ b/tests/ui/asm/parse-error.rs
@@ -146,5 +146,16 @@ global_asm!(format!("{{{}}}", 0), const FOO);
 //~^ ERROR asm template must be a string literal
 global_asm!("{1}", format!("{{{}}}", 0), const FOO, const BAR);
 //~^ ERROR asm template must be a string literal
-global_asm!("{}", label {});
-//~^ ERROR expected operand, options, or additional template string
+
+global_asm!("{}", in(reg));
+//~^ ERROR the `in` operand cannot be used with `global_asm!`
+global_asm!("{}", out(reg));
+//~^ ERROR the `out` operand cannot be used with `global_asm!`
+global_asm!("{}", lateout(reg));
+//~^ ERROR the `lateout` operand cannot be used with `global_asm!`
+global_asm!("{}", inout(reg));
+//~^ ERROR the `inout` operand cannot be used with `global_asm!`
+global_asm!("{}", inlateout(reg));
+//~^ ERROR the `inlateout` operand cannot be used with `global_asm!`
+global_asm!("{}", label(reg));
+//~^ ERROR the `label` operand cannot be used with `global_asm!`
diff --git a/tests/ui/asm/parse-error.stderr b/tests/ui/asm/parse-error.stderr
index e9ecd712bc3..f5f8d537d86 100644
--- a/tests/ui/asm/parse-error.stderr
+++ b/tests/ui/asm/parse-error.stderr
@@ -380,11 +380,41 @@ LL | global_asm!("{1}", format!("{{{}}}", 0), const FOO, const BAR);
    |
    = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: expected operand, options, or additional template string
-  --> $DIR/parse-error.rs:149:19
+error: the `in` operand cannot be used with `global_asm!`
+  --> $DIR/parse-error.rs:150:19
+   |
+LL | global_asm!("{}", in(reg));
+   |                   ^^ the `in` operand is not meaningful for global-scoped inline assembly, remove it
+
+error: the `out` operand cannot be used with `global_asm!`
+  --> $DIR/parse-error.rs:152:19
+   |
+LL | global_asm!("{}", out(reg));
+   |                   ^^^ the `out` operand is not meaningful for global-scoped inline assembly, remove it
+
+error: the `lateout` operand cannot be used with `global_asm!`
+  --> $DIR/parse-error.rs:154:19
+   |
+LL | global_asm!("{}", lateout(reg));
+   |                   ^^^^^^^ the `lateout` operand is not meaningful for global-scoped inline assembly, remove it
+
+error: the `inout` operand cannot be used with `global_asm!`
+  --> $DIR/parse-error.rs:156:19
+   |
+LL | global_asm!("{}", inout(reg));
+   |                   ^^^^^ the `inout` operand is not meaningful for global-scoped inline assembly, remove it
+
+error: the `inlateout` operand cannot be used with `global_asm!`
+  --> $DIR/parse-error.rs:158:19
+   |
+LL | global_asm!("{}", inlateout(reg));
+   |                   ^^^^^^^^^ the `inlateout` operand is not meaningful for global-scoped inline assembly, remove it
+
+error: the `label` operand cannot be used with `global_asm!`
+  --> $DIR/parse-error.rs:160:19
    |
-LL | global_asm!("{}", label {});
-   |                   ^^^^^^^^ expected operand, options, or additional template string
+LL | global_asm!("{}", label(reg));
+   |                   ^^^^^ the `label` operand is not meaningful for global-scoped inline assembly, remove it
 
 error[E0435]: attempt to use a non-constant value in a constant
   --> $DIR/parse-error.rs:39:37
@@ -441,6 +471,6 @@ help: consider using `const` instead of `let`
 LL |     const bar: /* Type */ = 0;
    |     ~~~~~    ++++++++++++
 
-error: aborting due to 67 previous errors
+error: aborting due to 72 previous errors
 
 For more information about this error, try `rustc --explain E0435`.
diff --git a/tests/ui/asm/type-check-1.rs b/tests/ui/asm/type-check-1.rs
index b0f1362f543..22669dce280 100644
--- a/tests/ui/asm/type-check-1.rs
+++ b/tests/ui/asm/type-check-1.rs
@@ -28,51 +28,5 @@ fn main() {
         asm!("{}", inout(reg) v[..]);
         //~^ ERROR the size for values of type `[u64]` cannot be known at compilation time
         //~| ERROR cannot use value of type `[u64]` for inline assembly
-
-        // Constants must be... constant
-
-        let x = 0;
-        const fn const_foo(x: i32) -> i32 {
-            x
-        }
-        const fn const_bar<T>(x: T) -> T {
-            x
-        }
-        asm!("{}", const x);
-        //~^ ERROR attempt to use a non-constant value in a constant
-        asm!("{}", const const_foo(0));
-        asm!("{}", const const_foo(x));
-        //~^ ERROR attempt to use a non-constant value in a constant
-        asm!("{}", const const_bar(0));
-        asm!("{}", const const_bar(x));
-        //~^ ERROR attempt to use a non-constant value in a constant
-        asm!("{}", sym x);
-        //~^ ERROR invalid `sym` operand
-
-        // Const operands must be integers and must be constants.
-
-        asm!("{}", const 0);
-        asm!("{}", const 0i32);
-        asm!("{}", const 0i128);
-        asm!("{}", const 0f32);
-        //~^ ERROR mismatched types
-        asm!("{}", const 0 as *mut u8);
-        //~^ ERROR mismatched types
-        asm!("{}", const &0);
-        //~^ ERROR mismatched types
     }
 }
-
-unsafe fn generic<T>() {
-    asm!("{}", sym generic::<T>);
-}
-
-// Const operands must be integers and must be constants.
-
-global_asm!("{}", const 0);
-global_asm!("{}", const 0i32);
-global_asm!("{}", const 0i128);
-global_asm!("{}", const 0f32);
-//~^ ERROR mismatched types
-global_asm!("{}", const 0 as *mut u8);
-//~^ ERROR mismatched types
diff --git a/tests/ui/asm/type-check-1.stderr b/tests/ui/asm/type-check-1.stderr
index 18526232118..d47e6ae1d2a 100644
--- a/tests/ui/asm/type-check-1.stderr
+++ b/tests/ui/asm/type-check-1.stderr
@@ -1,44 +1,3 @@
-error[E0435]: attempt to use a non-constant value in a constant
-  --> $DIR/type-check-1.rs:41:26
-   |
-LL |         asm!("{}", const x);
-   |                          ^ non-constant value
-   |
-help: consider using `const` instead of `let`
-   |
-LL |         const x: /* Type */ = 0;
-   |         ~~~~~  ++++++++++++
-
-error[E0435]: attempt to use a non-constant value in a constant
-  --> $DIR/type-check-1.rs:44:36
-   |
-LL |         asm!("{}", const const_foo(x));
-   |                                    ^ non-constant value
-   |
-help: consider using `const` instead of `let`
-   |
-LL |         const x: /* Type */ = 0;
-   |         ~~~~~  ++++++++++++
-
-error[E0435]: attempt to use a non-constant value in a constant
-  --> $DIR/type-check-1.rs:47:36
-   |
-LL |         asm!("{}", const const_bar(x));
-   |                                    ^ non-constant value
-   |
-help: consider using `const` instead of `let`
-   |
-LL |         const x: /* Type */ = 0;
-   |         ~~~~~  ++++++++++++
-
-error: invalid `sym` operand
-  --> $DIR/type-check-1.rs:49:24
-   |
-LL |         asm!("{}", sym x);
-   |                        ^ is a local variable
-   |
-   = help: `sym` operands must refer to either a function or a static
-
 error: invalid asm output
   --> $DIR/type-check-1.rs:14:29
    |
@@ -102,49 +61,6 @@ LL |         asm!("{}", inout(reg) v[..]);
    |
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
-error[E0308]: mismatched types
-  --> $DIR/type-check-1.rs:57:26
-   |
-LL |         asm!("{}", const 0f32);
-   |                          ^^^^ expected integer, found `f32`
-
-error[E0308]: mismatched types
-  --> $DIR/type-check-1.rs:59:26
-   |
-LL |         asm!("{}", const 0 as *mut u8);
-   |                          ^^^^^^^^^^^^ expected integer, found `*mut u8`
-   |
-   = note:     expected type `{integer}`
-           found raw pointer `*mut u8`
-
-error[E0308]: mismatched types
-  --> $DIR/type-check-1.rs:61:26
-   |
-LL |         asm!("{}", const &0);
-   |                          ^^ expected integer, found `&{integer}`
-   |
-help: consider removing the borrow
-   |
-LL -         asm!("{}", const &0);
-LL +         asm!("{}", const 0);
-   |
-
-error[E0308]: mismatched types
-  --> $DIR/type-check-1.rs:75:25
-   |
-LL | global_asm!("{}", const 0f32);
-   |                         ^^^^ expected integer, found `f32`
-
-error[E0308]: mismatched types
-  --> $DIR/type-check-1.rs:77:25
-   |
-LL | global_asm!("{}", const 0 as *mut u8);
-   |                         ^^^^^^^^^^^^ expected integer, found `*mut u8`
-   |
-   = note:     expected type `{integer}`
-           found raw pointer `*mut u8`
-
-error: aborting due to 17 previous errors
+error: aborting due to 8 previous errors
 
-Some errors have detailed explanations: E0277, E0308, E0435.
-For more information about an error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/asm/x86_64/type-check-2.rs b/tests/ui/asm/x86_64/type-check-2.rs
index 4b5d59fdbc7..ff811961462 100644
--- a/tests/ui/asm/x86_64/type-check-2.rs
+++ b/tests/ui/asm/x86_64/type-check-2.rs
@@ -27,17 +27,6 @@ fn main() {
         asm!("{}", out(reg) v[0]);
         asm!("{}", inout(reg) v[0]);
 
-        // Sym operands must point to a function or static
-
-        const C: i32 = 0;
-        static S: i32 = 0;
-        asm!("{}", sym S);
-        asm!("{}", sym main);
-        asm!("{}", sym C);
-        //~^ ERROR invalid `sym` operand
-        asm!("{}", sym x);
-        //~^ ERROR invalid `sym` operand
-
         // Register operands must be Copy
 
         asm!("{}", in(xmm_reg) SimdNonCopy(0.0, 0.0, 0.0, 0.0));
@@ -79,12 +68,3 @@ fn main() {
         asm!("{}", in(reg) u);
     }
 }
-
-// Sym operands must point to a function or static
-
-const C: i32 = 0;
-static S: i32 = 0;
-global_asm!("{}", sym S);
-global_asm!("{}", sym main);
-global_asm!("{}", sym C);
-//~^ ERROR invalid `sym` operand
diff --git a/tests/ui/asm/x86_64/type-check-2.stderr b/tests/ui/asm/x86_64/type-check-2.stderr
index 6ae118b16e7..c72e695aefb 100644
--- a/tests/ui/asm/x86_64/type-check-2.stderr
+++ b/tests/ui/asm/x86_64/type-check-2.stderr
@@ -1,37 +1,13 @@
-error: invalid `sym` operand
-  --> $DIR/type-check-2.rs:38:24
-   |
-LL |         asm!("{}", sym x);
-   |                        ^ is a local variable
-   |
-   = help: `sym` operands must refer to either a function or a static
-
-error: invalid `sym` operand
-  --> $DIR/type-check-2.rs:89:19
-   |
-LL | global_asm!("{}", sym C);
-   |                   ^^^^^ is an `i32`
-   |
-   = help: `sym` operands must refer to either a function or a static
-
-error: invalid `sym` operand
-  --> $DIR/type-check-2.rs:36:20
-   |
-LL |         asm!("{}", sym C);
-   |                    ^^^^^ is an `i32`
-   |
-   = help: `sym` operands must refer to either a function or a static
-
 error: arguments for inline assembly must be copyable
-  --> $DIR/type-check-2.rs:43:32
+  --> $DIR/type-check-2.rs:32:32
    |
 LL |         asm!("{}", in(xmm_reg) SimdNonCopy(0.0, 0.0, 0.0, 0.0));
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `SimdNonCopy` does not implement the Copy trait
 
-error: cannot use value of type `{closure@$DIR/type-check-2.rs:55:28: 55:36}` for inline assembly
-  --> $DIR/type-check-2.rs:55:28
+error: cannot use value of type `{closure@$DIR/type-check-2.rs:44:28: 44:36}` for inline assembly
+  --> $DIR/type-check-2.rs:44:28
    |
 LL |         asm!("{}", in(reg) |x: i32| x);
    |                            ^^^^^^^^^^
@@ -39,7 +15,7 @@ LL |         asm!("{}", in(reg) |x: i32| x);
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
 error: cannot use value of type `Vec<i32>` for inline assembly
-  --> $DIR/type-check-2.rs:57:28
+  --> $DIR/type-check-2.rs:46:28
    |
 LL |         asm!("{}", in(reg) vec![0]);
    |                            ^^^^^^^
@@ -48,7 +24,7 @@ LL |         asm!("{}", in(reg) vec![0]);
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: cannot use value of type `(i32, i32, i32)` for inline assembly
-  --> $DIR/type-check-2.rs:59:28
+  --> $DIR/type-check-2.rs:48:28
    |
 LL |         asm!("{}", in(reg) (1, 2, 3));
    |                            ^^^^^^^^^
@@ -56,7 +32,7 @@ LL |         asm!("{}", in(reg) (1, 2, 3));
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
 error: cannot use value of type `[i32; 3]` for inline assembly
-  --> $DIR/type-check-2.rs:61:28
+  --> $DIR/type-check-2.rs:50:28
    |
 LL |         asm!("{}", in(reg) [1, 2, 3]);
    |                            ^^^^^^^^^
@@ -64,7 +40,7 @@ LL |         asm!("{}", in(reg) [1, 2, 3]);
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
 error: cannot use value of type `fn() {main}` for inline assembly
-  --> $DIR/type-check-2.rs:69:31
+  --> $DIR/type-check-2.rs:58:31
    |
 LL |         asm!("{}", inout(reg) f);
    |                               ^
@@ -72,7 +48,7 @@ LL |         asm!("{}", inout(reg) f);
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
 error: cannot use value of type `&mut i32` for inline assembly
-  --> $DIR/type-check-2.rs:72:31
+  --> $DIR/type-check-2.rs:61:31
    |
 LL |         asm!("{}", inout(reg) r);
    |                               ^
@@ -121,7 +97,7 @@ help: consider changing this to be mutable
 LL |         let mut v: Vec<u64> = vec![0, 1, 2];
    |             +++
 
-error: aborting due to 13 previous errors
+error: aborting due to 10 previous errors
 
 Some errors have detailed explanations: E0381, E0596.
 For more information about an error, try `rustc --explain E0381`.
diff --git a/tests/ui/associated-type-bounds/name-same-as-generic-type-issue-128249.rs b/tests/ui/associated-type-bounds/name-same-as-generic-type-issue-128249.rs
new file mode 100644
index 00000000000..f5f8fa51e37
--- /dev/null
+++ b/tests/ui/associated-type-bounds/name-same-as-generic-type-issue-128249.rs
@@ -0,0 +1,15 @@
+trait Trait<Type> {
+    type Type;
+
+    fn one(&self, val:  impl Trait<Type: Default>);
+    //~^ ERROR trait takes 1 generic argument but 0 generic arguments were supplied
+
+    fn two<T: Trait<Type: Default>>(&self) -> T;
+    //~^ ERROR trait takes 1 generic argument but 0 generic arguments were supplied
+
+    fn three<T>(&self) -> T where
+        T: Trait<Type: Default>,;
+    //~^ ERROR trait takes 1 generic argument but 0 generic arguments were supplied
+}
+
+fn main() {}
diff --git a/tests/ui/associated-type-bounds/name-same-as-generic-type-issue-128249.stderr b/tests/ui/associated-type-bounds/name-same-as-generic-type-issue-128249.stderr
new file mode 100644
index 00000000000..06ab06003a1
--- /dev/null
+++ b/tests/ui/associated-type-bounds/name-same-as-generic-type-issue-128249.stderr
@@ -0,0 +1,51 @@
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
+  --> $DIR/name-same-as-generic-type-issue-128249.rs:4:30
+   |
+LL |     fn one(&self, val:  impl Trait<Type: Default>);
+   |                              ^^^^^ expected 1 generic argument
+   |
+note: trait defined here, with 1 generic parameter: `Type`
+  --> $DIR/name-same-as-generic-type-issue-128249.rs:1:7
+   |
+LL | trait Trait<Type> {
+   |       ^^^^^ ----
+help: add missing generic argument
+   |
+LL |     fn one(&self, val:  impl Trait<Type, Type: Default>);
+   |                                    +++++
+
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
+  --> $DIR/name-same-as-generic-type-issue-128249.rs:7:15
+   |
+LL |     fn two<T: Trait<Type: Default>>(&self) -> T;
+   |               ^^^^^ expected 1 generic argument
+   |
+note: trait defined here, with 1 generic parameter: `Type`
+  --> $DIR/name-same-as-generic-type-issue-128249.rs:1:7
+   |
+LL | trait Trait<Type> {
+   |       ^^^^^ ----
+help: add missing generic argument
+   |
+LL |     fn two<T: Trait<Type, Type: Default>>(&self) -> T;
+   |                     +++++
+
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
+  --> $DIR/name-same-as-generic-type-issue-128249.rs:11:12
+   |
+LL |         T: Trait<Type: Default>,;
+   |            ^^^^^ expected 1 generic argument
+   |
+note: trait defined here, with 1 generic parameter: `Type`
+  --> $DIR/name-same-as-generic-type-issue-128249.rs:1:7
+   |
+LL | trait Trait<Type> {
+   |       ^^^^^ ----
+help: add missing generic argument
+   |
+LL |         T: Trait<Type, Type: Default>,;
+   |                  +++++
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/tests/ui/associated-types/associated-types-outlives.stderr b/tests/ui/associated-types/associated-types-outlives.stderr
index 1164869bf19..bd6022fcec6 100644
--- a/tests/ui/associated-types/associated-types-outlives.stderr
+++ b/tests/ui/associated-types/associated-types-outlives.stderr
@@ -18,7 +18,7 @@ LL | pub fn free_and_use<T: for<'a> Foo<'a>,
    |                     ^ consider constraining this type parameter with `Clone`
 ...
 LL |         's: loop { y = denormalise(&x); break }
-   |                                    -- you could clone this value
+   |                                     - you could clone this value
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/async-await/async-closures/box-deref-in-debuginfo.rs b/tests/ui/async-await/async-closures/box-deref-in-debuginfo.rs
new file mode 100644
index 00000000000..8b2de578b24
--- /dev/null
+++ b/tests/ui/async-await/async-closures/box-deref-in-debuginfo.rs
@@ -0,0 +1,35 @@
+//@ aux-build:block-on.rs
+//@ edition:2021
+//@ run-pass
+
+#![feature(async_closure)]
+
+extern crate block_on;
+
+pub trait Trait {
+    fn callback(&mut self);
+}
+impl Trait for (i32,) {
+    fn callback(&mut self) {
+        println!("hi {}", self.0);
+        self.0 += 1;
+    }
+}
+
+async fn call_once(f: impl async FnOnce()) {
+    f().await;
+}
+
+async fn run(mut loader: Box<dyn Trait>) {
+    let f = async move || {
+        loader.callback();
+        loader.callback();
+    };
+    call_once(f).await;
+}
+
+fn main() {
+    block_on::block_on(async {
+        run(Box::new((42,))).await;
+    });
+}
diff --git a/tests/ui/async-await/async-closures/fn-exception-target-features.rs b/tests/ui/async-await/async-closures/fn-exception-target-features.rs
new file mode 100644
index 00000000000..de62fc8bf7e
--- /dev/null
+++ b/tests/ui/async-await/async-closures/fn-exception-target-features.rs
@@ -0,0 +1,17 @@
+//@ edition: 2021
+//@ only-x86_64
+
+#![feature(async_closure, target_feature_11)]
+// `target_feature_11` just to test safe functions w/ target features.
+
+use std::pin::Pin;
+use std::future::Future;
+
+#[target_feature(enable = "sse2")]
+fn target_feature()  -> Pin<Box<dyn Future<Output = ()> + 'static>> { todo!() }
+
+fn test(f: impl async Fn()) {}
+
+fn main() {
+    test(target_feature); //~ ERROR the trait bound
+}
diff --git a/tests/ui/async-await/async-closures/fn-exception-target-features.stderr b/tests/ui/async-await/async-closures/fn-exception-target-features.stderr
new file mode 100644
index 00000000000..396167f4070
--- /dev/null
+++ b/tests/ui/async-await/async-closures/fn-exception-target-features.stderr
@@ -0,0 +1,17 @@
+error[E0277]: the trait bound `fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {target_feature}: AsyncFn<()>` is not satisfied
+  --> $DIR/fn-exception-target-features.rs:16:10
+   |
+LL |     test(target_feature);
+   |     ---- ^^^^^^^^^^^^^^ the trait `AsyncFn<()>` is not implemented for fn item `fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {target_feature}`
+   |     |
+   |     required by a bound introduced by this call
+   |
+note: required by a bound in `test`
+  --> $DIR/fn-exception-target-features.rs:13:17
+   |
+LL | fn test(f: impl async Fn()) {}
+   |                 ^^^^^^^^^^ required by this bound in `test`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/async-await/async-closures/fn-exception.rs b/tests/ui/async-await/async-closures/fn-exception.rs
new file mode 100644
index 00000000000..0e06ebf48a4
--- /dev/null
+++ b/tests/ui/async-await/async-closures/fn-exception.rs
@@ -0,0 +1,21 @@
+//@ edition: 2021
+
+#![feature(async_closure)]
+
+use std::pin::Pin;
+use std::future::Future;
+
+unsafe extern "Rust" {
+    pub unsafe fn unsafety() -> Pin<Box<dyn Future<Output = ()> + 'static>>;
+}
+
+unsafe extern "C" {
+    pub safe fn abi() -> Pin<Box<dyn Future<Output = ()> + 'static>>;
+}
+
+fn test(f: impl async Fn()) {}
+
+fn main() {
+    test(unsafety); //~ ERROR the trait bound
+    test(abi); //~ ERROR the trait bound
+}
diff --git a/tests/ui/async-await/async-closures/fn-exception.stderr b/tests/ui/async-await/async-closures/fn-exception.stderr
new file mode 100644
index 00000000000..bacd079af0f
--- /dev/null
+++ b/tests/ui/async-await/async-closures/fn-exception.stderr
@@ -0,0 +1,31 @@
+error[E0277]: the trait bound `unsafe fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {unsafety}: AsyncFn<()>` is not satisfied
+  --> $DIR/fn-exception.rs:19:10
+   |
+LL |     test(unsafety);
+   |     ---- ^^^^^^^^ the trait `AsyncFn<()>` is not implemented for fn item `unsafe fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {unsafety}`
+   |     |
+   |     required by a bound introduced by this call
+   |
+note: required by a bound in `test`
+  --> $DIR/fn-exception.rs:16:17
+   |
+LL | fn test(f: impl async Fn()) {}
+   |                 ^^^^^^^^^^ required by this bound in `test`
+
+error[E0277]: the trait bound `extern "C" fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {abi}: AsyncFn<()>` is not satisfied
+  --> $DIR/fn-exception.rs:20:10
+   |
+LL |     test(abi);
+   |     ---- ^^^ the trait `AsyncFn<()>` is not implemented for fn item `extern "C" fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {abi}`
+   |     |
+   |     required by a bound introduced by this call
+   |
+note: required by a bound in `test`
+  --> $DIR/fn-exception.rs:16:17
+   |
+LL | fn test(f: impl async Fn()) {}
+   |                 ^^^^^^^^^^ required by this bound in `test`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs b/tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs
new file mode 100644
index 00000000000..cd9d98d0799
--- /dev/null
+++ b/tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs
@@ -0,0 +1,17 @@
+//@ aux-build:block-on.rs
+//@ edition:2021
+//@ build-pass
+
+#![feature(async_closure)]
+
+extern crate block_on;
+
+fn wrapper(f: impl Fn(String)) -> impl async Fn(String) {
+    async move |s| f(s)
+}
+
+fn main() {
+    block_on::block_on(async {
+        wrapper(|who| println!("Hello, {who}!"))(String::from("world")).await;
+    });
+}
diff --git a/tests/ui/async-await/for-await-consumes-iter.rs b/tests/ui/async-await/for-await-consumes-iter.rs
index 38dfe46c814..7ea88c14cb5 100644
--- a/tests/ui/async-await/for-await-consumes-iter.rs
+++ b/tests/ui/async-await/for-await-consumes-iter.rs
@@ -1,5 +1,5 @@
 //@ edition: 2021
-#![feature(async_iterator, async_iter_from_iter, const_waker, async_for_loop, noop_waker)]
+#![feature(async_iterator, async_iter_from_iter, async_for_loop, noop_waker)]
 
 use std::future::Future;
 
diff --git a/tests/ui/async-await/for-await-passthrough.rs b/tests/ui/async-await/for-await-passthrough.rs
index e09e843332e..b4fba6b2f76 100644
--- a/tests/ui/async-await/for-await-passthrough.rs
+++ b/tests/ui/async-await/for-await-passthrough.rs
@@ -1,7 +1,7 @@
 //@ run-pass
 //@ edition: 2024
 //@ compile-flags: -Zunstable-options
-#![feature(async_iterator, async_iter_from_iter, const_waker, async_for_loop, noop_waker,
+#![feature(async_iterator, async_iter_from_iter, async_for_loop, noop_waker,
            gen_blocks)]
 
 async gen fn async_iter() -> i32 {
diff --git a/tests/ui/async-await/for-await.rs b/tests/ui/async-await/for-await.rs
index acd9f01640a..b4af38a82b3 100644
--- a/tests/ui/async-await/for-await.rs
+++ b/tests/ui/async-await/for-await.rs
@@ -1,6 +1,6 @@
 //@ run-pass
 //@ edition: 2021
-#![feature(async_iterator, async_iter_from_iter, const_waker, async_for_loop, noop_waker)]
+#![feature(async_iterator, async_iter_from_iter, async_for_loop, noop_waker)]
 
 use std::future::Future;
 
diff --git a/tests/ui/async-await/in-trait/generics-mismatch.rs b/tests/ui/async-await/in-trait/generics-mismatch.rs
index d3d1284982a..a5c81a92998 100644
--- a/tests/ui/async-await/in-trait/generics-mismatch.rs
+++ b/tests/ui/async-await/in-trait/generics-mismatch.rs
@@ -6,7 +6,7 @@ trait Foo {
 
 impl Foo for () {
     async fn foo<const N: usize>() {}
-    //~^ ERROR: method `foo` has an incompatible generic parameter for trait `Foo` [E0053]
+    //~^ ERROR: associated function `foo` has an incompatible generic parameter for trait `Foo` [E0053]
 }
 
 fn main() {}
diff --git a/tests/ui/async-await/in-trait/generics-mismatch.stderr b/tests/ui/async-await/in-trait/generics-mismatch.stderr
index c0357dc7f3e..cb0f95e8d09 100644
--- a/tests/ui/async-await/in-trait/generics-mismatch.stderr
+++ b/tests/ui/async-await/in-trait/generics-mismatch.stderr
@@ -1,4 +1,4 @@
-error[E0053]: method `foo` has an incompatible generic parameter for trait `Foo`
+error[E0053]: associated function `foo` has an incompatible generic parameter for trait `Foo`
   --> $DIR/generics-mismatch.rs:8:18
    |
 LL | trait Foo {
diff --git a/tests/ui/async-await/unreachable-lint-2.rs b/tests/ui/async-await/unreachable-lint-2.rs
new file mode 100644
index 00000000000..137cb32481b
--- /dev/null
+++ b/tests/ui/async-await/unreachable-lint-2.rs
@@ -0,0 +1,15 @@
+//@ edition:2018
+
+#![deny(unreachable_code)]
+
+async fn foo() {
+    endless().await;
+    println!("this is unreachable!");
+    //~^ ERROR unreachable statement
+}
+
+async fn endless() -> ! {
+    loop {}
+}
+
+fn main() { }
diff --git a/tests/ui/async-await/unreachable-lint-2.stderr b/tests/ui/async-await/unreachable-lint-2.stderr
new file mode 100644
index 00000000000..cbebc9951f3
--- /dev/null
+++ b/tests/ui/async-await/unreachable-lint-2.stderr
@@ -0,0 +1,17 @@
+error: unreachable statement
+  --> $DIR/unreachable-lint-2.rs:7:5
+   |
+LL |     endless().await;
+   |               ----- any code following this expression is unreachable
+LL |     println!("this is unreachable!");
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
+   |
+note: the lint level is defined here
+  --> $DIR/unreachable-lint-2.rs:3:9
+   |
+LL | #![deny(unreachable_code)]
+   |         ^^^^^^^^^^^^^^^^
+   = note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/attributes/check-builtin-attr-ice.rs b/tests/ui/attributes/check-builtin-attr-ice.rs
new file mode 100644
index 00000000000..9ef5890601f
--- /dev/null
+++ b/tests/ui/attributes/check-builtin-attr-ice.rs
@@ -0,0 +1,58 @@
+//! Regression test for #128622.
+//!
+//! PR #128581 introduced an assertion that all builtin attributes are actually checked via
+//! `CheckAttrVisitor` and aren't accidentally usable on completely unrelated HIR nodes.
+//! Unfortunately, the check had correctness problems.
+//!
+//! The match on attribute path segments looked like
+//!
+//! ```rs,ignore
+//! [sym::should_panic] => /* check is implemented */
+//! match BUILTIN_ATTRIBUTE_MAP.get(name) {
+//!     // checked below
+//!     Some(BuiltinAttribute { type_: AttributeType::CrateLevel, .. }) => {}
+//!     Some(_) => {
+//!         if !name.as_str().starts_with("rustc_") {
+//!             span_bug!(
+//!                 attr.span,
+//!                 "builtin attribute {name:?} not handled by `CheckAttrVisitor`"
+//!             )
+//!         }
+//!     }
+//!     None => (),
+//! }
+//! ```
+//!
+//! However, it failed to account for edge cases such as an attribute whose:
+//!
+//! 1. path segments *starts* with a builtin attribute such as `should_panic`
+//! 2. which does not start with `rustc_`, and
+//! 3. is also an `AttributeType::Normal` attribute upon registration with the builtin attribute map
+//!
+//! These conditions when all satisfied cause the span bug to be issued for e.g.
+//! `#[should_panic::skip]` because the `[sym::should_panic]` arm is not matched (since it's
+//! `[sym::should_panic, sym::skip]`).
+//!
+//! This test checks that the span bug is not fired for such cases.
+//!
+//! issue: rust-lang/rust#128622
+
+// Notably, `should_panic` is a `AttributeType::Normal` attribute that is checked separately.
+
+struct Foo {
+    #[should_panic::skip]
+    //~^ ERROR failed to resolve
+    pub field: u8,
+
+    #[should_panic::a::b::c]
+    //~^ ERROR failed to resolve
+    pub field2: u8,
+}
+
+fn foo() {}
+
+fn main() {
+    #[deny::skip]
+    //~^ ERROR failed to resolve
+    foo();
+}
diff --git a/tests/ui/attributes/check-builtin-attr-ice.stderr b/tests/ui/attributes/check-builtin-attr-ice.stderr
new file mode 100644
index 00000000000..5a27da565a8
--- /dev/null
+++ b/tests/ui/attributes/check-builtin-attr-ice.stderr
@@ -0,0 +1,21 @@
+error[E0433]: failed to resolve: use of undeclared crate or module `should_panic`
+  --> $DIR/check-builtin-attr-ice.rs:43:7
+   |
+LL |     #[should_panic::skip]
+   |       ^^^^^^^^^^^^ use of undeclared crate or module `should_panic`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `should_panic`
+  --> $DIR/check-builtin-attr-ice.rs:47:7
+   |
+LL |     #[should_panic::a::b::c]
+   |       ^^^^^^^^^^^^ use of undeclared crate or module `should_panic`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `deny`
+  --> $DIR/check-builtin-attr-ice.rs:55:7
+   |
+LL |     #[deny::skip]
+   |       ^^^^ use of undeclared crate or module `deny`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0433`.
diff --git a/tests/ui/attributes/check-cfg_attr-ice.rs b/tests/ui/attributes/check-cfg_attr-ice.rs
new file mode 100644
index 00000000000..5bf8baab141
--- /dev/null
+++ b/tests/ui/attributes/check-cfg_attr-ice.rs
@@ -0,0 +1,68 @@
+//! I missed a `cfg_attr` match in #128581, it should have had the same treatment as `cfg`. If
+//! an invalid attribute starting with `cfg_attr` is passed, then it would trigger an ICE because
+//! it was not considered "checked" (e.g. `#[cfg_attr::skip]` or `#[cfg_attr::no_such_thing]`).
+//!
+//! This test is not exhaustive, there's too many possible positions to check, instead it just does
+//! a basic smoke test in a few select positions to make sure we don't ICE for e.g.
+//! `#[cfg_attr::no_such_thing]`.
+//!
+//! issue: rust-lang/rust#128716
+#![crate_type = "lib"]
+
+#[cfg_attr::no_such_thing]
+//~^ ERROR failed to resolve
+mod we_are_no_strangers_to_love {}
+
+#[cfg_attr::no_such_thing]
+//~^ ERROR failed to resolve
+struct YouKnowTheRules {
+    #[cfg_attr::no_such_thing]
+    //~^ ERROR failed to resolve
+    and_so_do_i: u8,
+}
+
+#[cfg_attr::no_such_thing]
+//~^ ERROR failed to resolve
+fn a_full_commitment() {
+    #[cfg_attr::no_such_thing]
+    //~^ ERROR failed to resolve
+    let is_what_i_am_thinking_of = ();
+}
+
+#[cfg_attr::no_such_thing]
+//~^ ERROR failed to resolve
+union AnyOtherGuy {
+    owo: ()
+}
+struct This;
+
+#[cfg_attr(FALSE, doc = "you wouldn't get this")]
+impl From<AnyOtherGuy> for This {
+    #[cfg_attr::no_such_thing]
+    //~^ ERROR failed to resolve
+    fn from(#[cfg_attr::no_such_thing] any_other_guy: AnyOtherGuy) -> This {
+        //~^ ERROR failed to resolve
+        #[cfg_attr::no_such_thing]
+        //~^ ERROR attributes on expressions are experimental
+        //~| ERROR failed to resolve
+        unreachable!()
+    }
+}
+
+#[cfg_attr::no_such_thing]
+//~^ ERROR failed to resolve
+enum NeverGonna {
+    #[cfg_attr::no_such_thing]
+    //~^ ERROR failed to resolve
+    GiveYouUp(#[cfg_attr::no_such_thing] u8),
+    //~^ ERROR failed to resolve
+    LetYouDown {
+        #![cfg_attr::no_such_thing]
+        //~^ ERROR an inner attribute is not permitted in this context
+        never_gonna: (),
+        round_around: (),
+        #[cfg_attr::no_such_thing]
+        //~^ ERROR failed to resolve
+        and_desert_you: (),
+    },
+}
diff --git a/tests/ui/attributes/check-cfg_attr-ice.stderr b/tests/ui/attributes/check-cfg_attr-ice.stderr
new file mode 100644
index 00000000000..dbdf32597f7
--- /dev/null
+++ b/tests/ui/attributes/check-cfg_attr-ice.stderr
@@ -0,0 +1,101 @@
+error: an inner attribute is not permitted in this context
+  --> $DIR/check-cfg_attr-ice.rs:60:9
+   |
+LL |         #![cfg_attr::no_such_thing]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
+   = note: outer attributes, like `#[test]`, annotate the item following them
+
+error[E0658]: attributes on expressions are experimental
+  --> $DIR/check-cfg_attr-ice.rs:45:9
+   |
+LL |         #[cfg_attr::no_such_thing]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
+   = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+
+error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+  --> $DIR/check-cfg_attr-ice.rs:52:3
+   |
+LL | #[cfg_attr::no_such_thing]
+   |   ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+  --> $DIR/check-cfg_attr-ice.rs:55:7
+   |
+LL |     #[cfg_attr::no_such_thing]
+   |       ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+  --> $DIR/check-cfg_attr-ice.rs:57:17
+   |
+LL |     GiveYouUp(#[cfg_attr::no_such_thing] u8),
+   |                 ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+  --> $DIR/check-cfg_attr-ice.rs:64:11
+   |
+LL |         #[cfg_attr::no_such_thing]
+   |           ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+  --> $DIR/check-cfg_attr-ice.rs:41:7
+   |
+LL |     #[cfg_attr::no_such_thing]
+   |       ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+  --> $DIR/check-cfg_attr-ice.rs:43:15
+   |
+LL |     fn from(#[cfg_attr::no_such_thing] any_other_guy: AnyOtherGuy) -> This {
+   |               ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+  --> $DIR/check-cfg_attr-ice.rs:45:11
+   |
+LL |         #[cfg_attr::no_such_thing]
+   |           ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+  --> $DIR/check-cfg_attr-ice.rs:32:3
+   |
+LL | #[cfg_attr::no_such_thing]
+   |   ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+  --> $DIR/check-cfg_attr-ice.rs:24:3
+   |
+LL | #[cfg_attr::no_such_thing]
+   |   ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+  --> $DIR/check-cfg_attr-ice.rs:27:7
+   |
+LL |     #[cfg_attr::no_such_thing]
+   |       ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+  --> $DIR/check-cfg_attr-ice.rs:16:3
+   |
+LL | #[cfg_attr::no_such_thing]
+   |   ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+  --> $DIR/check-cfg_attr-ice.rs:19:7
+   |
+LL |     #[cfg_attr::no_such_thing]
+   |       ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+
+error[E0433]: failed to resolve: use of undeclared crate or module `cfg_attr`
+  --> $DIR/check-cfg_attr-ice.rs:12:3
+   |
+LL | #[cfg_attr::no_such_thing]
+   |   ^^^^^^^^ use of undeclared crate or module `cfg_attr`
+
+error: aborting due to 15 previous errors
+
+Some errors have detailed explanations: E0433, E0658.
+For more information about an error, try `rustc --explain E0433`.
diff --git a/tests/ui/attributes/field-attributes-vis-unresolved.stderr b/tests/ui/attributes/field-attributes-vis-unresolved.stderr
index 819cd859ae9..f8610c08b02 100644
--- a/tests/ui/attributes/field-attributes-vis-unresolved.stderr
+++ b/tests/ui/attributes/field-attributes-vis-unresolved.stderr
@@ -4,7 +4,10 @@ error[E0433]: failed to resolve: you might be missing crate `nonexistent`
 LL |     pub(in nonexistent) field: u8
    |            ^^^^^^^^^^^ you might be missing crate `nonexistent`
    |
-   = help: consider adding `extern crate nonexistent` to use the `nonexistent` crate
+help: consider importing the `nonexistent` crate
+   |
+LL + extern crate nonexistent;
+   |
 
 error[E0433]: failed to resolve: you might be missing crate `nonexistent`
   --> $DIR/field-attributes-vis-unresolved.rs:22:12
@@ -12,7 +15,10 @@ error[E0433]: failed to resolve: you might be missing crate `nonexistent`
 LL |     pub(in nonexistent) u8
    |            ^^^^^^^^^^^ you might be missing crate `nonexistent`
    |
-   = help: consider adding `extern crate nonexistent` to use the `nonexistent` crate
+help: consider importing the `nonexistent` crate
+   |
+LL + extern crate nonexistent;
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/attributes/no-sanitize.rs b/tests/ui/attributes/no-sanitize.rs
new file mode 100644
index 00000000000..82b7a22d570
--- /dev/null
+++ b/tests/ui/attributes/no-sanitize.rs
@@ -0,0 +1,34 @@
+#![feature(no_sanitize)]
+#![feature(stmt_expr_attributes)]
+#![deny(unused_attributes)]
+#![allow(dead_code)]
+
+fn invalid() {
+    #[no_sanitize(memory)] //~ ERROR attribute should be applied to a function definition
+    {
+        1
+    };
+}
+
+#[no_sanitize(memory)] //~ ERROR attribute should be applied to a function definition
+type InvalidTy = ();
+
+#[no_sanitize(memory)] //~ ERROR attribute should be applied to a function definition
+mod invalid_module {}
+
+fn main() {
+    let _ = #[no_sanitize(memory)] //~ ERROR attribute should be applied to a function definition
+    (|| 1);
+}
+
+#[no_sanitize(memory)] //~ ERROR attribute should be applied to a function definition
+struct F;
+
+#[no_sanitize(memory)] //~ ERROR attribute should be applied to a function definition
+impl F {
+    #[no_sanitize(memory)]
+    fn valid(&self) {}
+}
+
+#[no_sanitize(memory)]
+fn valid() {}
diff --git a/tests/ui/attributes/no-sanitize.stderr b/tests/ui/attributes/no-sanitize.stderr
new file mode 100644
index 00000000000..f742ba0beed
--- /dev/null
+++ b/tests/ui/attributes/no-sanitize.stderr
@@ -0,0 +1,55 @@
+error: attribute should be applied to a function definition
+  --> $DIR/no-sanitize.rs:7:5
+   |
+LL |       #[no_sanitize(memory)]
+   |       ^^^^^^^^^^^^^^^^^^^^^^
+LL | /     {
+LL | |         1
+LL | |     };
+   | |_____- not a function definition
+
+error: attribute should be applied to a function definition
+  --> $DIR/no-sanitize.rs:13:1
+   |
+LL | #[no_sanitize(memory)]
+   | ^^^^^^^^^^^^^^^^^^^^^^
+LL | type InvalidTy = ();
+   | -------------------- not a function definition
+
+error: attribute should be applied to a function definition
+  --> $DIR/no-sanitize.rs:16:1
+   |
+LL | #[no_sanitize(memory)]
+   | ^^^^^^^^^^^^^^^^^^^^^^
+LL | mod invalid_module {}
+   | --------------------- not a function definition
+
+error: attribute should be applied to a function definition
+  --> $DIR/no-sanitize.rs:20:13
+   |
+LL |     let _ = #[no_sanitize(memory)]
+   |             ^^^^^^^^^^^^^^^^^^^^^^
+LL |     (|| 1);
+   |     ------ not a function definition
+
+error: attribute should be applied to a function definition
+  --> $DIR/no-sanitize.rs:24:1
+   |
+LL | #[no_sanitize(memory)]
+   | ^^^^^^^^^^^^^^^^^^^^^^
+LL | struct F;
+   | --------- not a function definition
+
+error: attribute should be applied to a function definition
+  --> $DIR/no-sanitize.rs:27:1
+   |
+LL |   #[no_sanitize(memory)]
+   |   ^^^^^^^^^^^^^^^^^^^^^^
+LL | / impl F {
+LL | |     #[no_sanitize(memory)]
+LL | |     fn valid(&self) {}
+LL | | }
+   | |_- not a function definition
+
+error: aborting due to 6 previous errors
+
diff --git a/tests/ui/attributes/optimize.rs b/tests/ui/attributes/optimize.rs
new file mode 100644
index 00000000000..b01806165c1
--- /dev/null
+++ b/tests/ui/attributes/optimize.rs
@@ -0,0 +1,28 @@
+#![feature(optimize_attribute)]
+#![feature(stmt_expr_attributes)]
+#![deny(unused_attributes)]
+#![allow(dead_code)]
+
+#[optimize(speed)] //~ ERROR attribute should be applied to function or closure
+struct F;
+
+fn invalid() {
+    #[optimize(speed)] //~ ERROR attribute should be applied to function or closure
+    {
+        1
+    };
+}
+
+#[optimize(speed)]
+fn valid() {}
+
+#[optimize(speed)]
+mod valid_module {}
+
+#[optimize(speed)]
+impl F {}
+
+fn main() {
+    let _ = #[optimize(speed)]
+    (|| 1);
+}
diff --git a/tests/ui/attributes/optimize.stderr b/tests/ui/attributes/optimize.stderr
new file mode 100644
index 00000000000..3c445d73c2e
--- /dev/null
+++ b/tests/ui/attributes/optimize.stderr
@@ -0,0 +1,20 @@
+error: attribute should be applied to function or closure
+  --> $DIR/optimize.rs:6:1
+   |
+LL | #[optimize(speed)]
+   | ^^^^^^^^^^^^^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/optimize.rs:3:9
+   |
+LL | #![deny(unused_attributes)]
+   |         ^^^^^^^^^^^^^^^^^
+
+error: attribute should be applied to function or closure
+  --> $DIR/optimize.rs:10:5
+   |
+LL |     #[optimize(speed)]
+   |     ^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/attributes/unsafe/derive-unsafe-attributes.rs b/tests/ui/attributes/unsafe/derive-unsafe-attributes.rs
index 774ce86c096..b8edb4aab90 100644
--- a/tests/ui/attributes/unsafe/derive-unsafe-attributes.rs
+++ b/tests/ui/attributes/unsafe/derive-unsafe-attributes.rs
@@ -1,6 +1,15 @@
 #![feature(unsafe_attributes)]
 
-#[derive(unsafe(Debug))] //~ ERROR: traits in `#[derive(...)]` don't accept `unsafe(...)`
+#[derive(unsafe(Debug))]
+//~^ ERROR: expected identifier, found keyword `unsafe`
+//~| ERROR: traits in `#[derive(...)]` don't accept arguments
+//~| ERROR: expected identifier, found keyword `unsafe`
+//~| ERROR: expected identifier, found keyword `unsafe`
+//~| ERROR: cannot find derive macro `r#unsafe` in this scope
+//~| ERROR: cannot find derive macro `r#unsafe` in this scope
 struct Foo;
 
+#[unsafe(derive(Debug))] //~ ERROR: is not an unsafe attribute
+struct Bar;
+
 fn main() {}
diff --git a/tests/ui/attributes/unsafe/derive-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/derive-unsafe-attributes.stderr
index fc0daf16790..c40a5512fd5 100644
--- a/tests/ui/attributes/unsafe/derive-unsafe-attributes.stderr
+++ b/tests/ui/attributes/unsafe/derive-unsafe-attributes.stderr
@@ -1,8 +1,65 @@
-error: traits in `#[derive(...)]` don't accept `unsafe(...)`
+error: expected identifier, found keyword `unsafe`
+  --> $DIR/derive-unsafe-attributes.rs:3:10
+   |
+LL | #[derive(unsafe(Debug))]
+   |          ^^^^^^ expected identifier, found keyword
+   |
+help: escape `unsafe` to use it as an identifier
+   |
+LL | #[derive(r#unsafe(Debug))]
+   |          ++
+
+error: traits in `#[derive(...)]` don't accept arguments
+  --> $DIR/derive-unsafe-attributes.rs:3:16
+   |
+LL | #[derive(unsafe(Debug))]
+   |                ^^^^^^^ help: remove the arguments
+
+error: `derive` is not an unsafe attribute
+  --> $DIR/derive-unsafe-attributes.rs:12:3
+   |
+LL | #[unsafe(derive(Debug))]
+   |   ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: expected identifier, found keyword `unsafe`
+  --> $DIR/derive-unsafe-attributes.rs:3:10
+   |
+LL | #[derive(unsafe(Debug))]
+   |          ^^^^^^ expected identifier, found keyword
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+help: escape `unsafe` to use it as an identifier
+   |
+LL | #[derive(r#unsafe(Debug))]
+   |          ++
+
+error: expected identifier, found keyword `unsafe`
+  --> $DIR/derive-unsafe-attributes.rs:3:10
+   |
+LL | #[derive(unsafe(Debug))]
+   |          ^^^^^^ expected identifier, found keyword
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+help: escape `unsafe` to use it as an identifier
+   |
+LL | #[derive(r#unsafe(Debug))]
+   |          ++
+
+error: cannot find derive macro `r#unsafe` in this scope
   --> $DIR/derive-unsafe-attributes.rs:3:10
    |
 LL | #[derive(unsafe(Debug))]
    |          ^^^^^^
 
-error: aborting due to 1 previous error
+error: cannot find derive macro `r#unsafe` in this scope
+  --> $DIR/derive-unsafe-attributes.rs:3:10
+   |
+LL | #[derive(unsafe(Debug))]
+   |          ^^^^^^
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+error: aborting due to 7 previous errors
 
diff --git a/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr
index ea82bac6df0..950b2636993 100644
--- a/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr
+++ b/tests/ui/attributes/unsafe/double-unsafe-attributes.stderr
@@ -13,7 +13,7 @@ error: `r#unsafe` is not an unsafe attribute
   --> $DIR/double-unsafe-attributes.rs:3:3
    |
 LL | #[unsafe(unsafe(no_mangle))]
-   |   ^^^^^^
+   |   ^^^^^^ this is not an unsafe attribute
    |
    = note: extraneous unsafe is not allowed in attributes
 
diff --git a/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs
new file mode 100644
index 00000000000..0181add843b
--- /dev/null
+++ b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.rs
@@ -0,0 +1,31 @@
+//@ edition: 2024
+//@ compile-flags: -Zunstable-options
+#![feature(unsafe_attributes)]
+
+#[unsafe(cfg(any()))] //~ ERROR: is not an unsafe attribute
+fn a() {}
+
+#[unsafe(cfg_attr(any(), allow(dead_code)))] //~ ERROR: is not an unsafe attribute
+fn b() {}
+
+#[unsafe(test)] //~ ERROR: is not an unsafe attribute
+fn aa() {}
+
+#[unsafe(ignore = "test")] //~ ERROR: is not an unsafe attribute
+fn bb() {}
+
+#[unsafe(should_panic(expected = "test"))] //~ ERROR: is not an unsafe attribute
+fn cc() {}
+
+#[unsafe(macro_use)] //~ ERROR: is not an unsafe attribute
+mod inner {
+    #[unsafe(macro_export)] //~ ERROR: is not an unsafe attribute
+    macro_rules! m {
+        () => {};
+    }
+}
+
+#[unsafe(used)] //~ ERROR: is not an unsafe attribute
+static FOO: usize = 0;
+
+fn main() {}
diff --git a/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.stderr
new file mode 100644
index 00000000000..f39074b613d
--- /dev/null
+++ b/tests/ui/attributes/unsafe/extraneous-unsafe-attributes.stderr
@@ -0,0 +1,66 @@
+error: `cfg` is not an unsafe attribute
+  --> $DIR/extraneous-unsafe-attributes.rs:5:3
+   |
+LL | #[unsafe(cfg(any()))]
+   |   ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: `cfg_attr` is not an unsafe attribute
+  --> $DIR/extraneous-unsafe-attributes.rs:8:3
+   |
+LL | #[unsafe(cfg_attr(any(), allow(dead_code)))]
+   |   ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: `test` is not an unsafe attribute
+  --> $DIR/extraneous-unsafe-attributes.rs:11:3
+   |
+LL | #[unsafe(test)]
+   |   ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: `ignore` is not an unsafe attribute
+  --> $DIR/extraneous-unsafe-attributes.rs:14:3
+   |
+LL | #[unsafe(ignore = "test")]
+   |   ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: `should_panic` is not an unsafe attribute
+  --> $DIR/extraneous-unsafe-attributes.rs:17:3
+   |
+LL | #[unsafe(should_panic(expected = "test"))]
+   |   ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: `macro_use` is not an unsafe attribute
+  --> $DIR/extraneous-unsafe-attributes.rs:20:3
+   |
+LL | #[unsafe(macro_use)]
+   |   ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: `macro_export` is not an unsafe attribute
+  --> $DIR/extraneous-unsafe-attributes.rs:22:7
+   |
+LL |     #[unsafe(macro_export)]
+   |       ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: `used` is not an unsafe attribute
+  --> $DIR/extraneous-unsafe-attributes.rs:28:3
+   |
+LL | #[unsafe(used)]
+   |   ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: aborting due to 8 previous errors
+
diff --git a/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs b/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs
new file mode 100644
index 00000000000..f29a5b3252b
--- /dev/null
+++ b/tests/ui/attributes/unsafe/proc-unsafe-attributes.rs
@@ -0,0 +1,37 @@
+#![feature(unsafe_attributes)]
+
+#[unsafe(proc_macro)]
+//~^ ERROR: is not an unsafe attribute
+//~| ERROR attribute is only usable with crates of the `proc-macro` crate type
+pub fn a() {}
+
+
+#[unsafe(proc_macro_derive(Foo))]
+//~^ ERROR: is not an unsafe attribute
+//~| ERROR attribute is only usable with crates of the `proc-macro` crate type
+pub fn b() {}
+
+#[proc_macro_derive(unsafe(Foo))]
+//~^ ERROR attribute is only usable with crates of the `proc-macro` crate type
+//~| ERROR: expected identifier, found keyword `unsafe`
+pub fn c() {}
+
+#[unsafe(proc_macro_attribute)]
+//~^ ERROR: is not an unsafe attribute
+//~| ERROR attribute is only usable with crates of the `proc-macro` crate type
+pub fn d() {}
+
+#[unsafe(allow(dead_code))]
+//~^ ERROR: is not an unsafe attribute
+pub fn e() {}
+
+#[unsafe(allow(unsafe(dead_code)))]
+//~^ ERROR: is not an unsafe attribute
+//~| ERROR: malformed lint attribute input
+//~| ERROR: malformed lint attribute input
+//~| ERROR: expected identifier, found keyword `unsafe`
+//~| ERROR: malformed lint attribute input
+//~| ERROR: malformed lint attribute input
+pub fn f() {}
+
+fn main() {}
diff --git a/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr
new file mode 100644
index 00000000000..79d34d458bd
--- /dev/null
+++ b/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr
@@ -0,0 +1,119 @@
+error[E0452]: malformed lint attribute input
+  --> $DIR/proc-unsafe-attributes.rs:28:16
+   |
+LL | #[unsafe(allow(unsafe(dead_code)))]
+   |                ^^^^^^^^^^^^^^^^^ bad attribute argument
+
+error[E0452]: malformed lint attribute input
+  --> $DIR/proc-unsafe-attributes.rs:28:16
+   |
+LL | #[unsafe(allow(unsafe(dead_code)))]
+   |                ^^^^^^^^^^^^^^^^^ bad attribute argument
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+error: `proc_macro` is not an unsafe attribute
+  --> $DIR/proc-unsafe-attributes.rs:3:3
+   |
+LL | #[unsafe(proc_macro)]
+   |   ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: `proc_macro_derive` is not an unsafe attribute
+  --> $DIR/proc-unsafe-attributes.rs:9:3
+   |
+LL | #[unsafe(proc_macro_derive(Foo))]
+   |   ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: expected identifier, found keyword `unsafe`
+  --> $DIR/proc-unsafe-attributes.rs:14:21
+   |
+LL | #[proc_macro_derive(unsafe(Foo))]
+   |                     ^^^^^^ expected identifier, found keyword
+   |
+help: escape `unsafe` to use it as an identifier
+   |
+LL | #[proc_macro_derive(r#unsafe(Foo))]
+   |                     ++
+
+error: `proc_macro_attribute` is not an unsafe attribute
+  --> $DIR/proc-unsafe-attributes.rs:19:3
+   |
+LL | #[unsafe(proc_macro_attribute)]
+   |   ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: `allow` is not an unsafe attribute
+  --> $DIR/proc-unsafe-attributes.rs:24:3
+   |
+LL | #[unsafe(allow(dead_code))]
+   |   ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: `allow` is not an unsafe attribute
+  --> $DIR/proc-unsafe-attributes.rs:28:3
+   |
+LL | #[unsafe(allow(unsafe(dead_code)))]
+   |   ^^^^^^ this is not an unsafe attribute
+   |
+   = note: extraneous unsafe is not allowed in attributes
+
+error: expected identifier, found keyword `unsafe`
+  --> $DIR/proc-unsafe-attributes.rs:28:16
+   |
+LL | #[unsafe(allow(unsafe(dead_code)))]
+   |                ^^^^^^ expected identifier, found keyword
+   |
+help: escape `unsafe` to use it as an identifier
+   |
+LL | #[unsafe(allow(r#unsafe(dead_code)))]
+   |                ++
+
+error: the `#[proc_macro]` attribute is only usable with crates of the `proc-macro` crate type
+  --> $DIR/proc-unsafe-attributes.rs:3:1
+   |
+LL | #[unsafe(proc_macro)]
+   | ^^^^^^^^^^^^^^^^^^^^^
+
+error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
+  --> $DIR/proc-unsafe-attributes.rs:9:1
+   |
+LL | #[unsafe(proc_macro_derive(Foo))]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
+  --> $DIR/proc-unsafe-attributes.rs:14:1
+   |
+LL | #[proc_macro_derive(unsafe(Foo))]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: the `#[proc_macro_attribute]` attribute is only usable with crates of the `proc-macro` crate type
+  --> $DIR/proc-unsafe-attributes.rs:19:1
+   |
+LL | #[unsafe(proc_macro_attribute)]
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0452]: malformed lint attribute input
+  --> $DIR/proc-unsafe-attributes.rs:28:16
+   |
+LL | #[unsafe(allow(unsafe(dead_code)))]
+   |                ^^^^^^^^^^^^^^^^^ bad attribute argument
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+error[E0452]: malformed lint attribute input
+  --> $DIR/proc-unsafe-attributes.rs:28:16
+   |
+LL | #[unsafe(allow(unsafe(dead_code)))]
+   |                ^^^^^^^^^^^^^^^^^ bad attribute argument
+   |
+   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
+
+error: aborting due to 15 previous errors
+
+For more information about this error, try `rustc --explain E0452`.
diff --git a/tests/ui/attributes/unsafe/unsafe-attributes.rs b/tests/ui/attributes/unsafe/unsafe-attributes.rs
index e7620a18048..33a412add50 100644
--- a/tests/ui/attributes/unsafe/unsafe-attributes.rs
+++ b/tests/ui/attributes/unsafe/unsafe-attributes.rs
@@ -4,4 +4,10 @@
 #[unsafe(no_mangle)]
 fn a() {}
 
+#[unsafe(export_name = "foo")]
+fn b() {}
+
+#[cfg_attr(any(), unsafe(no_mangle))]
+static VAR2: u32 = 1;
+
 fn main() {}
diff --git a/tests/ui/attributes/unsafe/unsafe-safe-attribute.stderr b/tests/ui/attributes/unsafe/unsafe-safe-attribute.stderr
index 0602af34e4f..584b0ea797d 100644
--- a/tests/ui/attributes/unsafe/unsafe-safe-attribute.stderr
+++ b/tests/ui/attributes/unsafe/unsafe-safe-attribute.stderr
@@ -2,7 +2,7 @@ error: `repr` is not an unsafe attribute
   --> $DIR/unsafe-safe-attribute.rs:3:3
    |
 LL | #[unsafe(repr(C))]
-   |   ^^^^^^
+   |   ^^^^^^ this is not an unsafe attribute
    |
    = note: extraneous unsafe is not allowed in attributes
 
diff --git a/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr b/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr
index 584dacf4d8c..26b5e4e37b9 100644
--- a/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr
+++ b/tests/ui/attributes/unsafe/unsafe-safe-attribute_diagnostic.stderr
@@ -2,7 +2,7 @@ error: `diagnostic::on_unimplemented` is not an unsafe attribute
   --> $DIR/unsafe-safe-attribute_diagnostic.rs:3:3
    |
 LL | #[unsafe(diagnostic::on_unimplemented(
-   |   ^^^^^^
+   |   ^^^^^^ this is not an unsafe attribute
    |
    = note: extraneous unsafe is not allowed in attributes
 
diff --git a/tests/ui/augmented-assignments.rs b/tests/ui/augmented-assignments.rs
index 8b263e03593..440a4a7fd65 100644
--- a/tests/ui/augmented-assignments.rs
+++ b/tests/ui/augmented-assignments.rs
@@ -17,7 +17,6 @@ fn main() {
     x;
     //~^ ERROR cannot move out of `x` because it is borrowed
     //~| move out of `x` occurs here
-    //~| HELP consider cloning
 
     let y = Int(2);
     //~^ HELP consider changing this to be mutable
diff --git a/tests/ui/augmented-assignments.stderr b/tests/ui/augmented-assignments.stderr
index 6b2900dd5d1..a4b75cbf6e8 100644
--- a/tests/ui/augmented-assignments.stderr
+++ b/tests/ui/augmented-assignments.stderr
@@ -8,14 +8,9 @@ LL |     x
 ...
 LL |     x;
    |     ^ move out of `x` occurs here
-   |
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |     x.clone();
-   |      ++++++++
 
 error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
-  --> $DIR/augmented-assignments.rs:25:5
+  --> $DIR/augmented-assignments.rs:24:5
    |
 LL |     y
    |     ^ cannot borrow as mutable
diff --git a/tests/ui/backtrace/synchronized-panic-handler.rs b/tests/ui/backtrace/synchronized-panic-handler.rs
index 00eb249da1d..29431ae3c45 100644
--- a/tests/ui/backtrace/synchronized-panic-handler.rs
+++ b/tests/ui/backtrace/synchronized-panic-handler.rs
@@ -3,6 +3,7 @@
 //@ edition:2021
 //@ exec-env:RUST_BACKTRACE=0
 //@ needs-threads
+//@ needs-unwind
 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 b7c815a94c8..8a06d00ea59 100644
--- a/tests/ui/backtrace/synchronized-panic-handler.run.stderr
+++ b/tests/ui/backtrace/synchronized-panic-handler.run.stderr
@@ -1,5 +1,5 @@
-thread '<unnamed>' panicked at $DIR/synchronized-panic-handler.rs:10:5:
+thread '<unnamed>' panicked at $DIR/synchronized-panic-handler.rs:11:5:
 oops oh no woe is me
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-thread '<unnamed>' panicked at $DIR/synchronized-panic-handler.rs:10:5:
+thread '<unnamed>' panicked at $DIR/synchronized-panic-handler.rs:11:5:
 oops oh no woe is me
diff --git a/tests/ui/binop/binop-move-semantics.stderr b/tests/ui/binop/binop-move-semantics.stderr
index 83c27590e90..45c7f110406 100644
--- a/tests/ui/binop/binop-move-semantics.stderr
+++ b/tests/ui/binop/binop-move-semantics.stderr
@@ -65,7 +65,7 @@ help: if `T` implemented `Clone`, you could clone the value
 LL | fn move_borrowed<T: Add<Output=()>>(x: T, mut y: T) {
    |                  ^ consider constraining this type parameter with `Clone`
 LL |     let m = &x;
-   |             -- you could clone this value
+   |              - you could clone this value
 
 error[E0505]: cannot move out of `y` because it is borrowed
   --> $DIR/binop-move-semantics.rs:23:5
@@ -88,7 +88,7 @@ LL | fn move_borrowed<T: Add<Output=()>>(x: T, mut y: T) {
    |                  ^ consider constraining this type parameter with `Clone`
 LL |     let m = &x;
 LL |     let n = &mut y;
-   |             ------ you could clone this value
+   |                  - you could clone this value
 
 error[E0507]: cannot move out of `*m` which is behind a mutable reference
   --> $DIR/binop-move-semantics.rs:30:5
diff --git a/tests/ui/borrowck/borrow-tuple-fields.stderr b/tests/ui/borrowck/borrow-tuple-fields.stderr
index 8ea7a9a4989..277c335cfcc 100644
--- a/tests/ui/borrowck/borrow-tuple-fields.stderr
+++ b/tests/ui/borrowck/borrow-tuple-fields.stderr
@@ -13,9 +13,8 @@ LL |     r.use_ref();
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let r = &x.0;
-LL +     let r = x.0.clone();
-   |
+LL |     let r = &x.0.clone();
+   |                 ++++++++
 
 error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immutable
   --> $DIR/borrow-tuple-fields.rs:18:13
@@ -51,9 +50,8 @@ LL |     r.use_ref();
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let r = &x.0;
-LL +     let r = x.0.clone();
-   |
+LL |     let r = &x.0.clone();
+   |                 ++++++++
 
 error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immutable
   --> $DIR/borrow-tuple-fields.rs:33:13
diff --git a/tests/ui/borrowck/borrowck-bad-nested-calls-move.stderr b/tests/ui/borrowck/borrowck-bad-nested-calls-move.stderr
index b96949fbb0e..5e7eee0422e 100644
--- a/tests/ui/borrowck/borrowck-bad-nested-calls-move.stderr
+++ b/tests/ui/borrowck/borrowck-bad-nested-calls-move.stderr
@@ -14,7 +14,7 @@ LL |         a);
 help: consider cloning the value if the performance cost is acceptable
    |
 LL -         &*a,
-LL +         a.clone(),
+LL +         &a.clone(),
    |
 
 error[E0505]: cannot move out of `a` because it is borrowed
@@ -32,7 +32,7 @@ LL |         a);
 help: consider cloning the value if the performance cost is acceptable
    |
 LL -         &*a,
-LL +         a.clone(),
+LL +         &a.clone(),
    |
 
 error: aborting due to 2 previous errors
diff --git a/tests/ui/borrowck/borrowck-field-sensitivity.stderr b/tests/ui/borrowck/borrowck-field-sensitivity.stderr
index ea552ff7820..b30dd144a4d 100644
--- a/tests/ui/borrowck/borrowck-field-sensitivity.stderr
+++ b/tests/ui/borrowck/borrowck-field-sensitivity.stderr
@@ -52,9 +52,8 @@ LL |     drop(**p);
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let p = &x.b;
-LL +     let p = x.b.clone();
-   |
+LL |     let p = &x.b.clone();
+   |                 ++++++++
 
 error[E0505]: cannot move out of `x.b` because it is borrowed
   --> $DIR/borrowck-field-sensitivity.rs:41:14
@@ -70,9 +69,8 @@ LL |     drop(**p);
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let p = &x.b;
-LL +     let p = x.b.clone();
-   |
+LL |     let p = &x.b.clone();
+   |                 ++++++++
 
 error[E0499]: cannot borrow `x.a` as mutable more than once at a time
   --> $DIR/borrowck-field-sensitivity.rs:48:13
diff --git a/tests/ui/borrowck/borrowck-issue-48962.stderr b/tests/ui/borrowck/borrowck-issue-48962.stderr
index 6e821a4c6b0..ee174f6736e 100644
--- a/tests/ui/borrowck/borrowck-issue-48962.stderr
+++ b/tests/ui/borrowck/borrowck-issue-48962.stderr
@@ -17,11 +17,6 @@ LL |     {src};
    |      --- value moved here
 LL |     src.0 = 66;
    |     ^^^^^^^^^^ value used here after move
-   |
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |     {src.clone()};
-   |         ++++++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/borrowck/borrowck-loan-blocks-move-cc.stderr b/tests/ui/borrowck/borrowck-loan-blocks-move-cc.stderr
index 370ae058f44..d9af5cf7d12 100644
--- a/tests/ui/borrowck/borrowck-loan-blocks-move-cc.stderr
+++ b/tests/ui/borrowck/borrowck-loan-blocks-move-cc.stderr
@@ -16,9 +16,8 @@ LL |     w.use_ref();
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let w = &v;
-LL +     let w = v.clone();
-   |
+LL |     let w = &v.clone();
+   |               ++++++++
 
 error[E0505]: cannot move out of `v` because it is borrowed
   --> $DIR/borrowck-loan-blocks-move-cc.rs:24:19
@@ -38,9 +37,8 @@ LL |     w.use_ref();
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let w = &v;
-LL +     let w = v.clone();
-   |
+LL |     let w = &v.clone();
+   |               ++++++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/borrowck/borrowck-loan-blocks-move.stderr b/tests/ui/borrowck/borrowck-loan-blocks-move.stderr
index 8a8005dbb83..1698035f20f 100644
--- a/tests/ui/borrowck/borrowck-loan-blocks-move.stderr
+++ b/tests/ui/borrowck/borrowck-loan-blocks-move.stderr
@@ -12,9 +12,8 @@ LL |     w.use_ref();
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let w = &v;
-LL +     let w = v.clone();
-   |
+LL |     let w = &v.clone();
+   |               ++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr b/tests/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr
index a23a203d999..b78c374c456 100644
--- a/tests/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr
+++ b/tests/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr
@@ -13,9 +13,8 @@ LL |     b.use_ref();
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let b = &a;
-LL +     let b = a.clone();
-   |
+LL |     let b = &a.clone();
+   |               ++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/borrowck/borrowck-move-mut-base-ptr.stderr b/tests/ui/borrowck/borrowck-move-mut-base-ptr.stderr
index acf426906c3..4b9351b64a0 100644
--- a/tests/ui/borrowck/borrowck-move-mut-base-ptr.stderr
+++ b/tests/ui/borrowck/borrowck-move-mut-base-ptr.stderr
@@ -14,7 +14,7 @@ LL |     p.use_ref();
 help: consider cloning the value if the performance cost is acceptable
    |
 LL -     let p: &isize = &*t0; // Freezes `*t0`
-LL +     let p: &isize = t0.clone(); // Freezes `*t0`
+LL +     let p: &isize = &t0.clone(); // Freezes `*t0`
    |
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/borrowck/borrowck-move-subcomponent.stderr b/tests/ui/borrowck/borrowck-move-subcomponent.stderr
index cc6c3bdeb10..b5dc01f180b 100644
--- a/tests/ui/borrowck/borrowck-move-subcomponent.stderr
+++ b/tests/ui/borrowck/borrowck-move-subcomponent.stderr
@@ -17,7 +17,7 @@ LL | struct S {
    | ^^^^^^^^ consider implementing `Clone` for this type
 ...
 LL |   let pb = &a;
-   |            -- you could clone this value
+   |             - you could clone this value
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/borrowck/borrowck-multiple-captures.stderr b/tests/ui/borrowck/borrowck-multiple-captures.stderr
index fdac4c27cee..01b648ea647 100644
--- a/tests/ui/borrowck/borrowck-multiple-captures.stderr
+++ b/tests/ui/borrowck/borrowck-multiple-captures.stderr
@@ -17,9 +17,8 @@ LL |     borrow(&*p1);
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let p1 = &x1;
-LL +     let p1 = x1.clone();
-   |
+LL |     let p1 = &x1.clone();
+   |                 ++++++++
 
 error[E0505]: cannot move out of `x2` because it is borrowed
   --> $DIR/borrowck-multiple-captures.rs:12:19
@@ -39,9 +38,8 @@ LL |     borrow(&*p2);
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let p2 = &x2;
-LL +     let p2 = x2.clone();
-   |
+LL |     let p2 = &x2.clone();
+   |                 ++++++++
 
 error[E0382]: use of moved value: `x1`
   --> $DIR/borrowck-multiple-captures.rs:27:19
@@ -108,9 +106,8 @@ LL |     borrow(&*p);
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let p = &x;
-LL +     let p = x.clone();
-   |
+LL |     let p = &x.clone();
+   |               ++++++++
 
 error[E0382]: use of moved value: `x`
   --> $DIR/borrowck-multiple-captures.rs:52:14
diff --git a/tests/ui/borrowck/borrowck-overloaded-index-move-index.stderr b/tests/ui/borrowck/borrowck-overloaded-index-move-index.stderr
index 7f8cc74a715..3366853b8e2 100644
--- a/tests/ui/borrowck/borrowck-overloaded-index-move-index.stderr
+++ b/tests/ui/borrowck/borrowck-overloaded-index-move-index.stderr
@@ -11,6 +11,11 @@ LL |     println!("{}", f[s]);
 ...
 LL |     use_mut(rs);
    |             -- borrow later used here
+   |
+help: consider cloning the value if the performance cost is acceptable
+   |
+LL |     let rs = &mut s.clone();
+   |                    ++++++++
 
 error[E0505]: cannot move out of `s` because it is borrowed
   --> $DIR/borrowck-overloaded-index-move-index.rs:53:7
@@ -25,6 +30,11 @@ LL |     f[s] = 10;
 ...
 LL |     use_mut(rs);
    |             -- borrow later used here
+   |
+help: consider cloning the value if the performance cost is acceptable
+   |
+LL |     let rs = &mut s.clone();
+   |                    ++++++++
 
 error[E0382]: use of moved value: `s`
   --> $DIR/borrowck-overloaded-index-move-index.rs:53:7
diff --git a/tests/ui/borrowck/borrowck-unary-move.stderr b/tests/ui/borrowck/borrowck-unary-move.stderr
index 598ecb53778..0aec6d42630 100644
--- a/tests/ui/borrowck/borrowck-unary-move.stderr
+++ b/tests/ui/borrowck/borrowck-unary-move.stderr
@@ -13,7 +13,7 @@ LL |     *y
 help: consider cloning the value if the performance cost is acceptable
    |
 LL -     let y = &*x;
-LL +     let y = x.clone();
+LL +     let y = &x.clone();
    |
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/borrowck/clone-on-ref.stderr b/tests/ui/borrowck/clone-on-ref.stderr
index 19f040556f8..d5d21296a3f 100644
--- a/tests/ui/borrowck/clone-on-ref.stderr
+++ b/tests/ui/borrowck/clone-on-ref.stderr
@@ -38,7 +38,7 @@ help: if `T` implemented `Clone`, you could clone the value
 LL | fn bar<T: std::fmt::Display>(x: T) {
    |        ^ consider constraining this type parameter with `Clone`
 LL |     let a = &x;
-   |             -- you could clone this value
+   |              - you could clone this value
 help: consider further restricting this bound
    |
 LL | fn bar<T: std::fmt::Display + Clone>(x: T) {
@@ -66,7 +66,7 @@ LL | struct A;
    | ^^^^^^^^ consider implementing `Clone` for this type
 LL | fn qux(x: A) {
 LL |     let a = &x;
-   |             -- you could clone this value
+   |              - you could clone this value
 help: consider annotating `A` with `#[derive(Clone)]`
    |
 LL + #[derive(Clone)]
diff --git a/tests/ui/borrowck/issue-101119.stderr b/tests/ui/borrowck/issue-101119.stderr
index a894fa63ace..7fec81b59b3 100644
--- a/tests/ui/borrowck/issue-101119.stderr
+++ b/tests/ui/borrowck/issue-101119.stderr
@@ -18,14 +18,6 @@ LL | fn fill_segment(_: &mut State) {}
    |    ------------    ^^^^^^^^^^ this parameter takes ownership of the value
    |    |
    |    in this function
-note: if `State` implemented `Clone`, you could clone the value
-  --> $DIR/issue-101119.rs:1:1
-   |
-LL | struct State;
-   | ^^^^^^^^^^^^ consider implementing `Clone` for this type
-...
-LL |             fill_segment(state);
-   |                          ----- you could clone this value
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/btreemap/btreemap_dropck.stderr b/tests/ui/btreemap/btreemap_dropck.stderr
index 873f8cf9a01..e8f14552af2 100644
--- a/tests/ui/btreemap/btreemap_dropck.stderr
+++ b/tests/ui/btreemap/btreemap_dropck.stderr
@@ -12,9 +12,8 @@ LL | }
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let _map = BTreeMap::from_iter([((), PrintOnDrop(&s))]);
-LL +     let _map = BTreeMap::from_iter([((), PrintOnDrop(s.clone()))]);
-   |
+LL |     let _map = BTreeMap::from_iter([((), PrintOnDrop(&s.clone()))]);
+   |                                                        ++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/cast/dyn-tails-need-normalization.rs b/tests/ui/cast/dyn-tails-need-normalization.rs
new file mode 100644
index 00000000000..719e0e89243
--- /dev/null
+++ b/tests/ui/cast/dyn-tails-need-normalization.rs
@@ -0,0 +1,21 @@
+//@ check-pass
+
+trait Trait {
+    type Associated;
+}
+
+impl Trait for i32 {
+    type Associated = i64;
+}
+
+trait Generic<T> {}
+
+type TraitObject = dyn Generic<<i32 as Trait>::Associated>;
+
+struct Wrap(TraitObject);
+
+fn cast(x: *mut TraitObject) {
+    x as *mut Wrap;
+}
+
+fn main() {}
diff --git a/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.stderr b/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.current.stderr
index d1d598e603f..5a5b4bfcacf 100644
--- a/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.stderr
+++ b/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.current.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ptr-to-trait-obj-different-regions-id-trait.rs:21:17
+  --> $DIR/ptr-to-trait-obj-different-regions-id-trait.rs:24:17
    |
 LL | fn m<'a>() {
    |      -- lifetime `'a` defined here
diff --git a/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.next.stderr b/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.next.stderr
new file mode 100644
index 00000000000..5a5b4bfcacf
--- /dev/null
+++ b/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.next.stderr
@@ -0,0 +1,15 @@
+error: lifetime may not live long enough
+  --> $DIR/ptr-to-trait-obj-different-regions-id-trait.rs:24:17
+   |
+LL | fn m<'a>() {
+   |      -- lifetime `'a` defined here
+LL |     let unsend: *const dyn Cat<'a> = &();
+LL |     let _send = unsend as *const S<dyn Cat<'static>>;
+   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
+   |
+   = note: requirement occurs because of the type `S<dyn Cat<'_>>`, which makes the generic argument `dyn Cat<'_>` invariant
+   = note: the struct `S<T>` is invariant over the parameter `T`
+   = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.rs b/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.rs
index cdd55e24392..f968dca4fd3 100644
--- a/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.rs
+++ b/tests/ui/cast/ptr-to-trait-obj-different-regions-id-trait.rs
@@ -1,3 +1,6 @@
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
 //@ check-fail
 //
 // Make sure we can't trick the compiler by using a projection.
diff --git a/tests/ui/cfg/disallowed-cli-cfgs-allow.rs b/tests/ui/cfg/disallowed-cli-cfgs-allow.rs
new file mode 100644
index 00000000000..0a9b07429d5
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs-allow.rs
@@ -0,0 +1,4 @@
+//@ check-pass
+//@ compile-flags: --cfg unix -Aexplicit_builtin_cfgs_in_flags
+
+fn main() {}
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.debug_assertions_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.debug_assertions_.stderr
new file mode 100644
index 00000000000..ec3e15b85c7
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.debug_assertions_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg debug_assertions` flag
+   |
+   = note: config `debug_assertions` is only supposed to be controlled by `-C debug-assertions`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.overflow_checks_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.overflow_checks_.stderr
new file mode 100644
index 00000000000..ba8ed3f2e65
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.overflow_checks_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg overflow_checks` flag
+   |
+   = note: config `overflow_checks` is only supposed to be controlled by `-C overflow-checks`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.panic_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.panic_.stderr
new file mode 100644
index 00000000000..5b375694b13
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.panic_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg panic="abort"` flag
+   |
+   = note: config `panic` is only supposed to be controlled by `-C panic`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.proc_macro_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.proc_macro_.stderr
new file mode 100644
index 00000000000..c2e29908857
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.proc_macro_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg proc_macro` flag
+   |
+   = note: config `proc_macro` is only supposed to be controlled by `--crate-type proc-macro`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.relocation_model_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.relocation_model_.stderr
new file mode 100644
index 00000000000..65ada551cba
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.relocation_model_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg relocation_model="a"` flag
+   |
+   = note: config `relocation_model` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.rs b/tests/ui/cfg/disallowed-cli-cfgs.rs
new file mode 100644
index 00000000000..714c01f4bc6
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.rs
@@ -0,0 +1,35 @@
+//@ check-fail
+//@ revisions: overflow_checks_ debug_assertions_ ub_checks_ sanitize_
+//@ revisions: sanitizer_cfi_generalize_pointers_ sanitizer_cfi_normalize_integers_
+//@ revisions: proc_macro_ panic_ target_feature_ unix_ windows_ target_abi_
+//@ revisions: target_arch_ target_endian_ target_env_ target_family_ target_os_
+//@ revisions: target_pointer_width_ target_vendor_ target_has_atomic_
+//@ revisions: target_has_atomic_equal_alignment_ target_has_atomic_load_store_
+//@ revisions: target_thread_local_ relocation_model_
+
+//@ [overflow_checks_]compile-flags: --cfg overflow_checks
+//@ [debug_assertions_]compile-flags: --cfg debug_assertions
+//@ [ub_checks_]compile-flags: --cfg ub_checks
+//@ [sanitize_]compile-flags: --cfg sanitize="cfi"
+//@ [sanitizer_cfi_generalize_pointers_]compile-flags: --cfg sanitizer_cfi_generalize_pointers
+//@ [sanitizer_cfi_normalize_integers_]compile-flags: --cfg sanitizer_cfi_normalize_integers
+//@ [proc_macro_]compile-flags: --cfg proc_macro
+//@ [panic_]compile-flags: --cfg panic="abort"
+//@ [target_feature_]compile-flags: --cfg target_feature="sse3"
+//@ [unix_]compile-flags: --cfg unix
+//@ [windows_]compile-flags: --cfg windows
+//@ [target_abi_]compile-flags: --cfg target_abi="gnu"
+//@ [target_arch_]compile-flags: --cfg target_arch="arm"
+//@ [target_endian_]compile-flags: --cfg target_endian="little"
+//@ [target_env_]compile-flags: --cfg target_env
+//@ [target_family_]compile-flags: --cfg target_family="unix"
+//@ [target_os_]compile-flags: --cfg target_os="linux"
+//@ [target_pointer_width_]compile-flags: --cfg target_pointer_width="32"
+//@ [target_vendor_]compile-flags: --cfg target_vendor
+//@ [target_has_atomic_]compile-flags: --cfg target_has_atomic="32"
+//@ [target_has_atomic_equal_alignment_]compile-flags: --cfg target_has_atomic_equal_alignment="32"
+//@ [target_has_atomic_load_store_]compile-flags: --cfg target_has_atomic_load_store="32"
+//@ [target_thread_local_]compile-flags: --cfg target_thread_local
+//@ [relocation_model_]compile-flags: --cfg relocation_model="a"
+
+fn main() {}
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.sanitize_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.sanitize_.stderr
new file mode 100644
index 00000000000..b1f3b19dd86
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.sanitize_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg sanitize="cfi"` flag
+   |
+   = note: config `sanitize` is only supposed to be controlled by `-Z sanitizer`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.sanitizer_cfi_generalize_pointers_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.sanitizer_cfi_generalize_pointers_.stderr
new file mode 100644
index 00000000000..49106f99b6b
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.sanitizer_cfi_generalize_pointers_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg sanitizer_cfi_generalize_pointers` flag
+   |
+   = note: config `sanitizer_cfi_generalize_pointers` is only supposed to be controlled by `-Z sanitizer=cfi`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.sanitizer_cfi_normalize_integers_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.sanitizer_cfi_normalize_integers_.stderr
new file mode 100644
index 00000000000..f9bb9e76297
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.sanitizer_cfi_normalize_integers_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg sanitizer_cfi_normalize_integers` flag
+   |
+   = note: config `sanitizer_cfi_normalize_integers` is only supposed to be controlled by `-Z sanitizer=cfi`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_abi_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_abi_.stderr
new file mode 100644
index 00000000000..f5c09110ce8
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.target_abi_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg target_abi="gnu"` flag
+   |
+   = note: config `target_abi` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_arch_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_arch_.stderr
new file mode 100644
index 00000000000..7f616e75d4e
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.target_arch_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg target_arch="arm"` flag
+   |
+   = note: config `target_arch` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_endian_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_endian_.stderr
new file mode 100644
index 00000000000..755f3708d67
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.target_endian_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg target_endian="little"` flag
+   |
+   = note: config `target_endian` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_env_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_env_.stderr
new file mode 100644
index 00000000000..ccd027dbebe
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.target_env_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg target_env` flag
+   |
+   = note: config `target_env` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_family_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_family_.stderr
new file mode 100644
index 00000000000..e376e4e16a1
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.target_family_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg target_family="unix"` flag
+   |
+   = note: config `target_family` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_feature_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_feature_.stderr
new file mode 100644
index 00000000000..457cca6b885
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.target_feature_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg target_feature="sse3"` flag
+   |
+   = note: config `target_feature` is only supposed to be controlled by `-C target-feature`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_.stderr
new file mode 100644
index 00000000000..160741198ad
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg target_has_atomic="32"` flag
+   |
+   = note: config `target_has_atomic` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_equal_alignment_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_equal_alignment_.stderr
new file mode 100644
index 00000000000..096490a03f6
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_equal_alignment_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg target_has_atomic_equal_alignment="32"` flag
+   |
+   = note: config `target_has_atomic_equal_alignment` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_load_store_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_load_store_.stderr
new file mode 100644
index 00000000000..5253987cb12
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_load_store_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg target_has_atomic_load_store="32"` flag
+   |
+   = note: config `target_has_atomic_load_store` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_os_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_os_.stderr
new file mode 100644
index 00000000000..ba2c967bfa1
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.target_os_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg target_os="linux"` flag
+   |
+   = note: config `target_os` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_pointer_width_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_pointer_width_.stderr
new file mode 100644
index 00000000000..983313bc517
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.target_pointer_width_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg target_pointer_width="32"` flag
+   |
+   = note: config `target_pointer_width` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_thread_local_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_thread_local_.stderr
new file mode 100644
index 00000000000..4f66ea17ee4
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.target_thread_local_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg target_thread_local` flag
+   |
+   = note: config `target_thread_local` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.target_vendor_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.target_vendor_.stderr
new file mode 100644
index 00000000000..e8f32598445
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.target_vendor_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg target_vendor` flag
+   |
+   = note: config `target_vendor` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.test_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.test_.stderr
new file mode 100644
index 00000000000..96b5beb0210
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.test_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg test` flag
+   |
+   = note: config `test` is only supposed to be controlled by `--test`
+   = note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information
+   = note: `#[deny(unexpected_builtin_cfgs)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.ub_checks_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.ub_checks_.stderr
new file mode 100644
index 00000000000..e61e5ac69d5
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.ub_checks_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg ub_checks` flag
+   |
+   = note: config `ub_checks` is only supposed to be controlled by `-Z ub-checks`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.unix_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.unix_.stderr
new file mode 100644
index 00000000000..f3c6bb0ef1b
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.unix_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg unix` flag
+   |
+   = note: config `unix` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/cfg/disallowed-cli-cfgs.windows_.stderr b/tests/ui/cfg/disallowed-cli-cfgs.windows_.stderr
new file mode 100644
index 00000000000..171a3f95bbd
--- /dev/null
+++ b/tests/ui/cfg/disallowed-cli-cfgs.windows_.stderr
@@ -0,0 +1,8 @@
+error: unexpected `--cfg windows` flag
+   |
+   = note: config `windows` is only supposed to be controlled by `--target`
+   = note: manually setting a built-in cfg can and does create incoherent behaviors
+   = note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/check-cfg/mix.stderr b/tests/ui/check-cfg/mix.stderr
index 57cbe173c78..520cffc4b02 100644
--- a/tests/ui/check-cfg/mix.stderr
+++ b/tests/ui/check-cfg/mix.stderr
@@ -251,7 +251,7 @@ warning: unexpected `cfg` condition value: `zebra`
 LL |     cfg!(target_feature = "zebra");
    |          ^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, and `avx512vpopcntdq` and 199 more
+   = note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, and `avx512vpopcntdq` and 201 more
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
 
 warning: 27 warnings emitted
diff --git a/tests/ui/check-cfg/well-known-values.stderr b/tests/ui/check-cfg/well-known-values.stderr
index 00abb5f5e5c..d780e04e729 100644
--- a/tests/ui/check-cfg/well-known-values.stderr
+++ b/tests/ui/check-cfg/well-known-values.stderr
@@ -165,7 +165,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
 LL |     target_feature = "_UNEXPECTED_VALUE",
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, `avx512vpopcntdq`, `avxifma`, `avxneconvert`, `avxvnni`, `avxvnniint16`, `avxvnniint8`, `backchain`, `bf16`, `bmi1`, `bmi2`, `bti`, `bulk-memory`, `c`, `cache`, `cmpxchg16b`, `crc`, `crt-static`, `d`, `d32`, `dit`, `doloop`, `dotprod`, `dpb`, `dpb2`, `dsp`, `dsp1e2`, `dspe60`, `e`, `e1`, `e2`, `edsp`, `elrw`, `ermsb`, `exception-handling`, `extended-const`, `f`, `f16c`, `f32mm`, `f64mm`, `fcma`, `fdivdu`, `fhm`, `flagm`, `float1e2`, `float1e3`, `float3e4`, `float7e60`, `floate1`, `fma`, `fp-armv8`, `fp16`, `fp64`, `fpuv2_df`, `fpuv2_sf`, `fpuv3_df`, `fpuv3_hf`, `fpuv3_hi`, `fpuv3_sf`, `frecipe`, `frintts`, `fxsr`, `gfni`, `hard-float`, `hard-float-abi`, `hard-tp`, `high-registers`, `hvx`, `hvx-length128b`, `hwdiv`, `i8mm`, `jsconv`, `lahfsahf`, `lasx`, `lbt`, `lor`, `lse`, `lsx`, `lvz`, `lzcnt`, `m`, `mclass`, `movbe`, `mp`, `mp1e2`, `msa`, `mte`, `multivalue`, `mutable-globals`, `neon`, `nontrapping-fptoint`, `nvic`, `paca`, `pacg`, `pan`, `pclmulqdq`, `pmuv3`, `popcnt`, `power10-vector`, `power8-altivec`, `power8-vector`, `power9-altivec`, `power9-vector`, `prfchw`, `rand`, `ras`, `rclass`, `rcpc`, `rcpc2`, `rdm`, `rdrand`, `rdseed`, `reference-types`, `relax`, `relaxed-simd`, `rtm`, `sb`, `sha`, `sha2`, `sha3`, `sign-ext`, `simd128`, `sm4`, `spe`, `ssbs`, `sse`, `sse2`, `sse3`, `sse4.1`, `sse4.2`, `sse4a`, `ssse3`, `sve`, `sve2`, `sve2-aes`, `sve2-bitperm`, `sve2-sha3`, `sve2-sm4`, `tbm`, `thumb-mode`, `thumb2`, `tme`, `trust`, `trustzone`, `ual`, `unaligned-scalar-mem`, `v`, `v5te`, `v6`, `v6k`, `v6t2`, `v7`, `v8`, `v8.1a`, `v8.2a`, `v8.3a`, `v8.4a`, `v8.5a`, `v8.6a`, `v8.7a`, `vaes`, `vdsp2e60f`, `vdspv1`, `vdspv2`, `vector`, `vfp2`, `vfp3`, `vfp4`, `vh`, `virt`, `virtualization`, `vpclmulqdq`, `vsx`, `xop`, `xsave`, `xsavec`, `xsaveopt`, `xsaves`, `zba`, `zbb`, `zbc`, `zbkb`, `zbkc`, `zbkx`, `zbs`, `zdinx`, `zfh`, `zfhmin`, `zfinx`, `zhinx`, `zhinxmin`, `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, and `zkt`
+   = note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, `avx512vpopcntdq`, `avxifma`, `avxneconvert`, `avxvnni`, `avxvnniint16`, `avxvnniint8`, `backchain`, `bf16`, `bmi1`, `bmi2`, `bti`, `bulk-memory`, `c`, `cache`, `cmpxchg16b`, `crc`, `crt-static`, `d`, `d32`, `dit`, `doloop`, `dotprod`, `dpb`, `dpb2`, `dsp`, `dsp1e2`, `dspe60`, `e`, `e1`, `e2`, `edsp`, `elrw`, `ermsb`, `exception-handling`, `extended-const`, `f`, `f16c`, `f32mm`, `f64mm`, `fcma`, `fdivdu`, `fhm`, `flagm`, `float1e2`, `float1e3`, `float3e4`, `float7e60`, `floate1`, `fma`, `fp-armv8`, `fp16`, `fp64`, `fpuv2_df`, `fpuv2_sf`, `fpuv3_df`, `fpuv3_hf`, `fpuv3_hi`, `fpuv3_sf`, `frecipe`, `frintts`, `fxsr`, `gfni`, `hard-float`, `hard-float-abi`, `hard-tp`, `high-registers`, `hvx`, `hvx-length128b`, `hwdiv`, `i8mm`, `jsconv`, `lahfsahf`, `lasx`, `lbt`, `lor`, `lse`, `lsx`, `lvz`, `lzcnt`, `m`, `mclass`, `movbe`, `mp`, `mp1e2`, `msa`, `mte`, `multivalue`, `mutable-globals`, `neon`, `nontrapping-fptoint`, `nvic`, `paca`, `pacg`, `pan`, `pclmulqdq`, `pmuv3`, `popcnt`, `power10-vector`, `power8-altivec`, `power8-vector`, `power9-altivec`, `power9-vector`, `prfchw`, `rand`, `ras`, `rclass`, `rcpc`, `rcpc2`, `rdm`, `rdrand`, `rdseed`, `reference-types`, `relax`, `relaxed-simd`, `rtm`, `sb`, `sha`, `sha2`, `sha3`, `sha512`, `sign-ext`, `simd128`, `sm3`, `sm4`, `spe`, `ssbs`, `sse`, `sse2`, `sse3`, `sse4.1`, `sse4.2`, `sse4a`, `ssse3`, `sve`, `sve2`, `sve2-aes`, `sve2-bitperm`, `sve2-sha3`, `sve2-sm4`, `tbm`, `thumb-mode`, `thumb2`, `tme`, `trust`, `trustzone`, `ual`, `unaligned-scalar-mem`, `v`, `v5te`, `v6`, `v6k`, `v6t2`, `v7`, `v8`, `v8.1a`, `v8.2a`, `v8.3a`, `v8.4a`, `v8.5a`, `v8.6a`, `v8.7a`, `vaes`, `vdsp2e60f`, `vdspv1`, `vdspv2`, `vector`, `vfp2`, `vfp3`, `vfp4`, `vh`, `virt`, `virtualization`, `vpclmulqdq`, `vsx`, `xop`, `xsave`, `xsavec`, `xsaveopt`, `xsaves`, `zba`, `zbb`, `zbc`, `zbkb`, `zbkc`, `zbkx`, `zbs`, `zdinx`, `zfh`, `zfhmin`, `zfinx`, `zhinx`, `zhinxmin`, `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, and `zkt`
    = 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`
diff --git a/tests/ui/closures/2229_closure_analysis/run_pass/multivariant.rs b/tests/ui/closures/2229_closure_analysis/run_pass/multivariant.rs
index 52ed008137f..74f37b514e4 100644
--- a/tests/ui/closures/2229_closure_analysis/run_pass/multivariant.rs
+++ b/tests/ui/closures/2229_closure_analysis/run_pass/multivariant.rs
@@ -1,10 +1,9 @@
 // Test precise capture of a multi-variant enum (when remaining variants are
 // visibly uninhabited).
-//@ revisions: min_exhaustive_patterns exhaustive_patterns
+//@ revisions: normal exhaustive_patterns
 //@ edition:2021
 //@ run-pass
 #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
-#![cfg_attr(min_exhaustive_patterns, feature(min_exhaustive_patterns))]
 #![feature(never_type)]
 
 pub fn main() {
diff --git a/tests/ui/codemap_tests/huge_multispan_highlight.svg b/tests/ui/codemap_tests/huge_multispan_highlight.svg
index 7b6dbb17c6f..12058176dc0 100644
--- a/tests/ui/codemap_tests/huge_multispan_highlight.svg
+++ b/tests/ui/codemap_tests/huge_multispan_highlight.svg
@@ -1,4 +1,4 @@
-<svg width="740px" height="848px" xmlns="http://www.w3.org/2000/svg">
+<svg width="818px" height="848px" xmlns="http://www.w3.org/2000/svg">
   <style>
     .fg { fill: #AAAAAA }
     .bg { background: #000000 }
diff --git a/tests/ui/coherence/normalize-for-errors.next.stderr b/tests/ui/coherence/normalize-for-errors.next.stderr
index 6c56a917741..634a10b7a14 100644
--- a/tests/ui/coherence/normalize-for-errors.next.stderr
+++ b/tests/ui/coherence/normalize-for-errors.next.stderr
@@ -7,6 +7,7 @@ LL |
 LL | impl<S: Iterator> MyTrait<S> for (Box<<(MyType,) as Mirror>::Assoc>, S::Item) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(Box<(MyType,)>, <_ as Iterator>::Item)`
    |
+   = note: upstream crates may add a new impl of trait `std::clone::Clone` for type `(MyType,)` in future versions
    = note: upstream crates may add a new impl of trait `std::marker::Copy` for type `std::boxed::Box<(MyType,)>` in future versions
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/coherence/normalize-for-errors.rs b/tests/ui/coherence/normalize-for-errors.rs
index 2288118676a..4188389a3ad 100644
--- a/tests/ui/coherence/normalize-for-errors.rs
+++ b/tests/ui/coherence/normalize-for-errors.rs
@@ -18,5 +18,6 @@ impl<S: Iterator> MyTrait<S> for (Box<<(MyType,) as Mirror>::Assoc>, S::Item) {}
 //~^ ERROR conflicting implementations of trait `MyTrait<_>` for type `(Box<(MyType,)>,
 //~| NOTE conflicting implementation for `(Box<(MyType,)>,
 //~| NOTE upstream crates may add a new impl of trait `std::marker::Copy` for type `std::boxed::Box<(MyType,)>` in future versions
+//[next]~| NOTE upstream crates may add a new impl of trait `std::clone::Clone` for type `(MyType,)` in future versions
 
 fn main() {}
diff --git a/tests/ui/coherence/re-rebalance-coherence.rs b/tests/ui/coherence/re-rebalance-coherence.rs
index 5383a634617..9c176d5b1b1 100644
--- a/tests/ui/coherence/re-rebalance-coherence.rs
+++ b/tests/ui/coherence/re-rebalance-coherence.rs
@@ -4,7 +4,6 @@
 extern crate re_rebalance_coherence_lib as lib;
 use lib::*;
 
-#[allow(dead_code)]
 struct Oracle;
 impl Backend for Oracle {}
 impl<'a, T:'a, Tab> QueryFragment<Oracle> for BatchInsert<'a, T, Tab> {}
diff --git a/tests/ui/coherence/super-traits/super-trait-knowable-1.current.stderr b/tests/ui/coherence/super-traits/super-trait-knowable-1.current.stderr
new file mode 100644
index 00000000000..fb01cf158d9
--- /dev/null
+++ b/tests/ui/coherence/super-traits/super-trait-knowable-1.current.stderr
@@ -0,0 +1,13 @@
+error[E0119]: conflicting implementations of trait `Overlap<_>` for type `()`
+  --> $DIR/super-trait-knowable-1.rs:16:1
+   |
+LL | impl<T, U: Sub<T>> Overlap<T> for U {}
+   | ----------------------------------- first implementation here
+LL | impl<T> Overlap<T> for () {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
+   |
+   = note: downstream crates may implement trait `Sub<_>` for type `()`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/coherence/super-traits/super-trait-knowable-1.rs b/tests/ui/coherence/super-traits/super-trait-knowable-1.rs
new file mode 100644
index 00000000000..80df8c19ee5
--- /dev/null
+++ b/tests/ui/coherence/super-traits/super-trait-knowable-1.rs
@@ -0,0 +1,19 @@
+// Added in #124532. While `(): Super` is knowable, `(): Sub<?t>` is not.
+//
+// We therefore elaborate super trait bounds in the implicit negative
+// overlap check.
+
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
+//@[next] check-pass
+
+trait Super {}
+trait Sub<T>: Super {}
+
+trait Overlap<T> {}
+impl<T, U: Sub<T>> Overlap<T> for U {}
+impl<T> Overlap<T> for () {}
+//[current]~^ ERROR conflicting implementations
+
+fn main() {}
diff --git a/tests/ui/coherence/super-traits/super-trait-knowable-2.rs b/tests/ui/coherence/super-traits/super-trait-knowable-2.rs
new file mode 100644
index 00000000000..d1f2e8d1c1a
--- /dev/null
+++ b/tests/ui/coherence/super-traits/super-trait-knowable-2.rs
@@ -0,0 +1,33 @@
+// A regression test for pyella-0.1.5 which broke when
+// enabling the new solver in coherence.
+//
+// `Tensor: TensorValue` is knowable while `Tensor: TensorOp<?t2>`
+// may be implemented downstream. We previously didn't check the
+// super trait bound in coherence, causing these impls to overlap.
+//
+// However, we did fail to normalize `<Tensor as TensorValue::Unmasked`
+// which caused the old solver to emit a `Tensor: TensorValue` goal in
+// `fn normalize_to_error` which then failed, causing this test to pass.
+
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
+//@ check-pass
+
+pub trait TensorValue {
+    type Unmasked;
+}
+
+trait TensorCompare<T> {}
+pub trait TensorOp<T>: TensorValue {}
+
+pub struct Tensor;
+impl<T2> TensorCompare<T2> for Tensor {}
+impl<T1, T2> TensorCompare<T2> for T1
+where
+    T1: TensorOp<T2>,
+    T1::Unmasked: Sized,
+{}
+
+
+fn main() {}
diff --git a/tests/ui/coherence/super-traits/super-trait-knowable-3.current.stderr b/tests/ui/coherence/super-traits/super-trait-knowable-3.current.stderr
new file mode 100644
index 00000000000..542edb8b7f6
--- /dev/null
+++ b/tests/ui/coherence/super-traits/super-trait-knowable-3.current.stderr
@@ -0,0 +1,13 @@
+error[E0119]: conflicting implementations of trait `Overlap<_>` for type `()`
+  --> $DIR/super-trait-knowable-3.rs:19:1
+   |
+LL | impl<T, U: Bound<W<T>>> Overlap<T> for U {}
+   | ---------------------------------------- first implementation here
+LL | impl<T> Overlap<T> for () {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
+   |
+   = note: downstream crates may implement trait `Sub<_>` for type `()`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/coherence/super-traits/super-trait-knowable-3.rs b/tests/ui/coherence/super-traits/super-trait-knowable-3.rs
new file mode 100644
index 00000000000..295d7ac48d8
--- /dev/null
+++ b/tests/ui/coherence/super-traits/super-trait-knowable-3.rs
@@ -0,0 +1,22 @@
+// Unlike in `super-trait-knowable-1.rs`, the knowable
+// super trait bound is in a nested goal so this would not
+// compile if we were to only elaborate root goals.
+
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
+//@[next] check-pass
+
+trait Super {}
+trait Sub<T>: Super {}
+
+struct W<T>(T);
+trait Bound<T> {}
+impl<T: Sub<U>, U> Bound<W<U>> for T {}
+
+trait Overlap<T> {}
+impl<T, U: Bound<W<T>>> Overlap<T> for U {}
+impl<T> Overlap<T> for () {}
+//[current]~^ ERROR conflicting implementations of trait `Overlap<_>` for type `()`
+
+fn main() {}
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
new file mode 100644
index 00000000000..311f507d3c7
--- /dev/null
+++ b/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.rs
@@ -0,0 +1,28 @@
+// This ensures we don't ICE in situations like rust-lang/rust#126272.
+
+#![feature(adt_const_params)]
+#![allow(incomplete_features)]
+
+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
+    //~| ERROR the size for values
+    //~| ERROR binary operation `==` cannot
+    //~| ERROR the trait bound `dyn Debug: Eq`
+    //~| ERROR the size for values
+}
+
+#[derive(Debug, PartialEq, Eq, ConstParamTy)]
+struct Bar<T>(T);
+
+struct Test<const F: Foo>;
+
+fn main() {
+    let x: Test<{ Foo { nested: &Bar(4) } }> = Test;
+    //~^ 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
new file mode 100644
index 00000000000..1c30aa68e85
--- /dev/null
+++ b/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.stderr
@@ -0,0 +1,160 @@
+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
+   |
+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
+   |
+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
+   |
+LL | struct Bar<T>(T);
+   |            ^  - ...if indirection were used here: `Box<T>`
+   |            |
+   |            this could be changed to `T: ?Sized`...
+
+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: this error originates in the derive macro `ConstParamTy` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+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
+   |
+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
+   |
+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
+   |
+LL |     nested: &'static Bar<dyn std::fmt::Debug>,
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: this error originates in the derive macro `ConstParamTy` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+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
+   |
+LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
+   |          ----- in this derive macro expansion
+...
+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)`, which is required by `&&'static Bar<(dyn Debug + 'static)>: Debug`
+   = 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
+   |
+LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
+   |          ^^^^^
+LL | struct Bar<T>(T);
+   |            - unsatisfied trait bound introduced in this `derive` macro
+   = note: 2 redundant requirements hidden
+   = note: required for `&&'static Bar<(dyn Debug + 'static)>` to implement `Debug`
+   = note: required for the cast from `&&&'static Bar<(dyn Debug + 'static)>` to `&dyn Debug`
+   = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0369]: binary operation `==` cannot be applied to type `&Bar<dyn Debug>`
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:12:5
+   |
+LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
+   |                 --------- in this derive macro expansion
+...
+LL |     nested: &'static Bar<dyn std::fmt::Debug>,
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0277]: the trait bound `dyn Debug: Eq` is not satisfied
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:12:5
+   |
+LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
+   |                            -- in this derive macro expansion
+...
+LL |     nested: &'static Bar<dyn std::fmt::Debug>,
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `dyn Debug`, which is required by `&'static Bar<dyn Debug>: Eq`
+   |
+   = 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
+   |
+LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
+   |                            ^^ unsatisfied trait bound introduced in this `derive` macro
+   = note: 1 redundant requirement hidden
+   = note: required for `&'static Bar<dyn Debug>` to implement `Eq`
+note: required by a bound in `AssertParamIsEq`
+  --> $SRC_DIR/core/src/cmp.rs:LL:COL
+   = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:12:5
+   |
+LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
+   |                            -- in this derive macro expansion
+...
+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`
+note: required by an implicit `Sized` bound in `Bar`
+  --> $DIR/unsizing-wfcheck-issue-126272.rs:21: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
+   |
+LL | struct Bar<T>(T);
+   |            ^  - ...if indirection were used here: `Box<T>`
+   |            |
+   |            this could be changed to `T: ?Sized`...
+   = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+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
+   |
+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
+   |
+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
+   |
+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
+
+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/cross_crate_complex.rs b/tests/ui/const-generics/cross_crate_complex.rs
index b44d889f5e9..d13b69aa0cf 100644
--- a/tests/ui/const-generics/cross_crate_complex.rs
+++ b/tests/ui/const-generics/cross_crate_complex.rs
@@ -11,7 +11,6 @@ async fn foo() {
     async_in_foo(async_out_foo::<4>().await).await;
 }
 
-#[allow(dead_code)]
 struct Faz<const N: usize>;
 
 impl<const N: usize> Foo<N> for Faz<N> {}
diff --git a/tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.rs b/tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.rs
index 5c9323261a9..9eb33acbb24 100644
--- a/tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.rs
+++ b/tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.rs
@@ -3,7 +3,7 @@ trait Trait {
 }
 impl Trait for () {
     fn foo<const M: u64>() {}
-    //~^ error: method `foo` has an incompatible generic parameter for trait
+    //~^ error: associated function `foo` has an incompatible generic parameter for trait
 }
 
 trait Other {
@@ -11,7 +11,7 @@ trait Other {
 }
 impl Other for () {
     fn bar<T>() {}
-    //~^ error: method `bar` has an incompatible generic parameter for trait
+    //~^ error: associated function `bar` has an incompatible generic parameter for trait
 }
 
 trait Uwu {
@@ -19,7 +19,7 @@ trait Uwu {
 }
 impl Uwu for () {
     fn baz<const N: i32>() {}
-    //~^ error: method `baz` has an incompatible generic parameter for trait
+    //~^ error: associated function `baz` has an incompatible generic parameter for trait
 }
 
 trait Aaaaaa {
@@ -27,7 +27,7 @@ trait Aaaaaa {
 }
 impl Aaaaaa for () {
     fn bbbb<T, const N: u32>() {}
-    //~^ error: method `bbbb` has an incompatible generic parameter for trait
+    //~^ error: associated function `bbbb` has an incompatible generic parameter for trait
 }
 
 trait Names {
@@ -35,7 +35,7 @@ trait Names {
 }
 impl Names for () {
     fn abcd<const N: u32, T>() {}
-    //~^ error: method `abcd` has an incompatible generic parameter for trait
+    //~^ error: associated function `abcd` has an incompatible generic parameter for trait
 }
 
 fn main() {}
diff --git a/tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr b/tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr
index 3455f2c8ea9..7ec162e1c29 100644
--- a/tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr
+++ b/tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.stderr
@@ -1,4 +1,4 @@
-error[E0053]: method `foo` has an incompatible generic parameter for trait `Trait`
+error[E0053]: associated function `foo` has an incompatible generic parameter for trait `Trait`
   --> $DIR/mismatched_ty_const_in_trait_impl.rs:5:12
    |
 LL | trait Trait {
@@ -11,7 +11,7 @@ LL | impl Trait for () {
 LL |     fn foo<const M: u64>() {}
    |            ^^^^^^^^^^^^ found const parameter of type `u64`
 
-error[E0053]: method `bar` has an incompatible generic parameter for trait `Other`
+error[E0053]: associated function `bar` has an incompatible generic parameter for trait `Other`
   --> $DIR/mismatched_ty_const_in_trait_impl.rs:13:12
    |
 LL | trait Other {
@@ -24,7 +24,7 @@ LL | impl Other for () {
 LL |     fn bar<T>() {}
    |            ^ found type parameter
 
-error[E0053]: method `baz` has an incompatible generic parameter for trait `Uwu`
+error[E0053]: associated function `baz` has an incompatible generic parameter for trait `Uwu`
   --> $DIR/mismatched_ty_const_in_trait_impl.rs:21:12
    |
 LL | trait Uwu {
@@ -37,7 +37,7 @@ LL | impl Uwu for () {
 LL |     fn baz<const N: i32>() {}
    |            ^^^^^^^^^^^^ found const parameter of type `i32`
 
-error[E0053]: method `bbbb` has an incompatible generic parameter for trait `Aaaaaa`
+error[E0053]: associated function `bbbb` has an incompatible generic parameter for trait `Aaaaaa`
   --> $DIR/mismatched_ty_const_in_trait_impl.rs:29:13
    |
 LL | trait Aaaaaa {
@@ -50,7 +50,7 @@ LL | impl Aaaaaa for () {
 LL |     fn bbbb<T, const N: u32>() {}
    |             ^ found type parameter
 
-error[E0053]: method `abcd` has an incompatible generic parameter for trait `Names`
+error[E0053]: associated function `abcd` has an incompatible generic parameter for trait `Names`
   --> $DIR/mismatched_ty_const_in_trait_impl.rs:37:13
    |
 LL | trait Names {
diff --git a/tests/ui/const-generics/defaults/repr-c-issue-82792.rs b/tests/ui/const-generics/defaults/repr-c-issue-82792.rs
index 4bf2fa761ea..c23187598bc 100644
--- a/tests/ui/const-generics/defaults/repr-c-issue-82792.rs
+++ b/tests/ui/const-generics/defaults/repr-c-issue-82792.rs
@@ -2,7 +2,6 @@
 
 //@ run-pass
 
-#[allow(dead_code)]
 #[repr(C)]
 pub struct Loaf<T: Sized, const N: usize = 1> {
     head: [T; N],
diff --git a/tests/ui/const-generics/generic_const_exprs/associated-consts.rs b/tests/ui/const-generics/generic_const_exprs/associated-consts.rs
index 50a6102c605..5d2198f50ad 100644
--- a/tests/ui/const-generics/generic_const_exprs/associated-consts.rs
+++ b/tests/ui/const-generics/generic_const_exprs/associated-consts.rs
@@ -16,8 +16,7 @@ impl BlockCipher for BarCipher {
     const BLOCK_SIZE: usize = 32;
 }
 
-#[allow(dead_code)]
-pub struct Block<C>(C);
+pub struct Block<C>(#[allow(dead_code)] C);
 
 pub fn test<C: BlockCipher, const M: usize>()
 where
diff --git a/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.rs b/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.rs
index 4ba696f4ae0..9f20cf08579 100644
--- a/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.rs
+++ b/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.rs
@@ -9,9 +9,10 @@ fn bug<const N: Nat>(&self)
 where
     for<const N: usize = 3, T = u32> [(); COT::BYTES]:,
     //~^ ERROR only lifetime parameters can be used in this context
-    //~^^ ERROR defaults for generic parameters are not allowed in `for<...>` binders
-    //~^^^ ERROR defaults for generic parameters are not allowed in `for<...>` binders
-    //~^^^^ ERROR failed to resolve: use of undeclared type `COT`
+    //~| ERROR defaults for generic parameters are not allowed in `for<...>` binders
+    //~| ERROR defaults for generic parameters are not allowed in `for<...>` binders
+    //~| ERROR failed to resolve: use of undeclared type `COT`
+    //~| ERROR  the name `N` is already used for a generic parameter in this item's generic parameters
 {
 }
 
diff --git a/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr b/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr
index ee0ec38ab06..6037e685e44 100644
--- a/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr
@@ -6,6 +6,15 @@ LL | fn bug<const N: Nat>(&self)
    |
    = note: associated functions are those in `impl` or `trait` definitions
 
+error[E0403]: the name `N` is already used for a generic parameter in this item's generic parameters
+  --> $DIR/ice-predicates-of-no-entry-found-for-key-119275.rs:10:15
+   |
+LL | fn bug<const N: Nat>(&self)
+   |              - first use of `N`
+...
+LL |     for<const N: usize = 3, T = u32> [(); COT::BYTES]:,
+   |               ^ already used
+
 error[E0412]: cannot find type `Nat` in this scope
   --> $DIR/ice-predicates-of-no-entry-found-for-key-119275.rs:6:17
    |
@@ -40,7 +49,7 @@ error[E0433]: failed to resolve: use of undeclared type `COT`
 LL |     for<const N: usize = 3, T = u32> [(); COT::BYTES]:,
    |                                           ^^^ use of undeclared type `COT`
 
-error: aborting due to 6 previous errors
+error: aborting due to 7 previous errors
 
-Some errors have detailed explanations: E0412, E0433, E0658.
-For more information about an error, try `rustc --explain E0412`.
+Some errors have detailed explanations: E0403, E0412, E0433, E0658.
+For more information about an error, try `rustc --explain E0403`.
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-105608.stderr b/tests/ui/const-generics/generic_const_exprs/issue-105608.stderr
index 09b618fb3f0..1c97eaddfe1 100644
--- a/tests/ui/const-generics/generic_const_exprs/issue-105608.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/issue-105608.stderr
@@ -4,10 +4,6 @@ error[E0282]: type annotations needed
 LL |     Combination::<0>.and::<_>().and::<_>();
    |                      ^^^ cannot infer type of the type parameter `M` declared on the method `and`
    |
-help: consider specifying the generic argument
-   |
-LL |     Combination::<0>.and::<_>().and::<_>();
-   |                         ~~~~~
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr
index 8d59235e2f4..01529599d37 100644
--- a/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/issue-80742.stderr
@@ -1,4 +1,4 @@
-error: internal compiler error: compiler/rustc_const_eval/src/interpret/step.rs:LL:CC: SizeOf MIR operator called for unsized type dyn Debug
+error: internal compiler error: compiler/rustc_const_eval/src/interpret/operator.rs:LL:CC: unsized type for `NullaryOp::SizeOf`
   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
 
 Box<dyn Any>
diff --git a/tests/ui/const-generics/generic_const_exprs/no_where_clause.rs b/tests/ui/const-generics/generic_const_exprs/no_where_clause.rs
index 77cce66e4ec..53230469491 100644
--- a/tests/ui/const-generics/generic_const_exprs/no_where_clause.rs
+++ b/tests/ui/const-generics/generic_const_exprs/no_where_clause.rs
@@ -17,6 +17,7 @@ impl<const N: usize> Example<N> {
       a: [0.; N],
       b: [0.; complex_maths(N)],
       //~^ ERROR: unconstrained generic constant
+      //~| ERROR: unconstrained generic constant
     }
   }
 }
diff --git a/tests/ui/const-generics/generic_const_exprs/no_where_clause.stderr b/tests/ui/const-generics/generic_const_exprs/no_where_clause.stderr
index a2680eac039..88fc68a4d1b 100644
--- a/tests/ui/const-generics/generic_const_exprs/no_where_clause.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/no_where_clause.stderr
@@ -10,6 +10,17 @@ LL | pub struct Example<const N: usize> where [(); complex_maths(N)]: {
    |                                    +++++++++++++++++++++++++++++
 
 error: unconstrained generic constant
+  --> $DIR/no_where_clause.rs:18:10
+   |
+LL |       b: [0.; complex_maths(N)],
+   |          ^^^^^^^^^^^^^^^^^^^^^^
+   |
+help: try adding a `where` bound
+   |
+LL |   pub fn new() -> Self where [(); complex_maths(N)]: {
+   |                        +++++++++++++++++++++++++++++
+
+error: unconstrained generic constant
   --> $DIR/no_where_clause.rs:18:15
    |
 LL |       b: [0.; complex_maths(N)],
@@ -20,5 +31,5 @@ help: try adding a `where` bound
 LL |   pub fn new() -> Self where [(); complex_maths(N)]: {
    |                        +++++++++++++++++++++++++++++
 
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
 
diff --git a/tests/ui/const-generics/issues/issue-86535-2.rs b/tests/ui/const-generics/issues/issue-86535-2.rs
index ab68c6b78df..8d064f3eeb1 100644
--- a/tests/ui/const-generics/issues/issue-86535-2.rs
+++ b/tests/ui/const-generics/issues/issue-86535-2.rs
@@ -9,7 +9,6 @@ pub trait Foo {
         [(); Self::ASSOC_C]:;
 }
 
-#[allow(dead_code)]
 struct Bar<const N: &'static ()>;
 impl<const N: &'static ()> Foo for Bar<N> {
     const ASSOC_C: usize = 3;
diff --git a/tests/ui/const-generics/issues/issue-86535.rs b/tests/ui/const-generics/issues/issue-86535.rs
index 9aaf7ddc9e8..62454f4a388 100644
--- a/tests/ui/const-generics/issues/issue-86535.rs
+++ b/tests/ui/const-generics/issues/issue-86535.rs
@@ -2,7 +2,6 @@
 #![feature(adt_const_params, unsized_const_params, generic_const_exprs)]
 #![allow(incomplete_features, unused_variables)]
 
-#[allow(dead_code)]
 struct F<const S: &'static str>;
 impl<const S: &'static str> X for F<{ S }> {
     const W: usize = 3;
diff --git a/tests/ui/const-generics/transparent-maybeunit-array-wrapper.rs b/tests/ui/const-generics/transparent-maybeunit-array-wrapper.rs
index 35c41ae4615..419d605d0c8 100644
--- a/tests/ui/const-generics/transparent-maybeunit-array-wrapper.rs
+++ b/tests/ui/const-generics/transparent-maybeunit-array-wrapper.rs
@@ -6,7 +6,6 @@
 
 use std::mem::MaybeUninit;
 
-#[allow(dead_code)]
 #[repr(transparent)]
 pub struct MaybeUninitWrapper<const N: usize>(MaybeUninit<[u64; N]>);
 
diff --git a/tests/ui/const-ptr/forbidden_slices.stderr b/tests/ui/const-ptr/forbidden_slices.stderr
index eb41a25c818..fad078ad2b2 100644
--- a/tests/ui/const-ptr/forbidden_slices.stderr
+++ b/tests/ui/const-ptr/forbidden_slices.stderr
@@ -118,7 +118,7 @@ LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
 error[E0080]: could not evaluate static initializer
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: out-of-bounds pointer arithmetic: ALLOC10 has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
+   = note: out-of-bounds pointer arithmetic: expected a pointer to 8 bytes of memory, but got ALLOC10 which is only 4 bytes from the end of the allocation
    |
 note: inside `std::ptr::const_ptr::<impl *const u32>::add`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -177,7 +177,7 @@ LL | pub static R7: &[u16] = unsafe {
 error[E0080]: could not evaluate static initializer
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: out-of-bounds pointer arithmetic: ALLOC11 has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
+   = note: out-of-bounds pointer arithmetic: expected a pointer to 8 bytes of memory, but got ALLOC11+0x1 which is only 7 bytes from the end of the allocation
    |
 note: inside `std::ptr::const_ptr::<impl *const u64>::add`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
diff --git a/tests/ui/const-ptr/out_of_bounds_read.stderr b/tests/ui/const-ptr/out_of_bounds_read.stderr
index 7634ba25210..7f354963eb1 100644
--- a/tests/ui/const-ptr/out_of_bounds_read.stderr
+++ b/tests/ui/const-ptr/out_of_bounds_read.stderr
@@ -1,7 +1,7 @@
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
    |
-   = note: memory access failed: ALLOC0 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
+   = note: memory access failed: expected a pointer to 4 bytes of memory, but got ALLOC0+0x4 which is at or beyond the end of the allocation of size 4 bytes
    |
 note: inside `std::ptr::read::<u32>`
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
@@ -14,7 +14,7 @@ LL |     const _READ: u32 = unsafe { ptr::read(PAST_END_PTR) };
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
    |
-   = note: memory access failed: ALLOC0 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
+   = note: memory access failed: expected a pointer to 4 bytes of memory, but got ALLOC0+0x4 which is at or beyond the end of the allocation of size 4 bytes
    |
 note: inside `std::ptr::read::<u32>`
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
@@ -29,7 +29,7 @@ LL |     const _CONST_READ: u32 = unsafe { PAST_END_PTR.read() };
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
    |
-   = note: memory access failed: ALLOC0 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
+   = note: memory access failed: expected a pointer to 4 bytes of memory, but got ALLOC0+0x4 which is at or beyond the end of the allocation of size 4 bytes
    |
 note: inside `std::ptr::read::<u32>`
   --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
diff --git a/tests/ui/consts/const-compare-bytes-ub.stderr b/tests/ui/consts/const-compare-bytes-ub.stderr
index 9e49706c4c8..7f83dee6409 100644
--- a/tests/ui/consts/const-compare-bytes-ub.stderr
+++ b/tests/ui/consts/const-compare-bytes-ub.stderr
@@ -2,31 +2,31 @@ error[E0080]: evaluation of constant value failed
   --> $DIR/const-compare-bytes-ub.rs:10:9
    |
 LL |         compare_bytes(0 as *const u8, 2 as *const u8, 1)
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: null pointer is a dangling pointer (it has no provenance)
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 1 byte of memory, but got a null pointer
 
 error[E0080]: evaluation of constant value failed
   --> $DIR/const-compare-bytes-ub.rs:14:9
    |
 LL |         compare_bytes(1 as *const u8, 0 as *const u8, 1)
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: 0x1[noalloc] is a dangling pointer (it has no provenance)
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 1 byte of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
 
 error[E0080]: evaluation of constant value failed
   --> $DIR/const-compare-bytes-ub.rs:18:9
    |
 LL |         compare_bytes(1 as *const u8, 2 as *const u8, 1)
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: 0x1[noalloc] is a dangling pointer (it has no provenance)
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 1 byte of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
 
 error[E0080]: evaluation of constant value failed
   --> $DIR/const-compare-bytes-ub.rs:22:9
    |
 LL |         compare_bytes([1, 2, 3].as_ptr(), [1, 2, 3, 4].as_ptr(), 4)
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC0 has size 3, so pointer to 4 bytes starting at offset 0 is out-of-bounds
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got ALLOC0 which is only 3 bytes from the end of the allocation
 
 error[E0080]: evaluation of constant value failed
   --> $DIR/const-compare-bytes-ub.rs:26:9
    |
 LL |         compare_bytes([1, 2, 3, 4].as_ptr(), [1, 2, 3].as_ptr(), 4)
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC1 has size 3, so pointer to 4 bytes starting at offset 0 is out-of-bounds
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got ALLOC1 which is only 3 bytes from the end of the allocation
 
 error[E0080]: evaluation of constant value failed
   --> $DIR/const-compare-bytes-ub.rs:30:9
diff --git a/tests/ui/consts/const-deref-ptr.stderr b/tests/ui/consts/const-deref-ptr.stderr
index b102b4d17cc..070685e0b9d 100644
--- a/tests/ui/consts/const-deref-ptr.stderr
+++ b/tests/ui/consts/const-deref-ptr.stderr
@@ -2,7 +2,7 @@ error[E0080]: could not evaluate static initializer
   --> $DIR/const-deref-ptr.rs:4:29
    |
 LL |     static C: u64 = unsafe {*(0xdeadbeef as *const u64)};
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: 0xdeadbeef[noalloc] is a dangling pointer (it has no provenance)
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 8 bytes of memory, but got 0xdeadbeef[noalloc] which is a dangling pointer (it has no provenance)
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/consts/const-eval/const_raw_ptr_ops2.stderr b/tests/ui/consts/const-eval/const_raw_ptr_ops2.stderr
index e6cd25e42ff..b0c864652e5 100644
--- a/tests/ui/consts/const-eval/const_raw_ptr_ops2.stderr
+++ b/tests/ui/consts/const-eval/const_raw_ptr_ops2.stderr
@@ -2,13 +2,13 @@ error[E0080]: evaluation of constant value failed
   --> $DIR/const_raw_ptr_ops2.rs:7:26
    |
 LL | const Z2: i32 = unsafe { *(42 as *const i32) };
-   |                          ^^^^^^^^^^^^^^^^^^^ memory access failed: 0x2a[noalloc] is a dangling pointer (it has no provenance)
+   |                          ^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got 0x2a[noalloc] which is a dangling pointer (it has no provenance)
 
 error[E0080]: evaluation of constant value failed
   --> $DIR/const_raw_ptr_ops2.rs:9:26
    |
 LL | const Z3: i32 = unsafe { *(44 as *const i32) };
-   |                          ^^^^^^^^^^^^^^^^^^^ memory access failed: 0x2c[noalloc] is a dangling pointer (it has no provenance)
+   |                          ^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got 0x2c[noalloc] which is a dangling pointer (it has no provenance)
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/consts/const-eval/nonnull_as_ref_ub.stderr b/tests/ui/consts/const-eval/nonnull_as_ref_ub.stderr
index b878c8d1b37..bd6dafb9366 100644
--- a/tests/ui/consts/const-eval/nonnull_as_ref_ub.stderr
+++ b/tests/ui/consts/const-eval/nonnull_as_ref_ub.stderr
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
   --> $DIR/nonnull_as_ref_ub.rs:4:29
    |
 LL | const _: () = assert!(42 == *unsafe { NON_NULL.as_ref() });
-   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: 0x1[noalloc] is a dangling pointer (it has no provenance)
+   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 1 byte of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/consts/const-eval/raw-bytes.32bit.stderr b/tests/ui/consts/const-eval/raw-bytes.32bit.stderr
index d7d24f373eb..27c85cc8ce4 100644
--- a/tests/ui/consts/const-eval/raw-bytes.32bit.stderr
+++ b/tests/ui/consts/const-eval/raw-bytes.32bit.stderr
@@ -436,17 +436,27 @@ LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_,
                ╾ALLOC_ID╼ ╾ALLOC_ID╼                         │ ╾──╼╾──╼
            }
 
-error[E0080]: evaluation of constant value failed
-  --> $DIR/raw-bytes.rs:196:62
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/raw-bytes.rs:196:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
-   |                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
+   |
+   = 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: 8, align: 4) {
+               ╾ALLOC_ID╼ 00 00 00 00                         │ ╾──╼....
+           }
 
-error[E0080]: evaluation of constant value failed
-  --> $DIR/raw-bytes.rs:199:65
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/raw-bytes.rs:199:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
-   |                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using ALLOC32 as vtable pointer but it does not point to a vtable
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC27<imm>, but expected a vtable pointer
+   |
+   = 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: 8, align: 4) {
+               ╾ALLOC_ID╼ ╾ALLOC_ID╼                         │ ╾──╼╾──╼
+           }
 
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/raw-bytes.rs:204:1
diff --git a/tests/ui/consts/const-eval/raw-bytes.64bit.stderr b/tests/ui/consts/const-eval/raw-bytes.64bit.stderr
index 22679acda98..2b0ce99a881 100644
--- a/tests/ui/consts/const-eval/raw-bytes.64bit.stderr
+++ b/tests/ui/consts/const-eval/raw-bytes.64bit.stderr
@@ -436,17 +436,27 @@ LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_,
                ╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──────╼╾──────╼
            }
 
-error[E0080]: evaluation of constant value failed
-  --> $DIR/raw-bytes.rs:196:62
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/raw-bytes.rs:196:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
-   |                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
+   |
+   = 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: 16, align: 8) {
+               ╾ALLOC_ID╼ 00 00 00 00 00 00 00 00 │ ╾──────╼........
+           }
 
-error[E0080]: evaluation of constant value failed
-  --> $DIR/raw-bytes.rs:199:65
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/raw-bytes.rs:199:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
-   |                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using ALLOC32 as vtable pointer but it does not point to a vtable
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC27<imm>, but expected a vtable pointer
+   |
+   = 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: 16, align: 8) {
+               ╾ALLOC_ID╼ ╾ALLOC_ID╼ │ ╾──────╼╾──────╼
+           }
 
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/raw-bytes.rs:204:1
diff --git a/tests/ui/consts/const-eval/raw-bytes.rs b/tests/ui/consts/const-eval/raw-bytes.rs
index de1a81b0024..0df732df30e 100644
--- a/tests/ui/consts/const-eval/raw-bytes.rs
+++ b/tests/ui/consts/const-eval/raw-bytes.rs
@@ -194,10 +194,10 @@ const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool
 //~| expected a boolean
 
 const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
-//~^ ERROR evaluation of constant value failed
+//~^ ERROR it is undefined behavior to use this value
 //~| null pointer
 const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
-//~^ ERROR evaluation of constant value failed
+//~^ ERROR it is undefined behavior to use this value
 //~| vtable
 
 // Uninhabited types
diff --git a/tests/ui/consts/const-eval/raw-pointer-ub.rs b/tests/ui/consts/const-eval/raw-pointer-ub.rs
index 47105de453c..5aced5b1bd6 100644
--- a/tests/ui/consts/const-eval/raw-pointer-ub.rs
+++ b/tests/ui/consts/const-eval/raw-pointer-ub.rs
@@ -39,7 +39,7 @@ const OOB: () = unsafe {
     let mem = [0u32; 1];
     let ptr = mem.as_ptr().cast::<u64>();
     let _val = *ptr; //~ERROR: evaluation of constant value failed
-    //~^NOTE: size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
+    //~^NOTE: expected a pointer to 8 bytes of memory
 };
 
 fn main() {}
diff --git a/tests/ui/consts/const-eval/raw-pointer-ub.stderr b/tests/ui/consts/const-eval/raw-pointer-ub.stderr
index cba06fdc639..aeb46725c06 100644
--- a/tests/ui/consts/const-eval/raw-pointer-ub.stderr
+++ b/tests/ui/consts/const-eval/raw-pointer-ub.stderr
@@ -35,7 +35,7 @@ error[E0080]: evaluation of constant value failed
   --> $DIR/raw-pointer-ub.rs:41:16
    |
 LL |     let _val = *ptr;
-   |                ^^^^ memory access failed: ALLOC0 has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
+   |                ^^^^ memory access failed: expected a pointer to 8 bytes of memory, but got ALLOC0 which is only 4 bytes from the end of the allocation
 
 error: aborting due to 5 previous errors
 
diff --git a/tests/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr b/tests/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr
index 439ccb24e61..5c47cbfdf3b 100644
--- a/tests/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr
+++ b/tests/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr
@@ -1,46 +1,56 @@
-error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-incorrect-vtable.rs:19:14
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/ub-incorrect-vtable.rs:18:1
+   |
+LL | const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC1<imm>, but expected a vtable pointer
    |
-LL |     unsafe { std::mem::transmute((&92u8, &[0usize, 1usize, 1000usize])) };
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using ALLOC8 as vtable pointer but it does not point to a vtable
+   = 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: 8, align: 4) {
+               ╾ALLOC0<imm>╼ ╾ALLOC1<imm>╼                         │ ╾──╼╾──╼
+           }
 
-error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-incorrect-vtable.rs:24:14
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/ub-incorrect-vtable.rs:23:1
+   |
+LL | const INVALID_VTABLE_SIZE: &dyn Trait =
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC3<imm>, but expected a vtable pointer
    |
-LL |     unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) };
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using ALLOC9 as vtable pointer but it does not point to a vtable
+   = 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: 8, align: 4) {
+               ╾ALLOC2<imm>╼ ╾ALLOC3<imm>╼                         │ ╾──╼╾──╼
+           }
 
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/ub-incorrect-vtable.rs:33:1
    |
 LL | const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> =
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC1<imm>, but expected a vtable pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC5<imm>, but expected a vtable pointer
    |
    = 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: 8, align: 4) {
-               ╾ALLOC0<imm>╼ ╾ALLOC1<imm>╼                         │ ╾──╼╾──╼
+               ╾ALLOC4<imm>╼ ╾ALLOC5<imm>╼                         │ ╾──╼╾──╼
            }
 
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/ub-incorrect-vtable.rs:38:1
    |
 LL | const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC3<imm>, but expected a vtable pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC7<imm>, but expected a vtable pointer
    |
    = 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: 8, align: 4) {
-               ╾ALLOC2<imm>╼ ╾ALLOC3<imm>╼                         │ ╾──╼╾──╼
+               ╾ALLOC6<imm>╼ ╾ALLOC7<imm>╼                         │ ╾──╼╾──╼
            }
 
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/ub-incorrect-vtable.rs:44:1
    |
 LL | const INVALID_VTABLE_UB: W<&dyn Trait> =
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC5<imm>, but expected a vtable pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC9<imm>, but expected a vtable pointer
    |
    = 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: 8, align: 4) {
-               ╾ALLOC4<imm>╼ ╾ALLOC5<imm>╼                         │ ╾──╼╾──╼
+               ╾ALLOC8<imm>╼ ╾ALLOC9<imm>╼                         │ ╾──╼╾──╼
            }
 
 error[E0080]: it is undefined behavior to use this value
@@ -51,7 +61,7 @@ LL | const G: Wide = unsafe { Transmute { t: FOO }.u };
    |
    = 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: 8, align: 4) {
-               ╾ALLOC6<imm>╼ ╾ALLOC7╼                         │ ╾──╼╾──╼
+               ╾ALLOC10<imm>╼ ╾ALLOC11╼                         │ ╾──╼╾──╼
            }
 
 error: aborting due to 6 previous errors
diff --git a/tests/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr b/tests/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr
index 89bf959703a..f400073aca2 100644
--- a/tests/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr
+++ b/tests/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr
@@ -1,46 +1,56 @@
-error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-incorrect-vtable.rs:19:14
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/ub-incorrect-vtable.rs:18:1
+   |
+LL | const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC1<imm>, but expected a vtable pointer
    |
-LL |     unsafe { std::mem::transmute((&92u8, &[0usize, 1usize, 1000usize])) };
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using ALLOC8 as vtable pointer but it does not point to a vtable
+   = 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: 16, align: 8) {
+               ╾ALLOC0<imm>╼ ╾ALLOC1<imm>╼ │ ╾──────╼╾──────╼
+           }
 
-error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-incorrect-vtable.rs:24:14
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/ub-incorrect-vtable.rs:23:1
+   |
+LL | const INVALID_VTABLE_SIZE: &dyn Trait =
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC3<imm>, but expected a vtable pointer
    |
-LL |     unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) };
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using ALLOC9 as vtable pointer but it does not point to a vtable
+   = 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: 16, align: 8) {
+               ╾ALLOC2<imm>╼ ╾ALLOC3<imm>╼ │ ╾──────╼╾──────╼
+           }
 
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/ub-incorrect-vtable.rs:33:1
    |
 LL | const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> =
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC1<imm>, but expected a vtable pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC5<imm>, but expected a vtable pointer
    |
    = 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: 16, align: 8) {
-               ╾ALLOC0<imm>╼ ╾ALLOC1<imm>╼ │ ╾──────╼╾──────╼
+               ╾ALLOC4<imm>╼ ╾ALLOC5<imm>╼ │ ╾──────╼╾──────╼
            }
 
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/ub-incorrect-vtable.rs:38:1
    |
 LL | const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC3<imm>, but expected a vtable pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC7<imm>, but expected a vtable pointer
    |
    = 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: 16, align: 8) {
-               ╾ALLOC2<imm>╼ ╾ALLOC3<imm>╼ │ ╾──────╼╾──────╼
+               ╾ALLOC6<imm>╼ ╾ALLOC7<imm>╼ │ ╾──────╼╾──────╼
            }
 
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/ub-incorrect-vtable.rs:44:1
    |
 LL | const INVALID_VTABLE_UB: W<&dyn Trait> =
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC5<imm>, but expected a vtable pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC9<imm>, but expected a vtable pointer
    |
    = 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: 16, align: 8) {
-               ╾ALLOC4<imm>╼ ╾ALLOC5<imm>╼ │ ╾──────╼╾──────╼
+               ╾ALLOC8<imm>╼ ╾ALLOC9<imm>╼ │ ╾──────╼╾──────╼
            }
 
 error[E0080]: it is undefined behavior to use this value
@@ -51,7 +61,7 @@ LL | const G: Wide = unsafe { Transmute { t: FOO }.u };
    |
    = 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: 16, align: 8) {
-               ╾ALLOC6<imm>╼ ╾ALLOC7╼ │ ╾──────╼╾──────╼
+               ╾ALLOC10<imm>╼ ╾ALLOC11╼ │ ╾──────╼╾──────╼
            }
 
 error: aborting due to 6 previous errors
diff --git a/tests/ui/consts/const-eval/ub-incorrect-vtable.rs b/tests/ui/consts/const-eval/ub-incorrect-vtable.rs
index 4325495a380..8058f7693a7 100644
--- a/tests/ui/consts/const-eval/ub-incorrect-vtable.rs
+++ b/tests/ui/consts/const-eval/ub-incorrect-vtable.rs
@@ -17,12 +17,12 @@ trait Trait {}
 
 const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
     unsafe { std::mem::transmute((&92u8, &[0usize, 1usize, 1000usize])) };
-//~^ ERROR evaluation of constant value failed
+//~^^ ERROR it is undefined behavior to use this value
 //~| vtable
 
 const INVALID_VTABLE_SIZE: &dyn Trait =
     unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) };
-//~^ ERROR evaluation of constant value failed
+//~^^ ERROR it is undefined behavior to use this value
 //~| vtable
 
 #[repr(transparent)]
diff --git a/tests/ui/consts/const-eval/ub-nonnull.stderr b/tests/ui/consts/const-eval/ub-nonnull.stderr
index ab0fb2abdb3..0e4926eb49e 100644
--- a/tests/ui/consts/const-eval/ub-nonnull.stderr
+++ b/tests/ui/consts/const-eval/ub-nonnull.stderr
@@ -13,7 +13,7 @@ error[E0080]: evaluation of constant value failed
   --> $DIR/ub-nonnull.rs:20:29
    |
 LL |     let out_of_bounds_ptr = &ptr[255];
-   |                             ^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC1 has size 1, so pointer to 255 bytes starting at offset 0 is out-of-bounds
+   |                             ^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to 255 bytes of memory, but got ALLOC1 which is only 1 byte from the end of the allocation
 
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/ub-nonnull.rs:24:1
diff --git a/tests/ui/consts/const-eval/ub-wide-ptr.rs b/tests/ui/consts/const-eval/ub-wide-ptr.rs
index 3956146f6ae..991d4424dcf 100644
--- a/tests/ui/consts/const-eval/ub-wide-ptr.rs
+++ b/tests/ui/consts/const-eval/ub-wide-ptr.rs
@@ -123,13 +123,13 @@ const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4u
 //~^ ERROR it is undefined behavior to use this value
 //~| vtable
 const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
-//~^ ERROR evaluation of constant value failed
+//~^ ERROR it is undefined behavior to use this value
 //~| vtable
 const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
-//~^ ERROR evaluation of constant value failed
+//~^ ERROR it is undefined behavior to use this value
 //~| vtable
 const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
-//~^ ERROR evaluation of constant value failed
+//~^ ERROR it is undefined behavior to use this value
 //~| vtable
 const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
 //~^ ERROR it is undefined behavior to use this value
@@ -142,10 +142,10 @@ const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool
 
 // # raw trait object
 const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
-//~^ ERROR evaluation of constant value failed
+//~^ ERROR it is undefined behavior to use this value
 //~| null pointer
 const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
-//~^ ERROR evaluation of constant value failed
+//~^ ERROR it is undefined behavior to use this value
 //~| vtable
 const RAW_TRAIT_OBJ_CONTENT_INVALID: *const dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) } as *const dyn Trait; // ok because raw
 // Officially blessed way to get the vtable
@@ -154,12 +154,12 @@ const DYN_METADATA: ptr::DynMetadata<dyn Send> = ptr::metadata::<dyn Send>(ptr::
 
 static mut RAW_TRAIT_OBJ_VTABLE_NULL_THROUGH_REF: *const dyn Trait = unsafe {
     mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
-    //~^ ERROR could not evaluate static initializer
+    //~^^ ERROR it is undefined behavior to use this value
     //~| null pointer
 };
 static mut RAW_TRAIT_OBJ_VTABLE_INVALID_THROUGH_REF: *const dyn Trait = unsafe {
     mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
-    //~^ ERROR could not evaluate static initializer
+    //~^^ ERROR it is undefined behavior to use this value
     //~| vtable
 };
 
diff --git a/tests/ui/consts/const-eval/ub-wide-ptr.stderr b/tests/ui/consts/const-eval/ub-wide-ptr.stderr
index 4fe744265df..92f0029a5b3 100644
--- a/tests/ui/consts/const-eval/ub-wide-ptr.stderr
+++ b/tests/ui/consts/const-eval/ub-wide-ptr.stderr
@@ -218,29 +218,44 @@ LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u
                HEX_DUMP
            }
 
-error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-wide-ptr.rs:125:57
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/ub-wide-ptr.rs:125:1
    |
 LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
-   |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using ALLOC20 as vtable pointer but it does not point to a vtable
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC17<imm>, but expected a vtable pointer
+   |
+   = 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]: evaluation of constant value failed
-  --> $DIR/ub-wide-ptr.rs:128:57
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/ub-wide-ptr.rs:128:1
    |
 LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
-   |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using ALLOC21 as vtable pointer but it does not point to a vtable
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC19<imm>, but expected a vtable pointer
+   |
+   = 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]: evaluation of constant value failed
-  --> $DIR/ub-wide-ptr.rs:131:56
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/ub-wide-ptr.rs:131:1
    |
 LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
-   |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using ALLOC22 as vtable pointer but it does not point to a vtable
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC21<imm>, but expected a vtable pointer
+   |
+   = 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]: it is undefined behavior to use this value
   --> $DIR/ub-wide-ptr.rs:134:1
    |
 LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC17<imm>, but expected a vtable pointer
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC23<imm>, but expected a vtable pointer
    |
    = 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) {
@@ -258,29 +273,49 @@ LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_,
                HEX_DUMP
            }
 
-error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-wide-ptr.rs:144:62
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/ub-wide-ptr.rs:144:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
-   |                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
+   |
+   = 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]: evaluation of constant value failed
-  --> $DIR/ub-wide-ptr.rs:147:65
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/ub-wide-ptr.rs:147:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
-   |                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using ALLOC23 as vtable pointer but it does not point to a vtable
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC28<imm>, but expected a vtable pointer
+   |
+   = 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]: could not evaluate static initializer
-  --> $DIR/ub-wide-ptr.rs:156:5
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/ub-wide-ptr.rs:155:1
    |
-LL |     mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
+LL | static mut RAW_TRAIT_OBJ_VTABLE_NULL_THROUGH_REF: *const dyn Trait = unsafe {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
+   |
+   = 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]: could not evaluate static initializer
-  --> $DIR/ub-wide-ptr.rs:161:5
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/ub-wide-ptr.rs:160:1
    |
-LL |     mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using ALLOC24 as vtable pointer but it does not point to a vtable
+LL | static mut RAW_TRAIT_OBJ_VTABLE_INVALID_THROUGH_REF: *const dyn Trait = unsafe {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC31<imm>, but expected a vtable pointer
+   |
+   = 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 29 previous errors
 
diff --git a/tests/ui/consts/const-eval/write-to-uninhabited-enum-variant.rs b/tests/ui/consts/const-eval/write-to-uninhabited-enum-variant.rs
index 5628ae1be36..f4130319eea 100644
--- a/tests/ui/consts/const-eval/write-to-uninhabited-enum-variant.rs
+++ b/tests/ui/consts/const-eval/write-to-uninhabited-enum-variant.rs
@@ -1,8 +1,8 @@
 //@ run-pass
-
+#![allow(unreachable_patterns)]
 #![allow(dead_code)]
 
-enum Empty { }
+enum Empty {}
 enum Test1 {
     A(u8),
     B(Empty),
diff --git a/tests/ui/consts/copy-intrinsic.rs b/tests/ui/consts/copy-intrinsic.rs
index 4183dc0fcd6..e3f43ce2037 100644
--- a/tests/ui/consts/copy-intrinsic.rs
+++ b/tests/ui/consts/copy-intrinsic.rs
@@ -27,7 +27,7 @@ const COPY_OOB_1: () = unsafe {
     copy_nonoverlapping(0x100 as *const i32, dangle, 0);
     // Non-zero-sized copy is not.
     copy_nonoverlapping(0x100 as *const i32, dangle, 1); //~ ERROR evaluation of constant value failed [E0080]
-    //~| 0x100[noalloc] is a dangling pointer
+    //~| got 0x100[noalloc] which is a dangling pointer
 };
 const COPY_OOB_2: () = unsafe {
     let x = 0i32;
@@ -36,7 +36,7 @@ const COPY_OOB_2: () = unsafe {
     copy_nonoverlapping(dangle, 0x100 as *mut i32, 0);
     // Non-zero-sized copy is not.
     copy_nonoverlapping(dangle, 0x100 as *mut i32, 1); //~ ERROR evaluation of constant value failed [E0080]
-    //~| offset 40 is out-of-bounds
+    //~| +0x28 which is at or beyond the end of the allocation
 };
 
 const COPY_SIZE_OVERFLOW: () = unsafe {
diff --git a/tests/ui/consts/copy-intrinsic.stderr b/tests/ui/consts/copy-intrinsic.stderr
index d34e61cd962..2dbb471131e 100644
--- a/tests/ui/consts/copy-intrinsic.stderr
+++ b/tests/ui/consts/copy-intrinsic.stderr
@@ -2,13 +2,13 @@ error[E0080]: evaluation of constant value failed
   --> $DIR/copy-intrinsic.rs:29:5
    |
 LL |     copy_nonoverlapping(0x100 as *const i32, dangle, 1);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: 0x100[noalloc] is a dangling pointer (it has no provenance)
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got 0x100[noalloc] which is a dangling pointer (it has no provenance)
 
 error[E0080]: evaluation of constant value failed
   --> $DIR/copy-intrinsic.rs:38:5
    |
 LL |     copy_nonoverlapping(dangle, 0x100 as *mut i32, 1);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC0 has size 4, so pointer to 4 bytes starting at offset 40 is out-of-bounds
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got ALLOC0+0x28 which is at or beyond the end of the allocation of size 4 bytes
 
 error[E0080]: evaluation of constant value failed
   --> $DIR/copy-intrinsic.rs:45:5
diff --git a/tests/ui/consts/offset_from_ub.rs b/tests/ui/consts/offset_from_ub.rs
index 1506c212fba..7efc5dd3e28 100644
--- a/tests/ui/consts/offset_from_ub.rs
+++ b/tests/ui/consts/offset_from_ub.rs
@@ -1,3 +1,4 @@
+//@ normalize-stderr-test: "\d+ bytes" -> "$$BYTES bytes"
 #![feature(const_ptr_sub_ptr)]
 #![feature(core_intrinsics)]
 
@@ -36,7 +37,7 @@ pub const DIFFERENT_INT: isize = { // offset_from with two different integers: l
     let ptr1 = 8 as *const u8;
     let ptr2 = 16 as *const u8;
     unsafe { ptr_offset_from(ptr2, ptr1) } //~ERROR evaluation of constant value failed
-    //~| different pointers without provenance
+    //~| dangling pointer
 };
 
 const OUT_OF_BOUNDS_1: isize = {
@@ -45,7 +46,7 @@ const OUT_OF_BOUNDS_1: isize = {
     let end_ptr = (start_ptr).wrapping_add(length);
     // First ptr is out of bounds
     unsafe { ptr_offset_from(end_ptr, start_ptr) } //~ERROR evaluation of constant value failed
-    //~| pointer to 10 bytes starting at offset 0 is out-of-bounds
+    //~| expected a pointer to 10 bytes of memory
 };
 
 const OUT_OF_BOUNDS_2: isize = {
@@ -54,7 +55,7 @@ const OUT_OF_BOUNDS_2: isize = {
     let end_ptr = (start_ptr).wrapping_add(length);
     // Second ptr is out of bounds
     unsafe { ptr_offset_from(start_ptr, end_ptr) } //~ERROR evaluation of constant value failed
-    //~| pointer to 10 bytes starting at offset 0 is out-of-bounds
+    //~| expected a pointer to the end of 10 bytes of memory
 };
 
 pub const DIFFERENT_ALLOC_UNSIGNED: usize = {
diff --git a/tests/ui/consts/offset_from_ub.stderr b/tests/ui/consts/offset_from_ub.stderr
index 7b623126d54..ac4597ff011 100644
--- a/tests/ui/consts/offset_from_ub.stderr
+++ b/tests/ui/consts/offset_from_ub.stderr
@@ -1,5 +1,5 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:18:27
+  --> $DIR/offset_from_ub.rs:19:27
    |
 LL |     let offset = unsafe { ptr_offset_from(field_ptr, base_ptr) };
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called on pointers into different allocations
@@ -12,67 +12,67 @@ error[E0080]: evaluation of constant value failed
 note: inside `std::ptr::const_ptr::<impl *const u8>::offset_from`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `NOT_PTR`
-  --> $DIR/offset_from_ub.rs:24:14
+  --> $DIR/offset_from_ub.rs:25:14
    |
 LL |     unsafe { (42 as *const u8).offset_from(&5u8) as usize }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:31:14
+  --> $DIR/offset_from_ub.rs:32:14
    |
 LL |     unsafe { ptr_offset_from(field_ptr, base_ptr as *const u16) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exact_div: 1_isize cannot be divided by 2_isize without remainder
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:38:14
+  --> $DIR/offset_from_ub.rs:39:14
    |
 LL |     unsafe { ptr_offset_from(ptr2, ptr1) }
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called on different pointers without provenance (i.e., without an associated allocation)
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from` origin: expected a pointer to $BYTES bytes of memory, but got 0x8[noalloc] which is a dangling pointer (it has no provenance)
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:47:14
+  --> $DIR/offset_from_ub.rs:48:14
    |
 LL |     unsafe { ptr_offset_from(end_ptr, start_ptr) }
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: ALLOC0 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from` origin: expected a pointer to $BYTES bytes of memory, but got ALLOC0 which is only $BYTES bytes from the end of the allocation
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:56:14
+  --> $DIR/offset_from_ub.rs:57:14
    |
 LL |     unsafe { ptr_offset_from(start_ptr, end_ptr) }
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from`: ALLOC1 has size 4, so pointer to 10 bytes starting at offset 0 is out-of-bounds
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from` origin: expected a pointer to the end of $BYTES bytes of memory, but got ALLOC1+0xa which does not have enough space to the beginning of the allocation
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:65:14
+  --> $DIR/offset_from_ub.rs:66:14
    |
 LL |     unsafe { ptr_offset_from_unsigned(field_ptr, base_ptr) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on pointers into different allocations
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:72:14
+  --> $DIR/offset_from_ub.rs:73:14
    |
 LL |     unsafe { ptr_offset_from(ptr2, ptr1) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far ahead of second
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:78:14
+  --> $DIR/offset_from_ub.rs:79:14
    |
 LL |     unsafe { ptr_offset_from(ptr1, ptr2) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far before second
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:86:14
+  --> $DIR/offset_from_ub.rs:87:14
    |
 LL |     unsafe { ptr_offset_from(ptr1, ptr2) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far before second
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:93:14
+  --> $DIR/offset_from_ub.rs:94:14
    |
 LL |     unsafe { ptr_offset_from_unsigned(p, p.add(2) ) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer has smaller offset than second: 0 < 8
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:100:14
+  --> $DIR/offset_from_ub.rs:101:14
    |
 LL |     unsafe { ptr_offset_from_unsigned(ptr2, ptr1) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer is too far ahead of second
@@ -80,12 +80,12 @@ LL |     unsafe { ptr_offset_from_unsigned(ptr2, ptr1) }
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: `ptr_offset_from` called on different pointers without provenance (i.e., without an associated allocation)
+   = note: out-of-bounds `offset_from` origin: expected a pointer to $BYTES bytes of memory, but got a null pointer
    |
 note: inside `std::ptr::const_ptr::<impl *const u8>::offset_from`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `OFFSET_VERY_FAR1`
-  --> $DIR/offset_from_ub.rs:109:14
+  --> $DIR/offset_from_ub.rs:110:14
    |
 LL |     unsafe { ptr2.offset_from(ptr1) }
    |              ^^^^^^^^^^^^^^^^^^^^^^
@@ -93,12 +93,12 @@ LL |     unsafe { ptr2.offset_from(ptr1) }
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: `ptr_offset_from` called on different pointers without provenance (i.e., without an associated allocation)
+   = note: `ptr_offset_from` called when first pointer is too far before second
    |
 note: inside `std::ptr::const_ptr::<impl *const u8>::offset_from`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `OFFSET_VERY_FAR2`
-  --> $DIR/offset_from_ub.rs:115:14
+  --> $DIR/offset_from_ub.rs:116:14
    |
 LL |     unsafe { ptr1.offset_from(ptr2.wrapping_offset(1)) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/consts/offset_ub.rs b/tests/ui/consts/offset_ub.rs
index ebc7019a75a..5026d9a2713 100644
--- a/tests/ui/consts/offset_ub.rs
+++ b/tests/ui/consts/offset_ub.rs
@@ -1,7 +1,8 @@
 use std::ptr;
 
-
+//@ normalize-stderr-test: "0xf+" -> "0xf..f"
 //@ normalize-stderr-test: "0x7f+" -> "0x7f..f"
+//@ normalize-stderr-test: "\d+ bytes" -> "$$BYTES bytes"
 
 
 pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1) }; //~NOTE
diff --git a/tests/ui/consts/offset_ub.stderr b/tests/ui/consts/offset_ub.stderr
index 89371f06d9d..779cb9654f4 100644
--- a/tests/ui/consts/offset_ub.stderr
+++ b/tests/ui/consts/offset_ub.stderr
@@ -1,12 +1,12 @@
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: overflowing in-bounds pointer arithmetic
+   = note: out-of-bounds pointer arithmetic: expected a pointer to the end of 1 byte of memory, but got ALLOC0 which is at the beginning of the allocation
    |
 note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `BEFORE_START`
-  --> $DIR/offset_ub.rs:7:46
+  --> $DIR/offset_ub.rs:8:46
    |
 LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1) };
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -14,12 +14,12 @@ LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1)
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: out-of-bounds pointer arithmetic: ALLOC0 has size 1, so pointer to 2 bytes starting at offset 0 is out-of-bounds
+   = note: out-of-bounds pointer arithmetic: expected a pointer to $BYTES bytes of memory, but got ALLOC1 which is only 1 byte from the end of the allocation
    |
 note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `AFTER_END`
-  --> $DIR/offset_ub.rs:8:43
+  --> $DIR/offset_ub.rs:9:43
    |
 LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) };
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -27,12 +27,12 @@ LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) };
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: out-of-bounds pointer arithmetic: ALLOC1 has size 100, so pointer to 101 bytes starting at offset 0 is out-of-bounds
+   = note: out-of-bounds pointer arithmetic: expected a pointer to $BYTES bytes of memory, but got ALLOC2 which is only $BYTES bytes from the end of the allocation
    |
 note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `AFTER_ARRAY`
-  --> $DIR/offset_ub.rs:9:45
+  --> $DIR/offset_ub.rs:10:45
    |
 LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101) };
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -40,12 +40,12 @@ LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101)
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: overflowing in-bounds pointer arithmetic
+   = note: overflowing pointer arithmetic: the total offset in bytes does not fit in an `isize`
    |
 note: inside `std::ptr::const_ptr::<impl *const u16>::offset`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `OVERFLOW`
-  --> $DIR/offset_ub.rs:11:43
+  --> $DIR/offset_ub.rs:12:43
    |
 LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MAX) };
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -53,12 +53,12 @@ LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: overflowing in-bounds pointer arithmetic
+   = note: overflowing pointer arithmetic: the total offset in bytes does not fit in an `isize`
    |
 note: inside `std::ptr::const_ptr::<impl *const u16>::offset`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `UNDERFLOW`
-  --> $DIR/offset_ub.rs:12:44
+  --> $DIR/offset_ub.rs:13:44
    |
 LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MIN) };
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -66,12 +66,12 @@ LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize:
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: overflowing in-bounds pointer arithmetic
+   = note: out-of-bounds pointer arithmetic: expected a pointer to $BYTES bytes of memory, but got 0xf..f[noalloc] which is a dangling pointer (it has no provenance)
    |
 note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `OVERFLOW_ADDRESS_SPACE`
-  --> $DIR/offset_ub.rs:13:56
+  --> $DIR/offset_ub.rs:14:56
    |
 LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *const u8).offset(2) };
    |                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -79,12 +79,12 @@ LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *cons
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: overflowing in-bounds pointer arithmetic
+   = note: out-of-bounds pointer arithmetic: expected a pointer to the end of $BYTES bytes of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
    |
 note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `UNDERFLOW_ADDRESS_SPACE`
-  --> $DIR/offset_ub.rs:14:57
+  --> $DIR/offset_ub.rs:15:57
    |
 LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).offset(-2) };
    |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -92,12 +92,12 @@ LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).of
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: out-of-bounds pointer arithmetic: ALLOC2 has size 1, so pointer to 2 bytes starting at offset -4 is out-of-bounds
+   = note: out-of-bounds pointer arithmetic: expected a pointer to the end of $BYTES bytes of memory, but got ALLOC3-0x2 which points to before the beginning of the allocation
    |
 note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `NEGATIVE_OFFSET`
-  --> $DIR/offset_ub.rs:15:49
+  --> $DIR/offset_ub.rs:16:49
    |
 LL | pub const NEGATIVE_OFFSET: *const u8 = unsafe { [0u8; 1].as_ptr().wrapping_offset(-2).offset(-2) };
    |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -105,12 +105,12 @@ LL | pub const NEGATIVE_OFFSET: *const u8 = unsafe { [0u8; 1].as_ptr().wrapping_
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: out-of-bounds pointer arithmetic: ALLOC3 has size 0, so pointer to 1 byte starting at offset 0 is out-of-bounds
+   = note: out-of-bounds pointer arithmetic: expected a pointer to 1 byte of memory, but got ALLOC4 which is at or beyond the end of the allocation of size $BYTES bytes
    |
 note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `ZERO_SIZED_ALLOC`
-  --> $DIR/offset_ub.rs:17:50
+  --> $DIR/offset_ub.rs:18:50
    |
 LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1) };
    |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -118,12 +118,12 @@ LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
    |
-   = note: out-of-bounds pointer arithmetic: 0x1[noalloc] is a dangling pointer (it has no provenance)
+   = note: out-of-bounds pointer arithmetic: expected a pointer to $BYTES bytes of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
    |
 note: inside `std::ptr::mut_ptr::<impl *mut u8>::offset`
   --> $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
 note: inside `DANGLING`
-  --> $DIR/offset_ub.rs:18:42
+  --> $DIR/offset_ub.rs:19:42
    |
 LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::<u8>::dangling().as_ptr().offset(4) };
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -131,12 +131,12 @@ LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::<u8>::dangling().as_
 error[E0080]: evaluation of constant value failed
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-   = note: out-of-bounds pointer arithmetic: 0x7f..f[noalloc] is a dangling pointer (it has no provenance)
+   = note: out-of-bounds pointer arithmetic: expected a pointer to the end of $BYTES bytes of memory, but got 0xf..f[noalloc] which is a dangling pointer (it has no provenance)
    |
 note: inside `std::ptr::const_ptr::<impl *const u8>::offset`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `UNDERFLOW_ABS`
-  --> $DIR/offset_ub.rs:21:47
+  --> $DIR/offset_ub.rs:22:47
    |
 LL | pub const UNDERFLOW_ABS: *const u8 = unsafe { (usize::MAX as *const u8).offset(isize::MIN) };
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/coroutine/gen_block.none.stderr b/tests/ui/coroutine/gen_block.none.stderr
index 64fa2be003d..15123a49e48 100644
--- a/tests/ui/coroutine/gen_block.none.stderr
+++ b/tests/ui/coroutine/gen_block.none.stderr
@@ -73,7 +73,6 @@ LL |     let _ = || yield true;
    = note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
    = help: add `#![feature(coroutines)]` 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: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
   --> $DIR/gen_block.rs:16:16
@@ -95,7 +94,6 @@ LL |     let _ = #[coroutine] || yield true;
    = note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
    = help: add `#![feature(coroutines)]` 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: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: aborting due to 11 previous errors
 
diff --git a/tests/ui/coroutine/invalid_attr_usage.rs b/tests/ui/coroutine/invalid_attr_usage.rs
new file mode 100644
index 00000000000..995a3aa3100
--- /dev/null
+++ b/tests/ui/coroutine/invalid_attr_usage.rs
@@ -0,0 +1,11 @@
+//! The `coroutine` attribute is only allowed on closures.
+
+#![feature(coroutines)]
+
+#[coroutine]
+//~^ ERROR: attribute should be applied to closures
+struct Foo;
+
+#[coroutine]
+//~^ ERROR: attribute should be applied to closures
+fn main() {}
diff --git a/tests/ui/coroutine/invalid_attr_usage.stderr b/tests/ui/coroutine/invalid_attr_usage.stderr
new file mode 100644
index 00000000000..316a0117e5d
--- /dev/null
+++ b/tests/ui/coroutine/invalid_attr_usage.stderr
@@ -0,0 +1,14 @@
+error: attribute should be applied to closures
+  --> $DIR/invalid_attr_usage.rs:5:1
+   |
+LL | #[coroutine]
+   | ^^^^^^^^^^^^
+
+error: attribute should be applied to closures
+  --> $DIR/invalid_attr_usage.rs:9:1
+   |
+LL | #[coroutine]
+   | ^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/delegation/explicit-paths.rs b/tests/ui/delegation/explicit-paths.rs
index d42e305b252..3b0454eb524 100644
--- a/tests/ui/delegation/explicit-paths.rs
+++ b/tests/ui/delegation/explicit-paths.rs
@@ -22,9 +22,7 @@ mod fn_to_other {
     use super::*;
 
     reuse Trait::foo1;
-    //~^ ERROR delegation to a trait method from a free function is not supported yet
     reuse <S as Trait>::foo2;
-    //~^ ERROR delegation to a trait method from a free function is not supported yet
     reuse to_reuse::foo3;
     reuse S::foo4;
     //~^ ERROR cannot find function `foo4` in `S`
diff --git a/tests/ui/delegation/explicit-paths.stderr b/tests/ui/delegation/explicit-paths.stderr
index b5afe19f878..8098ea8c54f 100644
--- a/tests/ui/delegation/explicit-paths.stderr
+++ b/tests/ui/delegation/explicit-paths.stderr
@@ -1,5 +1,5 @@
 error[E0407]: method `foo3` is not a member of trait `Trait`
-  --> $DIR/explicit-paths.rs:51:9
+  --> $DIR/explicit-paths.rs:49:9
    |
 LL |         reuse to_reuse::foo3;
    |         ^^^^^^^^^^^^^^^^----^
@@ -8,7 +8,7 @@ LL |         reuse to_reuse::foo3;
    |         not a member of trait `Trait`
 
 error[E0407]: method `foo4` is not a member of trait `Trait`
-  --> $DIR/explicit-paths.rs:53:9
+  --> $DIR/explicit-paths.rs:51:9
    |
 LL |         reuse F::foo4 { &self.0 }
    |         ^^^^^^^^^----^^^^^^^^^^^^
@@ -17,49 +17,49 @@ LL |         reuse F::foo4 { &self.0 }
    |         not a member of trait `Trait`
 
 error[E0425]: cannot find function `foo4` in `S`
-  --> $DIR/explicit-paths.rs:29:14
+  --> $DIR/explicit-paths.rs:27:14
    |
 LL |     reuse S::foo4;
    |              ^^^^ not found in `S`
 
 error[E0425]: cannot find function `foo4` in `F`
-  --> $DIR/explicit-paths.rs:40:18
+  --> $DIR/explicit-paths.rs:38:18
    |
 LL |         reuse F::foo4 { &self.0 }
    |                  ^^^^ not found in `F`
    |
 note: function `fn_to_other::foo4` exists but is inaccessible
-  --> $DIR/explicit-paths.rs:29:5
+  --> $DIR/explicit-paths.rs:27:5
    |
 LL |     reuse S::foo4;
    |     ^^^^^^^^^^^^^^ not accessible
 
 error[E0425]: cannot find function `foo4` in `F`
-  --> $DIR/explicit-paths.rs:53:18
+  --> $DIR/explicit-paths.rs:51:18
    |
 LL |         reuse F::foo4 { &self.0 }
    |                  ^^^^ not found in `F`
    |
 note: function `fn_to_other::foo4` exists but is inaccessible
-  --> $DIR/explicit-paths.rs:29:5
+  --> $DIR/explicit-paths.rs:27:5
    |
 LL |     reuse S::foo4;
    |     ^^^^^^^^^^^^^^ not accessible
 
 error[E0425]: cannot find function `foo4` in `F`
-  --> $DIR/explicit-paths.rs:67:18
+  --> $DIR/explicit-paths.rs:65:18
    |
 LL |         reuse F::foo4 { &F }
    |                  ^^^^ not found in `F`
    |
 note: function `fn_to_other::foo4` exists but is inaccessible
-  --> $DIR/explicit-paths.rs:29:5
+  --> $DIR/explicit-paths.rs:27:5
    |
 LL |     reuse S::foo4;
    |     ^^^^^^^^^^^^^^ not accessible
 
 error[E0119]: conflicting implementations of trait `Trait` for type `S`
-  --> $DIR/explicit-paths.rs:76:5
+  --> $DIR/explicit-paths.rs:74:5
    |
 LL |     impl Trait for S {
    |     ---------------- first implementation here
@@ -67,26 +67,8 @@ LL |     impl Trait for S {
 LL |     impl Trait for S {
    |     ^^^^^^^^^^^^^^^^ conflicting implementation for `S`
 
-error: delegation to a trait method from a free function is not supported yet
-  --> $DIR/explicit-paths.rs:24:18
-   |
-LL |     fn foo1(&self, x: i32) -> i32 { x }
-   |     ----------------------------- callee defined here
-...
-LL |     reuse Trait::foo1;
-   |                  ^^^^
-
-error: delegation to a trait method from a free function is not supported yet
-  --> $DIR/explicit-paths.rs:26:25
-   |
-LL |     fn foo2(x: i32) -> i32 { x }
-   |     ---------------------- callee defined here
-...
-LL |     reuse <S as Trait>::foo2;
-   |                         ^^^^
-
 error[E0308]: mismatched types
-  --> $DIR/explicit-paths.rs:63:36
+  --> $DIR/explicit-paths.rs:61:36
    |
 LL |     trait Trait2 : Trait {
    |     -------------------- found this type parameter
@@ -104,7 +86,7 @@ LL |     fn foo1(&self, x: i32) -> i32 { x }
    |        ^^^^ -----
 
 error[E0277]: the trait bound `S2: Trait` is not satisfied
-  --> $DIR/explicit-paths.rs:78:16
+  --> $DIR/explicit-paths.rs:76:16
    |
 LL |         reuse <S2 as Trait>::foo1;
    |                ^^ the trait `Trait` is not implemented for `S2`
@@ -114,7 +96,7 @@ LL |         reuse <S2 as Trait>::foo1;
              S
 
 error[E0308]: mismatched types
-  --> $DIR/explicit-paths.rs:78:30
+  --> $DIR/explicit-paths.rs:76:30
    |
 LL |         reuse <S2 as Trait>::foo1;
    |                              ^^^^
@@ -130,7 +112,7 @@ note: method defined here
 LL |     fn foo1(&self, x: i32) -> i32 { x }
    |        ^^^^ -----
 
-error: aborting due to 12 previous errors
+error: aborting due to 10 previous errors
 
 Some errors have detailed explanations: E0119, E0277, E0308, E0407, E0425.
 For more information about an error, try `rustc --explain E0119`.
diff --git a/tests/ui/delegation/generics/free-fn-to-free-fn-pass.rs b/tests/ui/delegation/generics/free-fn-to-free-fn-pass.rs
new file mode 100644
index 00000000000..625bbdd758c
--- /dev/null
+++ b/tests/ui/delegation/generics/free-fn-to-free-fn-pass.rs
@@ -0,0 +1,28 @@
+//@ run-pass
+#![feature(fn_delegation)]
+#![allow(incomplete_features)]
+
+mod to_reuse {
+    pub fn types<T, U>(x: U, y: T) -> (T, U) {
+        (y, x)
+    }
+    pub fn late<'a, 'b>(x: &'a u8, y: &'b u8) -> u8 {
+        *x + *y
+    }
+    pub fn early<'a: 'a>(x: &'a str) -> &'a str {
+        x
+    }
+}
+
+reuse to_reuse::types;
+reuse to_reuse::late;
+reuse to_reuse::early;
+
+fn main() {
+    assert_eq!(types(0, "str"), ("str", 0));
+    assert_eq!(late(&1u8, &2u8), 3);
+    {
+        let s: &'static str = "hello world";
+        assert_eq!(early::<'static>(s), "hello world");
+    }
+}
diff --git a/tests/ui/delegation/generics/free-fn-to-free-fn.rs b/tests/ui/delegation/generics/free-fn-to-free-fn.rs
new file mode 100644
index 00000000000..3741ad66485
--- /dev/null
+++ b/tests/ui/delegation/generics/free-fn-to-free-fn.rs
@@ -0,0 +1,27 @@
+#![feature(fn_delegation)]
+#![allow(incomplete_features)]
+
+mod to_reuse {
+    pub fn consts<const N: i32>() -> i32 {
+        N
+    }
+    pub fn late<'a>(x: &'a u8) -> u8 {
+        *x
+    }
+    pub fn bounds<T: Clone>(_: T) {}
+}
+
+// FIXME(fn_delegation): this is supposed to work eventually
+reuse to_reuse::consts;
+//~^ ERROR  type annotations needed
+reuse to_reuse::late;
+reuse to_reuse::bounds;
+
+fn main() {
+    late::<'static>(&0u8);
+    //~^ ERROR cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+
+    struct S;
+    bounds(S);
+    //~^ ERROR the trait bound `S: Clone` is not satisfied
+}
diff --git a/tests/ui/delegation/generics/free-fn-to-free-fn.stderr b/tests/ui/delegation/generics/free-fn-to-free-fn.stderr
new file mode 100644
index 00000000000..5ba56ce1718
--- /dev/null
+++ b/tests/ui/delegation/generics/free-fn-to-free-fn.stderr
@@ -0,0 +1,54 @@
+error[E0284]: type annotations needed
+  --> $DIR/free-fn-to-free-fn.rs:15:17
+   |
+LL | reuse to_reuse::consts;
+   |                 ^^^^^^ cannot infer the value of the const parameter `N` declared on the function `consts`
+   |
+note: required by a const generic parameter in `to_reuse::consts`
+  --> $DIR/free-fn-to-free-fn.rs:5:19
+   |
+LL |     pub fn consts<const N: i32>() -> i32 {
+   |                   ^^^^^^^^^^^^ required by this const generic parameter in `consts`
+help: consider specifying the generic argument
+   |
+LL | reuse to_reuse::consts::<N>;
+   |                       +++++
+
+error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
+  --> $DIR/free-fn-to-free-fn.rs:21:12
+   |
+LL |     late::<'static>(&0u8);
+   |            ^^^^^^^
+   |
+note: the late bound lifetime parameter is introduced here
+  --> $DIR/free-fn-to-free-fn.rs:8:17
+   |
+LL |     pub fn late<'a>(x: &'a u8) -> u8 {
+   |                 ^^
+
+error[E0277]: the trait bound `S: Clone` is not satisfied
+  --> $DIR/free-fn-to-free-fn.rs:25:12
+   |
+LL |     bounds(S);
+   |     ------ ^ the trait `Clone` is not implemented for `S`
+   |     |
+   |     required by a bound introduced by this call
+   |
+note: required by a bound in `bounds`
+  --> $DIR/free-fn-to-free-fn.rs:11:22
+   |
+LL |     pub fn bounds<T: Clone>(_: T) {}
+   |                      ^^^^^ required by this bound in `bounds`
+...
+LL | reuse to_reuse::bounds;
+   |                 ------ required by a bound in this function
+help: consider annotating `S` with `#[derive(Clone)]`
+   |
+LL +     #[derive(Clone)]
+LL |     struct S;
+   |
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0277, E0284, E0794.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/delegation/generics/free-fn-to-trait-method-pass.rs b/tests/ui/delegation/generics/free-fn-to-trait-method-pass.rs
new file mode 100644
index 00000000000..f7b7c09e2ca
--- /dev/null
+++ b/tests/ui/delegation/generics/free-fn-to-trait-method-pass.rs
@@ -0,0 +1,30 @@
+//@ run-pass
+#![feature(fn_delegation)]
+#![allow(incomplete_features)]
+
+mod types {
+    pub trait Trait<T> {
+        fn foo<U>(&self, x: U, y: T) -> (T, U) {(y, x)}
+    }
+    impl<T> Trait<T> for u8 {}
+}
+
+mod types_and_lifetimes {
+    pub trait Trait<'a, T> {
+        fn foo<'b, U>(&self, _: &'b U, _: &'a T) -> bool {
+            true
+        }
+    }
+    impl<'a, T> Trait<'a, T> for u8 {}
+}
+
+reuse types::Trait::foo as types;
+reuse types_and_lifetimes::Trait::foo as types_and_lifetimes;
+
+fn main() {
+    assert_eq!(types(&2, "str", 1), (1, "str"));
+
+    struct T;
+    struct U;
+    assert_eq!(types_and_lifetimes::<u8, T, U>(&1, &U, &T), true);
+}
diff --git a/tests/ui/delegation/generics/free-fn-to-trait-method.rs b/tests/ui/delegation/generics/free-fn-to-trait-method.rs
new file mode 100644
index 00000000000..70be1a4ace7
--- /dev/null
+++ b/tests/ui/delegation/generics/free-fn-to-trait-method.rs
@@ -0,0 +1,56 @@
+#![feature(fn_delegation)]
+#![allow(incomplete_features)]
+
+mod default_param {
+    pub trait Trait<T = u32> {
+        fn foo(&self, _: T) {}
+    }
+
+    impl<T> Trait<T> for u8 {}
+}
+
+mod types_and_lifetimes {
+    pub trait Trait<'a, T> {
+        fn foo<'b: 'b>(&'a self, x: &'b T) {
+            loop {}
+        }
+    }
+    impl<'a, T> Trait<'a, T> for u8 {}
+}
+
+mod bounds {
+    pub trait Trait<T> {
+        fn foo<U: Clone>(&self, t: T, u: U) where T: Copy {}
+    }
+
+    impl<T> Trait<T> for u8 {}
+}
+
+mod generic_arguments {
+    trait Trait<T> {
+        fn foo<U>(&self, _: U, _: T) {}
+    }
+
+    impl<T> Trait<T> for u8 {}
+
+    reuse Trait::<_>::foo::<i32> as generic_arguments1;
+    //~^ ERROR mismatched types
+    reuse <u8 as Trait<_>>::foo as generic_arguments2;
+    //~^ ERROR mismatched types
+    reuse <_ as Trait<_>>::foo as generic_arguments3; // OK
+}
+
+reuse default_param::Trait::foo as default_param;
+reuse types_and_lifetimes::Trait::foo as types_and_lifetimes;
+reuse bounds::Trait::foo as bounds;
+
+fn main() {
+    default_param(&0u8, "hello world"); // OK, default params are not substituted
+    types_and_lifetimes::<'static, 'static, _, _>(&0u8, &0u16); // OK, lifetimes go first
+
+    struct S;
+    struct U;
+    bounds(&0u8, S, U);
+    //~^ ERROR the trait bound `S: Copy` is not satisfied
+    //~| ERROR the trait bound `U: Clone` is not satisfied
+}
diff --git a/tests/ui/delegation/generics/free-fn-to-trait-method.stderr b/tests/ui/delegation/generics/free-fn-to-trait-method.stderr
new file mode 100644
index 00000000000..d8299d00c7e
--- /dev/null
+++ b/tests/ui/delegation/generics/free-fn-to-trait-method.stderr
@@ -0,0 +1,88 @@
+error[E0308]: mismatched types
+  --> $DIR/free-fn-to-trait-method.rs:36:23
+   |
+LL |         fn foo<U>(&self, _: U, _: T) {}
+   |                - found this type parameter
+...
+LL |     reuse Trait::<_>::foo::<i32> as generic_arguments1;
+   |                       ^^^
+   |                       |
+   |                       expected `i32`, found type parameter `U`
+   |                       arguments to this function are incorrect
+   |
+   = note:        expected type `i32`
+           found type parameter `U`
+note: method defined here
+  --> $DIR/free-fn-to-trait-method.rs:31:12
+   |
+LL |         fn foo<U>(&self, _: U, _: T) {}
+   |            ^^^           ----
+
+error[E0308]: mismatched types
+  --> $DIR/free-fn-to-trait-method.rs:38:29
+   |
+LL |     trait Trait<T> {
+   |     -------------- found this type parameter
+...
+LL |     reuse <u8 as Trait<_>>::foo as generic_arguments2;
+   |                             ^^^
+   |                             |
+   |                             expected `&u8`, found `&Self`
+   |                             arguments to this function are incorrect
+   |
+   = note: expected reference `&u8`
+              found reference `&Self`
+note: method defined here
+  --> $DIR/free-fn-to-trait-method.rs:31:12
+   |
+LL |         fn foo<U>(&self, _: U, _: T) {}
+   |            ^^^    -----
+
+error[E0277]: the trait bound `S: Copy` is not satisfied
+  --> $DIR/free-fn-to-trait-method.rs:53:18
+   |
+LL |     bounds(&0u8, S, U);
+   |     ------       ^ the trait `Copy` is not implemented for `S`
+   |     |
+   |     required by a bound introduced by this call
+   |
+note: required by a bound in `bounds`
+  --> $DIR/free-fn-to-trait-method.rs:23:54
+   |
+LL |         fn foo<U: Clone>(&self, t: T, u: U) where T: Copy {}
+   |                                                      ^^^^ required by this bound in `bounds`
+...
+LL | reuse bounds::Trait::foo as bounds;
+   |                             ------ required by a bound in this function
+help: consider annotating `S` with `#[derive(Copy)]`
+   |
+LL +     #[derive(Copy)]
+LL |     struct S;
+   |
+
+error[E0277]: the trait bound `U: Clone` is not satisfied
+  --> $DIR/free-fn-to-trait-method.rs:53:21
+   |
+LL |     bounds(&0u8, S, U);
+   |     ------          ^ the trait `Clone` is not implemented for `U`
+   |     |
+   |     required by a bound introduced by this call
+   |
+note: required by a bound in `bounds`
+  --> $DIR/free-fn-to-trait-method.rs:23:19
+   |
+LL |         fn foo<U: Clone>(&self, t: T, u: U) where T: Copy {}
+   |                   ^^^^^ required by this bound in `bounds`
+...
+LL | reuse bounds::Trait::foo as bounds;
+   |                             ------ required by a bound in this function
+help: consider annotating `U` with `#[derive(Clone)]`
+   |
+LL +     #[derive(Clone)]
+LL |     struct U;
+   |
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0277, E0308.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/delegation/ice-issue-124347.rs b/tests/ui/delegation/ice-issue-124347.rs
index 82a96055099..3bfae8face5 100644
--- a/tests/ui/delegation/ice-issue-124347.rs
+++ b/tests/ui/delegation/ice-issue-124347.rs
@@ -6,7 +6,8 @@ trait Trait {
     //~^ ERROR recursive delegation is not supported yet
 }
 
+// FIXME(fn_delegation): `recursive delegation` error should be emitted here
 reuse foo;
-//~^ ERROR recursive delegation is not supported yet
+//~^ ERROR cycle detected when computing generics of `foo`
 
 fn main() {}
diff --git a/tests/ui/delegation/ice-issue-124347.stderr b/tests/ui/delegation/ice-issue-124347.stderr
index 5a3f4525d29..87dd75ffec8 100644
--- a/tests/ui/delegation/ice-issue-124347.stderr
+++ b/tests/ui/delegation/ice-issue-124347.stderr
@@ -4,11 +4,20 @@ error: recursive delegation is not supported yet
 LL |     reuse Trait::foo { &self.0 }
    |                  ^^^ callee defined here
 
-error: recursive delegation is not supported yet
-  --> $DIR/ice-issue-124347.rs:9:7
+error[E0391]: cycle detected when computing generics of `foo`
+  --> $DIR/ice-issue-124347.rs:10:7
+   |
+LL | reuse foo;
+   |       ^^^
+   |
+   = note: ...which immediately requires computing generics of `foo` again
+note: cycle used when checking that `foo` is well-formed
+  --> $DIR/ice-issue-124347.rs:10:7
    |
 LL | reuse foo;
-   |       ^^^ callee defined here
+   |       ^^^
+   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
 
 error: aborting due to 2 previous errors
 
+For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/delegation/not-supported.rs b/tests/ui/delegation/not-supported.rs
index 25d7a4cb895..d5ac68ecf1b 100644
--- a/tests/ui/delegation/not-supported.rs
+++ b/tests/ui/delegation/not-supported.rs
@@ -1,4 +1,6 @@
+#![feature(const_trait_impl)]
 #![feature(c_variadic)]
+#![feature(effects)]
 #![feature(fn_delegation)]
 #![allow(incomplete_features)]
 
@@ -14,9 +16,9 @@ mod generics {
         fn foo3<'a: 'a>(_: &'a u32) {}
 
         reuse GenericTrait::bar;
-        //~^ ERROR delegation with early bound generics is not supported yet
+        //~^ ERROR early bound generics are not supported for associated delegation items
         reuse GenericTrait::bar1;
-        //~^ ERROR delegation with early bound generics is not supported yet
+        //~^ ERROR early bound generics are not supported for associated delegation items
     }
 
     struct F;
@@ -27,37 +29,37 @@ mod generics {
 
     impl<T> GenericTrait<T> for S {
         reuse <F as GenericTrait<T>>::bar { &self.0 }
-        //~^ ERROR delegation with early bound generics is not supported yet
+        //~^ ERROR early bound generics are not supported for associated delegation items
         reuse GenericTrait::<T>::bar1;
-        //~^ ERROR delegation with early bound generics is not supported yet
+        //~^ ERROR early bound generics are not supported for associated delegation items
     }
 
     impl GenericTrait<()> for () {
         reuse GenericTrait::bar { &F }
-        //~^ ERROR delegation with early bound generics is not supported yet
+        //~^ ERROR early bound generics are not supported for associated delegation items
         reuse GenericTrait::bar1;
-        //~^ ERROR delegation with early bound generics is not supported yet
+        //~^ ERROR early bound generics are not supported for associated delegation items
     }
 
     impl Trait for &S {
         reuse Trait::foo;
-        //~^ ERROR delegation with early bound generics is not supported yet
+        //~^ ERROR early bound generics are not supported for associated delegation items
     }
 
     impl Trait for S {
         reuse Trait::foo1 { &self.0 }
         reuse Trait::foo2 { &self.0 }
-        //~^ ERROR delegation with early bound generics is not supported yet
+        //~^ ERROR early bound generics are not supported for associated delegation items
         //~| ERROR method `foo2` has 0 type parameters but its trait declaration has 1 type parameter
         reuse <F as Trait>::foo3;
-        //~^ ERROR delegation with early bound generics is not supported yet
-        //~| ERROR lifetime parameters or bounds on method `foo3` do not match the trait declaration
+        //~^ ERROR early bound generics are not supported for associated delegation items
+        //~| ERROR lifetime parameters or bounds on associated function `foo3` do not match the trait declaration
     }
 
     struct GenericS<T>(T);
     impl<T> Trait for GenericS<T> {
         reuse Trait::foo { &self.0 }
-        //~^ ERROR delegation with early bound generics is not supported yet
+        //~^ ERROR early bound generics are not supported for associated delegation items
     }
 }
 
@@ -68,13 +70,10 @@ mod opaque {
     mod to_reuse {
         use super::Trait;
 
-        pub fn opaque_arg(_: impl Trait) -> i32 { 0 }
         pub fn opaque_ret() -> impl Trait { unimplemented!() }
         //~^ warn: this function depends on never type fallback being `()`
         //~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
     }
-    reuse to_reuse::opaque_arg;
-    //~^ ERROR delegation with early bound generics is not supported yet
 
     trait ToReuse {
         fn opaque_ret() -> impl Trait { unimplemented!() }
@@ -104,4 +103,14 @@ mod recursive {
     //~^ ERROR recursive delegation is not supported yet
 }
 
+mod effects {
+    #[const_trait]
+    trait Trait {
+        fn foo();
+    }
+
+    reuse Trait::foo;
+    //~^ ERROR delegation to a function with effect parameter is not supported yet
+}
+
 fn main() {}
diff --git a/tests/ui/delegation/not-supported.stderr b/tests/ui/delegation/not-supported.stderr
index 4ce01fd5d88..14d6b374bd2 100644
--- a/tests/ui/delegation/not-supported.stderr
+++ b/tests/ui/delegation/not-supported.stderr
@@ -1,5 +1,10 @@
-error: delegation with early bound generics is not supported yet
-  --> $DIR/not-supported.rs:16:29
+error: using `#![feature(effects)]` without enabling next trait solver globally
+   |
+   = note: the next trait solver must be enabled globally for the effects feature to work correctly
+   = help: use `-Znext-solver` to enable
+
+error: early bound generics are not supported for associated delegation items
+  --> $DIR/not-supported.rs:18:29
    |
 LL |         fn bar(&self, x: T) -> T { x }
    |         ------------------------ callee defined here
@@ -7,8 +12,8 @@ LL |         fn bar(&self, x: T) -> T { x }
 LL |         reuse GenericTrait::bar;
    |                             ^^^
 
-error: delegation with early bound generics is not supported yet
-  --> $DIR/not-supported.rs:18:29
+error: early bound generics are not supported for associated delegation items
+  --> $DIR/not-supported.rs:20:29
    |
 LL |         fn bar1() {}
    |         --------- callee defined here
@@ -16,8 +21,8 @@ LL |         fn bar1() {}
 LL |         reuse GenericTrait::bar1;
    |                             ^^^^
 
-error: delegation with early bound generics is not supported yet
-  --> $DIR/not-supported.rs:29:39
+error: early bound generics are not supported for associated delegation items
+  --> $DIR/not-supported.rs:31:39
    |
 LL |         fn bar(&self, x: T) -> T { x }
    |         ------------------------ callee defined here
@@ -25,8 +30,8 @@ LL |         fn bar(&self, x: T) -> T { x }
 LL |         reuse <F as GenericTrait<T>>::bar { &self.0 }
    |                                       ^^^
 
-error: delegation with early bound generics is not supported yet
-  --> $DIR/not-supported.rs:31:34
+error: early bound generics are not supported for associated delegation items
+  --> $DIR/not-supported.rs:33:34
    |
 LL |         fn bar1() {}
    |         --------- callee defined here
@@ -34,8 +39,8 @@ LL |         fn bar1() {}
 LL |         reuse GenericTrait::<T>::bar1;
    |                                  ^^^^
 
-error: delegation with early bound generics is not supported yet
-  --> $DIR/not-supported.rs:36:29
+error: early bound generics are not supported for associated delegation items
+  --> $DIR/not-supported.rs:38:29
    |
 LL |         fn bar(&self, x: T) -> T { x }
    |         ------------------------ callee defined here
@@ -43,8 +48,8 @@ LL |         fn bar(&self, x: T) -> T { x }
 LL |         reuse GenericTrait::bar { &F }
    |                             ^^^
 
-error: delegation with early bound generics is not supported yet
-  --> $DIR/not-supported.rs:38:29
+error: early bound generics are not supported for associated delegation items
+  --> $DIR/not-supported.rs:40:29
    |
 LL |         fn bar1() {}
    |         --------- callee defined here
@@ -52,8 +57,8 @@ LL |         fn bar1() {}
 LL |         reuse GenericTrait::bar1;
    |                             ^^^^
 
-error: delegation with early bound generics is not supported yet
-  --> $DIR/not-supported.rs:43:22
+error: early bound generics are not supported for associated delegation items
+  --> $DIR/not-supported.rs:45:22
    |
 LL |         fn foo(&self, x: i32) -> i32 { x }
    |         ---------------------------- callee defined here
@@ -62,7 +67,7 @@ LL |         reuse Trait::foo;
    |                      ^^^
 
 error[E0049]: method `foo2` has 0 type parameters but its trait declaration has 1 type parameter
-  --> $DIR/not-supported.rs:49:22
+  --> $DIR/not-supported.rs:51:22
    |
 LL |         fn foo2<T>(&self, x: T) -> T { x }
    |                 - expected 1 type parameter
@@ -70,8 +75,8 @@ LL |         fn foo2<T>(&self, x: T) -> T { x }
 LL |         reuse Trait::foo2 { &self.0 }
    |                      ^^^^ found 0 type parameters
 
-error: delegation with early bound generics is not supported yet
-  --> $DIR/not-supported.rs:52:29
+error: early bound generics are not supported for associated delegation items
+  --> $DIR/not-supported.rs:54:29
    |
 LL |         fn foo3<'a: 'a>(_: &'a u32) {}
    |         --------------------------- callee defined here
@@ -79,17 +84,26 @@ LL |         fn foo3<'a: 'a>(_: &'a u32) {}
 LL |         reuse <F as Trait>::foo3;
    |                             ^^^^
 
-error[E0195]: lifetime parameters or bounds on method `foo3` do not match the trait declaration
-  --> $DIR/not-supported.rs:52:29
+error[E0195]: lifetime parameters or bounds on associated function `foo3` do not match the trait declaration
+  --> $DIR/not-supported.rs:54:29
    |
 LL |         fn foo3<'a: 'a>(_: &'a u32) {}
-   |                -------- lifetimes in impl do not match this method in trait
+   |                -------- lifetimes in impl do not match this associated function in trait
 ...
 LL |         reuse <F as Trait>::foo3;
-   |                             ^^^^ lifetimes do not match method in trait
+   |                             ^^^^ lifetimes do not match associated function in trait
 
-error: delegation with early bound generics is not supported yet
-  --> $DIR/not-supported.rs:59:22
+error: delegation to a function with effect parameter is not supported yet
+  --> $DIR/not-supported.rs:112:18
+   |
+LL |         fn foo();
+   |         --------- callee defined here
+...
+LL |     reuse Trait::foo;
+   |                  ^^^
+
+error: early bound generics are not supported for associated delegation items
+  --> $DIR/not-supported.rs:61:22
    |
 LL |         fn foo(&self, x: i32) -> i32 { x }
    |         ---------------------------- callee defined here
@@ -97,8 +111,8 @@ LL |         fn foo(&self, x: i32) -> i32 { x }
 LL |         reuse Trait::foo { &self.0 }
    |                      ^^^
 
-error: delegation with early bound generics is not supported yet
-  --> $DIR/not-supported.rs:49:22
+error: early bound generics are not supported for associated delegation items
+  --> $DIR/not-supported.rs:51:22
    |
 LL |         fn foo2<T>(&self, x: T) -> T { x }
    |         ---------------------------- callee defined here
@@ -106,17 +120,8 @@ LL |         fn foo2<T>(&self, x: T) -> T { x }
 LL |         reuse Trait::foo2 { &self.0 }
    |                      ^^^^
 
-error: delegation with early bound generics is not supported yet
-  --> $DIR/not-supported.rs:76:21
-   |
-LL |         pub fn opaque_arg(_: impl Trait) -> i32 { 0 }
-   |         --------------------------------------- callee defined here
-...
-LL |     reuse to_reuse::opaque_arg;
-   |                     ^^^^^^^^^^
-
 warning: this function depends on never type fallback being `()`
-  --> $DIR/not-supported.rs:80:9
+  --> $DIR/not-supported.rs:79:9
    |
 LL |         fn opaque_ret() -> impl Trait { unimplemented!() }
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -125,33 +130,33 @@ LL |         fn opaque_ret() -> impl Trait { unimplemented!() }
    = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
    = help: specify the types explicitly
 note: in edition 2024, the requirement `!: opaque::Trait` will fail
-  --> $DIR/not-supported.rs:80:28
+  --> $DIR/not-supported.rs:79:28
    |
 LL |         fn opaque_ret() -> impl Trait { unimplemented!() }
    |                            ^^^^^^^^^^
    = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
 
-error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/not-supported.rs:86:5: 86:24>::{synthetic#0}`
-  --> $DIR/not-supported.rs:87:25
+error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/not-supported.rs:85:5: 85:24>::{synthetic#0}`
+  --> $DIR/not-supported.rs:86:25
    |
 LL |         reuse to_reuse::opaque_ret;
    |                         ^^^^^^^^^^
    |
 note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process...
-  --> $DIR/not-supported.rs:87:25
+  --> $DIR/not-supported.rs:86:25
    |
 LL |         reuse to_reuse::opaque_ret;
    |                         ^^^^^^^^^^
-   = note: ...which again requires computing type of `opaque::<impl at $DIR/not-supported.rs:86:5: 86:24>::{synthetic#0}`, completing the cycle
-note: cycle used when checking that `opaque::<impl at $DIR/not-supported.rs:86:5: 86:24>` is well-formed
-  --> $DIR/not-supported.rs:86:5
+   = note: ...which again requires computing type of `opaque::<impl at $DIR/not-supported.rs:85:5: 85:24>::{synthetic#0}`, completing the cycle
+note: cycle used when checking that `opaque::<impl at $DIR/not-supported.rs:85:5: 85:24>` is well-formed
+  --> $DIR/not-supported.rs:85:5
    |
 LL |     impl ToReuse for u8 {
    |     ^^^^^^^^^^^^^^^^^^^
    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
 
 warning: this function depends on never type fallback being `()`
-  --> $DIR/not-supported.rs:72:9
+  --> $DIR/not-supported.rs:73:9
    |
 LL |         pub fn opaque_ret() -> impl Trait { unimplemented!() }
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -160,32 +165,32 @@ LL |         pub fn opaque_ret() -> impl Trait { unimplemented!() }
    = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
    = help: specify the types explicitly
 note: in edition 2024, the requirement `!: opaque::Trait` will fail
-  --> $DIR/not-supported.rs:72:32
+  --> $DIR/not-supported.rs:73:32
    |
 LL |         pub fn opaque_ret() -> impl Trait { unimplemented!() }
    |                                ^^^^^^^^^^
 
-error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/not-supported.rs:89:5: 89:25>::{synthetic#0}`
-  --> $DIR/not-supported.rs:90:24
+error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/not-supported.rs:88:5: 88:25>::{synthetic#0}`
+  --> $DIR/not-supported.rs:89:24
    |
 LL |         reuse ToReuse::opaque_ret;
    |                        ^^^^^^^^^^
    |
 note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process...
-  --> $DIR/not-supported.rs:90:24
+  --> $DIR/not-supported.rs:89:24
    |
 LL |         reuse ToReuse::opaque_ret;
    |                        ^^^^^^^^^^
-   = note: ...which again requires computing type of `opaque::<impl at $DIR/not-supported.rs:89:5: 89:25>::{synthetic#0}`, completing the cycle
-note: cycle used when checking that `opaque::<impl at $DIR/not-supported.rs:89:5: 89:25>` is well-formed
-  --> $DIR/not-supported.rs:89:5
+   = note: ...which again requires computing type of `opaque::<impl at $DIR/not-supported.rs:88:5: 88:25>::{synthetic#0}`, completing the cycle
+note: cycle used when checking that `opaque::<impl at $DIR/not-supported.rs:88:5: 88:25>` is well-formed
+  --> $DIR/not-supported.rs:88:5
    |
 LL |     impl ToReuse for u16 {
    |     ^^^^^^^^^^^^^^^^^^^^
    = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
 
 error: recursive delegation is not supported yet
-  --> $DIR/not-supported.rs:103:22
+  --> $DIR/not-supported.rs:102:22
    |
 LL |         pub reuse to_reuse2::foo;
    |                              --- callee defined here
@@ -193,7 +198,7 @@ LL |         pub reuse to_reuse2::foo;
 LL |     reuse to_reuse1::foo;
    |                      ^^^
 
-error: aborting due to 16 previous errors; 2 warnings emitted
+error: aborting due to 17 previous errors; 2 warnings emitted
 
 Some errors have detailed explanations: E0049, E0195, E0391.
 For more information about an error, try `rustc --explain E0049`.
diff --git a/tests/ui/delegation/target-expr.rs b/tests/ui/delegation/target-expr.rs
index fd7ea943b9d..f766ca7356a 100644
--- a/tests/ui/delegation/target-expr.rs
+++ b/tests/ui/delegation/target-expr.rs
@@ -14,9 +14,7 @@ fn foo(x: i32) -> i32 { x }
 
 fn bar<T: Default>(_: T) {
     reuse Trait::static_method {
-    //~^ ERROR delegation to a trait method from a free function is not supported yet
-    //~| ERROR delegation with early bound generics is not supported yet
-    //~| ERROR mismatched types
+    //~^ ERROR mismatched types
         let _ = T::Default();
         //~^ ERROR can't use generic parameters from outer item
     }
@@ -25,7 +23,6 @@ fn bar<T: Default>(_: T) {
 fn main() {
     let y = 0;
     reuse <S as Trait>::static_method {
-    //~^ ERROR delegation to a trait method from a free function is not supported yet
         let x = y;
         //~^ ERROR can't capture dynamic environment in a fn item
         foo(self);
diff --git a/tests/ui/delegation/target-expr.stderr b/tests/ui/delegation/target-expr.stderr
index b30f0c474c6..f5556bf9f45 100644
--- a/tests/ui/delegation/target-expr.stderr
+++ b/tests/ui/delegation/target-expr.stderr
@@ -1,16 +1,16 @@
 error[E0401]: can't use generic parameters from outer item
-  --> $DIR/target-expr.rs:20:17
+  --> $DIR/target-expr.rs:18:17
    |
 LL | fn bar<T: Default>(_: T) {
    |        - type parameter from outer item
 LL |     reuse Trait::static_method {
    |                               - help: try introducing a local generic parameter here: `T,`
-...
+LL |
 LL |         let _ = T::Default();
    |                 ^^^^^^^^^^ use of generic parameter from outer item
 
 error[E0434]: can't capture dynamic environment in a fn item
-  --> $DIR/target-expr.rs:29:17
+  --> $DIR/target-expr.rs:26:17
    |
 LL |         let x = y;
    |                 ^
@@ -18,7 +18,7 @@ LL |         let x = y;
    = help: use the `|| { ... }` closure form instead
 
 error[E0424]: expected value, found module `self`
-  --> $DIR/target-expr.rs:36:5
+  --> $DIR/target-expr.rs:33:5
    |
 LL | fn main() {
    |    ---- this function can't have a `self` parameter
@@ -27,58 +27,29 @@ LL |     self.0;
    |     ^^^^ `self` value is a keyword only available in methods with a `self` parameter
 
 error[E0425]: cannot find value `x` in this scope
-  --> $DIR/target-expr.rs:38:13
+  --> $DIR/target-expr.rs:35:13
    |
 LL |     let z = x;
    |             ^
    |
 help: the binding `x` is available in a different scope in the same function
-  --> $DIR/target-expr.rs:29:13
+  --> $DIR/target-expr.rs:26:13
    |
 LL |         let x = y;
    |             ^
 
-error: delegation with early bound generics is not supported yet
-  --> $DIR/target-expr.rs:16:18
-   |
-LL |     fn static_method(x: i32) -> i32 { x }
-   |     ------------------------------- callee defined here
-...
-LL |     reuse Trait::static_method {
-   |                  ^^^^^^^^^^^^^
-
-error: delegation to a trait method from a free function is not supported yet
-  --> $DIR/target-expr.rs:16:18
-   |
-LL |     fn static_method(x: i32) -> i32 { x }
-   |     ------------------------------- callee defined here
-...
-LL |     reuse Trait::static_method {
-   |                  ^^^^^^^^^^^^^
-
-error: delegation to a trait method from a free function is not supported yet
-  --> $DIR/target-expr.rs:27:25
-   |
-LL |     fn static_method(x: i32) -> i32 { x }
-   |     ------------------------------- callee defined here
-...
-LL |     reuse <S as Trait>::static_method {
-   |                         ^^^^^^^^^^^^^
-
 error[E0308]: mismatched types
   --> $DIR/target-expr.rs:16:32
    |
 LL |       reuse Trait::static_method {
    |  ________________________________^
 LL | |
-LL | |
-LL | |
 LL | |         let _ = T::Default();
 LL | |
 LL | |     }
    | |_____^ expected `i32`, found `()`
 
-error: aborting due to 8 previous errors
+error: aborting due to 5 previous errors
 
 Some errors have detailed explanations: E0308, E0401, E0424, E0425, E0434.
 For more information about an error, try `rustc --explain E0308`.
diff --git a/tests/ui/derives/clone-debug-dead-code-in-the-same-struct.rs b/tests/ui/derives/clone-debug-dead-code-in-the-same-struct.rs
index 885dacc727a..6ab1fb7b039 100644
--- a/tests/ui/derives/clone-debug-dead-code-in-the-same-struct.rs
+++ b/tests/ui/derives/clone-debug-dead-code-in-the-same-struct.rs
@@ -1,9 +1,9 @@
 #![forbid(dead_code)]
 
 #[derive(Debug)]
-pub struct Whatever { //~ ERROR struct `Whatever` is never constructed
+pub struct Whatever {
     pub field0: (),
-    field1: (),
+    field1: (), //~ ERROR fields `field1`, `field2`, `field3`, and `field4` are never read
     field2: (),
     field3: (),
     field4: (),
diff --git a/tests/ui/derives/clone-debug-dead-code-in-the-same-struct.stderr b/tests/ui/derives/clone-debug-dead-code-in-the-same-struct.stderr
index e10d28ad03a..e9b757b6bae 100644
--- a/tests/ui/derives/clone-debug-dead-code-in-the-same-struct.stderr
+++ b/tests/ui/derives/clone-debug-dead-code-in-the-same-struct.stderr
@@ -1,9 +1,19 @@
-error: struct `Whatever` is never constructed
-  --> $DIR/clone-debug-dead-code-in-the-same-struct.rs:4:12
+error: fields `field1`, `field2`, `field3`, and `field4` are never read
+  --> $DIR/clone-debug-dead-code-in-the-same-struct.rs:6:5
    |
 LL | pub struct Whatever {
-   |            ^^^^^^^^
+   |            -------- fields in this struct
+LL |     pub field0: (),
+LL |     field1: (),
+   |     ^^^^^^
+LL |     field2: (),
+   |     ^^^^^^
+LL |     field3: (),
+   |     ^^^^^^
+LL |     field4: (),
+   |     ^^^^^^
    |
+   = note: `Whatever` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
 note: the lint level is defined here
   --> $DIR/clone-debug-dead-code-in-the-same-struct.rs:1:11
    |
diff --git a/tests/ui/derives/deriving-with-repr-packed.rs b/tests/ui/derives/deriving-with-repr-packed.rs
index 58be4519720..d17b52842ce 100644
--- a/tests/ui/derives/deriving-with-repr-packed.rs
+++ b/tests/ui/derives/deriving-with-repr-packed.rs
@@ -22,25 +22,22 @@ struct Y(usize);
 struct X(Y);
 //~^ ERROR cannot move out of `self` which is behind a shared reference
 
-// This is currently allowed, but will be phased out at some point. From
-// `zerovec` within icu4x-0.9.0.
 #[derive(Debug)]
 #[repr(packed)]
 struct FlexZeroSlice {
     width: u8,
     data: [u8],
-    //~^ WARNING byte slice in a packed struct that derives a built-in trait
-    //~^^ this was previously accepted
+    //~^ ERROR cannot move
+    //~| ERROR cannot move
 }
 
-// Again, currently allowed, but will be phased out.
 #[derive(Debug)]
 #[repr(packed)]
 struct WithStr {
     width: u8,
     data: str,
-    //~^ WARNING string slice in a packed struct that derives a built-in trait
-    //~^^ this was previously accepted
+    //~^ ERROR cannot move
+    //~| ERROR cannot move
 }
 
 fn main() {}
diff --git a/tests/ui/derives/deriving-with-repr-packed.stderr b/tests/ui/derives/deriving-with-repr-packed.stderr
index a8523d25cab..321ffb27eeb 100644
--- a/tests/ui/derives/deriving-with-repr-packed.stderr
+++ b/tests/ui/derives/deriving-with-repr-packed.stderr
@@ -1,32 +1,3 @@
-warning: byte slice in a packed struct that derives a built-in trait
-  --> $DIR/deriving-with-repr-packed.rs:31:5
-   |
-LL | #[derive(Debug)]
-   |          ----- in this derive macro expansion
-...
-LL |     data: [u8],
-   |     ^^^^^^^^^^
-   |
-   = 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 #107457 <https://github.com/rust-lang/rust/issues/107457>
-   = help: consider implementing the trait by hand, or remove the `packed` attribute
-   = note: `#[warn(byte_slice_in_packed_struct_with_derive)]` on by default
-   = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: string slice in a packed struct that derives a built-in trait
-  --> $DIR/deriving-with-repr-packed.rs:41:5
-   |
-LL | #[derive(Debug)]
-   |          ----- in this derive macro expansion
-...
-LL |     data: str,
-   |     ^^^^^^^^^
-   |
-   = 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 #107457 <https://github.com/rust-lang/rust/issues/107457>
-   = help: consider implementing the trait by hand, or remove the `packed` attribute
-   = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
-
 error[E0507]: cannot move out of `self` which is behind a shared reference
   --> $DIR/deriving-with-repr-packed.rs:22:10
    |
@@ -47,38 +18,43 @@ LL | struct X(Y);
    = note: `#[derive(Debug)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
    = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: aborting due to 1 previous error; 2 warnings emitted
+error[E0161]: cannot move a value of type `[u8]`
+  --> $DIR/deriving-with-repr-packed.rs:29:5
+   |
+LL |     data: [u8],
+   |     ^^^^^^^^^^ the size of `[u8]` cannot be statically determined
 
-For more information about this error, try `rustc --explain E0507`.
-Future incompatibility report: Future breakage diagnostic:
-warning: byte slice in a packed struct that derives a built-in trait
-  --> $DIR/deriving-with-repr-packed.rs:31:5
+error[E0507]: cannot move out of `self.data` which is behind a shared reference
+  --> $DIR/deriving-with-repr-packed.rs:29:5
    |
 LL | #[derive(Debug)]
    |          ----- in this derive macro expansion
 ...
 LL |     data: [u8],
-   |     ^^^^^^^^^^
+   |     ^^^^^^^^^^ move occurs because `self.data` has type `[u8]`, which does not implement the `Copy` trait
+   |
+   = note: `#[derive(Debug)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
+   = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0161]: cannot move a value of type `str`
+  --> $DIR/deriving-with-repr-packed.rs:38:5
    |
-   = 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 #107457 <https://github.com/rust-lang/rust/issues/107457>
-   = help: consider implementing the trait by hand, or remove the `packed` attribute
-   = note: `#[warn(byte_slice_in_packed_struct_with_derive)]` on by default
-   = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
+LL |     data: str,
+   |     ^^^^^^^^^ the size of `str` cannot be statically determined
 
-Future breakage diagnostic:
-warning: string slice in a packed struct that derives a built-in trait
-  --> $DIR/deriving-with-repr-packed.rs:41:5
+error[E0507]: cannot move out of `self.data` which is behind a shared reference
+  --> $DIR/deriving-with-repr-packed.rs:38:5
    |
 LL | #[derive(Debug)]
    |          ----- in this derive macro expansion
 ...
 LL |     data: str,
-   |     ^^^^^^^^^
+   |     ^^^^^^^^^ move occurs because `self.data` has type `str`, which does not implement the `Copy` trait
    |
-   = 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 #107457 <https://github.com/rust-lang/rust/issues/107457>
-   = help: consider implementing the trait by hand, or remove the `packed` attribute
-   = note: `#[warn(byte_slice_in_packed_struct_with_derive)]` on by default
-   = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: `#[derive(Debug)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
+   = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 5 previous errors
 
+Some errors have detailed explanations: E0161, E0507.
+For more information about an error, try `rustc --explain E0161`.
diff --git a/tests/ui/deriving/deriving-all-codegen.rs b/tests/ui/deriving/deriving-all-codegen.rs
index 6fa4f74f2a5..eab2b4f1f53 100644
--- a/tests/ui/deriving/deriving-all-codegen.rs
+++ b/tests/ui/deriving/deriving-all-codegen.rs
@@ -73,16 +73,6 @@ impl Copy for PackedManualCopy {}
 #[derive(Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
 struct Unsized([u32]);
 
-// A packed struct with an unsized `[u8]` field. This is currently allowed, but
-// causes a warning and will be phased out at some point.
-#[derive(Debug, Hash)]
-#[repr(packed)]
-struct PackedUnsizedU8([u8]);
-//~^ WARNING byte slice in a packed struct that derives a built-in trait
-//~^^ WARNING byte slice in a packed struct that derives a built-in trait
-//~^^^ this was previously accepted
-//~^^^^ this was previously accepted
-
 trait Trait {
     type A;
 }
diff --git a/tests/ui/deriving/deriving-all-codegen.stderr b/tests/ui/deriving/deriving-all-codegen.stderr
deleted file mode 100644
index 503f0cae73b..00000000000
--- a/tests/ui/deriving/deriving-all-codegen.stderr
+++ /dev/null
@@ -1,63 +0,0 @@
-warning: byte slice in a packed struct that derives a built-in trait
-  --> $DIR/deriving-all-codegen.rs:80:24
-   |
-LL | #[derive(Debug, Hash)]
-   |          ----- in this derive macro expansion
-LL | #[repr(packed)]
-LL | struct PackedUnsizedU8([u8]);
-   |                        ^^^^
-   |
-   = 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 #107457 <https://github.com/rust-lang/rust/issues/107457>
-   = help: consider implementing the trait by hand, or remove the `packed` attribute
-   = note: `#[warn(byte_slice_in_packed_struct_with_derive)]` on by default
-   = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: byte slice in a packed struct that derives a built-in trait
-  --> $DIR/deriving-all-codegen.rs:80:24
-   |
-LL | #[derive(Debug, Hash)]
-   |                 ---- in this derive macro expansion
-LL | #[repr(packed)]
-LL | struct PackedUnsizedU8([u8]);
-   |                        ^^^^
-   |
-   = 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 #107457 <https://github.com/rust-lang/rust/issues/107457>
-   = help: consider implementing the trait by hand, or remove the `packed` attribute
-   = note: this warning originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-warning: 2 warnings emitted
-
-Future incompatibility report: Future breakage diagnostic:
-warning: byte slice in a packed struct that derives a built-in trait
-  --> $DIR/deriving-all-codegen.rs:80:24
-   |
-LL | #[derive(Debug, Hash)]
-   |          ----- in this derive macro expansion
-LL | #[repr(packed)]
-LL | struct PackedUnsizedU8([u8]);
-   |                        ^^^^
-   |
-   = 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 #107457 <https://github.com/rust-lang/rust/issues/107457>
-   = help: consider implementing the trait by hand, or remove the `packed` attribute
-   = note: `#[warn(byte_slice_in_packed_struct_with_derive)]` on by default
-   = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-Future breakage diagnostic:
-warning: byte slice in a packed struct that derives a built-in trait
-  --> $DIR/deriving-all-codegen.rs:80:24
-   |
-LL | #[derive(Debug, Hash)]
-   |                 ---- in this derive macro expansion
-LL | #[repr(packed)]
-LL | struct PackedUnsizedU8([u8]);
-   |                        ^^^^
-   |
-   = 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 #107457 <https://github.com/rust-lang/rust/issues/107457>
-   = help: consider implementing the trait by hand, or remove the `packed` attribute
-   = note: `#[warn(byte_slice_in_packed_struct_with_derive)]` on by default
-   = note: this warning originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
-
diff --git a/tests/ui/deriving/deriving-all-codegen.stdout b/tests/ui/deriving/deriving-all-codegen.stdout
index 6b69b57c516..6503c870990 100644
--- a/tests/ui/deriving/deriving-all-codegen.stdout
+++ b/tests/ui/deriving/deriving-all-codegen.stdout
@@ -516,26 +516,6 @@ impl ::core::cmp::Ord for Unsized {
     }
 }
 
-// A packed struct with an unsized `[u8]` field. This is currently allowed, but
-// causes a warning and will be phased out at some point.
-#[repr(packed)]
-struct PackedUnsizedU8([u8]);
-#[automatically_derived]
-impl ::core::fmt::Debug for PackedUnsizedU8 {
-    #[inline]
-    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
-        ::core::fmt::Formatter::debug_tuple_field1_finish(f,
-            "PackedUnsizedU8", &&self.0)
-    }
-}
-#[automatically_derived]
-impl ::core::hash::Hash for PackedUnsizedU8 {
-    #[inline]
-    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
-        ::core::hash::Hash::hash(&self.0, state)
-    }
-}
-
 trait Trait {
     type A;
 }
diff --git a/tests/ui/deriving/deriving-smart-pointer-expanded.rs b/tests/ui/deriving/deriving-smart-pointer-expanded.rs
new file mode 100644
index 00000000000..b78258c2529
--- /dev/null
+++ b/tests/ui/deriving/deriving-smart-pointer-expanded.rs
@@ -0,0 +1,22 @@
+//@ check-pass
+//@ compile-flags: -Zunpretty=expanded
+#![feature(derive_smart_pointer)]
+use std::marker::SmartPointer;
+
+pub trait MyTrait<T: ?Sized> {}
+
+#[derive(SmartPointer)]
+#[repr(transparent)]
+struct MyPointer<'a, #[pointee] T: ?Sized> {
+    ptr: &'a T,
+}
+
+#[derive(core::marker::SmartPointer)]
+#[repr(transparent)]
+pub struct MyPointer2<'a, Y, Z: MyTrait<T>, #[pointee] T: ?Sized + MyTrait<T>, X: MyTrait<T> = ()>
+where
+    Y: MyTrait<T>,
+{
+    data: &'a mut T,
+    x: core::marker::PhantomData<X>,
+}
diff --git a/tests/ui/deriving/deriving-smart-pointer-expanded.stdout b/tests/ui/deriving/deriving-smart-pointer-expanded.stdout
new file mode 100644
index 00000000000..3c7e7198180
--- /dev/null
+++ b/tests/ui/deriving/deriving-smart-pointer-expanded.stdout
@@ -0,0 +1,44 @@
+#![feature(prelude_import)]
+#![no_std]
+//@ check-pass
+//@ compile-flags: -Zunpretty=expanded
+#![feature(derive_smart_pointer)]
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+use std::marker::SmartPointer;
+
+pub trait MyTrait<T: ?Sized> {}
+
+#[repr(transparent)]
+struct MyPointer<'a, #[pointee] T: ?Sized> {
+    ptr: &'a T,
+}
+#[automatically_derived]
+impl<'a, T: ?Sized + ::core::marker::Unsize<__S>, __S: ?Sized>
+    ::core::ops::DispatchFromDyn<MyPointer<'a, __S>> for MyPointer<'a, T> {
+}
+#[automatically_derived]
+impl<'a, T: ?Sized + ::core::marker::Unsize<__S>, __S: ?Sized>
+    ::core::ops::CoerceUnsized<MyPointer<'a, __S>> for MyPointer<'a, T> {
+}
+
+#[repr(transparent)]
+pub struct MyPointer2<'a, Y, Z: MyTrait<T>, #[pointee] T: ?Sized + MyTrait<T>,
+    X: MyTrait<T> = ()> where Y: MyTrait<T> {
+    data: &'a mut T,
+    x: core::marker::PhantomData<X>,
+}
+#[automatically_derived]
+impl<'a, Y, Z: MyTrait<T> + MyTrait<__S>, T: ?Sized + MyTrait<T> +
+    ::core::marker::Unsize<__S>, __S: ?Sized + MyTrait<__S>, X: MyTrait<T> +
+    MyTrait<__S>> ::core::ops::DispatchFromDyn<MyPointer2<'a, Y, Z, __S, X>>
+    for MyPointer2<'a, Y, Z, T, X> where Y: MyTrait<T>, Y: MyTrait<__S> {
+}
+#[automatically_derived]
+impl<'a, Y, Z: MyTrait<T> + MyTrait<__S>, T: ?Sized + MyTrait<T> +
+    ::core::marker::Unsize<__S>, __S: ?Sized + MyTrait<__S>, X: MyTrait<T> +
+    MyTrait<__S>> ::core::ops::CoerceUnsized<MyPointer2<'a, Y, Z, __S, X>> for
+    MyPointer2<'a, Y, Z, T, X> where Y: MyTrait<T>, Y: MyTrait<__S> {
+}
diff --git a/tests/ui/deriving/deriving-smart-pointer-neg.rs b/tests/ui/deriving/deriving-smart-pointer-neg.rs
index bfb4e86b396..04f52a154fe 100644
--- a/tests/ui/deriving/deriving-smart-pointer-neg.rs
+++ b/tests/ui/deriving/deriving-smart-pointer-neg.rs
@@ -1,5 +1,6 @@
 #![feature(derive_smart_pointer, arbitrary_self_types)]
 
+extern crate core;
 use std::marker::SmartPointer;
 
 #[derive(SmartPointer)]
@@ -35,6 +36,13 @@ struct NotTransparent<'a, #[pointee] T: ?Sized> {
     ptr: &'a T,
 }
 
+#[derive(SmartPointer)]
+#[repr(transparent)]
+struct NoMaybeSized<'a, #[pointee] T> {
+    //~^ ERROR: `derive(SmartPointer)` requires T to be marked `?Sized`
+    ptr: &'a T,
+}
+
 // However, reordering attributes should work nevertheless.
 #[repr(transparent)]
 #[derive(SmartPointer)]
@@ -42,4 +50,26 @@ struct ThisIsAPossibleSmartPointer<'a, #[pointee] T: ?Sized> {
     ptr: &'a T,
 }
 
+// Also, these paths to Sized should work
+#[derive(SmartPointer)]
+#[repr(transparent)]
+struct StdSized<'a, #[pointee] T: ?std::marker::Sized> {
+    ptr: &'a T,
+}
+#[derive(SmartPointer)]
+#[repr(transparent)]
+struct CoreSized<'a, #[pointee] T: ?core::marker::Sized> {
+    ptr: &'a T,
+}
+#[derive(SmartPointer)]
+#[repr(transparent)]
+struct GlobalStdSized<'a, #[pointee] T: ?::std::marker::Sized> {
+    ptr: &'a T,
+}
+#[derive(SmartPointer)]
+#[repr(transparent)]
+struct GlobalCoreSized<'a, #[pointee] T: ?::core::marker::Sized> {
+    ptr: &'a T,
+}
+
 fn main() {}
diff --git a/tests/ui/deriving/deriving-smart-pointer-neg.stderr b/tests/ui/deriving/deriving-smart-pointer-neg.stderr
index d994a6ee376..8b0f91d41fb 100644
--- a/tests/ui/deriving/deriving-smart-pointer-neg.stderr
+++ b/tests/ui/deriving/deriving-smart-pointer-neg.stderr
@@ -1,5 +1,5 @@
 error: `SmartPointer` can only be derived on `struct`s with `#[repr(transparent)]`
-  --> $DIR/deriving-smart-pointer-neg.rs:5:10
+  --> $DIR/deriving-smart-pointer-neg.rs:6:10
    |
 LL | #[derive(SmartPointer)]
    |          ^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL | #[derive(SmartPointer)]
    = note: this error originates in the derive macro `SmartPointer` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: At least one generic type should be designated as `#[pointee]` in order to derive `SmartPointer` traits
-  --> $DIR/deriving-smart-pointer-neg.rs:11:10
+  --> $DIR/deriving-smart-pointer-neg.rs:12:10
    |
 LL | #[derive(SmartPointer)]
    |          ^^^^^^^^^^^^
@@ -15,7 +15,7 @@ LL | #[derive(SmartPointer)]
    = note: this error originates in the derive macro `SmartPointer` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `SmartPointer` can only be derived on `struct`s with at least one field
-  --> $DIR/deriving-smart-pointer-neg.rs:18:10
+  --> $DIR/deriving-smart-pointer-neg.rs:19:10
    |
 LL | #[derive(SmartPointer)]
    |          ^^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL | #[derive(SmartPointer)]
    = note: this error originates in the derive macro `SmartPointer` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `SmartPointer` can only be derived on `struct`s with at least one field
-  --> $DIR/deriving-smart-pointer-neg.rs:25:10
+  --> $DIR/deriving-smart-pointer-neg.rs:26:10
    |
 LL | #[derive(SmartPointer)]
    |          ^^^^^^^^^^^^
@@ -31,15 +31,21 @@ LL | #[derive(SmartPointer)]
    = note: this error originates in the derive macro `SmartPointer` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `SmartPointer` can only be derived on `struct`s with `#[repr(transparent)]`
-  --> $DIR/deriving-smart-pointer-neg.rs:32:10
+  --> $DIR/deriving-smart-pointer-neg.rs:33:10
    |
 LL | #[derive(SmartPointer)]
    |          ^^^^^^^^^^^^
    |
    = note: this error originates in the derive macro `SmartPointer` (in Nightly builds, run with -Z macro-backtrace for more info)
 
+error: `derive(SmartPointer)` requires T to be marked `?Sized`
+  --> $DIR/deriving-smart-pointer-neg.rs:41:36
+   |
+LL | struct NoMaybeSized<'a, #[pointee] T> {
+   |                                    ^
+
 error[E0392]: lifetime parameter `'a` is never used
-  --> $DIR/deriving-smart-pointer-neg.rs:21:16
+  --> $DIR/deriving-smart-pointer-neg.rs:22:16
    |
 LL | struct NoField<'a, #[pointee] T: ?Sized> {}
    |                ^^ unused lifetime parameter
@@ -47,7 +53,7 @@ LL | struct NoField<'a, #[pointee] T: ?Sized> {}
    = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
 
 error[E0392]: type parameter `T` is never used
-  --> $DIR/deriving-smart-pointer-neg.rs:21:31
+  --> $DIR/deriving-smart-pointer-neg.rs:22:31
    |
 LL | struct NoField<'a, #[pointee] T: ?Sized> {}
    |                               ^ unused type parameter
@@ -55,7 +61,7 @@ LL | struct NoField<'a, #[pointee] T: ?Sized> {}
    = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
 
 error[E0392]: lifetime parameter `'a` is never used
-  --> $DIR/deriving-smart-pointer-neg.rs:28:20
+  --> $DIR/deriving-smart-pointer-neg.rs:29:20
    |
 LL | struct NoFieldUnit<'a, #[pointee] T: ?Sized>();
    |                    ^^ unused lifetime parameter
@@ -63,13 +69,13 @@ LL | struct NoFieldUnit<'a, #[pointee] T: ?Sized>();
    = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
 
 error[E0392]: type parameter `T` is never used
-  --> $DIR/deriving-smart-pointer-neg.rs:28:35
+  --> $DIR/deriving-smart-pointer-neg.rs:29:35
    |
 LL | struct NoFieldUnit<'a, #[pointee] T: ?Sized>();
    |                                   ^ unused type parameter
    |
    = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
 
-error: aborting due to 9 previous errors
+error: aborting due to 10 previous errors
 
 For more information about this error, try `rustc --explain E0392`.
diff --git a/tests/ui/deriving/smart-pointer-bounds-issue-127647.rs b/tests/ui/deriving/smart-pointer-bounds-issue-127647.rs
new file mode 100644
index 00000000000..4cae1b32896
--- /dev/null
+++ b/tests/ui/deriving/smart-pointer-bounds-issue-127647.rs
@@ -0,0 +1,78 @@
+//@ check-pass
+
+#![feature(derive_smart_pointer)]
+
+#[derive(core::marker::SmartPointer)]
+#[repr(transparent)]
+pub struct Ptr<'a, #[pointee] T: OnDrop + ?Sized, X> {
+    data: &'a mut T,
+    x: core::marker::PhantomData<X>,
+}
+
+pub trait OnDrop {
+    fn on_drop(&mut self);
+}
+
+#[derive(core::marker::SmartPointer)]
+#[repr(transparent)]
+pub struct Ptr2<'a, #[pointee] T: ?Sized, X>
+where
+    T: OnDrop,
+{
+    data: &'a mut T,
+    x: core::marker::PhantomData<X>,
+}
+
+pub trait MyTrait<T: ?Sized> {}
+
+#[derive(core::marker::SmartPointer)]
+#[repr(transparent)]
+pub struct Ptr3<'a, #[pointee] T: ?Sized, X>
+where
+    T: MyTrait<T>,
+{
+    data: &'a mut T,
+    x: core::marker::PhantomData<X>,
+}
+
+#[derive(core::marker::SmartPointer)]
+#[repr(transparent)]
+pub struct Ptr4<'a, #[pointee] T: MyTrait<T> + ?Sized, X> {
+    data: &'a mut T,
+    x: core::marker::PhantomData<X>,
+}
+
+#[derive(core::marker::SmartPointer)]
+#[repr(transparent)]
+pub struct Ptr5<'a, #[pointee] T: ?Sized, X>
+where
+    Ptr5Companion<T>: MyTrait<T>,
+    Ptr5Companion2: MyTrait<T>,
+{
+    data: &'a mut T,
+    x: core::marker::PhantomData<X>,
+}
+
+pub struct Ptr5Companion<T: ?Sized>(core::marker::PhantomData<T>);
+pub struct Ptr5Companion2;
+
+#[derive(core::marker::SmartPointer)]
+#[repr(transparent)]
+pub struct Ptr6<'a, #[pointee] T: ?Sized, X: MyTrait<T> = (), const PARAM: usize = 0> {
+    data: &'a mut T,
+    x: core::marker::PhantomData<X>,
+}
+
+// a reduced example from https://lore.kernel.org/all/20240402-linked-list-v1-1-b1c59ba7ae3b@google.com/
+#[repr(transparent)]
+#[derive(core::marker::SmartPointer)]
+pub struct ListArc<#[pointee] T, const ID: u64 = 0>
+where
+    T: ListArcSafe<ID> + ?Sized,
+{
+    arc: *const T,
+}
+
+pub trait ListArcSafe<const ID: u64> {}
+
+fn main() {}
diff --git a/tests/ui/diagnostic_namespace/do_not_recommend/do_not_apply_attribute_without_feature_flag.rs b/tests/ui/diagnostic_namespace/do_not_recommend/do_not_apply_attribute_without_feature_flag.rs
new file mode 100644
index 00000000000..5548fa2f52e
--- /dev/null
+++ b/tests/ui/diagnostic_namespace/do_not_recommend/do_not_apply_attribute_without_feature_flag.rs
@@ -0,0 +1,21 @@
+#![allow(unknown_or_malformed_diagnostic_attributes)]
+
+trait Foo {}
+
+#[diagnostic::do_not_recommend]
+impl<A> Foo for (A,) {}
+
+#[diagnostic::do_not_recommend]
+impl<A, B> Foo for (A, B) {}
+
+#[diagnostic::do_not_recommend]
+impl<A, B, C> Foo for (A, B, C) {}
+
+impl Foo for i32 {}
+
+fn check(a: impl Foo) {}
+
+fn main() {
+    check(());
+    //~^ ERROR the trait bound `(): Foo` is not satisfied
+}
diff --git a/tests/ui/diagnostic_namespace/do_not_recommend/do_not_apply_attribute_without_feature_flag.stderr b/tests/ui/diagnostic_namespace/do_not_recommend/do_not_apply_attribute_without_feature_flag.stderr
new file mode 100644
index 00000000000..e56af28f3fb
--- /dev/null
+++ b/tests/ui/diagnostic_namespace/do_not_recommend/do_not_apply_attribute_without_feature_flag.stderr
@@ -0,0 +1,21 @@
+error[E0277]: the trait bound `(): Foo` is not satisfied
+  --> $DIR/do_not_apply_attribute_without_feature_flag.rs:19:11
+   |
+LL |     check(());
+   |     ----- ^^ the trait `Foo` is not implemented for `()`
+   |     |
+   |     required by a bound introduced by this call
+   |
+   = help: the following other types implement trait `Foo`:
+             (A, B)
+             (A, B, C)
+             (A,)
+note: required by a bound in `check`
+  --> $DIR/do_not_apply_attribute_without_feature_flag.rs:16:18
+   |
+LL | fn check(a: impl Foo) {}
+   |                  ^^^ required by this bound in `check`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/dropck/drop-with-active-borrows-1.stderr b/tests/ui/dropck/drop-with-active-borrows-1.stderr
index 7d1633267f0..229514c6fee 100644
--- a/tests/ui/dropck/drop-with-active-borrows-1.stderr
+++ b/tests/ui/dropck/drop-with-active-borrows-1.stderr
@@ -9,11 +9,6 @@ LL |     drop(a);
    |          ^ move out of `a` occurs here
 LL |     for s in &b {
    |              -- borrow later used here
-   |
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |     let b: Vec<&str> = a.clone().lines().collect();
-   |                         ++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/dropck/dropck-empty-array.rs b/tests/ui/dropck/dropck-empty-array.rs
new file mode 100644
index 00000000000..f3eca6aed8d
--- /dev/null
+++ b/tests/ui/dropck/dropck-empty-array.rs
@@ -0,0 +1,23 @@
+//@ run-pass
+
+#[allow(dead_code)]
+struct Struct<'s>(&'s str);
+
+impl<'s> Drop for Struct<'s> {
+    fn drop(&mut self) {}
+}
+
+fn to_array_zero<T>(_: T) -> [T; 0] {
+    []
+}
+
+pub fn array_zero_in_tuple() {
+    let mut x = ([], String::new());
+    {
+        let s = String::from("temporary");
+        let p = Struct(&s);
+        x.0 = to_array_zero(p);
+    }
+}
+
+fn main() {}
diff --git a/tests/ui/enum-discriminant/issue-61696.rs b/tests/ui/enum-discriminant/issue-61696.rs
index d200b4410ff..e93fd0e07f6 100644
--- a/tests/ui/enum-discriminant/issue-61696.rs
+++ b/tests/ui/enum-discriminant/issue-61696.rs
@@ -1,4 +1,5 @@
 //@ run-pass
+#![allow(unreachable_patterns)]
 
 pub enum Infallible {}
 
diff --git a/tests/ui/enum-discriminant/niche.rs b/tests/ui/enum-discriminant/niche.rs
index 15d227fd826..f9c4a135a6f 100644
--- a/tests/ui/enum-discriminant/niche.rs
+++ b/tests/ui/enum-discriminant/niche.rs
@@ -1,4 +1,5 @@
 //@ run-pass
+#![allow(unreachable_patterns)]
 
 //! Make sure that we read and write enum discriminants correctly for corner cases caused
 //! by layout optimizations.
diff --git a/tests/ui/error-codes/E0049.stderr b/tests/ui/error-codes/E0049.stderr
index c0cd31faa90..83a30aa0a78 100644
--- a/tests/ui/error-codes/E0049.stderr
+++ b/tests/ui/error-codes/E0049.stderr
@@ -1,4 +1,4 @@
-error[E0049]: method `foo` has 0 type parameters but its trait declaration has 1 type parameter
+error[E0049]: associated function `foo` has 0 type parameters but its trait declaration has 1 type parameter
   --> $DIR/E0049.rs:8:11
    |
 LL |     fn foo<T: Default>(x: T) -> Self;
@@ -7,7 +7,7 @@ LL |     fn foo<T: Default>(x: T) -> Self;
 LL |     fn foo(x: bool) -> Self { Bar }
    |           ^ found 0 type parameters
 
-error[E0049]: method `fuzz` has 0 type parameters but its trait declaration has 2 type parameters
+error[E0049]: associated function `fuzz` has 0 type parameters but its trait declaration has 2 type parameters
   --> $DIR/E0049.rs:18:12
    |
 LL |     fn fuzz<A: Default, B>(x: A, y: B) -> Self;
diff --git a/tests/ui/error-codes/E0195.rs b/tests/ui/error-codes/E0195.rs
index f712ee42b8c..a7e51dff2f3 100644
--- a/tests/ui/error-codes/E0195.rs
+++ b/tests/ui/error-codes/E0195.rs
@@ -1,13 +1,13 @@
 trait Trait {
     fn bar<'a,'b:'a>(x: &'a str, y: &'b str);
-    //~^ NOTE lifetimes in impl do not match this method in trait
+    //~^ NOTE lifetimes in impl do not match this associated function in trait
 }
 
 struct Foo;
 
 impl Trait for Foo {
     fn bar<'a,'b>(x: &'a str, y: &'b str) { //~ ERROR E0195
-    //~^ NOTE lifetimes do not match method in trait
+    //~^ NOTE lifetimes do not match associated function in trait
     }
 }
 
diff --git a/tests/ui/error-codes/E0195.stderr b/tests/ui/error-codes/E0195.stderr
index b88064b7f90..9767dee9aec 100644
--- a/tests/ui/error-codes/E0195.stderr
+++ b/tests/ui/error-codes/E0195.stderr
@@ -1,11 +1,11 @@
-error[E0195]: lifetime parameters or bounds on method `bar` do not match the trait declaration
+error[E0195]: lifetime parameters or bounds on associated function `bar` do not match the trait declaration
   --> $DIR/E0195.rs:9:11
    |
 LL |     fn bar<'a,'b:'a>(x: &'a str, y: &'b str);
-   |           ---------- lifetimes in impl do not match this method in trait
+   |           ---------- lifetimes in impl do not match this associated function in trait
 ...
 LL |     fn bar<'a,'b>(x: &'a str, y: &'b str) {
-   |           ^^^^^^^ lifetimes do not match method in trait
+   |           ^^^^^^^ lifetimes do not match associated function in trait
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/error-codes/E0283.stderr b/tests/ui/error-codes/E0283.stderr
index fc08395a2b0..381eca5f2a4 100644
--- a/tests/ui/error-codes/E0283.stderr
+++ b/tests/ui/error-codes/E0283.stderr
@@ -7,10 +7,12 @@ LL |     fn create() -> u32;
 LL |     let cont: u32 = Coroutine::create();
    |                     ^^^^^^^^^^^^^^^^^^^ cannot call associated function of trait
    |
-help: use a fully-qualified path to a specific available implementation
+help: use a fully-qualified path to one of the available implementations
    |
-LL |     let cont: u32 = </* self type */ as Coroutine>::create();
-   |                     +++++++++++++++++++          +
+LL |     let cont: u32 = <Impl as Coroutine>::create();
+   |                     ++++++++          +
+LL |     let cont: u32 = <AnotherImpl as Coroutine>::create();
+   |                     +++++++++++++++          +
 
 error[E0283]: type annotations needed
   --> $DIR/E0283.rs:35:24
diff --git a/tests/ui/error-codes/E0396-fixed.stderr b/tests/ui/error-codes/E0396-fixed.stderr
index 2f8ea7993f7..c14f4948095 100644
--- a/tests/ui/error-codes/E0396-fixed.stderr
+++ b/tests/ui/error-codes/E0396-fixed.stderr
@@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed
   --> $DIR/E0396-fixed.rs:5:28
    |
 LL | const VALUE: u8 = unsafe { *REG_ADDR };
-   |                            ^^^^^^^^^ memory access failed: 0x5f3759df[noalloc] is a dangling pointer (it has no provenance)
+   |                            ^^^^^^^^^ memory access failed: expected a pointer to 1 byte of memory, but got 0x5f3759df[noalloc] which is a dangling pointer (it has no provenance)
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/error-codes/E0432.stderr b/tests/ui/error-codes/E0432.stderr
index a0b17e35c94..36fefc95897 100644
--- a/tests/ui/error-codes/E0432.stderr
+++ b/tests/ui/error-codes/E0432.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `something`
 LL | use something::Foo;
    |     ^^^^^^^^^ you might be missing crate `something`
    |
-   = help: consider adding `extern crate something` to use the `something` crate
+help: consider importing the `something` crate
+   |
+LL + extern crate something;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/error-codes/E0504.stderr b/tests/ui/error-codes/E0504.stderr
index 343bca9a72e..58266959333 100644
--- a/tests/ui/error-codes/E0504.stderr
+++ b/tests/ui/error-codes/E0504.stderr
@@ -21,7 +21,7 @@ LL | struct FancyNum {
    | ^^^^^^^^^^^^^^^ consider implementing `Clone` for this type
 ...
 LL |     let fancy_ref = &fancy_num;
-   |                     ---------- you could clone this value
+   |                      --------- you could clone this value
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/error-codes/E0505.stderr b/tests/ui/error-codes/E0505.stderr
index 266df9ea32a..3f2913e9fe3 100644
--- a/tests/ui/error-codes/E0505.stderr
+++ b/tests/ui/error-codes/E0505.stderr
@@ -18,7 +18,7 @@ LL | struct Value {}
    | ^^^^^^^^^^^^ consider implementing `Clone` for this type
 ...
 LL |         let _ref_to_val: &Value = &x;
-   |                                   -- you could clone this value
+   |                                    - you could clone this value
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/error-codes/E0790.stderr b/tests/ui/error-codes/E0790.stderr
index 6338a10b6af..106554b2425 100644
--- a/tests/ui/error-codes/E0790.stderr
+++ b/tests/ui/error-codes/E0790.stderr
@@ -63,10 +63,12 @@ LL |     fn my_fn();
 LL |     MyTrait2::my_fn();
    |     ^^^^^^^^^^^^^^^^^ cannot call associated function of trait
    |
-help: use a fully-qualified path to a specific available implementation
+help: use a fully-qualified path to one of the available implementations
    |
-LL |     </* self type */ as MyTrait2>::my_fn();
-   |     +++++++++++++++++++         +
+LL |     <Impl1 as MyTrait2>::my_fn();
+   |     +++++++++         +
+LL |     <Impl2 as MyTrait2>::my_fn();
+   |     +++++++++         +
 
 error: aborting due to 5 previous errors
 
diff --git a/tests/ui/extern/extern-types-field-offset.run.stderr b/tests/ui/extern/extern-types-field-offset.run.stderr
index 1b04b860db5..f1407398980 100644
--- a/tests/ui/extern/extern-types-field-offset.run.stderr
+++ b/tests/ui/extern/extern-types-field-offset.run.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL:
+thread 'main' panicked at core/src/panicking.rs:$LINE:$COL:
 attempted to compute the size or alignment of extern type `Opaque`
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 thread caused non-unwinding panic. aborting.
diff --git a/tests/ui/extern/extern-types-size_of_val.align.run.stderr b/tests/ui/extern/extern-types-size_of_val.align.run.stderr
index 20c4d8785e8..faad1aa13fa 100644
--- a/tests/ui/extern/extern-types-size_of_val.align.run.stderr
+++ b/tests/ui/extern/extern-types-size_of_val.align.run.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL:
+thread 'main' panicked at core/src/panicking.rs:$LINE:$COL:
 attempted to compute the size or alignment of extern type `A`
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 thread caused non-unwinding panic. aborting.
diff --git a/tests/ui/extern/extern-types-size_of_val.size.run.stderr b/tests/ui/extern/extern-types-size_of_val.size.run.stderr
index 20c4d8785e8..faad1aa13fa 100644
--- a/tests/ui/extern/extern-types-size_of_val.size.run.stderr
+++ b/tests/ui/extern/extern-types-size_of_val.size.run.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL:
+thread 'main' panicked at core/src/panicking.rs:$LINE:$COL:
 attempted to compute the size or alignment of extern type `A`
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 thread caused non-unwinding panic. aborting.
diff --git a/tests/ui/feature-gates/feature-gate-coroutines.none.stderr b/tests/ui/feature-gates/feature-gate-coroutines.none.stderr
index 65e7737ef84..032d7adf77a 100644
--- a/tests/ui/feature-gates/feature-gate-coroutines.none.stderr
+++ b/tests/ui/feature-gates/feature-gate-coroutines.none.stderr
@@ -47,7 +47,6 @@ LL |     yield true;
    = note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
    = help: add `#![feature(coroutines)]` 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: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
   --> $DIR/feature-gate-coroutines.rs:5:5
@@ -69,7 +68,6 @@ LL |     let _ = || yield true;
    = note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
    = help: add `#![feature(coroutines)]` 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: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
   --> $DIR/feature-gate-coroutines.rs:10:16
diff --git a/tests/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr b/tests/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr
deleted file mode 100644
index 308de269293..00000000000
--- a/tests/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
-  --> $DIR/feature-gate-default_type_parameter_fallback.rs:3:8
-   |
-LL | fn avg<T=i32>(_: T) {}
-   |        ^^^^^
-   |
-   = 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 #36887 <https://github.com/rust-lang/rust/issues/36887>
-   = note: `#[deny(invalid_type_param_default)]` on by default
-
-error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
-  --> $DIR/feature-gate-default_type_parameter_fallback.rs:8:6
-   |
-LL | impl<T=i32> S<T> {}
-   |      ^^^^^
-   |
-   = 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 #36887 <https://github.com/rust-lang/rust/issues/36887>
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/feature-gates/feature-gate-exhaustive-patterns.rs b/tests/ui/feature-gates/feature-gate-exhaustive-patterns.rs
index f0cc9ea7055..79891593692 100644
--- a/tests/ui/feature-gates/feature-gate-exhaustive-patterns.rs
+++ b/tests/ui/feature-gates/feature-gate-exhaustive-patterns.rs
@@ -5,5 +5,5 @@ fn foo() -> Result<u32, !> {
 }
 
 fn main() {
-    let Ok(_x) = foo(); //~ ERROR refutable pattern in local binding
+    let Ok(_x) = &foo(); //~ ERROR refutable pattern in local binding
 }
diff --git a/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr b/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr
index d34f257c8d9..4836ffe1723 100644
--- a/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr
+++ b/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr
@@ -1,16 +1,16 @@
 error[E0005]: refutable pattern in local binding
   --> $DIR/feature-gate-exhaustive-patterns.rs:8:9
    |
-LL |     let Ok(_x) = foo();
-   |         ^^^^^^ pattern `Err(_)` not covered
+LL |     let Ok(_x) = &foo();
+   |         ^^^^^^ pattern `&Err(_)` not covered
    |
    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
    = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
-   = note: the matched value is of type `Result<u32, !>`
+   = note: the matched value is of type `&Result<u32, !>`
 help: you might want to use `let else` to handle the variant that isn't matched
    |
-LL |     let Ok(_x) = foo() else { todo!() };
-   |                        ++++++++++++++++
+LL |     let Ok(_x) = &foo() else { todo!() };
+   |                         ++++++++++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/feature-gates/feature-gate-offset-of-enum.rs b/tests/ui/feature-gates/feature-gate-offset-of-enum.rs
index 1f2f7ee1e19..cc9efeb67f3 100644
--- a/tests/ui/feature-gates/feature-gate-offset-of-enum.rs
+++ b/tests/ui/feature-gates/feature-gate-offset-of-enum.rs
@@ -1,5 +1,3 @@
-#![feature(offset_of_nested)]
-
 use std::mem::offset_of;
 
 enum Alpha {
diff --git a/tests/ui/feature-gates/feature-gate-offset-of-enum.stderr b/tests/ui/feature-gates/feature-gate-offset-of-enum.stderr
index fc7dd7923f7..8a73abc8cad 100644
--- a/tests/ui/feature-gates/feature-gate-offset-of-enum.stderr
+++ b/tests/ui/feature-gates/feature-gate-offset-of-enum.stderr
@@ -1,5 +1,5 @@
 error[E0573]: expected type, found variant `Alpha::One`
-  --> $DIR/feature-gate-offset-of-enum.rs:11:16
+  --> $DIR/feature-gate-offset-of-enum.rs:9:16
    |
 LL |     offset_of!(Alpha::One, 0);
    |                ^^^^^^^^^^
@@ -8,7 +8,7 @@ LL |     offset_of!(Alpha::One, 0);
    |                help: try using the variant's enum: `Alpha`
 
 error[E0658]: using enums in offset_of is experimental
-  --> $DIR/feature-gate-offset-of-enum.rs:12:23
+  --> $DIR/feature-gate-offset-of-enum.rs:10:23
    |
 LL |     offset_of!(Alpha, One);
    |                       ^^^
@@ -18,13 +18,13 @@ LL |     offset_of!(Alpha, One);
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0795]: `One` is an enum variant; expected field at end of `offset_of`
-  --> $DIR/feature-gate-offset-of-enum.rs:12:23
+  --> $DIR/feature-gate-offset-of-enum.rs:10:23
    |
 LL |     offset_of!(Alpha, One);
    |                       ^^^ enum variant
 
 error[E0658]: using enums in offset_of is experimental
-  --> $DIR/feature-gate-offset-of-enum.rs:14:23
+  --> $DIR/feature-gate-offset-of-enum.rs:12:23
    |
 LL |     offset_of!(Alpha, Two.0);
    |                       ^^^
diff --git a/tests/ui/feature-gates/feature-gate-offset-of-nested.rs b/tests/ui/feature-gates/feature-gate-offset-of-nested.rs
deleted file mode 100644
index c4eb4720fde..00000000000
--- a/tests/ui/feature-gates/feature-gate-offset-of-nested.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-#![feature(offset_of_enum)]
-
-use std::mem::offset_of;
-
-struct S {
-    a: u8,
-    b: (u8, u8),
-    c: T,
-}
-
-struct T {
-    t: &'static str,
-}
-
-enum Alpha {
-    One(u8),
-    Two(u8),
-}
-
-fn main() {
-    offset_of!(Alpha, Two.0); //~ ERROR only a single ident or integer is stable as the field in offset_of
-    offset_of!(S, a);
-    offset_of!((u8, S), 1);
-    offset_of!((u32, (S, T)), 1.1); //~ ERROR only a single ident or integer is stable as the field in offset_of
-    offset_of!(S, b.0); //~ ERROR only a single ident or integer is stable as the field in offset_of
-    offset_of!((S, ()), 0.c); //~ ERROR only a single ident or integer is stable as the field in offset_of
-    offset_of!(S, c.t); //~ ERROR only a single ident or integer is stable as the field in offset_of
-}
diff --git a/tests/ui/feature-gates/feature-gate-offset-of-nested.stderr b/tests/ui/feature-gates/feature-gate-offset-of-nested.stderr
deleted file mode 100644
index f367fc9fa0d..00000000000
--- a/tests/ui/feature-gates/feature-gate-offset-of-nested.stderr
+++ /dev/null
@@ -1,60 +0,0 @@
-error[E0658]: only a single ident or integer is stable as the field in offset_of
-  --> $DIR/feature-gate-offset-of-nested.rs:21:27
-   |
-LL |     offset_of!(Alpha, Two.0);
-   |                           ^
-   |
-   = note: see issue #120140 <https://github.com/rust-lang/rust/issues/120140> for more information
-   = help: add `#![feature(offset_of_nested)]` 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]: only a single ident or integer is stable as the field in offset_of
-  --> $DIR/feature-gate-offset-of-nested.rs:24:33
-   |
-LL |       offset_of!((u32, (S, T)), 1.1);
-   |  _____----------------------------^-
-   | |     |
-   | |     in this macro invocation
-LL | |     offset_of!(S, b.0);
-LL | |     offset_of!((S, ()), 0.c);
-LL | |     offset_of!(S, c.t);
-...  |
-   |
-   = note: see issue #120140 <https://github.com/rust-lang/rust/issues/120140> for more information
-   = help: add `#![feature(offset_of_nested)]` 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 `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0658]: only a single ident or integer is stable as the field in offset_of
-  --> $DIR/feature-gate-offset-of-nested.rs:25:21
-   |
-LL |     offset_of!(S, b.0);
-   |                     ^
-   |
-   = note: see issue #120140 <https://github.com/rust-lang/rust/issues/120140> for more information
-   = help: add `#![feature(offset_of_nested)]` 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]: only a single ident or integer is stable as the field in offset_of
-  --> $DIR/feature-gate-offset-of-nested.rs:26:27
-   |
-LL |     offset_of!((S, ()), 0.c);
-   |                           ^
-   |
-   = note: see issue #120140 <https://github.com/rust-lang/rust/issues/120140> for more information
-   = help: add `#![feature(offset_of_nested)]` 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]: only a single ident or integer is stable as the field in offset_of
-  --> $DIR/feature-gate-offset-of-nested.rs:27:21
-   |
-LL |     offset_of!(S, c.t);
-   |                     ^
-   |
-   = note: see issue #120140 <https://github.com/rust-lang/rust/issues/120140> for more information
-   = help: add `#![feature(offset_of_nested)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/feature-gates/feature-gate-sha512_sm_x86.rs b/tests/ui/feature-gates/feature-gate-sha512_sm_x86.rs
new file mode 100644
index 00000000000..176a40ecf53
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-sha512_sm_x86.rs
@@ -0,0 +1,6 @@
+//@ only-x86_64
+#[target_feature(enable = "sha512")]
+//~^ ERROR: currently unstable
+unsafe fn foo() {}
+
+fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-sha512_sm_x86.stderr b/tests/ui/feature-gates/feature-gate-sha512_sm_x86.stderr
new file mode 100644
index 00000000000..da9eea095a3
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-sha512_sm_x86.stderr
@@ -0,0 +1,13 @@
+error[E0658]: the target feature `sha512` is currently unstable
+  --> $DIR/feature-gate-sha512_sm_x86.rs:2:18
+   |
+LL | #[target_feature(enable = "sha512")]
+   |                  ^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #126624 <https://github.com/rust-lang/rust/issues/126624> for more information
+   = help: add `#![feature(sha512_sm_x86)]` 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-unsafe-extern-blocks.rs b/tests/ui/feature-gates/feature-gate-unsafe-extern-blocks.rs
deleted file mode 100644
index 3ea62e875b8..00000000000
--- a/tests/ui/feature-gates/feature-gate-unsafe-extern-blocks.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-unsafe extern "C" {
-    //~^ ERROR extern block cannot be declared unsafe
-}
-
-// We can't gate `unsafe extern` blocks themselves since they were previously
-// allowed, but we should gate the `safe` soft keyword.
-#[cfg(any())]
-unsafe extern "C" {
-    safe fn foo();
-    //~^ ERROR `unsafe extern {}` blocks and `safe` keyword are experimental
-}
-
-fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-unsafe-extern-blocks.stderr b/tests/ui/feature-gates/feature-gate-unsafe-extern-blocks.stderr
deleted file mode 100644
index 56534946308..00000000000
--- a/tests/ui/feature-gates/feature-gate-unsafe-extern-blocks.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error: extern block cannot be declared unsafe
-  --> $DIR/feature-gate-unsafe-extern-blocks.rs:1:1
-   |
-LL | unsafe extern "C" {
-   | ^^^^^^
-   |
-   = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information
-   = help: add `#![feature(unsafe_extern_blocks)]` 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]: `unsafe extern {}` blocks and `safe` keyword are experimental
-  --> $DIR/feature-gate-unsafe-extern-blocks.rs:9:5
-   |
-LL |     safe fn foo();
-   |     ^^^^
-   |
-   = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information
-   = help: add `#![feature(unsafe_extern_blocks)]` 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 2 previous errors
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/feature-gates/version_check.rs b/tests/ui/feature-gates/version_check.rs
new file mode 100644
index 00000000000..e212dc74fd1
--- /dev/null
+++ b/tests/ui/feature-gates/version_check.rs
@@ -0,0 +1,17 @@
+//@ run-pass
+//@ only-linux
+//@ only-x86
+// FIXME: this should be more like //@ needs-subprocesses
+use std::process::Command;
+
+fn main() {
+    let signalled_version = "Ceci n'est pas une rustc";
+    let version = Command::new(std::env::var_os("RUSTC").unwrap())
+        .env("RUSTC_OVERRIDE_VERSION_STRING", signalled_version)
+        .arg("--version")
+        .output()
+        .unwrap()
+        .stdout;
+    let version = std::str::from_utf8(&version).unwrap().strip_prefix("rustc ").unwrap().trim_end();
+    assert_eq!(version, signalled_version);
+}
diff --git a/tests/ui/fn/implied-bounds-unnorm-associated-type-4.stderr b/tests/ui/fn/implied-bounds-unnorm-associated-type-4.stderr
index b8ec2e3b7e7..4e64ed6f482 100644
--- a/tests/ui/fn/implied-bounds-unnorm-associated-type-4.stderr
+++ b/tests/ui/fn/implied-bounds-unnorm-associated-type-4.stderr
@@ -13,9 +13,8 @@ LL |     println!("{}", y);
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let y = f(&x, ());
-LL +     let y = f(x.clone(), ());
-   |
+LL |     let y = f(&x.clone(), ());
+   |                 ++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/fn/implied-bounds-unnorm-associated-type-5.rs b/tests/ui/fn/implied-bounds-unnorm-associated-type-5.rs
index a7489f6fbaf..38be3250c7d 100644
--- a/tests/ui/fn/implied-bounds-unnorm-associated-type-5.rs
+++ b/tests/ui/fn/implied-bounds-unnorm-associated-type-5.rs
@@ -5,6 +5,7 @@ trait Trait<'a>: 'a {
 // if the `T: 'a` bound gets implied we would probably get ub here again
 impl<'a, T> Trait<'a> for T {
     //~^ ERROR the parameter type `T` may not live long enough
+    //~| ERROR the parameter type `T` may not live long enough
     type Type = ();
 }
 
diff --git a/tests/ui/fn/implied-bounds-unnorm-associated-type-5.stderr b/tests/ui/fn/implied-bounds-unnorm-associated-type-5.stderr
index 382ab8636a2..b2aa1abbbdb 100644
--- a/tests/ui/fn/implied-bounds-unnorm-associated-type-5.stderr
+++ b/tests/ui/fn/implied-bounds-unnorm-associated-type-5.stderr
@@ -16,8 +16,21 @@ help: consider adding an explicit lifetime bound
 LL | impl<'a, T: 'a> Trait<'a> for T {
    |           ++++
 
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/implied-bounds-unnorm-associated-type-5.rs:6:27
+   |
+LL | impl<'a, T> Trait<'a> for T {
+   |      --                   ^ ...so that the type `T` will meet its required lifetime bounds
+   |      |
+   |      the parameter type `T` must be valid for the lifetime `'a` as defined here...
+   |
+help: consider adding an explicit lifetime bound
+   |
+LL | impl<'a, T: 'a> Trait<'a> for T {
+   |           ++++
+
 error[E0505]: cannot move out of `x` because it is borrowed
-  --> $DIR/implied-bounds-unnorm-associated-type-5.rs:21:10
+  --> $DIR/implied-bounds-unnorm-associated-type-5.rs:22:10
    |
 LL |     let x = String::from("Hello World!");
    |         - binding `x` declared here
@@ -30,11 +43,10 @@ LL |     println!("{}", y);
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let y = f(&x, ());
-LL +     let y = f(x.clone(), ());
-   |
+LL |     let y = f(&x.clone(), ());
+   |                 ++++++++
 
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
 
 Some errors have detailed explanations: E0309, E0505.
 For more information about an error, try `rustc --explain E0309`.
diff --git a/tests/ui/fn/implied-bounds-unnorm-associated-type.stderr b/tests/ui/fn/implied-bounds-unnorm-associated-type.stderr
index ce97d8527e8..2a7431305fe 100644
--- a/tests/ui/fn/implied-bounds-unnorm-associated-type.stderr
+++ b/tests/ui/fn/implied-bounds-unnorm-associated-type.stderr
@@ -13,9 +13,8 @@ LL |     println!("{}", y);
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let y = f(&x, ());
-LL +     let y = f(x.clone(), ());
-   |
+LL |     let y = f(&x.clone(), ());
+   |                 ++++++++
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs b/tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs
index 285493132b6..946cb1a62b7 100644
--- a/tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs
+++ b/tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs
@@ -8,7 +8,7 @@ impl<T> X for T { //~ ERROR: not all trait items implemented
   fn foo<'a, T1: X<Y = T1>>(t : T1) -> T1::Y<'a> {
     //~^ ERROR missing generics for associated type
     //~^^ ERROR missing generics for associated type
-    //~| ERROR method `foo` has 1 type parameter but its trait declaration has 0 type parameters
+    //~| ERROR associated function `foo` has 1 type parameter but its trait declaration has 0 type parameters
     t
   }
 }
diff --git a/tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr b/tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr
index 6a600aee11f..72c2bdc72a2 100644
--- a/tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr
+++ b/tests/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr
@@ -1,4 +1,4 @@
-error[E0049]: method `foo` has 1 type parameter but its trait declaration has 0 type parameters
+error[E0049]: associated function `foo` has 1 type parameter but its trait declaration has 0 type parameters
   --> $DIR/gat-trait-path-missing-lifetime.rs:8:10
    |
 LL |   fn foo<'a>(t : Self::Y<'a>) -> Self::Y<'a> { t }
diff --git a/tests/ui/generic-associated-types/issue-71176.rs b/tests/ui/generic-associated-types/issue-71176.rs
index e58b6f6091e..b33fda8e154 100644
--- a/tests/ui/generic-associated-types/issue-71176.rs
+++ b/tests/ui/generic-associated-types/issue-71176.rs
@@ -16,6 +16,6 @@ struct Holder<B> {
 
 fn main() {
     Holder {
-        inner: Box::new(()),
+        inner: Box::new(()), //~ ERROR: the trait `Provider` cannot be made into an object
     };
 }
diff --git a/tests/ui/generic-associated-types/issue-71176.stderr b/tests/ui/generic-associated-types/issue-71176.stderr
index a1913bb618b..9f83c162c02 100644
--- a/tests/ui/generic-associated-types/issue-71176.stderr
+++ b/tests/ui/generic-associated-types/issue-71176.stderr
@@ -64,7 +64,23 @@ LL |     type A<'a>;
    = help: consider moving `A` to another trait
    = help: only type `()` implements the trait, consider using it directly instead
 
-error: aborting due to 4 previous errors
+error[E0038]: the trait `Provider` cannot be made into an object
+  --> $DIR/issue-71176.rs:19:16
+   |
+LL |         inner: Box::new(()),
+   |                ^^^^^^^^^^^^ `Provider` cannot be made into an object
+   |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/issue-71176.rs:2:10
+   |
+LL | trait Provider {
+   |       -------- this trait cannot be made into an object...
+LL |     type A<'a>;
+   |          ^ ...because it contains the generic associated type `A`
+   = help: consider moving `A` to another trait
+   = help: only type `()` implements the trait, consider using it directly instead
+
+error: aborting due to 5 previous errors
 
 Some errors have detailed explanations: E0038, E0107.
 For more information about an error, try `rustc --explain E0038`.
diff --git a/tests/ui/generic-associated-types/missing-bounds.fixed b/tests/ui/generic-associated-types/missing-bounds.fixed
index ff69016d862..703d3c1e0fb 100644
--- a/tests/ui/generic-associated-types/missing-bounds.fixed
+++ b/tests/ui/generic-associated-types/missing-bounds.fixed
@@ -2,7 +2,6 @@
 
 use std::ops::Add;
 
-#[allow(dead_code)]
 struct A<B>(B);
 
 impl<B> Add for A<B> where B: Add<Output = B> {
@@ -13,7 +12,6 @@ impl<B> Add for A<B> where B: Add<Output = B> {
     }
 }
 
-#[allow(dead_code)]
 struct C<B>(B);
 
 impl<B: Add<Output = B>> Add for C<B> {
@@ -24,7 +22,6 @@ impl<B: Add<Output = B>> Add for C<B> {
     }
 }
 
-#[allow(dead_code)]
 struct D<B>(B);
 
 impl<B: std::ops::Add<Output = B>> Add for D<B> {
@@ -35,7 +32,6 @@ impl<B: std::ops::Add<Output = B>> Add for D<B> {
     }
 }
 
-#[allow(dead_code)]
 struct E<B>(B);
 
 impl<B: Add<Output = B>> Add for E<B> where B: Add<Output = B> {
diff --git a/tests/ui/generic-associated-types/missing-bounds.rs b/tests/ui/generic-associated-types/missing-bounds.rs
index 1f83356c2fa..f40b4228873 100644
--- a/tests/ui/generic-associated-types/missing-bounds.rs
+++ b/tests/ui/generic-associated-types/missing-bounds.rs
@@ -2,7 +2,6 @@
 
 use std::ops::Add;
 
-#[allow(dead_code)]
 struct A<B>(B);
 
 impl<B> Add for A<B> where B: Add {
@@ -13,7 +12,6 @@ impl<B> Add for A<B> where B: Add {
     }
 }
 
-#[allow(dead_code)]
 struct C<B>(B);
 
 impl<B: Add> Add for C<B> {
@@ -24,7 +22,6 @@ impl<B: Add> Add for C<B> {
     }
 }
 
-#[allow(dead_code)]
 struct D<B>(B);
 
 impl<B> Add for D<B> {
@@ -35,7 +32,6 @@ impl<B> Add for D<B> {
     }
 }
 
-#[allow(dead_code)]
 struct E<B>(B);
 
 impl<B: Add> Add for E<B> where <B as Add>::Output = B {
diff --git a/tests/ui/generic-associated-types/missing-bounds.stderr b/tests/ui/generic-associated-types/missing-bounds.stderr
index 0f0dc24c06c..1d7d80d1b07 100644
--- a/tests/ui/generic-associated-types/missing-bounds.stderr
+++ b/tests/ui/generic-associated-types/missing-bounds.stderr
@@ -1,5 +1,5 @@
 error: equality constraints are not yet supported in `where` clauses
-  --> $DIR/missing-bounds.rs:41:33
+  --> $DIR/missing-bounds.rs:37:33
    |
 LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B {
    |                                 ^^^^^^^^^^^^^^^^^^^^^^ not supported
@@ -11,7 +11,7 @@ LL | impl<B: Add> Add for E<B> where B: Add<Output = B> {
    |                                 ~~~~~~~~~~~~~~~~~~
 
 error[E0308]: mismatched types
-  --> $DIR/missing-bounds.rs:12:11
+  --> $DIR/missing-bounds.rs:11:11
    |
 LL | impl<B> Add for A<B> where B: Add {
    |      - expected this type parameter
@@ -24,14 +24,14 @@ LL |         A(self.0 + rhs.0)
    = note: expected type parameter `B`
              found associated type `<B as Add>::Output`
 help: the type constructed contains `<B as Add>::Output` due to the type of the argument passed
-  --> $DIR/missing-bounds.rs:12:9
+  --> $DIR/missing-bounds.rs:11:9
    |
 LL |         A(self.0 + rhs.0)
    |         ^^--------------^
    |           |
    |           this argument influences the type of `A`
 note: tuple struct defined here
-  --> $DIR/missing-bounds.rs:6:8
+  --> $DIR/missing-bounds.rs:5:8
    |
 LL | struct A<B>(B);
    |        ^
@@ -41,7 +41,7 @@ LL | impl<B> Add for A<B> where B: Add<Output = B> {
    |                                  ++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/missing-bounds.rs:23:14
+  --> $DIR/missing-bounds.rs:21:14
    |
 LL | impl<B: Add> Add for C<B> {
    |      - expected this type parameter
@@ -54,7 +54,7 @@ LL |         Self(self.0 + rhs.0)
    = note: expected type parameter `B`
              found associated type `<B as Add>::Output`
 note: tuple struct defined here
-  --> $DIR/missing-bounds.rs:17:8
+  --> $DIR/missing-bounds.rs:15:8
    |
 LL | struct C<B>(B);
    |        ^
@@ -64,7 +64,7 @@ LL | impl<B: Add<Output = B>> Add for C<B> {
    |            ++++++++++++
 
 error[E0369]: cannot add `B` to `B`
-  --> $DIR/missing-bounds.rs:34:21
+  --> $DIR/missing-bounds.rs:31:21
    |
 LL |         Self(self.0 + rhs.0)
    |              ------ ^ ----- B
@@ -77,7 +77,7 @@ LL | impl<B: std::ops::Add<Output = B>> Add for D<B> {
    |       +++++++++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/missing-bounds.rs:46:14
+  --> $DIR/missing-bounds.rs:42:14
    |
 LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B {
    |      - expected this type parameter
@@ -90,7 +90,7 @@ LL |         Self(self.0 + rhs.0)
    = note: expected type parameter `B`
              found associated type `<B as Add>::Output`
 note: tuple struct defined here
-  --> $DIR/missing-bounds.rs:39:8
+  --> $DIR/missing-bounds.rs:35:8
    |
 LL | struct E<B>(B);
    |        ^
diff --git a/tests/ui/hygiene/panic-location.run.stderr b/tests/ui/hygiene/panic-location.run.stderr
index 5c1778bc485..bfed4cd6650 100644
--- a/tests/ui/hygiene/panic-location.run.stderr
+++ b/tests/ui/hygiene/panic-location.run.stderr
@@ -1,3 +1,3 @@
-thread 'main' panicked at library/alloc/src/raw_vec.rs:LL:CC:
+thread 'main' panicked at alloc/src/raw_vec.rs:LL:CC:
 capacity overflow
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
diff --git a/tests/ui/impl-trait/extra-impl-in-trait-impl.fixed b/tests/ui/impl-trait/extra-impl-in-trait-impl.fixed
index 3c4499f0173..886fc1d0058 100644
--- a/tests/ui/impl-trait/extra-impl-in-trait-impl.fixed
+++ b/tests/ui/impl-trait/extra-impl-in-trait-impl.fixed
@@ -1,8 +1,6 @@
 //@ run-rustfix
 
-#[allow(dead_code)]
 struct S<T>(T);
-#[allow(dead_code)]
 struct S2;
 
 impl<T: Default> Default for S<T> {
diff --git a/tests/ui/impl-trait/extra-impl-in-trait-impl.rs b/tests/ui/impl-trait/extra-impl-in-trait-impl.rs
index ac078329524..f3271993867 100644
--- a/tests/ui/impl-trait/extra-impl-in-trait-impl.rs
+++ b/tests/ui/impl-trait/extra-impl-in-trait-impl.rs
@@ -1,8 +1,6 @@
 //@ run-rustfix
 
-#[allow(dead_code)]
 struct S<T>(T);
-#[allow(dead_code)]
 struct S2;
 
 impl<T: Default> impl Default for S<T> {
diff --git a/tests/ui/impl-trait/extra-impl-in-trait-impl.stderr b/tests/ui/impl-trait/extra-impl-in-trait-impl.stderr
index 91c7da5a04f..5aafc8b64d4 100644
--- a/tests/ui/impl-trait/extra-impl-in-trait-impl.stderr
+++ b/tests/ui/impl-trait/extra-impl-in-trait-impl.stderr
@@ -1,23 +1,23 @@
 error: unexpected `impl` keyword
-  --> $DIR/extra-impl-in-trait-impl.rs:8:18
+  --> $DIR/extra-impl-in-trait-impl.rs:6:18
    |
 LL | impl<T: Default> impl Default for S<T> {
    |                  ^^^^^ help: remove the extra `impl`
    |
 note: this is parsed as an `impl Trait` type, but a trait is expected at this position
-  --> $DIR/extra-impl-in-trait-impl.rs:8:18
+  --> $DIR/extra-impl-in-trait-impl.rs:6:18
    |
 LL | impl<T: Default> impl Default for S<T> {
    |                  ^^^^^^^^^^^^
 
 error: unexpected `impl` keyword
-  --> $DIR/extra-impl-in-trait-impl.rs:14:6
+  --> $DIR/extra-impl-in-trait-impl.rs:12:6
    |
 LL | impl impl Default for S2 {
    |      ^^^^^ help: remove the extra `impl`
    |
 note: this is parsed as an `impl Trait` type, but a trait is expected at this position
-  --> $DIR/extra-impl-in-trait-impl.rs:14:6
+  --> $DIR/extra-impl-in-trait-impl.rs:12:6
    |
 LL | impl impl Default for S2 {
    |      ^^^^^^^^^^^^
diff --git a/tests/ui/impl-trait/in-trait/cannot-capture-intersection.rs b/tests/ui/impl-trait/in-trait/cannot-capture-intersection.rs
new file mode 100644
index 00000000000..d7b62436d2d
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/cannot-capture-intersection.rs
@@ -0,0 +1,29 @@
+#![feature(precise_capturing)]
+
+use std::future::Future;
+use std::pin::Pin;
+
+trait MyTrait {
+    fn foo<'a, 'b>(&'a self, x: &'b i32) -> impl Future<Output = i32>;
+}
+
+trait ErasedMyTrait {
+    fn foo<'life0, 'life1, 'dynosaur>(&'life0 self, x: &'life1 i32)
+    -> Pin<Box<dyn Future<Output = i32> + 'dynosaur>>
+    where
+        'life0: 'dynosaur,
+        'life1: 'dynosaur;
+}
+
+struct DynMyTrait<T: ErasedMyTrait> {
+    ptr: T,
+}
+
+impl<T: ErasedMyTrait> MyTrait for DynMyTrait<T> {
+    fn foo<'a, 'b>(&'a self, x: &'b i32) -> impl Future<Output = i32> {
+        self.ptr.foo(x)
+        //~^ ERROR hidden type for `impl Future<Output = i32>` captures lifetime that does not appear in bounds
+    }
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/cannot-capture-intersection.stderr b/tests/ui/impl-trait/in-trait/cannot-capture-intersection.stderr
new file mode 100644
index 00000000000..92ef66c5504
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/cannot-capture-intersection.stderr
@@ -0,0 +1,13 @@
+error[E0700]: hidden type for `impl Future<Output = i32>` captures lifetime that does not appear in bounds
+  --> $DIR/cannot-capture-intersection.rs:24:9
+   |
+LL |     fn foo<'a, 'b>(&'a self, x: &'b i32) -> impl Future<Output = i32> {
+   |                                             ------------------------- opaque type defined here
+LL |         self.ptr.foo(x)
+   |         ^^^^^^^^^^^^^^^
+   |
+   = note: hidden type `Pin<Box<dyn Future<Output = i32>>>` captures lifetime `'_`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0700`.
diff --git a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs
index d9fac0238e1..0477de3315a 100644
--- a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs
+++ b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs
@@ -6,7 +6,7 @@ trait Foo {
 
 impl Foo for S {
     fn bar() -> impl Sized {}
-    //~^ ERROR method `bar` has 0 type parameters but its trait declaration has 1 type parameter
+    //~^ ERROR associated function `bar` has 0 type parameters but its trait declaration has 1 type parameter
 }
 
 fn main() {
diff --git a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.stderr b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.stderr
index eed4c07710e..ca67db40362 100644
--- a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.stderr
+++ b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.stderr
@@ -1,4 +1,4 @@
-error[E0049]: method `bar` has 0 type parameters but its trait declaration has 1 type parameter
+error[E0049]: associated function `bar` has 0 type parameters but its trait declaration has 1 type parameter
   --> $DIR/trait-more-generics-than-impl.rs:8:11
    |
 LL |     fn bar<T>() -> impl Sized;
diff --git a/tests/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.stderr b/tests/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.stderr
index 4d4ba58c974..b7cee7d0b1f 100644
--- a/tests/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.stderr
+++ b/tests/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.stderr
@@ -2,17 +2,12 @@ error[E0700]: hidden type for `impl Trait<'d, 'e>` captures lifetime that does n
   --> $DIR/ordinary-bounds-unrelated.rs:28:33
    |
 LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e>
-   |                     --                                                   ------------------ opaque type defined here
-   |                     |
-   |                     hidden type `Ordinary<'b>` captures the lifetime `'b` as defined here
+   |                                                                          ------------------ opaque type defined here
 ...
 LL |     if condition() { a } else { b }
    |                                 ^
    |
-help: to declare that `impl Trait<'d, 'e>` captures `'b`, you can add an explicit `'b` lifetime bound
-   |
-LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e> + 'b
-   |                                                                                             ++++
+   = note: hidden type `Ordinary<'_>` captures lifetime `'_`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.stderr b/tests/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.stderr
index 060eaa7e64a..d1190da6c9f 100644
--- a/tests/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.stderr
+++ b/tests/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.stderr
@@ -2,17 +2,12 @@ error[E0700]: hidden type for `impl Trait<'a, 'b>` captures lifetime that does n
   --> $DIR/ordinary-bounds-unsuited.rs:31:33
    |
 LL | fn upper_bounds<'a, 'b>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'a, 'b>
-   |                     --                                       ------------------ opaque type defined here
-   |                     |
-   |                     hidden type `Ordinary<'b>` captures the lifetime `'b` as defined here
+   |                                                              ------------------ opaque type defined here
 ...
 LL |     if condition() { a } else { b }
    |                                 ^
    |
-help: to declare that `impl Trait<'a, 'b>` captures `'b`, you can add an explicit `'b` lifetime bound
-   |
-LL | fn upper_bounds<'a, 'b>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'a, 'b> + 'b
-   |                                                                                 ++++
+   = note: hidden type `Ordinary<'_>` captures lifetime `'_`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/impl-trait/where-allowed.stderr b/tests/ui/impl-trait/where-allowed.stderr
index f0d259d01de..1fb69db98c1 100644
--- a/tests/ui/impl-trait/where-allowed.stderr
+++ b/tests/ui/impl-trait/where-allowed.stderr
@@ -433,3 +433,25 @@ error: aborting due to 50 previous errors
 
 Some errors have detailed explanations: E0053, E0118, E0283, E0562, E0599, E0658, E0666.
 For more information about an error, try `rustc --explain E0053`.
+Future incompatibility report: Future breakage diagnostic:
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+  --> $DIR/where-allowed.rs:239:7
+   |
+LL | impl <T = impl Debug> T {}
+   |       ^^^^^^^^^^^^^^
+   |
+   = 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 #36887 <https://github.com/rust-lang/rust/issues/36887>
+   = note: `#[deny(invalid_type_param_default)]` on by default
+
+Future breakage diagnostic:
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+  --> $DIR/where-allowed.rs:246:36
+   |
+LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
+   |                                    ^^^^^^^^^^^^^^
+   |
+   = 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 #36887 <https://github.com/rust-lang/rust/issues/36887>
+   = note: `#[deny(invalid_type_param_default)]` on by default
+
diff --git a/tests/ui/imports/import-from-missing-star-2.stderr b/tests/ui/imports/import-from-missing-star-2.stderr
index 59b000a4382..dd35627c684 100644
--- a/tests/ui/imports/import-from-missing-star-2.stderr
+++ b/tests/ui/imports/import-from-missing-star-2.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `spam`
 LL |     use spam::*;
    |         ^^^^ you might be missing crate `spam`
    |
-   = help: consider adding `extern crate spam` to use the `spam` crate
+help: consider importing the `spam` crate
+   |
+LL + extern crate spam;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/imports/import-from-missing-star-3.stderr b/tests/ui/imports/import-from-missing-star-3.stderr
index 23df6b35445..1e2412b0959 100644
--- a/tests/ui/imports/import-from-missing-star-3.stderr
+++ b/tests/ui/imports/import-from-missing-star-3.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `spam`
 LL |     use spam::*;
    |         ^^^^ you might be missing crate `spam`
    |
-   = help: consider adding `extern crate spam` to use the `spam` crate
+help: consider importing the `spam` crate
+   |
+LL + extern crate spam;
+   |
 
 error[E0432]: unresolved import `spam`
   --> $DIR/import-from-missing-star-3.rs:27:13
@@ -12,7 +15,10 @@ error[E0432]: unresolved import `spam`
 LL |         use spam::*;
    |             ^^^^ you might be missing crate `spam`
    |
-   = help: consider adding `extern crate spam` to use the `spam` crate
+help: consider importing the `spam` crate
+   |
+LL + extern crate spam;
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/imports/import-from-missing-star.stderr b/tests/ui/imports/import-from-missing-star.stderr
index b311527bc28..c9bb9baeb4d 100644
--- a/tests/ui/imports/import-from-missing-star.stderr
+++ b/tests/ui/imports/import-from-missing-star.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `spam`
 LL | use spam::*;
    |     ^^^^ you might be missing crate `spam`
    |
-   = help: consider adding `extern crate spam` to use the `spam` crate
+help: consider importing the `spam` crate
+   |
+LL + extern crate spam;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/imports/import3.stderr b/tests/ui/imports/import3.stderr
index 06260ef9ebc..157b5b63566 100644
--- a/tests/ui/imports/import3.stderr
+++ b/tests/ui/imports/import3.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `main`
 LL | use main::bar;
    |     ^^^^ you might be missing crate `main`
    |
-   = help: consider adding `extern crate main` to use the `main` crate
+help: consider importing the `main` crate
+   |
+LL + extern crate main;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/imports/issue-109343.stderr b/tests/ui/imports/issue-109343.stderr
index fe06eddeada..e66528e8df5 100644
--- a/tests/ui/imports/issue-109343.stderr
+++ b/tests/ui/imports/issue-109343.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `unresolved`
 LL | pub use unresolved::f;
    |         ^^^^^^^^^^ you might be missing crate `unresolved`
    |
-   = help: consider adding `extern crate unresolved` to use the `unresolved` crate
+help: consider importing the `unresolved` crate
+   |
+LL + extern crate unresolved;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/imports/issue-1697.rs b/tests/ui/imports/issue-1697.rs
index 8ec48d4d286..019237611df 100644
--- a/tests/ui/imports/issue-1697.rs
+++ b/tests/ui/imports/issue-1697.rs
@@ -3,6 +3,6 @@
 use unresolved::*;
 //~^ ERROR unresolved import `unresolved` [E0432]
 //~| NOTE you might be missing crate `unresolved`
-//~| HELP consider adding `extern crate unresolved` to use the `unresolved` crate
+//~| HELP consider importing the `unresolved` crate
 
 fn main() {}
diff --git a/tests/ui/imports/issue-1697.stderr b/tests/ui/imports/issue-1697.stderr
index df2957b8f2b..ec0d94bd672 100644
--- a/tests/ui/imports/issue-1697.stderr
+++ b/tests/ui/imports/issue-1697.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `unresolved`
 LL | use unresolved::*;
    |     ^^^^^^^^^^ you might be missing crate `unresolved`
    |
-   = help: consider adding `extern crate unresolved` to use the `unresolved` crate
+help: consider importing the `unresolved` crate
+   |
+LL + extern crate unresolved;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/imports/issue-33464.stderr b/tests/ui/imports/issue-33464.stderr
index 17cc0e4469e..28fbcee401f 100644
--- a/tests/ui/imports/issue-33464.stderr
+++ b/tests/ui/imports/issue-33464.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `abc`
 LL | use abc::one_el;
    |     ^^^ you might be missing crate `abc`
    |
-   = help: consider adding `extern crate abc` to use the `abc` crate
+help: consider importing the `abc` crate
+   |
+LL + extern crate abc;
+   |
 
 error[E0432]: unresolved import `abc`
   --> $DIR/issue-33464.rs:5:5
@@ -12,7 +15,10 @@ error[E0432]: unresolved import `abc`
 LL | use abc::{a, bbb, cccccc};
    |     ^^^ you might be missing crate `abc`
    |
-   = help: consider adding `extern crate abc` to use the `abc` crate
+help: consider importing the `abc` crate
+   |
+LL + extern crate abc;
+   |
 
 error[E0432]: unresolved import `a_very_long_name`
   --> $DIR/issue-33464.rs:7:5
@@ -20,7 +26,10 @@ error[E0432]: unresolved import `a_very_long_name`
 LL | use a_very_long_name::{el, el2};
    |     ^^^^^^^^^^^^^^^^ you might be missing crate `a_very_long_name`
    |
-   = help: consider adding `extern crate a_very_long_name` to use the `a_very_long_name` crate
+help: consider importing the `a_very_long_name` crate
+   |
+LL + extern crate a_very_long_name;
+   |
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/imports/issue-36881.stderr b/tests/ui/imports/issue-36881.stderr
index 3c136df83fe..004836e072c 100644
--- a/tests/ui/imports/issue-36881.stderr
+++ b/tests/ui/imports/issue-36881.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `issue_36881_aux`
 LL |     use issue_36881_aux::Foo;
    |         ^^^^^^^^^^^^^^^ you might be missing crate `issue_36881_aux`
    |
-   = help: consider adding `extern crate issue_36881_aux` to use the `issue_36881_aux` crate
+help: consider importing the `issue_36881_aux` crate
+   |
+LL + extern crate issue_36881_aux;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/imports/issue-37887.stderr b/tests/ui/imports/issue-37887.stderr
index 36020707405..02c2c803262 100644
--- a/tests/ui/imports/issue-37887.stderr
+++ b/tests/ui/imports/issue-37887.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `test`
 LL |     use test::*;
    |         ^^^^ you might be missing crate `test`
    |
-   = help: consider adding `extern crate test` to use the `test` crate
+help: consider importing the `test` crate
+   |
+LL + extern crate test;
+   |
 
 error[E0658]: use of unstable library feature 'test'
   --> $DIR/issue-37887.rs:2:5
diff --git a/tests/ui/imports/issue-53269.stderr b/tests/ui/imports/issue-53269.stderr
index 317b3c633a6..d25d85bf46f 100644
--- a/tests/ui/imports/issue-53269.stderr
+++ b/tests/ui/imports/issue-53269.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `nonexistent_module`
 LL |     use nonexistent_module::mac;
    |         ^^^^^^^^^^^^^^^^^^ you might be missing crate `nonexistent_module`
    |
-   = help: consider adding `extern crate nonexistent_module` to use the `nonexistent_module` crate
+help: consider importing the `nonexistent_module` crate
+   |
+LL + extern crate nonexistent_module;
+   |
 
 error[E0659]: `mac` is ambiguous
   --> $DIR/issue-53269.rs:8:5
diff --git a/tests/ui/imports/issue-55457.stderr b/tests/ui/imports/issue-55457.stderr
index e9126e6575c..9c99b6a20de 100644
--- a/tests/ui/imports/issue-55457.stderr
+++ b/tests/ui/imports/issue-55457.stderr
@@ -13,7 +13,10 @@ error[E0432]: unresolved import `non_existent`
 LL | use non_existent::non_existent;
    |     ^^^^^^^^^^^^ you might be missing crate `non_existent`
    |
-   = help: consider adding `extern crate non_existent` to use the `non_existent` crate
+help: consider importing the `non_existent` crate
+   |
+LL + extern crate non_existent;
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/imports/issue-55884-2.stderr b/tests/ui/imports/issue-55884-2.stderr
index 8a9d5f2a6d8..0d4f01aeafc 100644
--- a/tests/ui/imports/issue-55884-2.stderr
+++ b/tests/ui/imports/issue-55884-2.stderr
@@ -24,10 +24,6 @@ note: ...and refers to the struct `ParseOptions` which is defined here
    |
 LL |     pub struct ParseOptions {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^ you could import this directly
-help: import `ParseOptions` through the re-export
-   |
-LL | pub use parser::ParseOptions;
-   |         ~~~~~~~~~~~~~~~~~~~~
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/imports/issue-81413.stderr b/tests/ui/imports/issue-81413.stderr
index 321b3695d2c..aa1246c1d2f 100644
--- a/tests/ui/imports/issue-81413.stderr
+++ b/tests/ui/imports/issue-81413.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `doesnt_exist`
 LL | pub use doesnt_exist::*;
    |         ^^^^^^^^^^^^ you might be missing crate `doesnt_exist`
    |
-   = help: consider adding `extern crate doesnt_exist` to use the `doesnt_exist` crate
+help: consider importing the `doesnt_exist` crate
+   |
+LL + extern crate doesnt_exist;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/imports/redundant-import-extern-prelude.rs b/tests/ui/imports/redundant-import-extern-prelude.rs
index f1de06417aa..0064eaa9318 100644
--- a/tests/ui/imports/redundant-import-extern-prelude.rs
+++ b/tests/ui/imports/redundant-import-extern-prelude.rs
@@ -1,16 +1,17 @@
-//@ check-pass
 // Check that we detect imports that are redundant due to the extern prelude
 // and that we emit a reasonable diagnostic.
 // issue: rust-lang/rust#121915
+//~^^^ NOTE the item `aux_issue_121915` is already defined by the extern prelude
 
 // See also the discussion in <https://github.com/rust-lang/rust/pull/122954>.
 
 //@ compile-flags: --extern aux_issue_121915 --edition 2018
 //@ aux-build: aux-issue-121915.rs
 
-#[deny(unused_imports)]
+#[deny(redundant_imports)]
+//~^ NOTE the lint level is defined here
 fn main() {
     use aux_issue_121915;
-    //FIXME(unused_imports): ~^ ERROR the item `aux_issue_121915` is imported redundantly
+    //~^ ERROR the item `aux_issue_121915` is imported redundantly
     aux_issue_121915::item();
 }
diff --git a/tests/ui/imports/redundant-import-extern-prelude.stderr b/tests/ui/imports/redundant-import-extern-prelude.stderr
new file mode 100644
index 00000000000..6d2518c1284
--- /dev/null
+++ b/tests/ui/imports/redundant-import-extern-prelude.stderr
@@ -0,0 +1,14 @@
+error: the item `aux_issue_121915` is imported redundantly
+  --> $DIR/redundant-import-extern-prelude.rs:14:9
+   |
+LL |     use aux_issue_121915;
+   |         ^^^^^^^^^^^^^^^^ the item `aux_issue_121915` is already defined by the extern prelude
+   |
+note: the lint level is defined here
+  --> $DIR/redundant-import-extern-prelude.rs:11:8
+   |
+LL | #[deny(redundant_imports)]
+   |        ^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/imports/redundant-import-issue-121915-2015.rs b/tests/ui/imports/redundant-import-issue-121915-2015.rs
index be3b8209ada..dc499bc40b6 100644
--- a/tests/ui/imports/redundant-import-issue-121915-2015.rs
+++ b/tests/ui/imports/redundant-import-issue-121915-2015.rs
@@ -1,12 +1,11 @@
-//@ check-pass
 //@ compile-flags: --extern aux_issue_121915 --edition 2015
 //@ aux-build: aux-issue-121915.rs
 
 extern crate aux_issue_121915;
 
-#[deny(unused_imports)]
+#[deny(redundant_imports)]
 fn main() {
     use aux_issue_121915;
-    //FIXME(unused_imports): ~^ ERROR the item `aux_issue_121915` is imported redundantly
+    //~^ ERROR the item `aux_issue_121915` is imported redundantly
     aux_issue_121915::item();
 }
diff --git a/tests/ui/imports/redundant-import-issue-121915-2015.stderr b/tests/ui/imports/redundant-import-issue-121915-2015.stderr
new file mode 100644
index 00000000000..f4e9f604896
--- /dev/null
+++ b/tests/ui/imports/redundant-import-issue-121915-2015.stderr
@@ -0,0 +1,17 @@
+error: the item `aux_issue_121915` is imported redundantly
+  --> $DIR/redundant-import-issue-121915-2015.rs:8:9
+   |
+LL | extern crate aux_issue_121915;
+   | ------------------------------ the item `aux_issue_121915` is already imported here
+...
+LL |     use aux_issue_121915;
+   |         ^^^^^^^^^^^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/redundant-import-issue-121915-2015.rs:6:8
+   |
+LL | #[deny(redundant_imports)]
+   |        ^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/imports/redundant-import-lang-prelude-attr.rs b/tests/ui/imports/redundant-import-lang-prelude-attr.rs
index 59cd570f44c..f7ee91880ba 100644
--- a/tests/ui/imports/redundant-import-lang-prelude-attr.rs
+++ b/tests/ui/imports/redundant-import-lang-prelude-attr.rs
@@ -1,6 +1,6 @@
-//@ check-pass
 // Check that we detect imports (of built-in attributes) that are redundant due to
 // the language prelude and that we emit a reasonable diagnostic.
+//~^^ NOTE the item `allow` is already defined by the extern prelude
 
 // Note that we use the term "extern prelude" in the label even though "language prelude"
 // would be more correct. However, it's not worth special-casing this.
@@ -9,9 +9,10 @@
 
 //@ edition: 2018
 
-#![deny(unused_imports)]
+#![deny(redundant_imports)]
+//~^ NOTE the lint level is defined here
 
-use allow; //FIXME(unused_imports): ~ ERROR the item `allow` is imported redundantly
+use allow; //~ ERROR the item `allow` is imported redundantly
 
 #[allow(unused)]
 fn main() {}
diff --git a/tests/ui/imports/redundant-import-lang-prelude-attr.stderr b/tests/ui/imports/redundant-import-lang-prelude-attr.stderr
new file mode 100644
index 00000000000..f0016f5fab4
--- /dev/null
+++ b/tests/ui/imports/redundant-import-lang-prelude-attr.stderr
@@ -0,0 +1,14 @@
+error: the item `allow` is imported redundantly
+  --> $DIR/redundant-import-lang-prelude-attr.rs:15:5
+   |
+LL | use allow;
+   |     ^^^^^ the item `allow` is already defined by the extern prelude
+   |
+note: the lint level is defined here
+  --> $DIR/redundant-import-lang-prelude-attr.rs:12:9
+   |
+LL | #![deny(redundant_imports)]
+   |         ^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/imports/redundant-import-lang-prelude.rs b/tests/ui/imports/redundant-import-lang-prelude.rs
index 53d3b709963..3f95ffbe02e 100644
--- a/tests/ui/imports/redundant-import-lang-prelude.rs
+++ b/tests/ui/imports/redundant-import-lang-prelude.rs
@@ -1,16 +1,17 @@
-//@ check-pass
 // Check that we detect imports that are redundant due to the language prelude
 // and that we emit a reasonable diagnostic.
+//~^^ NOTE the item `u8` is already defined by the extern prelude
 
 // Note that we use the term "extern prelude" in the label even though "language prelude"
 // would be more correct. However, it's not worth special-casing this.
 
 // See also the discussion in <https://github.com/rust-lang/rust/pull/122954>.
 
-#![deny(unused_imports)]
+#![deny(redundant_imports)]
+//~^ NOTE the lint level is defined here
 
 use std::primitive::u8;
-//FIXME(unused_imports): ~^ ERROR the item `u8` is imported redundantly
+//~^ ERROR the item `u8` is imported redundantly
 
 const _: u8 = 0;
 
diff --git a/tests/ui/imports/redundant-import-lang-prelude.stderr b/tests/ui/imports/redundant-import-lang-prelude.stderr
new file mode 100644
index 00000000000..4fd57639781
--- /dev/null
+++ b/tests/ui/imports/redundant-import-lang-prelude.stderr
@@ -0,0 +1,14 @@
+error: the item `u8` is imported redundantly
+  --> $DIR/redundant-import-lang-prelude.rs:13:5
+   |
+LL | use std::primitive::u8;
+   |     ^^^^^^^^^^^^^^^^^^ the item `u8` is already defined by the extern prelude
+   |
+note: the lint level is defined here
+  --> $DIR/redundant-import-lang-prelude.rs:10:9
+   |
+LL | #![deny(redundant_imports)]
+   |         ^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/imports/suggest-remove-issue-121315.rs b/tests/ui/imports/suggest-remove-issue-121315.rs
index 2bb82833a5b..ee3ceb6e3a3 100644
--- a/tests/ui/imports/suggest-remove-issue-121315.rs
+++ b/tests/ui/imports/suggest-remove-issue-121315.rs
@@ -1,20 +1,19 @@
 //@ compile-flags: --edition 2021
-
-#![deny(unused_imports)]
+#![deny(unused_imports, redundant_imports)]
 #![allow(dead_code)]
 
 fn test0() {
     // Test remove FlatUnused
     use std::convert::TryFrom;
-    //FIXME(unused_imports): ~^ ERROR the item `TryFrom` is imported redundantly
+    //~^ ERROR the item `TryFrom` is imported redundantly
     let _ = u32::try_from(5i32);
 }
 
 fn test1() {
     // FIXME(yukang) Test remove NestedFullUnused
     use std::convert::{TryFrom, TryInto};
-    //FIXME(unused_imports): ~^ ERROR the item `TryFrom` is imported redundantly
-    //FIXME(unused_imports): ~| ERROR the item `TryInto` is imported redundantly
+    //~^ ERROR the item `TryFrom` is imported redundantly
+    //~| ERROR the item `TryInto` is imported redundantly
 
     let _ = u32::try_from(5i32);
     let _a: i32 = u32::try_into(5u32).unwrap();
@@ -24,7 +23,7 @@ fn test2() {
     // FIXME(yukang): Test remove both redundant and unused
     use std::convert::{AsMut, Into};
     //~^ ERROR unused import: `AsMut`
-    //FIXME(unused_imports): ~| ERROR the item `Into` is imported redundantly
+    //~| ERROR the item `Into` is imported redundantly
 
     let _a: u32 = (5u8).into();
 }
diff --git a/tests/ui/imports/suggest-remove-issue-121315.stderr b/tests/ui/imports/suggest-remove-issue-121315.stderr
index 5701514e1bd..5d0bf9bea6a 100644
--- a/tests/ui/imports/suggest-remove-issue-121315.stderr
+++ b/tests/ui/imports/suggest-remove-issue-121315.stderr
@@ -1,20 +1,62 @@
+error: the item `TryFrom` is imported redundantly
+  --> $DIR/suggest-remove-issue-121315.rs:7:9
+   |
+LL |     use std::convert::TryFrom;
+   |         ^^^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `TryFrom` is already defined here
+   |
+note: the lint level is defined here
+  --> $DIR/suggest-remove-issue-121315.rs:2:25
+   |
+LL | #![deny(unused_imports, redundant_imports)]
+   |                         ^^^^^^^^^^^^^^^^^
+
+error: the item `TryFrom` is imported redundantly
+  --> $DIR/suggest-remove-issue-121315.rs:14:24
+   |
+LL |     use std::convert::{TryFrom, TryInto};
+   |                        ^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `TryFrom` is already defined here
+
+error: the item `TryInto` is imported redundantly
+  --> $DIR/suggest-remove-issue-121315.rs:14:33
+   |
+LL |     use std::convert::{TryFrom, TryInto};
+   |                                 ^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `TryInto` is already defined here
+
 error: unused import: `AsMut`
-  --> $DIR/suggest-remove-issue-121315.rs:25:24
+  --> $DIR/suggest-remove-issue-121315.rs:24:24
    |
 LL |     use std::convert::{AsMut, Into};
    |                        ^^^^^
    |
 note: the lint level is defined here
-  --> $DIR/suggest-remove-issue-121315.rs:3:9
+  --> $DIR/suggest-remove-issue-121315.rs:2:9
    |
-LL | #![deny(unused_imports)]
+LL | #![deny(unused_imports, redundant_imports)]
    |         ^^^^^^^^^^^^^^
 
+error: the item `Into` is imported redundantly
+  --> $DIR/suggest-remove-issue-121315.rs:24:31
+   |
+LL |     use std::convert::{AsMut, Into};
+   |                               ^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `Into` is already defined here
+
 error: unused import: `From`
-  --> $DIR/suggest-remove-issue-121315.rs:34:24
+  --> $DIR/suggest-remove-issue-121315.rs:33:24
    |
 LL |     use std::convert::{From, Infallible};
    |                        ^^^^
 
-error: aborting due to 2 previous errors
+error: aborting due to 6 previous errors
 
diff --git a/tests/ui/imports/tool-mod-child.stderr b/tests/ui/imports/tool-mod-child.stderr
index 764256e76f0..ec110ccd75d 100644
--- a/tests/ui/imports/tool-mod-child.stderr
+++ b/tests/ui/imports/tool-mod-child.stderr
@@ -4,7 +4,10 @@ error[E0433]: failed to resolve: you might be missing crate `clippy`
 LL | use clippy::a::b;
    |     ^^^^^^ you might be missing crate `clippy`
    |
-   = help: consider adding `extern crate clippy` to use the `clippy` crate
+help: consider importing the `clippy` crate
+   |
+LL + extern crate clippy;
+   |
 
 error[E0432]: unresolved import `clippy`
   --> $DIR/tool-mod-child.rs:1:5
@@ -12,7 +15,10 @@ error[E0432]: unresolved import `clippy`
 LL | use clippy::a;
    |     ^^^^^^ you might be missing crate `clippy`
    |
-   = help: consider adding `extern crate clippy` to use the `clippy` crate
+help: consider importing the `clippy` crate
+   |
+LL + extern crate clippy;
+   |
 
 error[E0433]: failed to resolve: you might be missing crate `rustdoc`
   --> $DIR/tool-mod-child.rs:5:5
@@ -20,7 +26,10 @@ error[E0433]: failed to resolve: you might be missing crate `rustdoc`
 LL | use rustdoc::a::b;
    |     ^^^^^^^ you might be missing crate `rustdoc`
    |
-   = help: consider adding `extern crate rustdoc` to use the `rustdoc` crate
+help: consider importing the `rustdoc` crate
+   |
+LL + extern crate rustdoc;
+   |
 
 error[E0432]: unresolved import `rustdoc`
   --> $DIR/tool-mod-child.rs:4:5
@@ -28,7 +37,10 @@ error[E0432]: unresolved import `rustdoc`
 LL | use rustdoc::a;
    |     ^^^^^^^ you might be missing crate `rustdoc`
    |
-   = help: consider adding `extern crate rustdoc` to use the `rustdoc` crate
+help: consider importing the `rustdoc` crate
+   |
+LL + extern crate rustdoc;
+   |
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/imports/unresolved-imports-used.stderr b/tests/ui/imports/unresolved-imports-used.stderr
index 1cbc2356320..4bf02ff6e3a 100644
--- a/tests/ui/imports/unresolved-imports-used.stderr
+++ b/tests/ui/imports/unresolved-imports-used.stderr
@@ -16,7 +16,10 @@ error[E0432]: unresolved import `foo`
 LL | use foo::bar;
    |     ^^^ you might be missing crate `foo`
    |
-   = help: consider adding `extern crate foo` to use the `foo` crate
+help: consider importing the `foo` crate
+   |
+LL + extern crate foo;
+   |
 
 error[E0432]: unresolved import `baz`
   --> $DIR/unresolved-imports-used.rs:12:5
@@ -24,7 +27,10 @@ error[E0432]: unresolved import `baz`
 LL | use baz::*;
    |     ^^^ you might be missing crate `baz`
    |
-   = help: consider adding `extern crate baz` to use the `baz` crate
+help: consider importing the `baz` crate
+   |
+LL + extern crate baz;
+   |
 
 error[E0432]: unresolved import `foo2`
   --> $DIR/unresolved-imports-used.rs:14:5
@@ -32,7 +38,10 @@ error[E0432]: unresolved import `foo2`
 LL | use foo2::bar2;
    |     ^^^^ you might be missing crate `foo2`
    |
-   = help: consider adding `extern crate foo2` to use the `foo2` crate
+help: consider importing the `foo2` crate
+   |
+LL + extern crate foo2;
+   |
 
 error[E0432]: unresolved import `baz2`
   --> $DIR/unresolved-imports-used.rs:15:5
@@ -40,7 +49,10 @@ error[E0432]: unresolved import `baz2`
 LL | use baz2::*;
    |     ^^^^ you might be missing crate `baz2`
    |
-   = help: consider adding `extern crate baz2` to use the `baz2` crate
+help: consider importing the `baz2` crate
+   |
+LL + extern crate baz2;
+   |
 
 error[E0603]: function `quz` is private
   --> $DIR/unresolved-imports-used.rs:9:10
diff --git a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.rs b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.rs
new file mode 100644
index 00000000000..830a6390fce
--- /dev/null
+++ b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.rs
@@ -0,0 +1,24 @@
+// issue#121613
+
+#![feature(more_qualified_paths)]
+
+struct S {}
+
+struct Foo;
+
+trait A {
+    type Assoc;
+}
+
+impl A for Foo {
+    type Assoc = S;
+}
+
+fn f() {}
+
+fn main() {
+  <Foo as A>::Assoc {};
+  f(|a, b| a.cmp(b));
+  //~^ ERROR: type annotations needed
+  //~| ERROR: this function takes 0 arguments but 1 argument was supplied
+}
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
new file mode 100644
index 00000000000..10056bdf3d4
--- /dev/null
+++ b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.stderr
@@ -0,0 +1,32 @@
+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
+   |
+help: consider giving this closure parameter an explicit type
+   |
+LL |   f(|a: /* Type */, b| a.cmp(b));
+   |       ++++++++++++
+
+error[E0061]: this function takes 0 arguments but 1 argument was supplied
+  --> $DIR/incompat-call-after-qualified-path-0.rs:21:3
+   |
+LL |   f(|a, b| a.cmp(b));
+   |   ^ --------------- unexpected argument
+   |
+note: function defined here
+  --> $DIR/incompat-call-after-qualified-path-0.rs:17:4
+   |
+LL | fn f() {}
+   |    ^
+help: remove the extra argument
+   |
+LL -   f(|a, b| a.cmp(b));
+LL +   f();
+   |
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0061, E0282.
+For more information about an error, try `rustc --explain E0061`.
diff --git a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.rs b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.rs
new file mode 100644
index 00000000000..6b786332a8f
--- /dev/null
+++ b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.rs
@@ -0,0 +1,28 @@
+// issue#121613
+
+#![feature(more_qualified_paths)]
+
+struct S<T> {
+    a: T
+}
+
+struct Foo;
+
+trait A {
+    type Assoc<T>;
+}
+
+impl A for Foo {
+    type Assoc<T> = S<T>;
+}
+
+fn f() {}
+
+fn main() {
+  <Foo as A>::Assoc::<i32> {
+    a: 1
+  };
+  f(|a, b| a.cmp(b));
+  //~^ ERROR: type annotations needed
+  //~| ERROR: this function takes 0 arguments but 1 argument was supplied
+}
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
new file mode 100644
index 00000000000..632a9b99f84
--- /dev/null
+++ b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.stderr
@@ -0,0 +1,32 @@
+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
+   |
+help: consider giving this closure parameter an explicit type
+   |
+LL |   f(|a: /* Type */, b| a.cmp(b));
+   |       ++++++++++++
+
+error[E0061]: this function takes 0 arguments but 1 argument was supplied
+  --> $DIR/incompat-call-after-qualified-path-1.rs:25:3
+   |
+LL |   f(|a, b| a.cmp(b));
+   |   ^ --------------- unexpected argument
+   |
+note: function defined here
+  --> $DIR/incompat-call-after-qualified-path-1.rs:19:4
+   |
+LL | fn f() {}
+   |    ^
+help: remove the extra argument
+   |
+LL -   f(|a, b| a.cmp(b));
+LL +   f();
+   |
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0061, E0282.
+For more information about an error, try `rustc --explain E0061`.
diff --git a/tests/ui/inline-const/using-late-bound-from-closure.rs b/tests/ui/inline-const/using-late-bound-from-closure.rs
new file mode 100644
index 00000000000..2b12b2e26a2
--- /dev/null
+++ b/tests/ui/inline-const/using-late-bound-from-closure.rs
@@ -0,0 +1,16 @@
+// Test for ICE: cannot convert ReLateParam to a region vid
+// https://github.com/rust-lang/rust/issues/125873
+
+#![feature(closure_lifetime_binder)]
+fn foo() {
+    let a = for<'a> |b: &'a ()| -> &'a () {
+        const {
+            let awd = ();
+            let _: &'a () = &awd;
+            //~^ `awd` does not live long enough
+        };
+        b
+    };
+}
+
+fn main() {}
diff --git a/tests/ui/inline-const/using-late-bound-from-closure.stderr b/tests/ui/inline-const/using-late-bound-from-closure.stderr
new file mode 100644
index 00000000000..d6e1579aa34
--- /dev/null
+++ b/tests/ui/inline-const/using-late-bound-from-closure.stderr
@@ -0,0 +1,19 @@
+error[E0597]: `awd` does not live long enough
+  --> $DIR/using-late-bound-from-closure.rs:9:29
+   |
+LL |     let a = for<'a> |b: &'a ()| -> &'a () {
+   |                 -- lifetime `'a` defined here
+LL |         const {
+LL |             let awd = ();
+   |                 --- binding `awd` declared here
+LL |             let _: &'a () = &awd;
+   |                    ------   ^^^^ borrowed value does not live long enough
+   |                    |
+   |                    type annotation requires that `awd` is borrowed for `'a`
+LL |
+LL |         };
+   |         - `awd` dropped here while still borrowed
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0597`.
diff --git a/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs
index 0e894ef581c..ab46fd796c5 100644
--- a/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs
+++ b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.rs
@@ -10,7 +10,7 @@ const RAW_EQ_PADDING: bool = unsafe {
 const RAW_EQ_PTR: bool = unsafe {
     std::intrinsics::raw_eq(&(&0), &(&1))
 //~^ ERROR evaluation of constant value failed
-//~| `raw_eq` on bytes with provenance
+//~| unable to turn pointer into integer
 };
 
 pub fn main() {
diff --git a/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr
index 317466eb322..af16c2bc64a 100644
--- a/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr
+++ b/tests/ui/intrinsics/intrinsic-raw_eq-const-bad.stderr
@@ -8,7 +8,10 @@ error[E0080]: evaluation of constant value failed
   --> $DIR/intrinsic-raw_eq-const-bad.rs:11:5
    |
 LL |     std::intrinsics::raw_eq(&(&0), &(&1))
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `raw_eq` on bytes with provenance
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
+   |
+   = help: this code performed an operation that depends on the underlying bytes representing a pointer
+   = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/issues/issue-19380.rs b/tests/ui/issues/issue-19380.rs
index fce737cba18..8b3fe4d2b09 100644
--- a/tests/ui/issues/issue-19380.rs
+++ b/tests/ui/issues/issue-19380.rs
@@ -15,5 +15,6 @@ struct Bar {
 const FOO : Foo = Foo;
 const BAR : Bar = Bar { foos: &[&FOO]};
 //~^ ERROR E0038
+//~| ERROR E0038
 
 fn main() { }
diff --git a/tests/ui/issues/issue-19380.stderr b/tests/ui/issues/issue-19380.stderr
index f6244d9d44f..1d7aa6bd459 100644
--- a/tests/ui/issues/issue-19380.stderr
+++ b/tests/ui/issues/issue-19380.stderr
@@ -45,6 +45,29 @@ help: alternatively, consider constraining `qiz` so it does not apply to trait o
 LL |   fn qiz() where Self: Sized;
    |            +++++++++++++++++
 
-error: aborting due to 2 previous errors
+error[E0038]: the trait `Qiz` cannot be made into an object
+  --> $DIR/issue-19380.rs:16:31
+   |
+LL | const BAR : Bar = Bar { foos: &[&FOO]};
+   |                               ^^^^^^^ `Qiz` cannot be made into an object
+   |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/issue-19380.rs:2:6
+   |
+LL | trait Qiz {
+   |       --- this trait cannot be made into an object...
+LL |   fn qiz();
+   |      ^^^ ...because associated function `qiz` has no `self` parameter
+   = help: only type `Foo` implements the trait, consider using it directly instead
+help: consider turning `qiz` into a method by giving it a `&self` argument
+   |
+LL |   fn qiz(&self);
+   |          +++++
+help: alternatively, consider constraining `qiz` so it does not apply to trait objects
+   |
+LL |   fn qiz() where Self: Sized;
+   |            +++++++++++++++++
+
+error: aborting due to 3 previous errors
 
 For more information about this error, try `rustc --explain E0038`.
diff --git a/tests/ui/issues/issue-26812.rs b/tests/ui/issues/issue-26812.rs
index 3391ea4b350..e0723e016b3 100644
--- a/tests/ui/issues/issue-26812.rs
+++ b/tests/ui/issues/issue-26812.rs
@@ -1,6 +1,6 @@
-#![feature(default_type_parameter_fallback)]
-
 fn avg<T=T::Item>(_: T) {}
 //~^ ERROR generic parameters with a default cannot use forward declared identifiers
+//~| ERROR defaults for type parameters
+//~| WARN previously accepted
 
 fn main() {}
diff --git a/tests/ui/issues/issue-26812.stderr b/tests/ui/issues/issue-26812.stderr
index c2a3d4b83d5..4a18b23fd8b 100644
--- a/tests/ui/issues/issue-26812.stderr
+++ b/tests/ui/issues/issue-26812.stderr
@@ -1,9 +1,30 @@
 error[E0128]: generic parameters with a default cannot use forward declared identifiers
-  --> $DIR/issue-26812.rs:3:10
+  --> $DIR/issue-26812.rs:1:10
    |
 LL | fn avg<T=T::Item>(_: T) {}
    |          ^^^^^^^ defaulted generic parameters cannot be forward declared
 
-error: aborting due to 1 previous error
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+  --> $DIR/issue-26812.rs:1:8
+   |
+LL | fn avg<T=T::Item>(_: T) {}
+   |        ^^^^^^^^^
+   |
+   = 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 #36887 <https://github.com/rust-lang/rust/issues/36887>
+   = note: `#[deny(invalid_type_param_default)]` on by default
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0128`.
+Future incompatibility report: Future breakage diagnostic:
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+  --> $DIR/issue-26812.rs:1:8
+   |
+LL | fn avg<T=T::Item>(_: T) {}
+   |        ^^^^^^^^^
+   |
+   = 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 #36887 <https://github.com/rust-lang/rust/issues/36887>
+   = note: `#[deny(invalid_type_param_default)]` on by default
+
diff --git a/tests/ui/issues/issue-48728.stderr b/tests/ui/issues/issue-48728.current.stderr
index 6b4247f1d79..2a1b4ff7818 100644
--- a/tests/ui/issues/issue-48728.stderr
+++ b/tests/ui/issues/issue-48728.current.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `Clone` for type `Node<[_]>`
-  --> $DIR/issue-48728.rs:4:10
+  --> $DIR/issue-48728.rs:9:10
    |
 LL | #[derive(Clone)]
    |          ^^^^^ conflicting implementation for `Node<[_]>`
diff --git a/tests/ui/issues/issue-48728.rs b/tests/ui/issues/issue-48728.rs
index cbdc10bd2e1..7ef05f4277b 100644
--- a/tests/ui/issues/issue-48728.rs
+++ b/tests/ui/issues/issue-48728.rs
@@ -1,7 +1,12 @@
 // Regression test for #48728, an ICE that occurred computing
 // coherence "help" information.
 
-#[derive(Clone)] //~ ERROR conflicting implementations of trait `Clone`
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
+//@[next] check-pass
+
+#[derive(Clone)] //[current]~ ERROR conflicting implementations of trait `Clone`
 struct Node<T: ?Sized>(Box<T>);
 
 impl<T: Clone + ?Sized> Clone for Node<[T]> {
diff --git a/tests/ui/issues/issue-5708.rs b/tests/ui/issues/issue-5708.rs
index 89ea9fbdcd8..ce9ef78ffcd 100644
--- a/tests/ui/issues/issue-5708.rs
+++ b/tests/ui/issues/issue-5708.rs
@@ -44,7 +44,6 @@ pub trait MyTrait<T> {
     fn dummy(&self, t: T) -> T { panic!() }
 }
 
-#[allow(dead_code)]
 pub struct MyContainer<'a, T:'a> {
     foos: Vec<&'a (dyn MyTrait<T>+'a)> ,
 }
diff --git a/tests/ui/json/json-bom-plus-crlf-multifile.stderr b/tests/ui/json/json-bom-plus-crlf-multifile.stderr
index 2ed26f9a8a5..9c88a7e5a25 100644
--- a/tests/ui/json/json-bom-plus-crlf-multifile.stderr
+++ b/tests/ui/json/json-bom-plus-crlf-multifile.stderr
@@ -24,7 +24,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":622,"byte_end":623,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":613,"byte_end":619,"line_start":17,"line_end":17,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":623,"byte_end":623,"line_start":17,"line_end":17,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":622,"byte_end":623,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":613,"byte_end":619,"line_start":17,"line_end":17,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":623,"byte_end":623,"line_start":17,"line_end":17,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types: expected `String`, found integer
 "}
 {"$message_type":"diagnostic","message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
 
@@ -52,7 +52,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":682,"byte_end":683,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":673,"byte_end":679,"line_start":19,"line_end":19,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":683,"byte_end":683,"line_start":19,"line_end":19,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":682,"byte_end":683,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":673,"byte_end":679,"line_start":19,"line_end":19,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":683,"byte_end":683,"line_start":19,"line_end":19,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types: expected `String`, found integer
 "}
 {"$message_type":"diagnostic","message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
 
@@ -80,7 +80,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":746,"byte_end":747,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":736,"byte_end":742,"line_start":22,"line_end":22,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":747,"byte_end":747,"line_start":23,"line_end":23,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":746,"byte_end":747,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":736,"byte_end":742,"line_start":22,"line_end":22,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":747,"byte_end":747,"line_start":23,"line_end":23,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types: expected `String`, found integer
 "}
 {"$message_type":"diagnostic","message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
 
@@ -108,7 +108,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":802,"byte_end":810,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":"    let s : String = (","highlight_start":22,"highlight_end":23},{"text":"    );  // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":793,"byte_end":799,"line_start":25,"line_end":25,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":802,"byte_end":810,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":"    let s : String = (","highlight_start":22,"highlight_end":23},{"text":"    );  // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":793,"byte_end":799,"line_start":25,"line_end":25,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types: expected `String`, found `()`
 "}
 {"$message_type":"diagnostic","message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors
 "}
diff --git a/tests/ui/json/json-bom-plus-crlf.stderr b/tests/ui/json/json-bom-plus-crlf.stderr
index b5e6f658616..cd1e3665b3e 100644
--- a/tests/ui/json/json-bom-plus-crlf.stderr
+++ b/tests/ui/json/json-bom-plus-crlf.stderr
@@ -24,7 +24,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":607,"byte_end":608,"line_start":16,"line_end":16,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":598,"byte_end":604,"line_start":16,"line_end":16,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":608,"byte_end":608,"line_start":16,"line_end":16,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:16:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":607,"byte_end":608,"line_start":16,"line_end":16,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":598,"byte_end":604,"line_start":16,"line_end":16,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":608,"byte_end":608,"line_start":16,"line_end":16,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:16:22: error[E0308]: mismatched types: expected `String`, found integer
 "}
 {"$message_type":"diagnostic","message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
 
@@ -52,7 +52,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":667,"byte_end":668,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":658,"byte_end":664,"line_start":18,"line_end":18,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":668,"byte_end":668,"line_start":18,"line_end":18,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:18:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":667,"byte_end":668,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":658,"byte_end":664,"line_start":18,"line_end":18,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":668,"byte_end":668,"line_start":18,"line_end":18,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:18:22: error[E0308]: mismatched types: expected `String`, found integer
 "}
 {"$message_type":"diagnostic","message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
 
@@ -80,7 +80,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":731,"byte_end":732,"line_start":22,"line_end":22,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":721,"byte_end":727,"line_start":21,"line_end":21,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":732,"byte_end":732,"line_start":22,"line_end":22,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:22:1: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":731,"byte_end":732,"line_start":22,"line_end":22,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":721,"byte_end":727,"line_start":21,"line_end":21,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":732,"byte_end":732,"line_start":22,"line_end":22,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:22:1: error[E0308]: mismatched types: expected `String`, found integer
 "}
 {"$message_type":"diagnostic","message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
 
@@ -108,7 +108,7 @@ This error occurs when an expression was used in a place where the compiler
 expected an expression of a different type. It can occur in several cases, the
 most common being when calling a function and passing an argument which has a
 different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":787,"byte_end":795,"line_start":24,"line_end":25,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":"    let s : String = (","highlight_start":22,"highlight_end":23},{"text":"    );  // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":778,"byte_end":784,"line_start":24,"line_end":24,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:24:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":787,"byte_end":795,"line_start":24,"line_end":25,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":"    let s : String = (","highlight_start":22,"highlight_end":23},{"text":"    );  // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":778,"byte_end":784,"line_start":24,"line_end":24,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:24:22: error[E0308]: mismatched types: expected `String`, found `()`
 "}
 {"$message_type":"diagnostic","message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors
 "}
diff --git a/tests/ui/json/json-short.stderr b/tests/ui/json/json-short.stderr
index a3d579cadcc..8a4a55edf68 100644
--- a/tests/ui/json/json-short.stderr
+++ b/tests/ui/json/json-short.stderr
@@ -13,7 +13,7 @@ If you don't know the basics of Rust, you can look at the
 [Rust Book][rust-book] to get started.
 
 [rust-book]: https://doc.rust-lang.org/book/
-"},"level":"error","spans":[{"file_name":"$DIR/json-short.rs","byte_start":63,"byte_end":63,"line_start":1,"line_end":1,"column_start":64,"column_end":64,"is_primary":true,"text":[{"text":"//@ compile-flags: --json=diagnostic-short --error-format=json","highlight_start":64,"highlight_end":64}],"label":"consider adding a `main` function to `$DIR/json-short.rs`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-short.rs:1:64: error[E0601]: `main` function not found in crate `json_short`
+"},"level":"error","spans":[{"file_name":"$DIR/json-short.rs","byte_start":63,"byte_end":63,"line_start":1,"line_end":1,"column_start":64,"column_end":64,"is_primary":true,"text":[{"text":"//@ compile-flags: --json=diagnostic-short --error-format=json","highlight_start":64,"highlight_end":64}],"label":"consider adding a `main` function to `$DIR/json-short.rs`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-short.rs:1:64: error[E0601]: `main` function not found in crate `json_short`: consider adding a `main` function to `$DIR/json-short.rs`
 "}
 {"$message_type":"diagnostic","message":"aborting due to 1 previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 1 previous error
 "}
diff --git a/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr b/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr
index a647ca27f1c..f23f855c9e8 100644
--- a/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr
+++ b/tests/ui/keyword/extern/keyword-extern-as-identifier-use.stderr
@@ -15,7 +15,10 @@ error[E0432]: unresolved import `r#extern`
 LL | use extern::foo;
    |     ^^^^^^ you might be missing crate `r#extern`
    |
-   = help: consider adding `extern crate r#extern` to use the `r#extern` crate
+help: consider importing the `r#extern` crate
+   |
+LL + extern crate r#extern;
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/lifetimes/elided-lint-in-mod.rs b/tests/ui/lifetimes/elided-lint-in-mod.rs
new file mode 100644
index 00000000000..afe85cb607d
--- /dev/null
+++ b/tests/ui/lifetimes/elided-lint-in-mod.rs
@@ -0,0 +1,11 @@
+struct Foo<'a>(&'a ());
+
+fn test(_: Foo) {}
+
+#[deny(elided_lifetimes_in_paths)]
+mod w {
+    fn test2(_: super::Foo) {}
+    //~^ ERROR hidden lifetime parameters in types are deprecated
+}
+
+fn main() {}
diff --git a/tests/ui/lifetimes/elided-lint-in-mod.stderr b/tests/ui/lifetimes/elided-lint-in-mod.stderr
new file mode 100644
index 00000000000..1fee18028c6
--- /dev/null
+++ b/tests/ui/lifetimes/elided-lint-in-mod.stderr
@@ -0,0 +1,20 @@
+error: hidden lifetime parameters in types are deprecated
+  --> $DIR/elided-lint-in-mod.rs:7:24
+   |
+LL |     fn test2(_: super::Foo) {}
+   |                 -------^^^
+   |                 |
+   |                 expected lifetime parameter
+   |
+note: the lint level is defined here
+  --> $DIR/elided-lint-in-mod.rs:5:8
+   |
+LL | #[deny(elided_lifetimes_in_paths)]
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^
+help: indicate the anonymous lifetime
+   |
+LL |     fn test2(_: super::Foo<'_>) {}
+   |                           ++++
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/lifetimes/unusual-rib-combinations.stderr b/tests/ui/lifetimes/unusual-rib-combinations.stderr
index e446345aedc..ebf6f6ca403 100644
--- a/tests/ui/lifetimes/unusual-rib-combinations.stderr
+++ b/tests/ui/lifetimes/unusual-rib-combinations.stderr
@@ -72,3 +72,14 @@ error: aborting due to 8 previous errors
 
 Some errors have detailed explanations: E0106, E0214, E0308, E0770.
 For more information about an error, try `rustc --explain E0106`.
+Future incompatibility report: Future breakage diagnostic:
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+  --> $DIR/unusual-rib-combinations.rs:15:6
+   |
+LL | fn c<T = u8()>() {}
+   |      ^^^^^^^^
+   |
+   = 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 #36887 <https://github.com/rust-lang/rust/issues/36887>
+   = note: `#[deny(invalid_type_param_default)]` on by default
+
diff --git a/tests/ui/lint/command-line-lint-group-forbid.stderr b/tests/ui/lint/command-line-lint-group-forbid.stderr
index 7b527e7b8b4..ec9b6ca9664 100644
--- a/tests/ui/lint/command-line-lint-group-forbid.stderr
+++ b/tests/ui/lint/command-line-lint-group-forbid.stderr
@@ -5,7 +5,6 @@ LL |     let _InappropriateCamelCasing = true;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `_inappropriate_camel_casing`
    |
    = note: `-F non-snake-case` implied by `-F bad-style`
-   = help: to override `-F bad-style` add `#[allow(non_snake_case)]`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/lint/dead-code/allow-unconstructed-pub-struct.rs b/tests/ui/lint/dead-code/allow-unconstructed-pub-struct.rs
deleted file mode 100644
index 8cd1524045b..00000000000
--- a/tests/ui/lint/dead-code/allow-unconstructed-pub-struct.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-//@ check-pass
-
-mod ffi {
-    use super::*;
-
-    extern "C" {
-        pub fn DomPromise_AddRef(promise: *const Promise);
-        pub fn DomPromise_Release(promise: *const Promise);
-    }
-}
-
-#[repr(C)]
-#[allow(unused)]
-pub struct Promise {
-    private: [u8; 0],
-    __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
-}
-
-pub unsafe trait RefCounted {
-    unsafe fn addref(&self);
-    unsafe fn release(&self);
-}
-
-unsafe impl RefCounted for Promise {
-    unsafe fn addref(&self) {
-        ffi::DomPromise_AddRef(self)
-    }
-    unsafe fn release(&self) {
-        ffi::DomPromise_Release(self)
-    }
-}
-
-fn main() {}
diff --git a/tests/ui/lint/dead-code/issue-59003.rs b/tests/ui/lint/dead-code/issue-59003.rs
index 319cf2db149..e3dcaca5778 100644
--- a/tests/ui/lint/dead-code/issue-59003.rs
+++ b/tests/ui/lint/dead-code/issue-59003.rs
@@ -4,8 +4,8 @@
 
 #![deny(dead_code)]
 
-#[allow(dead_code)]
 struct Foo {
+    #[allow(dead_code)]
     inner: u32,
 }
 
diff --git a/tests/ui/lint/dead-code/lint-dead-code-1.rs b/tests/ui/lint/dead-code/lint-dead-code-1.rs
index 3386dfa4747..ddcafedf7bc 100644
--- a/tests/ui/lint/dead-code/lint-dead-code-1.rs
+++ b/tests/ui/lint/dead-code/lint-dead-code-1.rs
@@ -46,10 +46,11 @@ struct SemiUsedStruct;
 impl SemiUsedStruct {
     fn la_la_la() {}
 }
-struct StructUsedAsField; //~ ERROR struct `StructUsedAsField` is never constructed
+struct StructUsedAsField;
 pub struct StructUsedInEnum;
 struct StructUsedInGeneric;
-pub struct PubStruct2 { //~ ERROR struct `PubStruct2` is never constructed
+pub struct PubStruct2 {
+    #[allow(dead_code)]
     struct_used_as_field: *const StructUsedAsField
 }
 
diff --git a/tests/ui/lint/dead-code/lint-dead-code-1.stderr b/tests/ui/lint/dead-code/lint-dead-code-1.stderr
index b0163df8855..eb728b5b930 100644
--- a/tests/ui/lint/dead-code/lint-dead-code-1.stderr
+++ b/tests/ui/lint/dead-code/lint-dead-code-1.stderr
@@ -22,26 +22,14 @@ error: struct `PrivStruct` is never constructed
 LL | struct PrivStruct;
    |        ^^^^^^^^^^
 
-error: struct `StructUsedAsField` is never constructed
-  --> $DIR/lint-dead-code-1.rs:49:8
-   |
-LL | struct StructUsedAsField;
-   |        ^^^^^^^^^^^^^^^^^
-
-error: struct `PubStruct2` is never constructed
-  --> $DIR/lint-dead-code-1.rs:52:12
-   |
-LL | pub struct PubStruct2 {
-   |            ^^^^^^^^^^
-
 error: enum `priv_enum` is never used
-  --> $DIR/lint-dead-code-1.rs:63:6
+  --> $DIR/lint-dead-code-1.rs:64:6
    |
 LL | enum priv_enum { foo2, bar2 }
    |      ^^^^^^^^^
 
 error: variant `bar3` is never constructed
-  --> $DIR/lint-dead-code-1.rs:66:5
+  --> $DIR/lint-dead-code-1.rs:67:5
    |
 LL | enum used_enum {
    |      --------- variant in this enum
@@ -50,25 +38,25 @@ LL |     bar3
    |     ^^^^
 
 error: function `priv_fn` is never used
-  --> $DIR/lint-dead-code-1.rs:87:4
+  --> $DIR/lint-dead-code-1.rs:88:4
    |
 LL | fn priv_fn() {
    |    ^^^^^^^
 
 error: function `foo` is never used
-  --> $DIR/lint-dead-code-1.rs:92:4
+  --> $DIR/lint-dead-code-1.rs:93:4
    |
 LL | fn foo() {
    |    ^^^
 
 error: function `bar` is never used
-  --> $DIR/lint-dead-code-1.rs:97:4
+  --> $DIR/lint-dead-code-1.rs:98:4
    |
 LL | fn bar() {
    |    ^^^
 
 error: function `baz` is never used
-  --> $DIR/lint-dead-code-1.rs:101:4
+  --> $DIR/lint-dead-code-1.rs:102:4
    |
 LL | fn baz() -> impl Copy {
    |    ^^^
@@ -79,5 +67,5 @@ error: struct `Bar` is never constructed
 LL |     pub struct Bar;
    |                ^^^
 
-error: aborting due to 12 previous errors
+error: aborting due to 10 previous errors
 
diff --git a/tests/ui/lint/dead-code/lint-unused-adt-appeared-in-pattern.rs b/tests/ui/lint/dead-code/lint-unused-adt-appeared-in-pattern.rs
deleted file mode 100644
index 25777438456..00000000000
--- a/tests/ui/lint/dead-code/lint-unused-adt-appeared-in-pattern.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-#![deny(dead_code)]
-
-struct Foo(u8); //~ ERROR struct `Foo` is never constructed
-
-enum Bar { //~ ERROR enum `Bar` is never used
-    Var1(u8),
-    Var2(u8),
-}
-
-pub trait Tr1 {
-    fn f1() -> Self;
-}
-
-impl Tr1 for Foo {
-    fn f1() -> Foo {
-        let f = Foo(0);
-        let Foo(tag) = f;
-        Foo(tag)
-    }
-}
-
-impl Tr1 for Bar {
-    fn f1() -> Bar {
-        let b = Bar::Var1(0);
-        let b = if let Bar::Var1(_) = b {
-            Bar::Var1(0)
-        } else {
-            Bar::Var2(0)
-        };
-        match b {
-            Bar::Var1(_) => Bar::Var2(0),
-            Bar::Var2(_) => Bar::Var1(0),
-        }
-    }
-}
-
-fn main() {}
diff --git a/tests/ui/lint/dead-code/lint-unused-adt-appeared-in-pattern.stderr b/tests/ui/lint/dead-code/lint-unused-adt-appeared-in-pattern.stderr
deleted file mode 100644
index 7c1a4b45977..00000000000
--- a/tests/ui/lint/dead-code/lint-unused-adt-appeared-in-pattern.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: struct `Foo` is never constructed
-  --> $DIR/lint-unused-adt-appeared-in-pattern.rs:3:8
-   |
-LL | struct Foo(u8);
-   |        ^^^
-   |
-note: the lint level is defined here
-  --> $DIR/lint-unused-adt-appeared-in-pattern.rs:1:9
-   |
-LL | #![deny(dead_code)]
-   |         ^^^^^^^^^
-
-error: enum `Bar` is never used
-  --> $DIR/lint-unused-adt-appeared-in-pattern.rs:5:6
-   |
-LL | enum Bar {
-   |      ^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/lint/dead-code/not-lint-used-adt-appeared-in-pattern.rs b/tests/ui/lint/dead-code/not-lint-used-adt-appeared-in-pattern.rs
deleted file mode 100644
index 43a2e431904..00000000000
--- a/tests/ui/lint/dead-code/not-lint-used-adt-appeared-in-pattern.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-//@ check-pass
-
-#![deny(dead_code)]
-
-#[repr(u8)]
-#[derive(Copy, Clone, Debug)]
-pub enum RecordField {
-    Target = 1,
-    Level,
-    Module,
-    File,
-    Line,
-    NumArgs,
-}
-
-unsafe trait Pod {}
-
-#[repr(transparent)]
-struct RecordFieldWrapper(RecordField);
-
-unsafe impl Pod for RecordFieldWrapper {}
-
-fn try_read<T: Pod>(buf: &[u8]) -> T {
-    unsafe { std::ptr::read_unaligned(buf.as_ptr() as *const T) }
-}
-
-pub fn foo(buf: &[u8]) -> RecordField {
-    let RecordFieldWrapper(tag) = try_read(buf);
-    tag
-}
-
-fn main() {}
diff --git a/tests/ui/lint/dead-code/offset-of-correct-param-env.rs b/tests/ui/lint/dead-code/offset-of-correct-param-env.rs
index 61babdeb28b..8cb242f8282 100644
--- a/tests/ui/lint/dead-code/offset-of-correct-param-env.rs
+++ b/tests/ui/lint/dead-code/offset-of-correct-param-env.rs
@@ -1,6 +1,5 @@
 //@ check-pass
 
-#![feature(offset_of_nested)]
 #![deny(dead_code)]
 
 // This struct contains a projection that can only be normalized after getting the field type.
diff --git a/tests/ui/lint/dead-code/offset-of.rs b/tests/ui/lint/dead-code/offset-of.rs
index 5269426d2ff..89e9fd910cb 100644
--- a/tests/ui/lint/dead-code/offset-of.rs
+++ b/tests/ui/lint/dead-code/offset-of.rs
@@ -1,4 +1,3 @@
-#![feature(offset_of_nested)]
 #![deny(dead_code)]
 
 use std::mem::offset_of;
diff --git a/tests/ui/lint/dead-code/offset-of.stderr b/tests/ui/lint/dead-code/offset-of.stderr
index ed2916461cd..4a903a9d6e8 100644
--- a/tests/ui/lint/dead-code/offset-of.stderr
+++ b/tests/ui/lint/dead-code/offset-of.stderr
@@ -1,5 +1,5 @@
 error: field `b` is never read
-  --> $DIR/offset-of.rs:8:5
+  --> $DIR/offset-of.rs:7:5
    |
 LL | struct Alpha {
    |        ----- field in this struct
@@ -8,13 +8,13 @@ LL |     b: (),
    |     ^
    |
 note: the lint level is defined here
-  --> $DIR/offset-of.rs:2:9
+  --> $DIR/offset-of.rs:1:9
    |
 LL | #![deny(dead_code)]
    |         ^^^^^^^^^
 
 error: field `a` is never read
-  --> $DIR/offset-of.rs:13:5
+  --> $DIR/offset-of.rs:12:5
    |
 LL | struct Beta {
    |        ---- field in this struct
@@ -22,7 +22,7 @@ LL |     a: (),
    |     ^
 
 error: field `a` is never read
-  --> $DIR/offset-of.rs:18:5
+  --> $DIR/offset-of.rs:17:5
    |
 LL | struct Gamma {
    |        ----- field in this struct
@@ -30,7 +30,7 @@ LL |     a: (),
    |     ^
 
 error: field `b` is never read
-  --> $DIR/offset-of.rs:24:5
+  --> $DIR/offset-of.rs:23:5
    |
 LL | struct Delta {
    |        ----- field in this struct
@@ -39,7 +39,7 @@ LL |     b: (),
    |     ^
 
 error: field `a` is never read
-  --> $DIR/offset-of.rs:35:5
+  --> $DIR/offset-of.rs:34:5
    |
 LL | struct Project<T: Trait> {
    |        ------- field in this struct
diff --git a/tests/ui/lint/dead-code/unused-adt-impl-pub-trait-with-assoc-const.rs b/tests/ui/lint/dead-code/unused-adt-impl-pub-trait-with-assoc-const.rs
index 658cc3d6c61..5b755d62a05 100644
--- a/tests/ui/lint/dead-code/unused-adt-impl-pub-trait-with-assoc-const.rs
+++ b/tests/ui/lint/dead-code/unused-adt-impl-pub-trait-with-assoc-const.rs
@@ -1,9 +1,8 @@
 #![deny(dead_code)]
 
 struct T1; //~ ERROR struct `T1` is never constructed
-struct T2; //~ ERROR struct `T2` is never constructed
-pub struct T3(i32); //~ ERROR struct `T3` is never constructed
-pub struct T4(i32); //~ ERROR field `0` is never read
+pub struct T2(i32); //~ ERROR field `0` is never read
+struct T3;
 
 trait Trait1 { //~ ERROR trait `Trait1` is never used
     const UNUSED: i32;
@@ -12,13 +11,13 @@ trait Trait1 { //~ ERROR trait `Trait1` is never used
 }
 
 pub trait Trait2 {
-    const MAY_USED: i32;
-    fn may_used(&self) {}
+    const USED: i32;
+    fn used(&self) {}
 }
 
 pub trait Trait3 {
-    const MAY_USED: i32;
-    fn may_used() -> Self;
+    const USED: i32;
+    fn construct_self() -> Self;
 }
 
 impl Trait1 for T1 {
@@ -31,34 +30,23 @@ impl Trait1 for T1 {
 impl Trait1 for T2 {
     const UNUSED: i32 = 0;
     fn construct_self() -> Self {
-        Self
+        T2(0)
     }
 }
 
 impl Trait2 for T1 {
-    const MAY_USED: i32 = 0;
+    const USED: i32 = 0;
 }
 
 impl Trait2 for T2 {
-    const MAY_USED: i32 = 0;
-}
-
-impl Trait2 for T3 {
-    const MAY_USED: i32 = 0;
+    const USED: i32 = 0;
 }
 
-impl Trait3 for T2 {
-    const MAY_USED: i32 = 0;
-    fn may_used() -> Self {
+impl Trait3 for T3 {
+    const USED: i32 = 0;
+    fn construct_self() -> Self {
         Self
     }
 }
 
-impl Trait3 for T4 {
-    const MAY_USED: i32 = 0;
-    fn may_used() -> Self {
-        T4(0)
-    }
-}
-
 fn main() {}
diff --git a/tests/ui/lint/dead-code/unused-adt-impl-pub-trait-with-assoc-const.stderr b/tests/ui/lint/dead-code/unused-adt-impl-pub-trait-with-assoc-const.stderr
index 08c7a5cb4b0..2441a3f868d 100644
--- a/tests/ui/lint/dead-code/unused-adt-impl-pub-trait-with-assoc-const.stderr
+++ b/tests/ui/lint/dead-code/unused-adt-impl-pub-trait-with-assoc-const.stderr
@@ -10,22 +10,10 @@ note: the lint level is defined here
 LL | #![deny(dead_code)]
    |         ^^^^^^^^^
 
-error: struct `T2` is never constructed
-  --> $DIR/unused-adt-impl-pub-trait-with-assoc-const.rs:4:8
-   |
-LL | struct T2;
-   |        ^^
-
-error: struct `T3` is never constructed
-  --> $DIR/unused-adt-impl-pub-trait-with-assoc-const.rs:5:12
-   |
-LL | pub struct T3(i32);
-   |            ^^
-
 error: field `0` is never read
-  --> $DIR/unused-adt-impl-pub-trait-with-assoc-const.rs:6:15
+  --> $DIR/unused-adt-impl-pub-trait-with-assoc-const.rs:4:15
    |
-LL | pub struct T4(i32);
+LL | pub struct T2(i32);
    |            -- ^^^
    |            |
    |            field in this struct
@@ -33,10 +21,10 @@ LL | pub struct T4(i32);
    = help: consider removing this field
 
 error: trait `Trait1` is never used
-  --> $DIR/unused-adt-impl-pub-trait-with-assoc-const.rs:8:7
+  --> $DIR/unused-adt-impl-pub-trait-with-assoc-const.rs:7:7
    |
 LL | trait Trait1 {
    |       ^^^^^^
 
-error: aborting due to 5 previous errors
+error: aborting due to 3 previous errors
 
diff --git a/tests/ui/lint/dead-code/unused-assoc-const.rs b/tests/ui/lint/dead-code/unused-assoc-const.rs
deleted file mode 100644
index 36e8315ad36..00000000000
--- a/tests/ui/lint/dead-code/unused-assoc-const.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-#![deny(dead_code)]
-
-trait Trait {
-    const UNUSED_CONST: i32; //~ ERROR associated constant `UNUSED_CONST` is never used
-    const USED_CONST: i32;
-
-    fn foo(&self) {}
-}
-
-pub struct T(());
-
-impl Trait for T {
-    const UNUSED_CONST: i32 = 0;
-    const USED_CONST: i32 = 1;
-}
-
-fn main() {
-    T(()).foo();
-    T::USED_CONST;
-}
diff --git a/tests/ui/lint/dead-code/unused-assoc-const.stderr b/tests/ui/lint/dead-code/unused-assoc-const.stderr
deleted file mode 100644
index 78296d70663..00000000000
--- a/tests/ui/lint/dead-code/unused-assoc-const.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error: associated constant `UNUSED_CONST` is never used
-  --> $DIR/unused-assoc-const.rs:4:11
-   |
-LL | trait Trait {
-   |       ----- associated constant in this trait
-LL |     const UNUSED_CONST: i32;
-   |           ^^^^^^^^^^^^
-   |
-note: the lint level is defined here
-  --> $DIR/unused-assoc-const.rs:1:9
-   |
-LL | #![deny(dead_code)]
-   |         ^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/lint/dead-code/unused-impl-for-non-adts.rs b/tests/ui/lint/dead-code/unused-impl-for-non-adts.rs
deleted file mode 100644
index 46065dcee81..00000000000
--- a/tests/ui/lint/dead-code/unused-impl-for-non-adts.rs
+++ /dev/null
@@ -1,45 +0,0 @@
-#![deny(dead_code)]
-
-struct Foo; //~ ERROR struct `Foo` is never constructed
-
-trait Trait { //~ ERROR trait `Trait` is never used
-    fn foo(&self) {}
-}
-
-impl Trait for Foo {}
-
-impl Trait for [Foo] {}
-impl<const N: usize> Trait for [Foo; N] {}
-
-impl Trait for *const Foo {}
-impl Trait for *mut Foo {}
-
-impl Trait for &Foo {}
-impl Trait for &&Foo {}
-impl Trait for &mut Foo {}
-
-impl Trait for [&Foo] {}
-impl Trait for &[Foo] {}
-impl Trait for &*const Foo {}
-
-pub trait Trait2 {
-    fn foo(&self) {}
-}
-
-impl Trait2 for Foo {}
-
-impl Trait2 for [Foo] {}
-impl<const N: usize> Trait2 for [Foo; N] {}
-
-impl Trait2 for *const Foo {}
-impl Trait2 for *mut Foo {}
-
-impl Trait2 for &Foo {}
-impl Trait2 for &&Foo {}
-impl Trait2 for &mut Foo {}
-
-impl Trait2 for [&Foo] {}
-impl Trait2 for &[Foo] {}
-impl Trait2 for &*const Foo {}
-
-fn main() {}
diff --git a/tests/ui/lint/dead-code/unused-impl-for-non-adts.stderr b/tests/ui/lint/dead-code/unused-impl-for-non-adts.stderr
deleted file mode 100644
index e61fc403e81..00000000000
--- a/tests/ui/lint/dead-code/unused-impl-for-non-adts.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: struct `Foo` is never constructed
-  --> $DIR/unused-impl-for-non-adts.rs:3:8
-   |
-LL | struct Foo;
-   |        ^^^
-   |
-note: the lint level is defined here
-  --> $DIR/unused-impl-for-non-adts.rs:1:9
-   |
-LL | #![deny(dead_code)]
-   |         ^^^^^^^^^
-
-error: trait `Trait` is never used
-  --> $DIR/unused-impl-for-non-adts.rs:5:7
-   |
-LL | trait Trait {
-   |       ^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/lint/dead-code/unused-pub-struct.rs b/tests/ui/lint/dead-code/unused-pub-struct.rs
deleted file mode 100644
index aaf4dd612de..00000000000
--- a/tests/ui/lint/dead-code/unused-pub-struct.rs
+++ /dev/null
@@ -1,48 +0,0 @@
-#![deny(dead_code)]
-
-pub struct NotLint1(());
-pub struct NotLint2(std::marker::PhantomData<i32>);
-
-pub struct NeverConstructed(i32); //~ ERROR struct `NeverConstructed` is never constructed
-
-impl NeverConstructed {
-    pub fn not_construct_self(&self) {}
-}
-
-impl Clone for NeverConstructed {
-    fn clone(&self) -> NeverConstructed {
-        NeverConstructed(0)
-    }
-}
-
-pub trait Trait {
-    fn not_construct_self(&self);
-}
-
-impl Trait for NeverConstructed {
-    fn not_construct_self(&self) {
-        self.0;
-    }
-}
-
-pub struct Constructed(i32);
-
-impl Constructed {
-    pub fn construct_self() -> Self {
-        Constructed(0)
-    }
-}
-
-impl Clone for Constructed {
-    fn clone(&self) -> Constructed {
-        Constructed(0)
-    }
-}
-
-impl Trait for Constructed {
-    fn not_construct_self(&self) {
-        self.0;
-    }
-}
-
-fn main() {}
diff --git a/tests/ui/lint/dead-code/unused-pub-struct.stderr b/tests/ui/lint/dead-code/unused-pub-struct.stderr
deleted file mode 100644
index 3667ddb97bd..00000000000
--- a/tests/ui/lint/dead-code/unused-pub-struct.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: struct `NeverConstructed` is never constructed
-  --> $DIR/unused-pub-struct.rs:6:12
-   |
-LL | pub struct NeverConstructed(i32);
-   |            ^^^^^^^^^^^^^^^^
-   |
-note: the lint level is defined here
-  --> $DIR/unused-pub-struct.rs:1:9
-   |
-LL | #![deny(dead_code)]
-   |         ^^^^^^^^^
-
-error: aborting due to 1 previous error
-
diff --git a/tests/ui/lint/dead-code/unused-struct-derive-default.rs b/tests/ui/lint/dead-code/unused-struct-derive-default.rs
index f20b7cb66ee..330ad32dd57 100644
--- a/tests/ui/lint/dead-code/unused-struct-derive-default.rs
+++ b/tests/ui/lint/dead-code/unused-struct-derive-default.rs
@@ -22,5 +22,4 @@ pub struct T2 {
 
 fn main() {
     let _x: Used = Default::default();
-    let _e: E = Default::default();
 }
diff --git a/tests/ui/lint/dead-code/unused-struct-derive-default.stderr b/tests/ui/lint/dead-code/unused-struct-derive-default.stderr
index 7422f9a39f3..bbb0bd7be70 100644
--- a/tests/ui/lint/dead-code/unused-struct-derive-default.stderr
+++ b/tests/ui/lint/dead-code/unused-struct-derive-default.stderr
@@ -4,6 +4,7 @@ error: struct `T` is never constructed
 LL | struct T;
    |        ^
    |
+   = note: `T` has a derived impl for the trait `Default`, but this is intentionally ignored during dead code analysis
 note: the lint level is defined here
   --> $DIR/unused-struct-derive-default.rs:1:9
    |
diff --git a/tests/ui/lint/dead-code/unused-trait-with-assoc-ty.rs b/tests/ui/lint/dead-code/unused-trait-with-assoc-ty.rs
deleted file mode 100644
index e8116d83ebf..00000000000
--- a/tests/ui/lint/dead-code/unused-trait-with-assoc-ty.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-#![deny(dead_code)]
-
-struct T1; //~ ERROR struct `T1` is never constructed
-
-trait Foo { type Unused; } //~ ERROR trait `Foo` is never used
-impl Foo for T1 { type Unused = Self; }
-
-pub trait Bar { type Used; }
-impl Bar for T1 { type Used = Self; }
-
-fn main() {}
diff --git a/tests/ui/lint/dead-code/unused-trait-with-assoc-ty.stderr b/tests/ui/lint/dead-code/unused-trait-with-assoc-ty.stderr
deleted file mode 100644
index ab73c640634..00000000000
--- a/tests/ui/lint/dead-code/unused-trait-with-assoc-ty.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: struct `T1` is never constructed
-  --> $DIR/unused-trait-with-assoc-ty.rs:3:8
-   |
-LL | struct T1;
-   |        ^^
-   |
-note: the lint level is defined here
-  --> $DIR/unused-trait-with-assoc-ty.rs:1:9
-   |
-LL | #![deny(dead_code)]
-   |         ^^^^^^^^^
-
-error: trait `Foo` is never used
-  --> $DIR/unused-trait-with-assoc-ty.rs:5:7
-   |
-LL | trait Foo { type Unused; }
-   |       ^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr
index 01c2ed84c63..d1b764b3414 100644
--- a/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr
+++ b/tests/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr
@@ -7,7 +7,6 @@ LL |         0...100 => true,
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
    = note: `--force-warn ellipsis-inclusive-range-patterns` implied by `--force-warn rust-2021-compatibility`
-   = help: to override `--force-warn rust-2021-compatibility` add `#[allow(ellipsis_inclusive_range_patterns)]`
 
 warning: 1 warning emitted
 
diff --git a/tests/ui/lint/force-warn/lint-group-allow-warnings.stderr b/tests/ui/lint/force-warn/lint-group-allow-warnings.stderr
index e925a195fb1..dc7b1b7b98d 100644
--- a/tests/ui/lint/force-warn/lint-group-allow-warnings.stderr
+++ b/tests/ui/lint/force-warn/lint-group-allow-warnings.stderr
@@ -5,7 +5,6 @@ LL | pub fn FUNCTION() {}
    |        ^^^^^^^^ help: convert the identifier to snake case: `function`
    |
    = note: `--force-warn non-snake-case` implied by `--force-warn nonstandard-style`
-   = help: to override `--force-warn nonstandard-style` add `#[allow(non_snake_case)]`
 
 warning: 1 warning emitted
 
diff --git a/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr
index a74cda2239f..dc85e8cf961 100644
--- a/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr
+++ b/tests/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr
@@ -7,7 +7,6 @@ LL | pub fn function(_x: Box<SomeTrait>) {}
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
    = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
-   = help: to override `--force-warn rust-2018-idioms` add `#[allow(bare_trait_objects)]`
 help: if this is an object-safe trait, use `dyn`
    |
 LL | pub fn function(_x: Box<dyn SomeTrait>) {}
diff --git a/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr b/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr
index c9472a3b9b9..55cfad838f8 100644
--- a/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr
+++ b/tests/ui/lint/force-warn/lint-group-allowed-lint-group.stderr
@@ -7,7 +7,6 @@ LL | pub fn function(_x: Box<SomeTrait>) {}
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
    = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
-   = help: to override `--force-warn rust-2018-idioms` add `#[allow(bare_trait_objects)]`
 help: if this is an object-safe trait, use `dyn`
    |
 LL | pub fn function(_x: Box<dyn SomeTrait>) {}
diff --git a/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr b/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr
index 558d5cbb531..b7bf0c4ee21 100644
--- a/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr
+++ b/tests/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr
@@ -7,7 +7,6 @@ LL | pub fn function(_x: Box<SomeTrait>) {}
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
    = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
-   = help: to override `--force-warn rust-2018-idioms` add `#[allow(bare_trait_objects)]`
 help: if this is an object-safe trait, use `dyn`
    |
 LL | pub fn function(_x: Box<dyn SomeTrait>) {}
diff --git a/tests/ui/lint/group-forbid-always-trumps-cli.stderr b/tests/ui/lint/group-forbid-always-trumps-cli.stderr
index 21674ebae9c..ed1242eacfc 100644
--- a/tests/ui/lint/group-forbid-always-trumps-cli.stderr
+++ b/tests/ui/lint/group-forbid-always-trumps-cli.stderr
@@ -5,7 +5,6 @@ LL |     let x = 1;
    |         ^ help: if this is intentional, prefix it with an underscore: `_x`
    |
    = note: `-F unused-variables` implied by `-F unused`
-   = help: to override `-F unused` add `#[allow(unused_variables)]`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/lint/lint-unnecessary-parens.fixed b/tests/ui/lint/lint-unnecessary-parens.fixed
index 760897c5143..089aa1b7ab7 100644
--- a/tests/ui/lint/lint-unnecessary-parens.fixed
+++ b/tests/ui/lint/lint-unnecessary-parens.fixed
@@ -1,6 +1,7 @@
 //@ run-rustfix
 
 #![deny(unused_parens)]
+#![feature(raw_ref_op)]
 #![allow(while_true)] // for rustfix
 
 #[derive(Eq, PartialEq)]
@@ -125,4 +126,11 @@ fn main() {
         // FIXME: false positive. This parenthesis is required.
         unit! {} - One //~ ERROR unnecessary parentheses around block return value
     };
+
+    // Do *not* lint around `&raw` (but do lint when `&` creates a reference).
+    let mut x = 0;
+    let _r = &x; //~ ERROR unnecessary parentheses
+    let _r = &mut x; //~ ERROR unnecessary parentheses
+    let _r = (&raw const x);
+    let _r = (&raw mut x);
 }
diff --git a/tests/ui/lint/lint-unnecessary-parens.rs b/tests/ui/lint/lint-unnecessary-parens.rs
index 7cbaac8ae54..dc77ee00352 100644
--- a/tests/ui/lint/lint-unnecessary-parens.rs
+++ b/tests/ui/lint/lint-unnecessary-parens.rs
@@ -1,6 +1,7 @@
 //@ run-rustfix
 
 #![deny(unused_parens)]
+#![feature(raw_ref_op)]
 #![allow(while_true)] // for rustfix
 
 #[derive(Eq, PartialEq)]
@@ -125,4 +126,11 @@ fn main() {
         // FIXME: false positive. This parenthesis is required.
         (unit! {} - One) //~ ERROR unnecessary parentheses around block return value
     };
+
+    // Do *not* lint around `&raw` (but do lint when `&` creates a reference).
+    let mut x = 0;
+    let _r = (&x); //~ ERROR unnecessary parentheses
+    let _r = (&mut x); //~ ERROR unnecessary parentheses
+    let _r = (&raw const x);
+    let _r = (&raw mut x);
 }
diff --git a/tests/ui/lint/lint-unnecessary-parens.stderr b/tests/ui/lint/lint-unnecessary-parens.stderr
index 755dd5fc309..c9422437a9f 100644
--- a/tests/ui/lint/lint-unnecessary-parens.stderr
+++ b/tests/ui/lint/lint-unnecessary-parens.stderr
@@ -1,5 +1,5 @@
 error: unnecessary parentheses around `return` value
-  --> $DIR/lint-unnecessary-parens.rs:13:12
+  --> $DIR/lint-unnecessary-parens.rs:14:12
    |
 LL |     return (1);
    |            ^ ^
@@ -16,7 +16,7 @@ LL +     return 1;
    |
 
 error: unnecessary parentheses around `return` value
-  --> $DIR/lint-unnecessary-parens.rs:16:12
+  --> $DIR/lint-unnecessary-parens.rs:17:12
    |
 LL |     return (X { y });
    |            ^       ^
@@ -28,7 +28,7 @@ LL +     return X { y };
    |
 
 error: unnecessary parentheses around type
-  --> $DIR/lint-unnecessary-parens.rs:19:46
+  --> $DIR/lint-unnecessary-parens.rs:20:46
    |
 LL | pub fn unused_parens_around_return_type() -> (u32) {
    |                                              ^   ^
@@ -40,7 +40,7 @@ LL + pub fn unused_parens_around_return_type() -> u32 {
    |
 
 error: unnecessary parentheses around block return value
-  --> $DIR/lint-unnecessary-parens.rs:25:9
+  --> $DIR/lint-unnecessary-parens.rs:26:9
    |
 LL |         (5)
    |         ^ ^
@@ -52,7 +52,7 @@ LL +         5
    |
 
 error: unnecessary parentheses around block return value
-  --> $DIR/lint-unnecessary-parens.rs:27:5
+  --> $DIR/lint-unnecessary-parens.rs:28:5
    |
 LL |     (5)
    |     ^ ^
@@ -64,7 +64,7 @@ LL +     5
    |
 
 error: unnecessary parentheses around `if` condition
-  --> $DIR/lint-unnecessary-parens.rs:39:7
+  --> $DIR/lint-unnecessary-parens.rs:40:7
    |
 LL |     if(true) {}
    |       ^    ^
@@ -76,7 +76,7 @@ LL +     if true {}
    |
 
 error: unnecessary parentheses around `while` condition
-  --> $DIR/lint-unnecessary-parens.rs:40:10
+  --> $DIR/lint-unnecessary-parens.rs:41:10
    |
 LL |     while(true) {}
    |          ^    ^
@@ -88,7 +88,7 @@ LL +     while true {}
    |
 
 error: unnecessary parentheses around `for` iterator expression
-  --> $DIR/lint-unnecessary-parens.rs:41:13
+  --> $DIR/lint-unnecessary-parens.rs:42:13
    |
 LL |     for _ in(e) {}
    |             ^ ^
@@ -100,7 +100,7 @@ LL +     for _ in e {}
    |
 
 error: unnecessary parentheses around `match` scrutinee expression
-  --> $DIR/lint-unnecessary-parens.rs:42:10
+  --> $DIR/lint-unnecessary-parens.rs:43:10
    |
 LL |     match(1) { _ => ()}
    |          ^ ^
@@ -112,7 +112,7 @@ LL +     match 1 { _ => ()}
    |
 
 error: unnecessary parentheses around `return` value
-  --> $DIR/lint-unnecessary-parens.rs:43:11
+  --> $DIR/lint-unnecessary-parens.rs:44:11
    |
 LL |     return(1);
    |           ^ ^
@@ -124,7 +124,7 @@ LL +     return 1;
    |
 
 error: unnecessary parentheses around assigned value
-  --> $DIR/lint-unnecessary-parens.rs:74:31
+  --> $DIR/lint-unnecessary-parens.rs:75:31
    |
 LL | pub const CONST_ITEM: usize = (10);
    |                               ^  ^
@@ -136,7 +136,7 @@ LL + pub const CONST_ITEM: usize = 10;
    |
 
 error: unnecessary parentheses around assigned value
-  --> $DIR/lint-unnecessary-parens.rs:75:33
+  --> $DIR/lint-unnecessary-parens.rs:76:33
    |
 LL | pub static STATIC_ITEM: usize = (10);
    |                                 ^  ^
@@ -148,7 +148,7 @@ LL + pub static STATIC_ITEM: usize = 10;
    |
 
 error: unnecessary parentheses around function argument
-  --> $DIR/lint-unnecessary-parens.rs:79:9
+  --> $DIR/lint-unnecessary-parens.rs:80:9
    |
 LL |     bar((true));
    |         ^    ^
@@ -160,7 +160,7 @@ LL +     bar(true);
    |
 
 error: unnecessary parentheses around `if` condition
-  --> $DIR/lint-unnecessary-parens.rs:81:8
+  --> $DIR/lint-unnecessary-parens.rs:82:8
    |
 LL |     if (true) {}
    |        ^    ^
@@ -172,7 +172,7 @@ LL +     if true {}
    |
 
 error: unnecessary parentheses around `while` condition
-  --> $DIR/lint-unnecessary-parens.rs:82:11
+  --> $DIR/lint-unnecessary-parens.rs:83:11
    |
 LL |     while (true) {}
    |           ^    ^
@@ -184,7 +184,7 @@ LL +     while true {}
    |
 
 error: unnecessary parentheses around `match` scrutinee expression
-  --> $DIR/lint-unnecessary-parens.rs:83:11
+  --> $DIR/lint-unnecessary-parens.rs:84:11
    |
 LL |     match (true) {
    |           ^    ^
@@ -196,7 +196,7 @@ LL +     match true {
    |
 
 error: unnecessary parentheses around `let` scrutinee expression
-  --> $DIR/lint-unnecessary-parens.rs:86:16
+  --> $DIR/lint-unnecessary-parens.rs:87:16
    |
 LL |     if let 1 = (1) {}
    |                ^ ^
@@ -208,7 +208,7 @@ LL +     if let 1 = 1 {}
    |
 
 error: unnecessary parentheses around `let` scrutinee expression
-  --> $DIR/lint-unnecessary-parens.rs:87:19
+  --> $DIR/lint-unnecessary-parens.rs:88:19
    |
 LL |     while let 1 = (2) {}
    |                   ^ ^
@@ -220,7 +220,7 @@ LL +     while let 1 = 2 {}
    |
 
 error: unnecessary parentheses around method argument
-  --> $DIR/lint-unnecessary-parens.rs:103:24
+  --> $DIR/lint-unnecessary-parens.rs:104:24
    |
 LL |     X { y: false }.foo((true));
    |                        ^    ^
@@ -232,7 +232,7 @@ LL +     X { y: false }.foo(true);
    |
 
 error: unnecessary parentheses around assigned value
-  --> $DIR/lint-unnecessary-parens.rs:105:18
+  --> $DIR/lint-unnecessary-parens.rs:106:18
    |
 LL |     let mut _a = (0);
    |                  ^ ^
@@ -244,7 +244,7 @@ LL +     let mut _a = 0;
    |
 
 error: unnecessary parentheses around assigned value
-  --> $DIR/lint-unnecessary-parens.rs:106:10
+  --> $DIR/lint-unnecessary-parens.rs:107:10
    |
 LL |     _a = (0);
    |          ^ ^
@@ -256,7 +256,7 @@ LL +     _a = 0;
    |
 
 error: unnecessary parentheses around assigned value
-  --> $DIR/lint-unnecessary-parens.rs:107:11
+  --> $DIR/lint-unnecessary-parens.rs:108:11
    |
 LL |     _a += (1);
    |           ^ ^
@@ -268,7 +268,7 @@ LL +     _a += 1;
    |
 
 error: unnecessary parentheses around pattern
-  --> $DIR/lint-unnecessary-parens.rs:109:8
+  --> $DIR/lint-unnecessary-parens.rs:110:8
    |
 LL |     let(mut _a) = 3;
    |        ^      ^
@@ -280,7 +280,7 @@ LL +     let mut _a = 3;
    |
 
 error: unnecessary parentheses around pattern
-  --> $DIR/lint-unnecessary-parens.rs:110:9
+  --> $DIR/lint-unnecessary-parens.rs:111:9
    |
 LL |     let (mut _a) = 3;
    |         ^      ^
@@ -292,7 +292,7 @@ LL +     let mut _a = 3;
    |
 
 error: unnecessary parentheses around pattern
-  --> $DIR/lint-unnecessary-parens.rs:111:8
+  --> $DIR/lint-unnecessary-parens.rs:112:8
    |
 LL |     let( mut _a) = 3;
    |        ^^      ^
@@ -304,7 +304,7 @@ LL +     let mut _a = 3;
    |
 
 error: unnecessary parentheses around pattern
-  --> $DIR/lint-unnecessary-parens.rs:113:8
+  --> $DIR/lint-unnecessary-parens.rs:114:8
    |
 LL |     let(_a) = 3;
    |        ^  ^
@@ -316,7 +316,7 @@ LL +     let _a = 3;
    |
 
 error: unnecessary parentheses around pattern
-  --> $DIR/lint-unnecessary-parens.rs:114:9
+  --> $DIR/lint-unnecessary-parens.rs:115:9
    |
 LL |     let (_a) = 3;
    |         ^  ^
@@ -328,7 +328,7 @@ LL +     let _a = 3;
    |
 
 error: unnecessary parentheses around pattern
-  --> $DIR/lint-unnecessary-parens.rs:115:8
+  --> $DIR/lint-unnecessary-parens.rs:116:8
    |
 LL |     let( _a) = 3;
    |        ^^  ^
@@ -340,7 +340,7 @@ LL +     let _a = 3;
    |
 
 error: unnecessary parentheses around block return value
-  --> $DIR/lint-unnecessary-parens.rs:121:9
+  --> $DIR/lint-unnecessary-parens.rs:122:9
    |
 LL |         (unit!() - One)
    |         ^             ^
@@ -352,7 +352,7 @@ LL +         unit!() - One
    |
 
 error: unnecessary parentheses around block return value
-  --> $DIR/lint-unnecessary-parens.rs:123:9
+  --> $DIR/lint-unnecessary-parens.rs:124:9
    |
 LL |         (unit![] - One)
    |         ^             ^
@@ -364,7 +364,7 @@ LL +         unit![] - One
    |
 
 error: unnecessary parentheses around block return value
-  --> $DIR/lint-unnecessary-parens.rs:126:9
+  --> $DIR/lint-unnecessary-parens.rs:127:9
    |
 LL |         (unit! {} - One)
    |         ^              ^
@@ -375,5 +375,29 @@ LL -         (unit! {} - One)
 LL +         unit! {} - One
    |
 
-error: aborting due to 31 previous errors
+error: unnecessary parentheses around assigned value
+  --> $DIR/lint-unnecessary-parens.rs:132:14
+   |
+LL |     let _r = (&x);
+   |              ^  ^
+   |
+help: remove these parentheses
+   |
+LL -     let _r = (&x);
+LL +     let _r = &x;
+   |
+
+error: unnecessary parentheses around assigned value
+  --> $DIR/lint-unnecessary-parens.rs:133:14
+   |
+LL |     let _r = (&mut x);
+   |              ^      ^
+   |
+help: remove these parentheses
+   |
+LL -     let _r = (&mut x);
+LL +     let _r = &mut x;
+   |
+
+error: aborting due to 33 previous errors
 
diff --git a/tests/ui/lint/negative_literals.rs b/tests/ui/lint/negative_literals.rs
index 048fcd6ff57..5964bbb559a 100644
--- a/tests/ui/lint/negative_literals.rs
+++ b/tests/ui/lint/negative_literals.rs
@@ -1,5 +1,7 @@
 //@ check-fail
 
+#![deny(ambiguous_negative_literals)]
+
 fn main() {
     let _ = -1i32.abs();
     //~^ ERROR `-` has lower precedence than method calls
diff --git a/tests/ui/lint/negative_literals.stderr b/tests/ui/lint/negative_literals.stderr
index df000a71882..b0323cc96a0 100644
--- a/tests/ui/lint/negative_literals.stderr
+++ b/tests/ui/lint/negative_literals.stderr
@@ -1,11 +1,15 @@
 error: `-` has lower precedence than method calls, which might be unexpected
-  --> $DIR/negative_literals.rs:4:13
+  --> $DIR/negative_literals.rs:6:13
    |
 LL |     let _ = -1i32.abs();
    |             ^^^^^^^^^^^
    |
    = note: e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4`
-   = note: `#[deny(ambiguous_negative_literals)]` on by default
+note: the lint level is defined here
+  --> $DIR/negative_literals.rs:3:9
+   |
+LL | #![deny(ambiguous_negative_literals)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: add parentheses around the `-` and the literal to call the method on a negative literal
    |
 LL |     let _ = (-1i32).abs();
@@ -16,7 +20,7 @@ LL |     let _ = -(1i32.abs());
    |              +          +
 
 error: `-` has lower precedence than method calls, which might be unexpected
-  --> $DIR/negative_literals.rs:6:13
+  --> $DIR/negative_literals.rs:8:13
    |
 LL |     let _ = -1f32.abs();
    |             ^^^^^^^^^^^
@@ -32,7 +36,7 @@ LL |     let _ = -(1f32.abs());
    |              +          +
 
 error: `-` has lower precedence than method calls, which might be unexpected
-  --> $DIR/negative_literals.rs:8:13
+  --> $DIR/negative_literals.rs:10:13
    |
 LL |     let _ = -1f64.asin();
    |             ^^^^^^^^^^^^
@@ -48,7 +52,7 @@ LL |     let _ = -(1f64.asin());
    |              +           +
 
 error: `-` has lower precedence than method calls, which might be unexpected
-  --> $DIR/negative_literals.rs:10:13
+  --> $DIR/negative_literals.rs:12:13
    |
 LL |     let _ = -1f64.asinh();
    |             ^^^^^^^^^^^^^
@@ -64,7 +68,7 @@ LL |     let _ = -(1f64.asinh());
    |              +            +
 
 error: `-` has lower precedence than method calls, which might be unexpected
-  --> $DIR/negative_literals.rs:12:13
+  --> $DIR/negative_literals.rs:14:13
    |
 LL |     let _ = -1f64.tan();
    |             ^^^^^^^^^^^
@@ -80,7 +84,7 @@ LL |     let _ = -(1f64.tan());
    |              +          +
 
 error: `-` has lower precedence than method calls, which might be unexpected
-  --> $DIR/negative_literals.rs:14:13
+  --> $DIR/negative_literals.rs:16:13
    |
 LL |     let _ = -1f64.tanh();
    |             ^^^^^^^^^^^^
@@ -96,7 +100,7 @@ LL |     let _ = -(1f64.tanh());
    |              +           +
 
 error: `-` has lower precedence than method calls, which might be unexpected
-  --> $DIR/negative_literals.rs:16:13
+  --> $DIR/negative_literals.rs:18:13
    |
 LL |     let _ = -1.0_f64.cos().cos();
    |             ^^^^^^^^^^^^^^^^^^^^
@@ -112,7 +116,7 @@ LL |     let _ = -(1.0_f64.cos().cos());
    |              +                   +
 
 error: `-` has lower precedence than method calls, which might be unexpected
-  --> $DIR/negative_literals.rs:18:13
+  --> $DIR/negative_literals.rs:20:13
    |
 LL |     let _ = -1.0_f64.cos().sin();
    |             ^^^^^^^^^^^^^^^^^^^^
@@ -128,7 +132,7 @@ LL |     let _ = -(1.0_f64.cos().sin());
    |              +                   +
 
 error: `-` has lower precedence than method calls, which might be unexpected
-  --> $DIR/negative_literals.rs:20:13
+  --> $DIR/negative_literals.rs:22:13
    |
 LL |     let _ = -1.0_f64.sin().cos();
    |             ^^^^^^^^^^^^^^^^^^^^
@@ -144,7 +148,7 @@ LL |     let _ = -(1.0_f64.sin().cos());
    |              +                   +
 
 error: `-` has lower precedence than method calls, which might be unexpected
-  --> $DIR/negative_literals.rs:22:13
+  --> $DIR/negative_literals.rs:24:13
    |
 LL |     let _ = -1f64.sin().sin();
    |             ^^^^^^^^^^^^^^^^^
@@ -160,7 +164,7 @@ LL |     let _ = -(1f64.sin().sin());
    |              +                +
 
 error: `-` has lower precedence than method calls, which might be unexpected
-  --> $DIR/negative_literals.rs:25:11
+  --> $DIR/negative_literals.rs:27:11
    |
 LL |     dbg!( -1.0_f32.cos() );
    |           ^^^^^^^^^^^^^^
diff --git a/tests/ui/lint/unaligned_references.stderr b/tests/ui/lint/unaligned_references.current.stderr
index 328cafbd986..0f980c5301f 100644
--- a/tests/ui/lint/unaligned_references.stderr
+++ b/tests/ui/lint/unaligned_references.current.stderr
@@ -1,5 +1,5 @@
 error[E0793]: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:28:13
+  --> $DIR/unaligned_references.rs:32:13
    |
 LL |             &self.x;
    |             ^^^^^^^
@@ -9,7 +9,7 @@ LL |             &self.x;
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
 
 error[E0793]: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:40:24
+  --> $DIR/unaligned_references.rs:44:24
    |
 LL |     println!("{:?}", &*foo.0);
    |                        ^^^^^
@@ -19,7 +19,7 @@ LL |     println!("{:?}", &*foo.0);
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
 
 error[E0793]: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:42:24
+  --> $DIR/unaligned_references.rs:46:24
    |
 LL |     println!("{:?}", &*foo.0);
    |                        ^^^^^
@@ -29,7 +29,7 @@ LL |     println!("{:?}", &*foo.0);
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
 
 error[E0793]: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:47:24
+  --> $DIR/unaligned_references.rs:51:24
    |
 LL |     println!("{:?}", &*foo.0);
    |                        ^^^^^
@@ -39,7 +39,7 @@ LL |     println!("{:?}", &*foo.0);
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
 
 error[E0793]: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:57:17
+  --> $DIR/unaligned_references.rs:81:17
    |
 LL |         let _ = &good.ptr;
    |                 ^^^^^^^^^
@@ -49,7 +49,7 @@ LL |         let _ = &good.ptr;
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
 
 error[E0793]: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:58:17
+  --> $DIR/unaligned_references.rs:82:17
    |
 LL |         let _ = &good.data;
    |                 ^^^^^^^^^^
@@ -59,7 +59,7 @@ LL |         let _ = &good.data;
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
 
 error[E0793]: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:60:17
+  --> $DIR/unaligned_references.rs:84:17
    |
 LL |         let _ = &good.data as *const _;
    |                 ^^^^^^^^^^
@@ -69,7 +69,7 @@ LL |         let _ = &good.data as *const _;
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
 
 error[E0793]: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:61:27
+  --> $DIR/unaligned_references.rs:85:27
    |
 LL |         let _: *const _ = &good.data;
    |                           ^^^^^^^^^^
@@ -79,7 +79,7 @@ LL |         let _: *const _ = &good.data;
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
 
 error[E0793]: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:63:17
+  --> $DIR/unaligned_references.rs:87:17
    |
 LL |         let _ = good.data.clone();
    |                 ^^^^^^^^^
@@ -89,7 +89,7 @@ LL |         let _ = good.data.clone();
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
 
 error[E0793]: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:65:17
+  --> $DIR/unaligned_references.rs:89:17
    |
 LL |         let _ = &good.data2[0];
    |                 ^^^^^^^^^^^^^^
@@ -99,7 +99,7 @@ LL |         let _ = &good.data2[0];
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
 
 error[E0793]: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:74:17
+  --> $DIR/unaligned_references.rs:98:17
    |
 LL |         let _ = &packed2.x;
    |                 ^^^^^^^^^^
@@ -109,7 +109,7 @@ LL |         let _ = &packed2.x;
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
 
 error[E0793]: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:113:20
+  --> $DIR/unaligned_references.rs:137:20
    |
 LL |         let _ref = &m1.1.a;
    |                    ^^^^^^^
@@ -119,7 +119,7 @@ LL |         let _ref = &m1.1.a;
    = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
 
 error[E0793]: reference to packed field is unaligned
-  --> $DIR/unaligned_references.rs:116:20
+  --> $DIR/unaligned_references.rs:140:20
    |
 LL |         let _ref = &m2.1.a;
    |                    ^^^^^^^
diff --git a/tests/ui/lint/unaligned_references.next.stderr b/tests/ui/lint/unaligned_references.next.stderr
new file mode 100644
index 00000000000..0f980c5301f
--- /dev/null
+++ b/tests/ui/lint/unaligned_references.next.stderr
@@ -0,0 +1,133 @@
+error[E0793]: reference to packed field is unaligned
+  --> $DIR/unaligned_references.rs:32:13
+   |
+LL |             &self.x;
+   |             ^^^^^^^
+   |
+   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+  --> $DIR/unaligned_references.rs:44:24
+   |
+LL |     println!("{:?}", &*foo.0);
+   |                        ^^^^^
+   |
+   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+  --> $DIR/unaligned_references.rs:46:24
+   |
+LL |     println!("{:?}", &*foo.0);
+   |                        ^^^^^
+   |
+   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+  --> $DIR/unaligned_references.rs:51:24
+   |
+LL |     println!("{:?}", &*foo.0);
+   |                        ^^^^^
+   |
+   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+  --> $DIR/unaligned_references.rs:81:17
+   |
+LL |         let _ = &good.ptr;
+   |                 ^^^^^^^^^
+   |
+   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+  --> $DIR/unaligned_references.rs:82:17
+   |
+LL |         let _ = &good.data;
+   |                 ^^^^^^^^^^
+   |
+   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+  --> $DIR/unaligned_references.rs:84:17
+   |
+LL |         let _ = &good.data as *const _;
+   |                 ^^^^^^^^^^
+   |
+   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+  --> $DIR/unaligned_references.rs:85:27
+   |
+LL |         let _: *const _ = &good.data;
+   |                           ^^^^^^^^^^
+   |
+   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+  --> $DIR/unaligned_references.rs:87:17
+   |
+LL |         let _ = good.data.clone();
+   |                 ^^^^^^^^^
+   |
+   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+  --> $DIR/unaligned_references.rs:89:17
+   |
+LL |         let _ = &good.data2[0];
+   |                 ^^^^^^^^^^^^^^
+   |
+   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+  --> $DIR/unaligned_references.rs:98:17
+   |
+LL |         let _ = &packed2.x;
+   |                 ^^^^^^^^^^
+   |
+   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+  --> $DIR/unaligned_references.rs:137:20
+   |
+LL |         let _ref = &m1.1.a;
+   |                    ^^^^^^^
+   |
+   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error[E0793]: reference to packed field is unaligned
+  --> $DIR/unaligned_references.rs:140:20
+   |
+LL |         let _ref = &m2.1.a;
+   |                    ^^^^^^^
+   |
+   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
+   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
+   = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
+
+error: aborting due to 13 previous errors
+
+For more information about this error, try `rustc --explain E0793`.
diff --git a/tests/ui/lint/unaligned_references.rs b/tests/ui/lint/unaligned_references.rs
index 3f6dab35475..321e3ed135c 100644
--- a/tests/ui/lint/unaligned_references.rs
+++ b/tests/ui/lint/unaligned_references.rs
@@ -1,5 +1,9 @@
-use std::mem::ManuallyDrop;
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
+
 use std::fmt::Debug;
+use std::mem::ManuallyDrop;
 
 #[repr(packed)]
 pub struct Good {
@@ -50,6 +54,26 @@ fn packed_dyn() {
     println!("{:?}", &*foo.0); // no error!
 }
 
+// Test for #115396
+fn packed_slice_behind_alias() {
+    trait Mirror {
+        type Assoc: ?Sized;
+    }
+    impl<T: ?Sized> Mirror for T {
+        type Assoc = T;
+    }
+
+    struct W<T: ?Sized>(<T as Mirror>::Assoc);
+
+    #[repr(packed)]
+    struct Unaligned<T: ?Sized>(ManuallyDrop<W<T>>);
+
+    // Even if the actual alignment is 1, we cannot know that when looking at `dyn Debug.`
+    let ref local: Unaligned<[_; 3]> = Unaligned(ManuallyDrop::new(W([3, 5, 8u8])));
+    let foo: &Unaligned<[u8]> = local;
+    let x = &foo.0; // Fine, since the tail of `foo` is `[_]`
+}
+
 fn main() {
     unsafe {
         let good = Good { data: 0, ptr: &0, data2: [0, 0], aligned: [0; 32] };
diff --git a/tests/ui/lint/unsafe_code/unsafe-extern-blocks.rs b/tests/ui/lint/unsafe_code/unsafe-extern-blocks.rs
index 6f2ead70db8..c264fa1c8da 100644
--- a/tests/ui/lint/unsafe_code/unsafe-extern-blocks.rs
+++ b/tests/ui/lint/unsafe_code/unsafe-extern-blocks.rs
@@ -1,4 +1,3 @@
-#![feature(unsafe_extern_blocks)]
 #![deny(unsafe_code)]
 
 #[allow(unsafe_code)]
diff --git a/tests/ui/lint/unsafe_code/unsafe-extern-blocks.stderr b/tests/ui/lint/unsafe_code/unsafe-extern-blocks.stderr
index 5439a311256..6d3b064da34 100644
--- a/tests/ui/lint/unsafe_code/unsafe-extern-blocks.stderr
+++ b/tests/ui/lint/unsafe_code/unsafe-extern-blocks.stderr
@@ -1,5 +1,5 @@
 error: usage of an `unsafe extern` block
-  --> $DIR/unsafe-extern-blocks.rs:9:1
+  --> $DIR/unsafe-extern-blocks.rs:8:1
    |
 LL | / unsafe extern "C" {
 LL | |
@@ -8,7 +8,7 @@ LL | | }
    | |_^
    |
 note: the lint level is defined here
-  --> $DIR/unsafe-extern-blocks.rs:2:9
+  --> $DIR/unsafe-extern-blocks.rs:1:9
    |
 LL | #![deny(unsafe_code)]
    |         ^^^^^^^^^^^
diff --git a/tests/ui/lint/unused/issue-59896.rs b/tests/ui/lint/unused/issue-59896.rs
index a98017524f5..5624e7f02fb 100644
--- a/tests/ui/lint/unused/issue-59896.rs
+++ b/tests/ui/lint/unused/issue-59896.rs
@@ -1,10 +1,9 @@
-//@ check-pass
-#![deny(unused_imports)]
+#![deny(redundant_imports)]
 
 struct S;
 
 fn main() {
-    use S;  //FIXME(unused_imports): ~ ERROR the item `S` is imported redundantly
+    use S;  //~ ERROR the item `S` is imported redundantly
 
     let _s = S;
 }
diff --git a/tests/ui/lint/unused/issue-59896.stderr b/tests/ui/lint/unused/issue-59896.stderr
new file mode 100644
index 00000000000..363a6419d9c
--- /dev/null
+++ b/tests/ui/lint/unused/issue-59896.stderr
@@ -0,0 +1,17 @@
+error: the item `S` is imported redundantly
+  --> $DIR/issue-59896.rs:6:9
+   |
+LL | struct S;
+   | --------- the item `S` is already defined here
+...
+LL |     use S;
+   |         ^
+   |
+note: the lint level is defined here
+  --> $DIR/issue-59896.rs:1:9
+   |
+LL | #![deny(redundant_imports)]
+   |         ^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/lint/use-redundant/use-redundant-glob-parent.rs b/tests/ui/lint/use-redundant/use-redundant-glob-parent.rs
index 797e57f48e9..c8c413dccd3 100644
--- a/tests/ui/lint/use-redundant/use-redundant-glob-parent.rs
+++ b/tests/ui/lint/use-redundant/use-redundant-glob-parent.rs
@@ -1,5 +1,5 @@
 //@ check-pass
-#![warn(unused_imports)]
+#![warn(redundant_imports)]
 
 pub mod bar {
     pub struct Foo(pub Bar);
@@ -9,7 +9,7 @@ pub mod bar {
 use bar::*;
 
 pub fn warning() -> Foo {
-    use bar::Foo; //FIXME(unused_imports): ~ WARNING imported redundantly
+    use bar::Foo; //~ WARNING imported redundantly
     Foo(Bar('a'))
 }
 
diff --git a/tests/ui/lint/use-redundant/use-redundant-glob-parent.stderr b/tests/ui/lint/use-redundant/use-redundant-glob-parent.stderr
new file mode 100644
index 00000000000..3b06b2df674
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-glob-parent.stderr
@@ -0,0 +1,17 @@
+warning: the item `Foo` is imported redundantly
+  --> $DIR/use-redundant-glob-parent.rs:12:9
+   |
+LL | use bar::*;
+   |     ------ the item `Foo` is already imported here
+...
+LL |     use bar::Foo;
+   |         ^^^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/use-redundant-glob-parent.rs:2:9
+   |
+LL | #![warn(redundant_imports)]
+   |         ^^^^^^^^^^^^^^^^^
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/lint/use-redundant/use-redundant-glob.rs b/tests/ui/lint/use-redundant/use-redundant-glob.rs
index e5835be89d8..52383d4ceff 100644
--- a/tests/ui/lint/use-redundant/use-redundant-glob.rs
+++ b/tests/ui/lint/use-redundant/use-redundant-glob.rs
@@ -1,5 +1,5 @@
 //@ check-pass
-#![warn(unused_imports)]
+#![warn(redundant_imports)]
 
 pub mod bar {
     pub struct Foo(pub Bar);
@@ -8,7 +8,7 @@ pub mod bar {
 
 pub fn warning() -> bar::Foo {
     use bar::*;
-    use bar::Foo; //FIXME(unused_imports): ~ WARNING imported redundantly
+    use bar::Foo; //~ WARNING imported redundantly
     Foo(Bar('a'))
 }
 
diff --git a/tests/ui/lint/use-redundant/use-redundant-glob.stderr b/tests/ui/lint/use-redundant/use-redundant-glob.stderr
new file mode 100644
index 00000000000..47b2ce54bb7
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-glob.stderr
@@ -0,0 +1,16 @@
+warning: the item `Foo` is imported redundantly
+  --> $DIR/use-redundant-glob.rs:11:9
+   |
+LL |     use bar::*;
+   |         ------ the item `Foo` is already imported here
+LL |     use bar::Foo;
+   |         ^^^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/use-redundant-glob.rs:2:9
+   |
+LL | #![warn(redundant_imports)]
+   |         ^^^^^^^^^^^^^^^^^
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/lint/use-redundant/use-redundant-issue-71450.rs b/tests/ui/lint/use-redundant/use-redundant-issue-71450.rs
index 2db3435d46d..6a3ffa4522a 100644
--- a/tests/ui/lint/use-redundant/use-redundant-issue-71450.rs
+++ b/tests/ui/lint/use-redundant/use-redundant-issue-71450.rs
@@ -1,6 +1,6 @@
 //@ check-pass
 
-#![warn(unused_imports)]
+#![warn(redundant_imports)]
 
 mod foo {
     use std::fmt;
@@ -23,8 +23,7 @@ mod foo {
 fn main() {
 
     {
-        use std::string::String;
-        //FIXME(unused_imports): ~^ WARNING the item `String` is imported redundantly
+        use std::string::String; //~ WARNING the item `String` is imported redundantly
         // 'String' from 'std::string::String'.
         let s = String::new();
         println!("{}", s);
diff --git a/tests/ui/lint/use-redundant/use-redundant-issue-71450.stderr b/tests/ui/lint/use-redundant/use-redundant-issue-71450.stderr
new file mode 100644
index 00000000000..c14ab9e11e0
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-issue-71450.stderr
@@ -0,0 +1,17 @@
+warning: the item `String` is imported redundantly
+  --> $DIR/use-redundant-issue-71450.rs:26:13
+   |
+LL |         use std::string::String;
+   |             ^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `String` is already defined here
+   |
+note: the lint level is defined here
+  --> $DIR/use-redundant-issue-71450.rs:3:9
+   |
+LL | #![warn(redundant_imports)]
+   |         ^^^^^^^^^^^^^^^^^
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.rs b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.rs
index 62f50c8a0df..6abe3602abe 100644
--- a/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.rs
+++ b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.rs
@@ -1,16 +1,12 @@
 //@ check-pass
-#![warn(unused_imports)]
+#![warn(redundant_imports)]
 
 
-use std::option::Option::Some;
-//FIXME(unused_imports): ~^ WARNING the item `Some` is imported redundantly
-use std::option::Option::None;
-//FIXME(unused_imports): ~ WARNING the item `None` is imported redundantly
+use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly
+use std::option::Option::None; //~ WARNING the item `None` is imported redundantly
 
-use std::result::Result::Ok;
-//FIXME(unused_imports): ~^ WARNING the item `Ok` is imported redundantly
-use std::result::Result::Err;
-//FIXME(unused_imports): ~^ WARNING the item `Err` is imported redundantly
+use std::result::Result::Ok;//~ WARNING the item `Ok` is imported redundantly
+use std::result::Result::Err;//~ WARNING the item `Err` is imported redundantly
 use std::convert::{TryFrom, TryInto};
 
 fn main() {
diff --git a/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.stderr b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.stderr
new file mode 100644
index 00000000000..2b0e16a87dc
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2015.stderr
@@ -0,0 +1,44 @@
+warning: the item `Some` is imported redundantly
+  --> $DIR/use-redundant-prelude-rust-2015.rs:5:5
+   |
+LL | use std::option::Option::Some;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `Some` is already defined here
+   |
+note: the lint level is defined here
+  --> $DIR/use-redundant-prelude-rust-2015.rs:2:9
+   |
+LL | #![warn(redundant_imports)]
+   |         ^^^^^^^^^^^^^^^^^
+
+warning: the item `None` is imported redundantly
+  --> $DIR/use-redundant-prelude-rust-2015.rs:6:5
+   |
+LL | use std::option::Option::None;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `None` is already defined here
+
+warning: the item `Ok` is imported redundantly
+  --> $DIR/use-redundant-prelude-rust-2015.rs:8:5
+   |
+LL | use std::result::Result::Ok;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `Ok` is already defined here
+
+warning: the item `Err` is imported redundantly
+  --> $DIR/use-redundant-prelude-rust-2015.rs:9:5
+   |
+LL | use std::result::Result::Err;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `Err` is already defined here
+
+warning: 4 warnings emitted
+
diff --git a/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.rs b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.rs
index 1baa1ac1b8c..236ee032b67 100644
--- a/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.rs
+++ b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.rs
@@ -1,11 +1,9 @@
 //@ check-pass
 //@ edition:2021
-#![warn(unused_imports)]
+#![warn(redundant_imports)]
 
-use std::convert::TryFrom;
-//FIXME(unused_imports): ~^ WARNING the item `TryFrom` is imported redundantly
-use std::convert::TryInto;
-//FIXME(unused_imports): ~^ WARNING the item `TryInto` is imported redundantly
+use std::convert::TryFrom;//~ WARNING the item `TryFrom` is imported redundantly
+use std::convert::TryInto;//~ WARNING the item `TryInto` is imported redundantly
 
 fn main() {
     let _e: Result<i32, _> = 8u8.try_into();
diff --git a/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.stderr b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.stderr
new file mode 100644
index 00000000000..526771c597a
--- /dev/null
+++ b/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.stderr
@@ -0,0 +1,26 @@
+warning: the item `TryFrom` is imported redundantly
+  --> $DIR/use-redundant-prelude-rust-2021.rs:5:5
+   |
+LL | use std::convert::TryFrom;
+   |     ^^^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `TryFrom` is already defined here
+   |
+note: the lint level is defined here
+  --> $DIR/use-redundant-prelude-rust-2021.rs:3:9
+   |
+LL | #![warn(redundant_imports)]
+   |         ^^^^^^^^^^^^^^^^^
+
+warning: the item `TryInto` is imported redundantly
+  --> $DIR/use-redundant-prelude-rust-2021.rs:6:5
+   |
+LL | use std::convert::TryInto;
+   |     ^^^^^^^^^^^^^^^^^^^^^
+  --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
+   |
+   = note: the item `TryInto` is already defined here
+
+warning: 2 warnings emitted
+
diff --git a/tests/ui/lint/use-redundant/use-redundant.rs b/tests/ui/lint/use-redundant/use-redundant.rs
index 9e4902af34b..0efed378f98 100644
--- a/tests/ui/lint/use-redundant/use-redundant.rs
+++ b/tests/ui/lint/use-redundant/use-redundant.rs
@@ -1,5 +1,5 @@
 //@ check-pass
-#![warn(unused_imports)]
+#![warn(unused_imports, redundant_imports)]
 
 use crate::foo::Bar;
 
@@ -18,7 +18,7 @@ use m1::*; //~ WARNING unused import
 use m2::*; //~ WARNING unused import
 
 fn main() {
-    use crate::foo::Bar; //FIXME(unused_imports): ~ WARNING imported redundantly
+    use crate::foo::Bar; //~ WARNING imported redundantly
     let _a: Bar = 3;
     baz();
 
diff --git a/tests/ui/lint/use-redundant/use-redundant.stderr b/tests/ui/lint/use-redundant/use-redundant.stderr
index 224e8411237..76846a1dca9 100644
--- a/tests/ui/lint/use-redundant/use-redundant.stderr
+++ b/tests/ui/lint/use-redundant/use-redundant.stderr
@@ -7,7 +7,7 @@ LL | use m1::*;
 note: the lint level is defined here
   --> $DIR/use-redundant.rs:2:9
    |
-LL | #![warn(unused_imports)]
+LL | #![warn(unused_imports, redundant_imports)]
    |         ^^^^^^^^^^^^^^
 
 warning: unused import: `m2::*`
@@ -16,5 +16,20 @@ warning: unused import: `m2::*`
 LL | use m2::*;
    |     ^^^^^
 
-warning: 2 warnings emitted
+warning: the item `Bar` is imported redundantly
+  --> $DIR/use-redundant.rs:21:9
+   |
+LL | use crate::foo::Bar;
+   |     --------------- the item `Bar` is already imported here
+...
+LL |     use crate::foo::Bar;
+   |         ^^^^^^^^^^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/use-redundant.rs:2:25
+   |
+LL | #![warn(unused_imports, redundant_imports)]
+   |                         ^^^^^^^^^^^^^^^^^
+
+warning: 3 warnings emitted
 
diff --git a/tests/ui/lint/wide_pointer_comparisons.stderr b/tests/ui/lint/wide_pointer_comparisons.stderr
index 81a221c0ee6..7fe382393d7 100644
--- a/tests/ui/lint/wide_pointer_comparisons.stderr
+++ b/tests/ui/lint/wide_pointer_comparisons.stderr
@@ -74,7 +74,7 @@ LL |     let _ = PartialEq::eq(&a, &b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |     let _ = std::ptr::addr_eq(a, b);
-   |             ~~~~~~~~~~~~~~~~~~ ~  ~
+   |             ~~~~~~~~~~~~~~~~~~ ~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:35:13
@@ -85,7 +85,7 @@ LL |     let _ = PartialEq::ne(&a, &b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |     let _ = !std::ptr::addr_eq(a, b);
-   |             ~~~~~~~~~~~~~~~~~~~ ~  ~
+   |             ~~~~~~~~~~~~~~~~~~~ ~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:37:13
@@ -96,7 +96,7 @@ LL |     let _ = a.eq(&b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |     let _ = std::ptr::addr_eq(a, b);
-   |             ++++++++++++++++++ ~  ~
+   |             ++++++++++++++++++ ~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:39:13
@@ -107,7 +107,7 @@ LL |     let _ = a.ne(&b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |     let _ = !std::ptr::addr_eq(a, b);
-   |             +++++++++++++++++++ ~  ~
+   |             +++++++++++++++++++ ~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:41:13
@@ -283,7 +283,7 @@ LL |         let _ = PartialEq::eq(a, b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |         let _ = std::ptr::addr_eq(*a, *b);
-   |                 ~~~~~~~~~~~~~~~~~~~ ~~~ ~
+   |                 ~~~~~~~~~~~~~~~~~~~ ~~~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:85:17
@@ -294,7 +294,7 @@ LL |         let _ = PartialEq::ne(a, b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |         let _ = !std::ptr::addr_eq(*a, *b);
-   |                 ~~~~~~~~~~~~~~~~~~~~ ~~~ ~
+   |                 ~~~~~~~~~~~~~~~~~~~~ ~~~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:87:17
@@ -305,7 +305,7 @@ LL |         let _ = PartialEq::eq(&a, &b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |         let _ = std::ptr::addr_eq(*a, *b);
-   |                 ~~~~~~~~~~~~~~~~~~~ ~~~ ~
+   |                 ~~~~~~~~~~~~~~~~~~~ ~~~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:89:17
@@ -316,7 +316,7 @@ LL |         let _ = PartialEq::ne(&a, &b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |         let _ = !std::ptr::addr_eq(*a, *b);
-   |                 ~~~~~~~~~~~~~~~~~~~~ ~~~ ~
+   |                 ~~~~~~~~~~~~~~~~~~~~ ~~~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:91:17
@@ -327,7 +327,7 @@ LL |         let _ = a.eq(b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |         let _ = std::ptr::addr_eq(*a, *b);
-   |                 +++++++++++++++++++ ~~~ ~
+   |                 +++++++++++++++++++ ~~~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:93:17
@@ -338,7 +338,7 @@ LL |         let _ = a.ne(b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |         let _ = !std::ptr::addr_eq(*a, *b);
-   |                 ++++++++++++++++++++ ~~~ ~
+   |                 ++++++++++++++++++++ ~~~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:95:17
@@ -519,11 +519,11 @@ LL |         let _ = PartialEq::eq(&a, &b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |         let _ = std::ptr::addr_eq(a, b);
-   |                 ~~~~~~~~~~~~~~~~~~ ~  ~
+   |                 ~~~~~~~~~~~~~~~~~~ ~
 help: use explicit `std::ptr::eq` method to compare metadata and addresses
    |
 LL |         let _ = std::ptr::eq(a, b);
-   |                 ~~~~~~~~~~~~~ ~  ~
+   |                 ~~~~~~~~~~~~~ ~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:133:17
@@ -534,11 +534,11 @@ LL |         let _ = PartialEq::ne(&a, &b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |         let _ = !std::ptr::addr_eq(a, b);
-   |                 ~~~~~~~~~~~~~~~~~~~ ~  ~
+   |                 ~~~~~~~~~~~~~~~~~~~ ~
 help: use explicit `std::ptr::eq` method to compare metadata and addresses
    |
 LL |         let _ = !std::ptr::eq(a, b);
-   |                 ~~~~~~~~~~~~~~ ~  ~
+   |                 ~~~~~~~~~~~~~~ ~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:135:17
@@ -549,11 +549,11 @@ LL |         let _ = a.eq(&b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |         let _ = std::ptr::addr_eq(a, b);
-   |                 ++++++++++++++++++ ~  ~
+   |                 ++++++++++++++++++ ~
 help: use explicit `std::ptr::eq` method to compare metadata and addresses
    |
 LL |         let _ = std::ptr::eq(a, b);
-   |                 +++++++++++++ ~  ~
+   |                 +++++++++++++ ~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:137:17
@@ -564,11 +564,11 @@ LL |         let _ = a.ne(&b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |         let _ = !std::ptr::addr_eq(a, b);
-   |                 +++++++++++++++++++ ~  ~
+   |                 +++++++++++++++++++ ~
 help: use explicit `std::ptr::eq` method to compare metadata and addresses
    |
 LL |         let _ = !std::ptr::eq(a, b);
-   |                 ++++++++++++++ ~  ~
+   |                 ++++++++++++++ ~
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:142:9
@@ -594,7 +594,7 @@ LL |         cmp!(a, b);
 help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
 LL |         cmp!(std::ptr::addr_eq(a, b));
-   |              ++++++++++++++++++ ~  +
+   |              ++++++++++++++++++    +
 
 warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> $DIR/wide_pointer_comparisons.rs:159:39
diff --git a/tests/ui/macros/expr_2024_underscore_expr.edi2021.stderr b/tests/ui/macros/expr_2024_underscore_expr.edi2021.stderr
new file mode 100644
index 00000000000..335b3f61343
--- /dev/null
+++ b/tests/ui/macros/expr_2024_underscore_expr.edi2021.stderr
@@ -0,0 +1,32 @@
+error: no rules expected the token `_`
+  --> $DIR/expr_2024_underscore_expr.rs:22:12
+   |
+LL | macro_rules! m2021 {
+   | ------------------ when calling this macro
+...
+LL |     m2021!(_);
+   |            ^ no rules expected this token in macro call
+   |
+note: while trying to match meta-variable `$e:expr_2021`
+  --> $DIR/expr_2024_underscore_expr.rs:10:6
+   |
+LL |     ($e:expr_2021) => {
+   |      ^^^^^^^^^^^^
+
+error: no rules expected the token `_`
+  --> $DIR/expr_2024_underscore_expr.rs:23:12
+   |
+LL | macro_rules! m2024 {
+   | ------------------ when calling this macro
+...
+LL |     m2024!(_);
+   |            ^ no rules expected this token in macro call
+   |
+note: while trying to match meta-variable `$e:expr`
+  --> $DIR/expr_2024_underscore_expr.rs:16:6
+   |
+LL |     ($e:expr) => {
+   |      ^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/macros/expr_2024_underscore_expr.edi2024.stderr b/tests/ui/macros/expr_2024_underscore_expr.edi2024.stderr
new file mode 100644
index 00000000000..9e49f66a89a
--- /dev/null
+++ b/tests/ui/macros/expr_2024_underscore_expr.edi2024.stderr
@@ -0,0 +1,17 @@
+error: no rules expected the token `_`
+  --> $DIR/expr_2024_underscore_expr.rs:22:12
+   |
+LL | macro_rules! m2021 {
+   | ------------------ when calling this macro
+...
+LL |     m2021!(_);
+   |            ^ no rules expected this token in macro call
+   |
+note: while trying to match meta-variable `$e:expr_2021`
+  --> $DIR/expr_2024_underscore_expr.rs:10:6
+   |
+LL |     ($e:expr_2021) => {
+   |      ^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/macros/expr_2024_underscore_expr.rs b/tests/ui/macros/expr_2024_underscore_expr.rs
new file mode 100644
index 00000000000..b2129bf154f
--- /dev/null
+++ b/tests/ui/macros/expr_2024_underscore_expr.rs
@@ -0,0 +1,24 @@
+//@ revisions: edi2021 edi2024
+//@[edi2024]compile-flags: --edition=2024 -Z unstable-options
+//@[edi2021]compile-flags: --edition=2021
+// This test ensures that the `_` tok is considered an
+// expression on edition 2024.
+#![feature(expr_fragment_specifier_2024)]
+#![allow(incomplete_features)]
+
+macro_rules! m2021 {
+    ($e:expr_2021) => {
+        $e = 1;
+    };
+}
+
+macro_rules! m2024 {
+    ($e:expr) => {
+        $e = 1;
+    };
+}
+
+fn main() {
+    m2021!(_); //~ ERROR: no rules expected the token `_`
+    m2024!(_); //[edi2021]~ ERROR: no rules expected the token `_`
+}
diff --git a/tests/ui/methods/dont-ice-on-object-lookup-w-error-region.rs b/tests/ui/methods/dont-ice-on-object-lookup-w-error-region.rs
new file mode 100644
index 00000000000..0a6d196364f
--- /dev/null
+++ b/tests/ui/methods/dont-ice-on-object-lookup-w-error-region.rs
@@ -0,0 +1,11 @@
+// Fix for issue: #122914
+
+use std::future::Future;
+use std::pin::Pin;
+
+fn project(x: Pin<&'missing mut dyn Future<Output = ()>>) {
+    //~^ ERROR use of undeclared lifetime name `'missing`
+    let _ = x.poll(todo!());
+}
+
+fn main() {}
diff --git a/tests/ui/methods/dont-ice-on-object-lookup-w-error-region.stderr b/tests/ui/methods/dont-ice-on-object-lookup-w-error-region.stderr
new file mode 100644
index 00000000000..2c33941be43
--- /dev/null
+++ b/tests/ui/methods/dont-ice-on-object-lookup-w-error-region.stderr
@@ -0,0 +1,11 @@
+error[E0261]: use of undeclared lifetime name `'missing`
+  --> $DIR/dont-ice-on-object-lookup-w-error-region.rs:6:20
+   |
+LL | fn project(x: Pin<&'missing mut dyn Future<Output = ()>>) {
+   |           -        ^^^^^^^^ undeclared lifetime
+   |           |
+   |           help: consider introducing lifetime `'missing` here: `<'missing>`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0261`.
diff --git a/tests/ui/moves/move-fn-self-receiver.stderr b/tests/ui/moves/move-fn-self-receiver.stderr
index f2c6008d27e..de19a99d388 100644
--- a/tests/ui/moves/move-fn-self-receiver.stderr
+++ b/tests/ui/moves/move-fn-self-receiver.stderr
@@ -101,15 +101,6 @@ LL |     mut_foo;
    |     ^^^^^^^ move out of `mut_foo` occurs here
 LL |     ret;
    |     --- borrow later used here
-   |
-note: if `Foo` implemented `Clone`, you could clone the value
-  --> $DIR/move-fn-self-receiver.rs:5:1
-   |
-LL | struct Foo;
-   | ^^^^^^^^^^ consider implementing `Clone` for this type
-...
-LL |     let ret = mut_foo.use_mut_self();
-   |               ------- you could clone this value
 
 error[E0382]: use of moved value: `rc_foo`
   --> $DIR/move-fn-self-receiver.rs:55:5
diff --git a/tests/ui/never_type/never-result.rs b/tests/ui/never_type/never-result.rs
index bdd06ec5bd1..98ad1404666 100644
--- a/tests/ui/never_type/never-result.rs
+++ b/tests/ui/never_type/never-result.rs
@@ -2,9 +2,8 @@
 
 #![allow(unused_variables)]
 #![allow(unreachable_code)]
-
+#![allow(unreachable_patterns)]
 // Test that we can extract a ! through pattern matching then use it as several different types.
-
 #![feature(never_type)]
 
 fn main() {
@@ -16,6 +15,6 @@ fn main() {
             let w: i32 = y;
             let e: String = y;
             y
-        },
+        }
     }
 }
diff --git a/tests/ui/nll/closure-access-spans.stderr b/tests/ui/nll/closure-access-spans.stderr
index f789e5e9f95..a8024a8c20b 100644
--- a/tests/ui/nll/closure-access-spans.stderr
+++ b/tests/ui/nll/closure-access-spans.stderr
@@ -60,9 +60,8 @@ LL |     r.use_ref();
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     let r = &x;
-LL +     let r = x.clone();
-   |
+LL |     let r = &x.clone();
+   |               ++++++++
 
 error[E0382]: borrow of moved value: `x`
   --> $DIR/closure-access-spans.rs:35:5
@@ -109,11 +108,6 @@ LL |     || *x = String::new();
    |     ^^ -- borrow occurs due to use in closure
    |     |
    |     value borrowed here after move
-   |
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |     let r = x.clone();
-   |              ++++++++
 
 error[E0382]: use of moved value: `x`
   --> $DIR/closure-access-spans.rs:50:5
@@ -126,11 +120,6 @@ LL |     || x;
    |     ^^ - use occurs due to use in closure
    |     |
    |     value used here after move
-   |
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |     let r = x.clone();
-   |              ++++++++
 
 error: aborting due to 9 previous errors
 
diff --git a/tests/ui/nll/issue-27282-move-match-input-into-guard.stderr b/tests/ui/nll/issue-27282-move-match-input-into-guard.stderr
index 39ec45b20ea..ae797800457 100644
--- a/tests/ui/nll/issue-27282-move-match-input-into-guard.stderr
+++ b/tests/ui/nll/issue-27282-move-match-input-into-guard.stderr
@@ -10,11 +10,6 @@ LL |         _ if { (|| { let bar = b; *bar = false; })();
    |                 --             - variable moved due to use in closure
    |                 |
    |                 value moved into closure here
-   |
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |         _ if { (|| { let bar = b.clone(); *bar = false; })();
-   |                                 ++++++++
 
 error[E0382]: use of moved value: `b`
   --> $DIR/issue-27282-move-match-input-into-guard.rs:24:5
@@ -28,11 +23,6 @@ LL |             (|| { let bar = b; *bar = false; })();
    |              --             - variable moved due to use in closure
    |              |
    |              value moved into closure here
-   |
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |             (|| { let bar = b.clone(); *bar = false; })();
-   |                              ++++++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/nll/issue-27282-move-ref-mut-into-guard.fixed b/tests/ui/nll/issue-27282-move-ref-mut-into-guard.fixed
deleted file mode 100644
index 7692be7ccc8..00000000000
--- a/tests/ui/nll/issue-27282-move-ref-mut-into-guard.fixed
+++ /dev/null
@@ -1,23 +0,0 @@
-// Issue 27282: Example 1: This sidesteps the AST checks disallowing
-// mutable borrows in match guards by hiding the mutable borrow in a
-// guard behind a move (of the ref mut pattern id) within a closure.
-//@ run-rustfix
-#![feature(if_let_guard)]
-
-fn main() {
-    match Some(&4) {
-        None => {},
-        ref mut foo
-            if { (|| { let mut bar = foo.clone(); bar.take() })(); false } => {},
-        //~^ ERROR cannot move out of `foo` in pattern guard [E0507]
-        Some(s) => std::process::exit(*s),
-    }
-
-    match Some(&4) {
-        None => {},
-        ref mut foo
-            if let Some(()) = { (|| { let mut bar = foo.clone(); bar.take() })(); None } => {},
-        //~^ ERROR cannot move out of `foo` in pattern guard [E0507]
-        Some(s) => std::process::exit(*s),
-    }
-}
diff --git a/tests/ui/nll/issue-27282-move-ref-mut-into-guard.rs b/tests/ui/nll/issue-27282-move-ref-mut-into-guard.rs
index f3d0a184e03..c3b19886a50 100644
--- a/tests/ui/nll/issue-27282-move-ref-mut-into-guard.rs
+++ b/tests/ui/nll/issue-27282-move-ref-mut-into-guard.rs
@@ -1,7 +1,7 @@
 // Issue 27282: Example 1: This sidesteps the AST checks disallowing
 // mutable borrows in match guards by hiding the mutable borrow in a
 // guard behind a move (of the ref mut pattern id) within a closure.
-//@ run-rustfix
+
 #![feature(if_let_guard)]
 
 fn main() {
diff --git a/tests/ui/nll/issue-27282-move-ref-mut-into-guard.stderr b/tests/ui/nll/issue-27282-move-ref-mut-into-guard.stderr
index 7781e77894b..e790fda4d7c 100644
--- a/tests/ui/nll/issue-27282-move-ref-mut-into-guard.stderr
+++ b/tests/ui/nll/issue-27282-move-ref-mut-into-guard.stderr
@@ -7,10 +7,6 @@ LL |             if { (|| { let mut bar = foo; bar.take() })(); false } => {},
    |                   `foo` is moved here
    |
    = note: variables bound in patterns cannot be moved from until after the end of the pattern guard
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |             if { (|| { let mut bar = foo.clone(); bar.take() })(); false } => {},
-   |                                         ++++++++
 
 error[E0507]: cannot move out of `foo` in pattern guard
   --> $DIR/issue-27282-move-ref-mut-into-guard.rs:19:34
@@ -21,10 +17,6 @@ LL |             if let Some(()) = { (|| { let mut bar = foo; bar.take() })(); N
    |                                  `foo` is moved here
    |
    = note: variables bound in patterns cannot be moved from until after the end of the pattern guard
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |             if let Some(()) = { (|| { let mut bar = foo.clone(); bar.take() })(); None } => {},
-   |                                                        ++++++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/nll/issue-27282-mutation-in-guard.stderr b/tests/ui/nll/issue-27282-mutation-in-guard.stderr
index f73e4aaa489..0b5d723172c 100644
--- a/tests/ui/nll/issue-27282-mutation-in-guard.stderr
+++ b/tests/ui/nll/issue-27282-mutation-in-guard.stderr
@@ -7,10 +7,6 @@ LL |                 (|| { let bar = foo; bar.take() })();
    |                  `foo` is moved here
    |
    = note: variables bound in patterns cannot be moved from until after the end of the pattern guard
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |                 (|| { let bar = foo.clone(); bar.take() })();
-   |                                    ++++++++
 
 error[E0507]: cannot move out of `foo` in pattern guard
   --> $DIR/issue-27282-mutation-in-guard.rs:20:18
@@ -21,10 +17,6 @@ LL |                 (|| { let bar = foo; bar.take() })();
    |                  `foo` is moved here
    |
    = note: variables bound in patterns cannot be moved from until after the end of the pattern guard
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |                 (|| { let bar = foo.clone(); bar.take() })();
-   |                                    ++++++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr b/tests/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr
index f4e7869bf00..7f9cbc3c30a 100644
--- a/tests/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr
+++ b/tests/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr
@@ -41,10 +41,6 @@ help: consider borrowing here
    |
 LL |     let p = &s.url; p
    |             +
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |     let p = s.url.clone(); p
-   |                  ++++++++
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/nll/match-guards-always-borrow.fixed b/tests/ui/nll/match-guards-always-borrow.fixed
deleted file mode 100644
index 56e743bf196..00000000000
--- a/tests/ui/nll/match-guards-always-borrow.fixed
+++ /dev/null
@@ -1,66 +0,0 @@
-#![feature(if_let_guard)]
-#![allow(unused_mut)]
-//@ run-rustfix
-
-// Here is arielb1's basic example from rust-lang/rust#27282
-// that AST borrowck is flummoxed by:
-
-fn should_reject_destructive_mutate_in_guard() {
-    match Some(&4) {
-        None => {},
-        ref mut foo if {
-            (|| { let mut bar = foo.clone(); bar.take() })();
-            //~^ ERROR cannot move out of `foo` in pattern guard [E0507]
-            false } => { },
-        Some(s) => std::process::exit(*s),
-    }
-
-    match Some(&4) {
-        None => {},
-        ref mut foo if let Some(()) = {
-            (|| { let mut bar = foo.clone(); bar.take() })();
-            //~^ ERROR cannot move out of `foo` in pattern guard [E0507]
-            None } => { },
-        Some(s) => std::process::exit(*s),
-    }
-}
-
-// Here below is a case that needs to keep working: we only use the
-// binding via immutable-borrow in the guard, and we mutate in the arm
-// body.
-fn allow_mutate_in_arm_body() {
-    match Some(&4) {
-        None => {},
-        ref mut foo if foo.is_some() => { foo.take(); () }
-        Some(s) => std::process::exit(*s),
-    }
-
-    match Some(&4) {
-        None => {},
-        ref mut foo if let Some(_) = foo => { foo.take(); () }
-        Some(s) => std::process::exit(*s),
-    }
-}
-
-// Here below is a case that needs to keep working: we only use the
-// binding via immutable-borrow in the guard, and we move into the arm
-// body.
-fn allow_move_into_arm_body() {
-    match Some(&4) {
-        None => {},
-        mut foo if foo.is_some() => { foo.unwrap(); () }
-        Some(s) => std::process::exit(*s),
-    }
-
-    match Some(&4) {
-        None => {},
-        mut foo if let Some(_) = foo => { foo.unwrap(); () }
-        Some(s) => std::process::exit(*s),
-    }
-}
-
-fn main() {
-    should_reject_destructive_mutate_in_guard();
-    allow_mutate_in_arm_body();
-    allow_move_into_arm_body();
-}
diff --git a/tests/ui/nll/match-guards-always-borrow.rs b/tests/ui/nll/match-guards-always-borrow.rs
index 927d55c42a6..5271e3cfc66 100644
--- a/tests/ui/nll/match-guards-always-borrow.rs
+++ b/tests/ui/nll/match-guards-always-borrow.rs
@@ -1,6 +1,5 @@
 #![feature(if_let_guard)]
 #![allow(unused_mut)]
-//@ run-rustfix
 
 // Here is arielb1's basic example from rust-lang/rust#27282
 // that AST borrowck is flummoxed by:
diff --git a/tests/ui/nll/match-guards-always-borrow.stderr b/tests/ui/nll/match-guards-always-borrow.stderr
index bb0c5bd4c97..71977bd8472 100644
--- a/tests/ui/nll/match-guards-always-borrow.stderr
+++ b/tests/ui/nll/match-guards-always-borrow.stderr
@@ -1,5 +1,5 @@
 error[E0507]: cannot move out of `foo` in pattern guard
-  --> $DIR/match-guards-always-borrow.rs:12:14
+  --> $DIR/match-guards-always-borrow.rs:11:14
    |
 LL |             (|| { let mut bar = foo; bar.take() })();
    |              ^^                 --- move occurs because `foo` has type `&mut Option<&i32>`, which does not implement the `Copy` trait
@@ -7,13 +7,9 @@ LL |             (|| { let mut bar = foo; bar.take() })();
    |              `foo` is moved here
    |
    = note: variables bound in patterns cannot be moved from until after the end of the pattern guard
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |             (|| { let mut bar = foo.clone(); bar.take() })();
-   |                                    ++++++++
 
 error[E0507]: cannot move out of `foo` in pattern guard
-  --> $DIR/match-guards-always-borrow.rs:21:14
+  --> $DIR/match-guards-always-borrow.rs:20:14
    |
 LL |             (|| { let mut bar = foo; bar.take() })();
    |              ^^                 --- move occurs because `foo` has type `&mut Option<&i32>`, which does not implement the `Copy` trait
@@ -21,10 +17,6 @@ LL |             (|| { let mut bar = foo; bar.take() })();
    |              `foo` is moved here
    |
    = note: variables bound in patterns cannot be moved from until after the end of the pattern guard
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |             (|| { let mut bar = foo.clone(); bar.take() })();
-   |                                    ++++++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/nll/polonius/polonius-smoke-test.stderr b/tests/ui/nll/polonius/polonius-smoke-test.stderr
index 534813b2d9f..a8a8267290d 100644
--- a/tests/ui/nll/polonius/polonius-smoke-test.stderr
+++ b/tests/ui/nll/polonius/polonius-smoke-test.stderr
@@ -27,6 +27,12 @@ LL |     let z = x;
    |             ^ move out of `x` occurs here
 LL |     y
    |     - returning this value requires that `*x` is borrowed for `'1`
+   |
+help: consider cloning the value if the performance cost is acceptable
+   |
+LL -     let y = &mut *x;
+LL +     let y = &mut x.clone();
+   |
 
 error[E0505]: cannot move out of `s` because it is borrowed
   --> $DIR/polonius-smoke-test.rs:42:5
@@ -40,6 +46,12 @@ LL |     s;
    |     ^ move out of `s` occurs here
 LL |     tmp;
    |     --- borrow later used here
+   |
+help: consider cloning the value if the performance cost is acceptable
+   |
+LL -     let r = &mut *s;
+LL +     let r = &mut s.clone();
+   |
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/offset-of/offset-of-enum.rs b/tests/ui/offset-of/offset-of-enum.rs
index cb2f04786ac..64850e47823 100644
--- a/tests/ui/offset-of/offset-of-enum.rs
+++ b/tests/ui/offset-of/offset-of-enum.rs
@@ -1,4 +1,4 @@
-#![feature(offset_of_enum, offset_of_nested)]
+#![feature(offset_of_enum)]
 
 use std::mem::offset_of;
 
diff --git a/tests/ui/offset-of/offset-of-private.rs b/tests/ui/offset-of/offset-of-private.rs
index 1c326b5c79a..8b8ffb5e08e 100644
--- a/tests/ui/offset-of/offset-of-private.rs
+++ b/tests/ui/offset-of/offset-of-private.rs
@@ -1,4 +1,4 @@
-#![feature(offset_of_enum, offset_of_nested)]
+#![feature(offset_of_enum)]
 
 use std::mem::offset_of;
 
diff --git a/tests/ui/offset-of/offset-of-self.rs b/tests/ui/offset-of/offset-of-self.rs
index 1558e13b530..e5730b8cf6c 100644
--- a/tests/ui/offset-of/offset-of-self.rs
+++ b/tests/ui/offset-of/offset-of-self.rs
@@ -1,5 +1,3 @@
-#![feature(offset_of_nested)]
-
 use std::mem::offset_of;
 
 struct C<T> {
diff --git a/tests/ui/offset-of/offset-of-self.stderr b/tests/ui/offset-of/offset-of-self.stderr
index 7c7576e066b..5bbb4ecf091 100644
--- a/tests/ui/offset-of/offset-of-self.stderr
+++ b/tests/ui/offset-of/offset-of-self.stderr
@@ -1,11 +1,11 @@
 error: offset_of expects dot-separated field and variant names
-  --> $DIR/offset-of-self.rs:20:26
+  --> $DIR/offset-of-self.rs:18:26
    |
 LL |         offset_of!(Self, Self::v);
    |                          ^^^^^^^
 
 error[E0412]: cannot find type `S` in module `self`
-  --> $DIR/offset-of-self.rs:34:26
+  --> $DIR/offset-of-self.rs:32:26
    |
 LL |         offset_of!(self::S, v);
    |                          ^ not found in `self`
@@ -21,7 +21,7 @@ LL +         offset_of!(S, v);
    |
 
 error[E0411]: cannot find type `Self` in this scope
-  --> $DIR/offset-of-self.rs:51:16
+  --> $DIR/offset-of-self.rs:49:16
    |
 LL | fn main() {
    |    ---- `Self` not allowed in a function
@@ -30,7 +30,7 @@ LL |     offset_of!(Self, v);
    |                ^^^^ `Self` is only available in impls, traits, and type definitions
 
 error[E0609]: no field `Self` on type `S`
-  --> $DIR/offset-of-self.rs:21:23
+  --> $DIR/offset-of-self.rs:19:23
    |
 LL |         offset_of!(S, Self);
    |                       ^^^^
@@ -38,13 +38,13 @@ LL |         offset_of!(S, Self);
    = note: available fields are: `v`, `w`
 
 error[E0616]: field `v` of struct `T` is private
-  --> $DIR/offset-of-self.rs:40:30
+  --> $DIR/offset-of-self.rs:38:30
    |
 LL |             offset_of!(Self, v)
    |                              ^ private field
 
 error[E0609]: no field `self` on type `S`
-  --> $DIR/offset-of-self.rs:53:19
+  --> $DIR/offset-of-self.rs:51:19
    |
 LL |     offset_of!(S, self);
    |                   ^^^^
@@ -52,7 +52,7 @@ LL |     offset_of!(S, self);
    = note: available fields are: `v`, `w`
 
 error[E0609]: no field `self` on type `u8`
-  --> $DIR/offset-of-self.rs:54:21
+  --> $DIR/offset-of-self.rs:52:21
    |
 LL |     offset_of!(S, v.self);
    |                     ^^^^
diff --git a/tests/ui/offset-of/offset-of-slice-normalized.rs b/tests/ui/offset-of/offset-of-slice-normalized.rs
new file mode 100644
index 00000000000..9d1fd9dd2ee
--- /dev/null
+++ b/tests/ui/offset-of/offset-of-slice-normalized.rs
@@ -0,0 +1,37 @@
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
+//@ run-pass
+
+#![feature(offset_of_slice)]
+
+use std::mem::offset_of;
+
+trait Mirror {
+    type Assoc: ?Sized;
+}
+impl<T: ?Sized> Mirror for T {
+    type Assoc = T;
+}
+
+#[repr(C)]
+struct S {
+    a: u8,
+    b: (u8, u8),
+    c: <[i32] as Mirror>::Assoc,
+}
+
+#[repr(C)]
+struct T {
+    x: i8,
+    y: S,
+}
+
+type Tup = (i16, <[i32] as Mirror>::Assoc);
+
+fn main() {
+    assert_eq!(offset_of!(S, c), 4);
+    assert_eq!(offset_of!(T, y), 4);
+    assert_eq!(offset_of!(T, y.c), 8);
+    assert_eq!(offset_of!(Tup, 1), 4);
+}
diff --git a/tests/ui/offset-of/offset-of-slice.rs b/tests/ui/offset-of/offset-of-slice.rs
index a0fe3198f68..e6eb12abd7b 100644
--- a/tests/ui/offset-of/offset-of-slice.rs
+++ b/tests/ui/offset-of/offset-of-slice.rs
@@ -1,5 +1,5 @@
 //@run-pass
-#![feature(offset_of_slice, offset_of_nested)]
+#![feature(offset_of_slice)]
 
 use std::mem::offset_of;
 
diff --git a/tests/ui/offset-of/offset-of-tuple-nested.rs b/tests/ui/offset-of/offset-of-tuple-nested.rs
index 4a58b7167cb..210a8b6e897 100644
--- a/tests/ui/offset-of/offset-of-tuple-nested.rs
+++ b/tests/ui/offset-of/offset-of-tuple-nested.rs
@@ -2,8 +2,6 @@
 // Test for issue #112204 -- make sure this goes through the entire compilation pipeline,
 // similar to why `offset-of-unsized.rs` is also build-pass
 
-#![feature(offset_of_nested)]
-
 use std::mem::offset_of;
 
 type ComplexTup = ((u8, (u8, (u8, u16), u8)), (u8, u32, u16));
diff --git a/tests/ui/offset-of/offset-of-tuple.rs b/tests/ui/offset-of/offset-of-tuple.rs
index 75ba8d77f2f..b0822352c9d 100644
--- a/tests/ui/offset-of/offset-of-tuple.rs
+++ b/tests/ui/offset-of/offset-of-tuple.rs
@@ -1,4 +1,3 @@
-#![feature(offset_of_nested)]
 #![feature(builtin_syntax)]
 
 use std::mem::offset_of;
diff --git a/tests/ui/offset-of/offset-of-tuple.stderr b/tests/ui/offset-of/offset-of-tuple.stderr
index 1e2d9240267..e6b45c0b6b8 100644
--- a/tests/ui/offset-of/offset-of-tuple.stderr
+++ b/tests/ui/offset-of/offset-of-tuple.stderr
@@ -1,11 +1,11 @@
 error: suffixes on a tuple index are invalid
-  --> $DIR/offset-of-tuple.rs:19:35
+  --> $DIR/offset-of-tuple.rs:18:35
    |
 LL |     builtin # offset_of((u8, u8), 1_u8);
    |                                   ^^^^ invalid suffix `u8`
 
 error: leading `+` is not supported
-  --> $DIR/offset-of-tuple.rs:23:37
+  --> $DIR/offset-of-tuple.rs:22:37
    |
 LL |     { builtin # offset_of((u8, u8), +1) };
    |                                     ^ unexpected `+`
@@ -17,67 +17,67 @@ LL +     { builtin # offset_of((u8, u8), 1) };
    |
 
 error: offset_of expects dot-separated field and variant names
-  --> $DIR/offset-of-tuple.rs:24:38
+  --> $DIR/offset-of-tuple.rs:23:38
    |
 LL |     { builtin # offset_of((u8, u8), 1.) };
    |                                      ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:25:40
+  --> $DIR/offset-of-tuple.rs:24:40
    |
 LL |     { builtin # offset_of((u8, u8), 1 .) };
    |                                        ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:47:45
+  --> $DIR/offset-of-tuple.rs:46:45
    |
 LL |     { builtin # offset_of(ComplexTup, 0.0.1.) };
    |                                             ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:48:46
+  --> $DIR/offset-of-tuple.rs:47:46
    |
 LL |     { builtin # offset_of(ComplexTup, 0 .0.1.) };
    |                                              ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:49:47
+  --> $DIR/offset-of-tuple.rs:48:47
    |
 LL |     { builtin # offset_of(ComplexTup, 0 . 0.1.) };
    |                                               ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:50:46
+  --> $DIR/offset-of-tuple.rs:49:46
    |
 LL |     { builtin # offset_of(ComplexTup, 0. 0.1.) };
    |                                              ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:51:46
+  --> $DIR/offset-of-tuple.rs:50:46
    |
 LL |     { builtin # offset_of(ComplexTup, 0.0 .1.) };
    |                                              ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:52:47
+  --> $DIR/offset-of-tuple.rs:51:47
    |
 LL |     { builtin # offset_of(ComplexTup, 0.0 . 1.) };
    |                                               ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:53:46
+  --> $DIR/offset-of-tuple.rs:52:46
    |
 LL |     { builtin # offset_of(ComplexTup, 0.0. 1.) };
    |                                              ^
 
 error: suffixes on a tuple index are invalid
-  --> $DIR/offset-of-tuple.rs:10:26
+  --> $DIR/offset-of-tuple.rs:9:26
    |
 LL |     offset_of!((u8, u8), 1_u8);
    |                          ^^^^ invalid suffix `u8`
 
 error: no rules expected the token `+`
-  --> $DIR/offset-of-tuple.rs:12:26
+  --> $DIR/offset-of-tuple.rs:11:26
    |
 LL |     offset_of!((u8, u8), +1);
    |                          ^ no rules expected this token in macro call
@@ -86,115 +86,115 @@ note: while trying to match meta-variable `$fields:expr`
   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
 
 error: offset_of expects dot-separated field and variant names
-  --> $DIR/offset-of-tuple.rs:13:26
+  --> $DIR/offset-of-tuple.rs:12:26
    |
 LL |     offset_of!((u8, u8), -1);
    |                          ^^
 
 error: offset_of expects dot-separated field and variant names
-  --> $DIR/offset-of-tuple.rs:14:27
+  --> $DIR/offset-of-tuple.rs:13:27
    |
 LL |     offset_of!((u8, u8), 1.);
    |                           ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:15:29
+  --> $DIR/offset-of-tuple.rs:14:29
    |
 LL |     offset_of!((u8, u8), 1 .);
    |                             ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:36:34
+  --> $DIR/offset-of-tuple.rs:35:34
    |
 LL |     offset_of!(ComplexTup, 0.0.1.);
    |                                  ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:37:35
+  --> $DIR/offset-of-tuple.rs:36:35
    |
 LL |     offset_of!(ComplexTup, 0 .0.1.);
    |                                   ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:38:36
+  --> $DIR/offset-of-tuple.rs:37:36
    |
 LL |     offset_of!(ComplexTup, 0 . 0.1.);
    |                                    ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:39:35
+  --> $DIR/offset-of-tuple.rs:38:35
    |
 LL |     offset_of!(ComplexTup, 0. 0.1.);
    |                                   ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:40:35
+  --> $DIR/offset-of-tuple.rs:39:35
    |
 LL |     offset_of!(ComplexTup, 0.0 .1.);
    |                                   ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:41:36
+  --> $DIR/offset-of-tuple.rs:40:36
    |
 LL |     offset_of!(ComplexTup, 0.0 . 1.);
    |                                    ^
 
 error: unexpected token: `)`
-  --> $DIR/offset-of-tuple.rs:42:35
+  --> $DIR/offset-of-tuple.rs:41:35
    |
 LL |     offset_of!(ComplexTup, 0.0. 1.);
    |                                   ^
 
 error[E0609]: no field `_0` on type `(u8, u8)`
-  --> $DIR/offset-of-tuple.rs:7:26
+  --> $DIR/offset-of-tuple.rs:6:26
    |
 LL |     offset_of!((u8, u8), _0);
    |                          ^^
 
 error[E0609]: no field `01` on type `(u8, u8)`
-  --> $DIR/offset-of-tuple.rs:8:26
+  --> $DIR/offset-of-tuple.rs:7:26
    |
 LL |     offset_of!((u8, u8), 01);
    |                          ^^
 
 error[E0609]: no field `1e2` on type `(u8, u8)`
-  --> $DIR/offset-of-tuple.rs:9:26
+  --> $DIR/offset-of-tuple.rs:8:26
    |
 LL |     offset_of!((u8, u8), 1e2);
    |                          ^^^
 
 error[E0609]: no field `1_` on type `(u8, u8)`
-  --> $DIR/offset-of-tuple.rs:10:26
+  --> $DIR/offset-of-tuple.rs:9:26
    |
 LL |     offset_of!((u8, u8), 1_u8);
    |                          ^^^^
 
 error[E0609]: no field `1e2` on type `(u8, u8)`
-  --> $DIR/offset-of-tuple.rs:16:35
+  --> $DIR/offset-of-tuple.rs:15:35
    |
 LL |     builtin # offset_of((u8, u8), 1e2);
    |                                   ^^^
 
 error[E0609]: no field `_0` on type `(u8, u8)`
-  --> $DIR/offset-of-tuple.rs:17:35
+  --> $DIR/offset-of-tuple.rs:16:35
    |
 LL |     builtin # offset_of((u8, u8), _0);
    |                                   ^^
 
 error[E0609]: no field `01` on type `(u8, u8)`
-  --> $DIR/offset-of-tuple.rs:18:35
+  --> $DIR/offset-of-tuple.rs:17:35
    |
 LL |     builtin # offset_of((u8, u8), 01);
    |                                   ^^
 
 error[E0609]: no field `1_` on type `(u8, u8)`
-  --> $DIR/offset-of-tuple.rs:19:35
+  --> $DIR/offset-of-tuple.rs:18:35
    |
 LL |     builtin # offset_of((u8, u8), 1_u8);
    |                                   ^^^^
 
 error[E0609]: no field `2` on type `(u8, u16)`
-  --> $DIR/offset-of-tuple.rs:31:47
+  --> $DIR/offset-of-tuple.rs:30:47
    |
 LL |       offset_of!(((u8, u16), (u32, u16, u8)), 0.2);
    |  _____------------------------------------------^-
@@ -207,7 +207,7 @@ LL | |     offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0);
    = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0609]: no field `0` on type `u8`
-  --> $DIR/offset-of-tuple.rs:33:49
+  --> $DIR/offset-of-tuple.rs:32:49
    |
 LL |     offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0);
    |                                                 ^
diff --git a/tests/ui/offset-of/offset-of-unstable-with-feature.rs b/tests/ui/offset-of/offset-of-unstable-with-feature.rs
index c9d4f30e99a..c2614ba3d8a 100644
--- a/tests/ui/offset-of/offset-of-unstable-with-feature.rs
+++ b/tests/ui/offset-of/offset-of-unstable-with-feature.rs
@@ -1,7 +1,7 @@
 //@ check-pass
 //@ aux-build:offset-of-staged-api.rs
 
-#![feature(offset_of_nested, unstable_test_feature)]
+#![feature(unstable_test_feature)]
 
 use std::mem::offset_of;
 
diff --git a/tests/ui/offset-of/offset-of-unstable.rs b/tests/ui/offset-of/offset-of-unstable.rs
index ab6f89ce52a..d249e8871c3 100644
--- a/tests/ui/offset-of/offset-of-unstable.rs
+++ b/tests/ui/offset-of/offset-of-unstable.rs
@@ -1,7 +1,5 @@
 //@ aux-build:offset-of-staged-api.rs
 
-#![feature(offset_of_nested)]
-
 use std::mem::offset_of;
 
 extern crate offset_of_staged_api;
diff --git a/tests/ui/offset-of/offset-of-unstable.stderr b/tests/ui/offset-of/offset-of-unstable.stderr
index 4882dee4042..44ccad3ff39 100644
--- a/tests/ui/offset-of/offset-of-unstable.stderr
+++ b/tests/ui/offset-of/offset-of-unstable.stderr
@@ -1,5 +1,5 @@
 error[E0658]: use of unstable library feature 'unstable_test_feature'
-  --> $DIR/offset-of-unstable.rs:14:9
+  --> $DIR/offset-of-unstable.rs:12:9
    |
 LL |         Unstable,
    |         ^^^^^^^^
@@ -8,7 +8,7 @@ LL |         Unstable,
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: use of unstable library feature 'unstable_test_feature'
-  --> $DIR/offset-of-unstable.rs:23:9
+  --> $DIR/offset-of-unstable.rs:21:9
    |
 LL |         UnstableWithStableFieldType,
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -17,7 +17,7 @@ LL |         UnstableWithStableFieldType,
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: use of unstable library feature 'unstable_test_feature'
-  --> $DIR/offset-of-unstable.rs:28:9
+  --> $DIR/offset-of-unstable.rs:26:9
    |
 LL |         UnstableWithStableFieldType,
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -26,7 +26,7 @@ LL |         UnstableWithStableFieldType,
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: use of unstable library feature 'unstable_test_feature'
-  --> $DIR/offset-of-unstable.rs:12:5
+  --> $DIR/offset-of-unstable.rs:10:5
    |
 LL | /     offset_of!(
 LL | |
@@ -40,7 +40,7 @@ LL | |     );
    = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0658]: use of unstable library feature 'unstable_test_feature'
-  --> $DIR/offset-of-unstable.rs:18:5
+  --> $DIR/offset-of-unstable.rs:16:5
    |
 LL |     offset_of!(StableWithUnstableField, unstable);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -50,7 +50,7 @@ LL |     offset_of!(StableWithUnstableField, unstable);
    = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0658]: use of unstable library feature 'unstable_test_feature'
-  --> $DIR/offset-of-unstable.rs:20:5
+  --> $DIR/offset-of-unstable.rs:18:5
    |
 LL |     offset_of!(StableWithUnstableFieldType, stable.unstable);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -60,7 +60,7 @@ LL |     offset_of!(StableWithUnstableFieldType, stable.unstable);
    = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0658]: use of unstable library feature 'unstable_test_feature'
-  --> $DIR/offset-of-unstable.rs:21:5
+  --> $DIR/offset-of-unstable.rs:19:5
    |
 LL | /     offset_of!(
 LL | |
@@ -74,7 +74,7 @@ LL | |     );
    = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0658]: use of unstable library feature 'unstable_test_feature'
-  --> $DIR/offset-of-unstable.rs:26:5
+  --> $DIR/offset-of-unstable.rs:24:5
    |
 LL | /     offset_of!(
 LL | |
diff --git a/tests/ui/panics/panic-in-cleanup.run.stderr b/tests/ui/panics/panic-in-cleanup.run.stderr
index e7def11b0e9..3417d4bf1a3 100644
--- a/tests/ui/panics/panic-in-cleanup.run.stderr
+++ b/tests/ui/panics/panic-in-cleanup.run.stderr
@@ -4,6 +4,6 @@ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 thread 'main' panicked at $DIR/panic-in-cleanup.rs:16:9:
 BOOM
 stack backtrace:
-thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL:
+thread 'main' panicked at core/src/panicking.rs:$LINE:$COL:
 panic in a destructor during cleanup
 thread caused non-unwinding panic. aborting.
diff --git a/tests/ui/panics/panic-in-ffi.run.stderr b/tests/ui/panics/panic-in-ffi.run.stderr
index 596355399c8..fc70847ad9a 100644
--- a/tests/ui/panics/panic-in-ffi.run.stderr
+++ b/tests/ui/panics/panic-in-ffi.run.stderr
@@ -1,7 +1,7 @@
 thread 'main' panicked at $DIR/panic-in-ffi.rs:12:5:
 Test
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL:
+thread 'main' panicked at core/src/panicking.rs:$LINE:$COL:
 panic in a function that cannot unwind
 stack backtrace:
 thread caused non-unwinding panic. aborting.
diff --git a/tests/ui/parser/brace-in-let-chain.stderr b/tests/ui/parser/brace-in-let-chain.stderr
index d76cb25ad8b..913a34700df 100644
--- a/tests/ui/parser/brace-in-let-chain.stderr
+++ b/tests/ui/parser/brace-in-let-chain.stderr
@@ -17,14 +17,8 @@ LL | fn qux() {
    |          - unclosed delimiter
 ...
 LL | fn foo() {
-   |          - unclosed delimiter
-...
-LL | fn bar() {
-   |          - unclosed delimiter
+   |          - another 3 unclosed delimiters begin from here
 ...
-LL | fn baz() {
-   |          - unclosed delimiter
-LL |     if false {
 LL |         {
    |         - this delimiter might not be properly closed...
 LL |             && let () = ()
diff --git a/tests/ui/parser/issues/issue-105366.fixed b/tests/ui/parser/issues/issue-105366.fixed
index 95419dc07f2..7157b647524 100644
--- a/tests/ui/parser/issues/issue-105366.fixed
+++ b/tests/ui/parser/issues/issue-105366.fixed
@@ -1,6 +1,5 @@
 //@ run-rustfix
 
-#[allow(dead_code)]
 struct Foo;
 
 impl From<i32> for Foo {
diff --git a/tests/ui/parser/issues/issue-105366.rs b/tests/ui/parser/issues/issue-105366.rs
index 3278b737991..dc3cb8b343d 100644
--- a/tests/ui/parser/issues/issue-105366.rs
+++ b/tests/ui/parser/issues/issue-105366.rs
@@ -1,6 +1,5 @@
 //@ run-rustfix
 
-#[allow(dead_code)]
 struct Foo;
 
 fn From<i32> for Foo {
diff --git a/tests/ui/parser/issues/issue-105366.stderr b/tests/ui/parser/issues/issue-105366.stderr
index 195305a2ec8..18c04dfaf20 100644
--- a/tests/ui/parser/issues/issue-105366.stderr
+++ b/tests/ui/parser/issues/issue-105366.stderr
@@ -1,5 +1,5 @@
 error: you might have meant to write `impl` instead of `fn`
-  --> $DIR/issue-105366.rs:6:1
+  --> $DIR/issue-105366.rs:5:1
    |
 LL | fn From<i32> for Foo {
    | ^^
diff --git a/tests/ui/parser/mismatched-delimiter-corner-case-issue-127868.rs b/tests/ui/parser/mismatched-delimiter-corner-case-issue-127868.rs
new file mode 100644
index 00000000000..5dcaa266325
--- /dev/null
+++ b/tests/ui/parser/mismatched-delimiter-corner-case-issue-127868.rs
@@ -0,0 +1,6 @@
+// issue: rust-lang/rust#127868
+
+fn main() {
+    let a = [[[[[[[[[[[[[[[[[[[[1, {, (, [,;
+} //~ ERROR mismatched closing delimiter: `}`
+//~ ERROR this file contains an unclosed delimiter
diff --git a/tests/ui/parser/mismatched-delimiter-corner-case-issue-127868.stderr b/tests/ui/parser/mismatched-delimiter-corner-case-issue-127868.stderr
new file mode 100644
index 00000000000..94e25c18e40
--- /dev/null
+++ b/tests/ui/parser/mismatched-delimiter-corner-case-issue-127868.stderr
@@ -0,0 +1,30 @@
+error: mismatched closing delimiter: `}`
+  --> $DIR/mismatched-delimiter-corner-case-issue-127868.rs:4:42
+   |
+LL | fn main() {
+   |           - closing delimiter possibly meant for this
+LL |     let a = [[[[[[[[[[[[[[[[[[[[1, {, (, [,;
+   |                                          ^ unclosed delimiter
+LL | }
+   | ^ mismatched closing delimiter
+
+error: this file contains an unclosed delimiter
+  --> $DIR/mismatched-delimiter-corner-case-issue-127868.rs:6:52
+   |
+LL | fn main() {
+   |           - unclosed delimiter
+LL |     let a = [[[[[[[[[[[[[[[[[[[[1, {, (, [,;
+   |             -----                  - this delimiter might not be properly closed...
+   |             |||||
+   |             ||||another 16 unclosed delimiters begin from here
+   |             |||unclosed delimiter
+   |             ||unclosed delimiter
+   |             |unclosed delimiter
+   |             unclosed delimiter
+LL | }
+   | - ...as it matches this but it has different indentation
+LL |
+   |                                                   ^
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.fixed b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.fixed
index e9c89807fa5..a851300a982 100644
--- a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.fixed
+++ b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.fixed
@@ -1,8 +1,7 @@
 // Regression test for issues #100790 and #106439.
 //@ run-rustfix
 
-#[allow(dead_code)]
-pub struct Example(usize)
+pub struct Example(#[allow(dead_code)] usize)
 where
     (): Sized;
 //~^^^ ERROR where clauses are not allowed before tuple struct bodies
diff --git a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.rs b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.rs
index 3bd0f51ec2c..10f435859f1 100644
--- a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.rs
+++ b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.rs
@@ -1,11 +1,10 @@
 // Regression test for issues #100790 and #106439.
 //@ run-rustfix
 
-#[allow(dead_code)]
 pub struct Example
 where
     (): Sized,
-(usize);
+(#[allow(dead_code)] usize);
 //~^^^ ERROR where clauses are not allowed before tuple struct bodies
 
 struct _Demo
diff --git a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.stderr b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.stderr
index 77eafa6bea3..ddbf237e866 100644
--- a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.stderr
+++ b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.stderr
@@ -1,23 +1,23 @@
 error: where clauses are not allowed before tuple struct bodies
-  --> $DIR/recover-where-clause-before-tuple-struct-body-0.rs:6:1
+  --> $DIR/recover-where-clause-before-tuple-struct-body-0.rs:5:1
    |
 LL |   pub struct Example
    |              ------- while parsing this tuple struct
 LL | / where
 LL | |     (): Sized,
    | |______________^ unexpected where clause
-LL |   (usize);
-   |   ------- the struct body
+LL |   (#[allow(dead_code)] usize);
+   |   --------------------------- the struct body
    |
 help: move the body before the where clause
    |
-LL ~ pub struct Example(usize)
+LL ~ pub struct Example(#[allow(dead_code)] usize)
 LL | where
 LL ~     (): Sized;
    |
 
 error: where clauses are not allowed before tuple struct bodies
-  --> $DIR/recover-where-clause-before-tuple-struct-body-0.rs:12:1
+  --> $DIR/recover-where-clause-before-tuple-struct-body-0.rs:11:1
    |
 LL |   struct _Demo
    |          ----- while parsing this tuple struct
diff --git a/tests/ui/parser/removed-syntax/removed-syntax-box.stderr b/tests/ui/parser/removed-syntax/removed-syntax-box.stderr
index 46b891587d5..60c39fd37c4 100644
--- a/tests/ui/parser/removed-syntax/removed-syntax-box.stderr
+++ b/tests/ui/parser/removed-syntax/removed-syntax-box.stderr
@@ -7,7 +7,7 @@ LL |     let _ = box ();
 help: use `Box::new()` instead
    |
 LL |     let _ = Box::new(());
-   |             ~~~~~~~~~~~~
+   |             ~~~~~~~~~  +
 
 error: `box_syntax` has been removed
   --> $DIR/removed-syntax-box.rs:10:13
@@ -18,7 +18,7 @@ LL |     let _ = box 1;
 help: use `Box::new()` instead
    |
 LL |     let _ = Box::new(1);
-   |             ~~~~~~~~~~~
+   |             ~~~~~~~~~ +
 
 error: `box_syntax` has been removed
   --> $DIR/removed-syntax-box.rs:11:13
@@ -29,7 +29,7 @@ LL |     let _ = box T { a: 12, b: 18 };
 help: use `Box::new()` instead
    |
 LL |     let _ = Box::new(T { a: 12, b: 18 });
-   |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   |             ~~~~~~~~~                  +
 
 error: `box_syntax` has been removed
   --> $DIR/removed-syntax-box.rs:12:13
@@ -40,7 +40,7 @@ LL |     let _ = box [5; 30];
 help: use `Box::new()` instead
    |
 LL |     let _ = Box::new([5; 30]);
-   |             ~~~~~~~~~~~~~~~~~
+   |             ~~~~~~~~~       +
 
 error: `box_syntax` has been removed
   --> $DIR/removed-syntax-box.rs:13:22
@@ -51,7 +51,7 @@ LL |     let _: Box<()> = box ();
 help: use `Box::new()` instead
    |
 LL |     let _: Box<()> = Box::new(());
-   |                      ~~~~~~~~~~~~
+   |                      ~~~~~~~~~  +
 
 error: aborting due to 5 previous errors
 
diff --git a/tests/ui/parser/suggest-remove-compount-assign-let-ice.rs b/tests/ui/parser/suggest-remove-compount-assign-let-ice.rs
new file mode 100644
index 00000000000..1affee5678e
--- /dev/null
+++ b/tests/ui/parser/suggest-remove-compount-assign-let-ice.rs
@@ -0,0 +1,16 @@
+//! Previously we would try to issue a suggestion for `let x <op>= 1`, i.e. a compound assignment
+//! within a `let` binding, to remove the `<op>`. The suggestion code unfortunately incorrectly
+//! assumed that the `<op>` is an exactly-1-byte ASCII character, but this assumption is incorrect
+//! because we also recover Unicode-confusables like `➖=` as `-=`. In this example, the suggestion
+//! code used a `+ BytePos(1)` to calculate the span of the `<op>` codepoint that looks like `-` but
+//! the mult-byte Unicode look-alike would cause the suggested removal span to be inside a
+//! multi-byte codepoint boundary, triggering a codepoint boundary assertion.
+//!
+//! issue: rust-lang/rust#128845
+
+fn main() {
+    // Adapted from #128845 but with irrelevant components removed and simplified.
+    let x ➖= 1;
+    //~^ ERROR unknown start of token: \u{2796}
+    //~| ERROR: can't reassign to an uninitialized variable
+}
diff --git a/tests/ui/parser/suggest-remove-compount-assign-let-ice.stderr b/tests/ui/parser/suggest-remove-compount-assign-let-ice.stderr
new file mode 100644
index 00000000000..59716d69b50
--- /dev/null
+++ b/tests/ui/parser/suggest-remove-compount-assign-let-ice.stderr
@@ -0,0 +1,26 @@
+error: unknown start of token: \u{2796}
+  --> $DIR/suggest-remove-compount-assign-let-ice.rs:13:11
+   |
+LL |     let x ➖= 1;
+   |           ^^
+   |
+help: Unicode character '➖' (Heavy Minus Sign) looks like '-' (Minus/Hyphen), but it is not
+   |
+LL |     let x -= 1;
+   |           ~
+
+error: can't reassign to an uninitialized variable
+  --> $DIR/suggest-remove-compount-assign-let-ice.rs:13:11
+   |
+LL |     let x ➖= 1;
+   |           ^^^
+   |
+   = help: if you meant to overwrite, remove the `let` binding
+help: initialize the variable
+   |
+LL -     let x ➖= 1;
+LL +     let x = 1;
+   |
+
+error: aborting due to 2 previous errors
+
diff --git a/tests/ui/parser/unsafe-foreign-mod-2.rs b/tests/ui/parser/unsafe-foreign-mod-2.rs
index 0b63a993c5b..6d339cd9088 100644
--- a/tests/ui/parser/unsafe-foreign-mod-2.rs
+++ b/tests/ui/parser/unsafe-foreign-mod-2.rs
@@ -1,8 +1,6 @@
 extern "C" unsafe {
     //~^ ERROR expected `{`, found keyword `unsafe`
-    //~| ERROR extern block cannot be declared unsafe
     unsafe fn foo();
-    //~^ ERROR items in unadorned `extern` blocks cannot have safety qualifiers
 }
 
 fn main() {}
diff --git a/tests/ui/parser/unsafe-foreign-mod-2.stderr b/tests/ui/parser/unsafe-foreign-mod-2.stderr
index 8bd592b5d43..0625e3362ed 100644
--- a/tests/ui/parser/unsafe-foreign-mod-2.stderr
+++ b/tests/ui/parser/unsafe-foreign-mod-2.stderr
@@ -4,21 +4,5 @@ error: expected `{`, found keyword `unsafe`
 LL | extern "C" unsafe {
    |            ^^^^^^ expected `{`
 
-error: extern block cannot be declared unsafe
-  --> $DIR/unsafe-foreign-mod-2.rs:1:12
-   |
-LL | extern "C" unsafe {
-   |            ^^^^^^
-   |
-   = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information
-   = help: add `#![feature(unsafe_extern_blocks)]` 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: items in unadorned `extern` blocks cannot have safety qualifiers
-  --> $DIR/unsafe-foreign-mod-2.rs:4:5
-   |
-LL |     unsafe fn foo();
-   |     ^^^^^^^^^^^^^^^^
-
-error: aborting due to 3 previous errors
+error: aborting due to 1 previous error
 
diff --git a/tests/ui/parser/unsafe-foreign-mod.rs b/tests/ui/parser/unsafe-foreign-mod.rs
index eab134a4a4d..623c3bb81e4 100644
--- a/tests/ui/parser/unsafe-foreign-mod.rs
+++ b/tests/ui/parser/unsafe-foreign-mod.rs
@@ -1,5 +1,5 @@
-unsafe extern "C" {
-    //~^ ERROR extern block cannot be declared unsafe
-}
+//@ check-pass
+
+unsafe extern "C" {}
 
 fn main() {}
diff --git a/tests/ui/parser/unsafe-foreign-mod.stderr b/tests/ui/parser/unsafe-foreign-mod.stderr
deleted file mode 100644
index 60b918a89b3..00000000000
--- a/tests/ui/parser/unsafe-foreign-mod.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error: extern block cannot be declared unsafe
-  --> $DIR/unsafe-foreign-mod.rs:1:1
-   |
-LL | unsafe extern "C" {
-   | ^^^^^^
-   |
-   = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information
-   = help: add `#![feature(unsafe_extern_blocks)]` 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/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
index e925fe78f33..9359244c6eb 100644
--- a/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
+++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
@@ -333,14 +333,6 @@ LL |         ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false
    |                                                                  ^ move occurs because `b` has type `&mut U`, which does not implement the `Copy` trait
    |
    = note: variables bound in patterns cannot be moved from until after the end of the pattern guard
-note: if `U` implemented `Clone`, you could clone the value
-  --> $DIR/borrowck-pat-ref-mut-and-ref.rs:17:5
-   |
-LL |     struct U;
-   |     ^^^^^^^^ consider implementing `Clone` for this type
-...
-LL |         ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {}
-   |                                                                  - you could clone this value
 
 error[E0507]: cannot move out of `b` in pattern guard
   --> $DIR/borrowck-pat-ref-mut-and-ref.rs:103:66
@@ -349,14 +341,6 @@ LL |         ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false
    |                                                                  ^ move occurs because `b` has type `&mut U`, which does not implement the `Copy` trait
    |
    = note: variables bound in patterns cannot be moved from until after the end of the pattern guard
-note: if `U` implemented `Clone`, you could clone the value
-  --> $DIR/borrowck-pat-ref-mut-and-ref.rs:17:5
-   |
-LL |     struct U;
-   |     ^^^^^^^^ consider implementing `Clone` for this type
-...
-LL |         ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {}
-   |                                                                  - you could clone this value
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error[E0507]: cannot move out of `a` in pattern guard
diff --git a/tests/ui/pattern/issue-22546.rs b/tests/ui/pattern/issue-22546.rs
index d5c5b68be78..fd1d5fb6c47 100644
--- a/tests/ui/pattern/issue-22546.rs
+++ b/tests/ui/pattern/issue-22546.rs
@@ -15,7 +15,7 @@ impl<T: ::std::fmt::Display> Foo<T> {
     }
 }
 
-trait Tr {
+trait Tr { //~ WARN trait `Tr` is never used
     type U;
 }
 
diff --git a/tests/ui/pattern/issue-22546.stderr b/tests/ui/pattern/issue-22546.stderr
new file mode 100644
index 00000000000..e067a95e422
--- /dev/null
+++ b/tests/ui/pattern/issue-22546.stderr
@@ -0,0 +1,10 @@
+warning: trait `Tr` is never used
+  --> $DIR/issue-22546.rs:18:7
+   |
+LL | trait Tr {
+   |       ^^
+   |
+   = note: `#[warn(dead_code)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/pattern/usefulness/always-inhabited-union-ref.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/always-inhabited-union-ref.exhaustive_patterns.stderr
index d6304a0b997..bc74069b3e7 100644
--- a/tests/ui/pattern/usefulness/always-inhabited-union-ref.exhaustive_patterns.stderr
+++ b/tests/ui/pattern/usefulness/always-inhabited-union-ref.exhaustive_patterns.stderr
@@ -1,5 +1,5 @@
 error[E0004]: non-exhaustive patterns: type `&!` is non-empty
-  --> $DIR/always-inhabited-union-ref.rs:25:11
+  --> $DIR/always-inhabited-union-ref.rs:24:11
    |
 LL |     match uninhab_ref() {
    |           ^^^^^^^^^^^^^
@@ -14,13 +14,13 @@ LL +     }
    |
 
 error[E0004]: non-exhaustive patterns: type `Foo` is non-empty
-  --> $DIR/always-inhabited-union-ref.rs:29:11
+  --> $DIR/always-inhabited-union-ref.rs:28:11
    |
 LL |     match uninhab_union() {
    |           ^^^^^^^^^^^^^^^
    |
 note: `Foo` defined here
-  --> $DIR/always-inhabited-union-ref.rs:12:11
+  --> $DIR/always-inhabited-union-ref.rs:11:11
    |
 LL | pub union Foo {
    |           ^^^
diff --git a/tests/ui/pattern/usefulness/always-inhabited-union-ref.min_exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/always-inhabited-union-ref.normal.stderr
index d6304a0b997..bc74069b3e7 100644
--- a/tests/ui/pattern/usefulness/always-inhabited-union-ref.min_exhaustive_patterns.stderr
+++ b/tests/ui/pattern/usefulness/always-inhabited-union-ref.normal.stderr
@@ -1,5 +1,5 @@
 error[E0004]: non-exhaustive patterns: type `&!` is non-empty
-  --> $DIR/always-inhabited-union-ref.rs:25:11
+  --> $DIR/always-inhabited-union-ref.rs:24:11
    |
 LL |     match uninhab_ref() {
    |           ^^^^^^^^^^^^^
@@ -14,13 +14,13 @@ LL +     }
    |
 
 error[E0004]: non-exhaustive patterns: type `Foo` is non-empty
-  --> $DIR/always-inhabited-union-ref.rs:29:11
+  --> $DIR/always-inhabited-union-ref.rs:28:11
    |
 LL |     match uninhab_union() {
    |           ^^^^^^^^^^^^^^^
    |
 note: `Foo` defined here
-  --> $DIR/always-inhabited-union-ref.rs:12:11
+  --> $DIR/always-inhabited-union-ref.rs:11:11
    |
 LL | pub union Foo {
    |           ^^^
diff --git a/tests/ui/pattern/usefulness/always-inhabited-union-ref.rs b/tests/ui/pattern/usefulness/always-inhabited-union-ref.rs
index 5088098d0ae..335eff425ab 100644
--- a/tests/ui/pattern/usefulness/always-inhabited-union-ref.rs
+++ b/tests/ui/pattern/usefulness/always-inhabited-union-ref.rs
@@ -1,10 +1,9 @@
-//@ revisions: min_exhaustive_patterns exhaustive_patterns
+//@ revisions: normal exhaustive_patterns
 
 // The precise semantics of inhabitedness with respect to unions and references is currently
 // undecided. This test file currently checks a conservative choice.
 
 #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
-#![cfg_attr(min_exhaustive_patterns, feature(min_exhaustive_patterns))]
 #![feature(never_type)]
 #![allow(dead_code)]
 #![allow(unreachable_code)]
diff --git a/tests/ui/pattern/usefulness/empty-match-check-notes.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-match-check-notes.exhaustive_patterns.stderr
index 9e700ee55ef..1b65ff7aa57 100644
--- a/tests/ui/pattern/usefulness/empty-match-check-notes.exhaustive_patterns.stderr
+++ b/tests/ui/pattern/usefulness/empty-match-check-notes.exhaustive_patterns.stderr
@@ -38,7 +38,7 @@ LL |         _ if false => {}
 error[E0005]: refutable pattern in local binding
   --> $DIR/empty-match-check-notes.rs:39:9
    |
-LL |     let None = x;
+LL |     let None = *x;
    |         ^^^^ pattern `Some(_)` not covered
    |
    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
@@ -47,8 +47,8 @@ LL |     let None = x;
    = note: the matched value is of type `Option<SecretlyUninhabitedForeignStruct>`
 help: you might want to use `if let` to ignore the variant that isn't matched
    |
-LL |     if let None = x { todo!() };
-   |     ++              +++++++++++
+LL |     if let None = *x { todo!() };
+   |     ++               +++++++++++
 
 error[E0004]: non-exhaustive patterns: `0_u8..=u8::MAX` not covered
   --> $DIR/empty-match-check-notes.rs:49:11
diff --git a/tests/ui/pattern/usefulness/empty-match-check-notes.normal.stderr b/tests/ui/pattern/usefulness/empty-match-check-notes.normal.stderr
index 480ae7095a6..1b65ff7aa57 100644
--- a/tests/ui/pattern/usefulness/empty-match-check-notes.normal.stderr
+++ b/tests/ui/pattern/usefulness/empty-match-check-notes.normal.stderr
@@ -38,16 +38,17 @@ LL |         _ if false => {}
 error[E0005]: refutable pattern in local binding
   --> $DIR/empty-match-check-notes.rs:39:9
    |
-LL |     let None = x;
+LL |     let None = *x;
    |         ^^^^ pattern `Some(_)` not covered
    |
    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
    = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
+   = note: pattern `Some(_)` is currently uninhabited, but this variant contains private fields which may become inhabited in the future
    = note: the matched value is of type `Option<SecretlyUninhabitedForeignStruct>`
 help: you might want to use `if let` to ignore the variant that isn't matched
    |
-LL |     if let None = x { todo!() };
-   |     ++              +++++++++++
+LL |     if let None = *x { todo!() };
+   |     ++               +++++++++++
 
 error[E0004]: non-exhaustive patterns: `0_u8..=u8::MAX` not covered
   --> $DIR/empty-match-check-notes.rs:49:11
diff --git a/tests/ui/pattern/usefulness/empty-match-check-notes.rs b/tests/ui/pattern/usefulness/empty-match-check-notes.rs
index 2eef283a21e..61a75e6c801 100644
--- a/tests/ui/pattern/usefulness/empty-match-check-notes.rs
+++ b/tests/ui/pattern/usefulness/empty-match-check-notes.rs
@@ -35,14 +35,14 @@ fn empty_foreign_enum(x: empty::EmptyForeignEnum) {
     }
 }
 
-fn empty_foreign_enum_private(x: Option<empty::SecretlyUninhabitedForeignStruct>) {
-    let None = x;
+fn empty_foreign_enum_private(x: &Option<empty::SecretlyUninhabitedForeignStruct>) {
+    let None = *x;
     //~^ ERROR refutable pattern in local binding
     //~| NOTE `let` bindings require an "irrefutable pattern"
     //~| NOTE for more information, visit
     //~| NOTE the matched value is of type
     //~| NOTE pattern `Some(_)` not covered
-    //[exhaustive_patterns]~| NOTE currently uninhabited, but this variant contains private fields
+    //~| NOTE currently uninhabited, but this variant contains private fields
 }
 
 fn main() {
diff --git a/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
index 5f895fab0fb..f2067f0341f 100644
--- a/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
+++ b/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
@@ -1,5 +1,5 @@
 error[E0004]: non-exhaustive patterns: type `u8` is non-empty
-  --> $DIR/empty-match.rs:46:20
+  --> $DIR/empty-match.rs:47:20
    |
 LL |     match_no_arms!(0u8);
    |                    ^^^
@@ -8,7 +8,7 @@ LL |     match_no_arms!(0u8);
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `i8` is non-empty
-  --> $DIR/empty-match.rs:47:20
+  --> $DIR/empty-match.rs:48:20
    |
 LL |     match_no_arms!(0i8);
    |                    ^^^
@@ -17,7 +17,7 @@ LL |     match_no_arms!(0i8);
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `usize` is non-empty
-  --> $DIR/empty-match.rs:48:20
+  --> $DIR/empty-match.rs:49:20
    |
 LL |     match_no_arms!(0usize);
    |                    ^^^^^^
@@ -26,7 +26,7 @@ LL |     match_no_arms!(0usize);
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `isize` is non-empty
-  --> $DIR/empty-match.rs:49:20
+  --> $DIR/empty-match.rs:50:20
    |
 LL |     match_no_arms!(0isize);
    |                    ^^^^^^
@@ -35,7 +35,7 @@ LL |     match_no_arms!(0isize);
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `NonEmptyStruct1` is non-empty
-  --> $DIR/empty-match.rs:50:20
+  --> $DIR/empty-match.rs:51:20
    |
 LL |     match_no_arms!(NonEmptyStruct1);
    |                    ^^^^^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL |     struct NonEmptyStruct1;
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `NonEmptyStruct2` is non-empty
-  --> $DIR/empty-match.rs:51:20
+  --> $DIR/empty-match.rs:52:20
    |
 LL |     match_no_arms!(NonEmptyStruct2(true));
    |                    ^^^^^^^^^^^^^^^^^^^^^
@@ -63,7 +63,7 @@ LL |     struct NonEmptyStruct2(bool);
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
-  --> $DIR/empty-match.rs:52:20
+  --> $DIR/empty-match.rs:53:20
    |
 LL |     match_no_arms!((NonEmptyUnion1 { foo: () }));
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -77,7 +77,7 @@ LL |     union NonEmptyUnion1 {
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
-  --> $DIR/empty-match.rs:53:20
+  --> $DIR/empty-match.rs:54:20
    |
 LL |     match_no_arms!((NonEmptyUnion2 { foo: () }));
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -91,7 +91,7 @@ LL |     union NonEmptyUnion2 {
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
-  --> $DIR/empty-match.rs:54:20
+  --> $DIR/empty-match.rs:55:20
    |
 LL |     match_no_arms!(NonEmptyEnum1::Foo(true));
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
@@ -107,7 +107,7 @@ LL |         Foo(bool),
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern
 
 error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
-  --> $DIR/empty-match.rs:55:20
+  --> $DIR/empty-match.rs:56:20
    |
 LL |     match_no_arms!(NonEmptyEnum2::Foo(true));
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
@@ -125,7 +125,7 @@ LL |         Bar,
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
 
 error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
-  --> $DIR/empty-match.rs:56:20
+  --> $DIR/empty-match.rs:57:20
    |
 LL |     match_no_arms!(NonEmptyEnum5::V1);
    |                    ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
@@ -148,8 +148,26 @@ LL |         V5,
    = note: the matched value is of type `NonEmptyEnum5`
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
 
+error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty
+  --> $DIR/empty-match.rs:58:20
+   |
+LL |     match_no_arms!(array0_of_empty);
+   |                    ^^^^^^^^^^^^^^^
+   |
+   = note: the matched value is of type `[!; 0]`
+   = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
+
+error[E0004]: non-exhaustive patterns: type `[!; N]` is non-empty
+  --> $DIR/empty-match.rs:59:20
+   |
+LL |     match_no_arms!(arrayN_of_empty);
+   |                    ^^^^^^^^^^^^^^^
+   |
+   = note: the matched value is of type `[!; N]`
+   = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
+
 error[E0004]: non-exhaustive patterns: `0_u8..=u8::MAX` not covered
-  --> $DIR/empty-match.rs:58:24
+  --> $DIR/empty-match.rs:61:24
    |
 LL |     match_guarded_arm!(0u8);
    |                        ^^^ pattern `0_u8..=u8::MAX` not covered
@@ -163,7 +181,7 @@ LL +                 0_u8..=u8::MAX => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `i8::MIN..=i8::MAX` not covered
-  --> $DIR/empty-match.rs:59:24
+  --> $DIR/empty-match.rs:62:24
    |
 LL |     match_guarded_arm!(0i8);
    |                        ^^^ pattern `i8::MIN..=i8::MAX` not covered
@@ -177,7 +195,7 @@ LL +                 i8::MIN..=i8::MAX => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `0_usize..` not covered
-  --> $DIR/empty-match.rs:60:24
+  --> $DIR/empty-match.rs:63:24
    |
 LL |     match_guarded_arm!(0usize);
    |                        ^^^^^^ pattern `0_usize..` not covered
@@ -191,7 +209,7 @@ LL +                 0_usize.. => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `_` not covered
-  --> $DIR/empty-match.rs:61:24
+  --> $DIR/empty-match.rs:64:24
    |
 LL |     match_guarded_arm!(0isize);
    |                        ^^^^^^ pattern `_` not covered
@@ -205,7 +223,7 @@ LL +                 _ => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered
-  --> $DIR/empty-match.rs:62:24
+  --> $DIR/empty-match.rs:65:24
    |
 LL |     match_guarded_arm!(NonEmptyStruct1);
    |                        ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered
@@ -224,7 +242,7 @@ LL +                 NonEmptyStruct1 => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered
-  --> $DIR/empty-match.rs:63:24
+  --> $DIR/empty-match.rs:66:24
    |
 LL |     match_guarded_arm!(NonEmptyStruct2(true));
    |                        ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered
@@ -243,7 +261,7 @@ LL +                 NonEmptyStruct2(_) => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
-  --> $DIR/empty-match.rs:64:24
+  --> $DIR/empty-match.rs:67:24
    |
 LL |     match_guarded_arm!((NonEmptyUnion1 { foo: () }));
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered
@@ -262,7 +280,7 @@ LL +                 NonEmptyUnion1 { .. } => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
-  --> $DIR/empty-match.rs:65:24
+  --> $DIR/empty-match.rs:68:24
    |
 LL |     match_guarded_arm!((NonEmptyUnion2 { foo: () }));
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered
@@ -273,6 +291,7 @@ note: `NonEmptyUnion2` defined here
 LL |     union NonEmptyUnion2 {
    |           ^^^^^^^^^^^^^^
    = note: the matched value is of type `NonEmptyUnion2`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
    = note: match arms with guards don't count towards exhaustivity
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
@@ -281,7 +300,7 @@ LL +                 NonEmptyUnion2 { .. } => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
-  --> $DIR/empty-match.rs:66:24
+  --> $DIR/empty-match.rs:69:24
    |
 LL |     match_guarded_arm!(NonEmptyEnum1::Foo(true));
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
@@ -302,7 +321,7 @@ LL +                 NonEmptyEnum1::Foo(_) => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
-  --> $DIR/empty-match.rs:67:24
+  --> $DIR/empty-match.rs:70:24
    |
 LL |     match_guarded_arm!(NonEmptyEnum2::Foo(true));
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
@@ -325,7 +344,7 @@ LL +                 NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
-  --> $DIR/empty-match.rs:68:24
+  --> $DIR/empty-match.rs:71:24
    |
 LL |     match_guarded_arm!(NonEmptyEnum5::V1);
    |                        ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
@@ -353,6 +372,34 @@ LL ~                 _ if false => {},
 LL +                 _ => todo!()
    |
 
-error: aborting due to 22 previous errors
+error[E0004]: non-exhaustive patterns: `[]` not covered
+  --> $DIR/empty-match.rs:72:24
+   |
+LL |     match_guarded_arm!(array0_of_empty);
+   |                        ^^^^^^^^^^^^^^^ pattern `[]` not covered
+   |
+   = note: the matched value is of type `[!; 0]`
+   = note: match arms with guards don't count towards exhaustivity
+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 ~                 _ if false => {},
+LL +                 [] => todo!()
+   |
+
+error[E0004]: non-exhaustive patterns: `[]` not covered
+  --> $DIR/empty-match.rs:73:24
+   |
+LL |     match_guarded_arm!(arrayN_of_empty);
+   |                        ^^^^^^^^^^^^^^^ pattern `[]` not covered
+   |
+   = note: the matched value is of type `[!; N]`
+   = note: match arms with guards don't count towards exhaustivity
+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 ~                 _ if false => {},
+LL +                 [] => todo!()
+   |
+
+error: aborting due to 26 previous errors
 
 For more information about this error, try `rustc --explain E0004`.
diff --git a/tests/ui/pattern/usefulness/empty-match.normal.stderr b/tests/ui/pattern/usefulness/empty-match.normal.stderr
index 5f895fab0fb..f2067f0341f 100644
--- a/tests/ui/pattern/usefulness/empty-match.normal.stderr
+++ b/tests/ui/pattern/usefulness/empty-match.normal.stderr
@@ -1,5 +1,5 @@
 error[E0004]: non-exhaustive patterns: type `u8` is non-empty
-  --> $DIR/empty-match.rs:46:20
+  --> $DIR/empty-match.rs:47:20
    |
 LL |     match_no_arms!(0u8);
    |                    ^^^
@@ -8,7 +8,7 @@ LL |     match_no_arms!(0u8);
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `i8` is non-empty
-  --> $DIR/empty-match.rs:47:20
+  --> $DIR/empty-match.rs:48:20
    |
 LL |     match_no_arms!(0i8);
    |                    ^^^
@@ -17,7 +17,7 @@ LL |     match_no_arms!(0i8);
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `usize` is non-empty
-  --> $DIR/empty-match.rs:48:20
+  --> $DIR/empty-match.rs:49:20
    |
 LL |     match_no_arms!(0usize);
    |                    ^^^^^^
@@ -26,7 +26,7 @@ LL |     match_no_arms!(0usize);
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `isize` is non-empty
-  --> $DIR/empty-match.rs:49:20
+  --> $DIR/empty-match.rs:50:20
    |
 LL |     match_no_arms!(0isize);
    |                    ^^^^^^
@@ -35,7 +35,7 @@ LL |     match_no_arms!(0isize);
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `NonEmptyStruct1` is non-empty
-  --> $DIR/empty-match.rs:50:20
+  --> $DIR/empty-match.rs:51:20
    |
 LL |     match_no_arms!(NonEmptyStruct1);
    |                    ^^^^^^^^^^^^^^^
@@ -49,7 +49,7 @@ LL |     struct NonEmptyStruct1;
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `NonEmptyStruct2` is non-empty
-  --> $DIR/empty-match.rs:51:20
+  --> $DIR/empty-match.rs:52:20
    |
 LL |     match_no_arms!(NonEmptyStruct2(true));
    |                    ^^^^^^^^^^^^^^^^^^^^^
@@ -63,7 +63,7 @@ LL |     struct NonEmptyStruct2(bool);
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
-  --> $DIR/empty-match.rs:52:20
+  --> $DIR/empty-match.rs:53:20
    |
 LL |     match_no_arms!((NonEmptyUnion1 { foo: () }));
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -77,7 +77,7 @@ LL |     union NonEmptyUnion1 {
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
-  --> $DIR/empty-match.rs:53:20
+  --> $DIR/empty-match.rs:54:20
    |
 LL |     match_no_arms!((NonEmptyUnion2 { foo: () }));
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -91,7 +91,7 @@ LL |     union NonEmptyUnion2 {
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
 
 error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
-  --> $DIR/empty-match.rs:54:20
+  --> $DIR/empty-match.rs:55:20
    |
 LL |     match_no_arms!(NonEmptyEnum1::Foo(true));
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
@@ -107,7 +107,7 @@ LL |         Foo(bool),
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern
 
 error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
-  --> $DIR/empty-match.rs:55:20
+  --> $DIR/empty-match.rs:56:20
    |
 LL |     match_no_arms!(NonEmptyEnum2::Foo(true));
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
@@ -125,7 +125,7 @@ LL |         Bar,
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
 
 error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
-  --> $DIR/empty-match.rs:56:20
+  --> $DIR/empty-match.rs:57:20
    |
 LL |     match_no_arms!(NonEmptyEnum5::V1);
    |                    ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
@@ -148,8 +148,26 @@ LL |         V5,
    = note: the matched value is of type `NonEmptyEnum5`
    = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
 
+error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty
+  --> $DIR/empty-match.rs:58:20
+   |
+LL |     match_no_arms!(array0_of_empty);
+   |                    ^^^^^^^^^^^^^^^
+   |
+   = note: the matched value is of type `[!; 0]`
+   = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
+
+error[E0004]: non-exhaustive patterns: type `[!; N]` is non-empty
+  --> $DIR/empty-match.rs:59:20
+   |
+LL |     match_no_arms!(arrayN_of_empty);
+   |                    ^^^^^^^^^^^^^^^
+   |
+   = note: the matched value is of type `[!; N]`
+   = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
+
 error[E0004]: non-exhaustive patterns: `0_u8..=u8::MAX` not covered
-  --> $DIR/empty-match.rs:58:24
+  --> $DIR/empty-match.rs:61:24
    |
 LL |     match_guarded_arm!(0u8);
    |                        ^^^ pattern `0_u8..=u8::MAX` not covered
@@ -163,7 +181,7 @@ LL +                 0_u8..=u8::MAX => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `i8::MIN..=i8::MAX` not covered
-  --> $DIR/empty-match.rs:59:24
+  --> $DIR/empty-match.rs:62:24
    |
 LL |     match_guarded_arm!(0i8);
    |                        ^^^ pattern `i8::MIN..=i8::MAX` not covered
@@ -177,7 +195,7 @@ LL +                 i8::MIN..=i8::MAX => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `0_usize..` not covered
-  --> $DIR/empty-match.rs:60:24
+  --> $DIR/empty-match.rs:63:24
    |
 LL |     match_guarded_arm!(0usize);
    |                        ^^^^^^ pattern `0_usize..` not covered
@@ -191,7 +209,7 @@ LL +                 0_usize.. => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `_` not covered
-  --> $DIR/empty-match.rs:61:24
+  --> $DIR/empty-match.rs:64:24
    |
 LL |     match_guarded_arm!(0isize);
    |                        ^^^^^^ pattern `_` not covered
@@ -205,7 +223,7 @@ LL +                 _ => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered
-  --> $DIR/empty-match.rs:62:24
+  --> $DIR/empty-match.rs:65:24
    |
 LL |     match_guarded_arm!(NonEmptyStruct1);
    |                        ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered
@@ -224,7 +242,7 @@ LL +                 NonEmptyStruct1 => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered
-  --> $DIR/empty-match.rs:63:24
+  --> $DIR/empty-match.rs:66:24
    |
 LL |     match_guarded_arm!(NonEmptyStruct2(true));
    |                        ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered
@@ -243,7 +261,7 @@ LL +                 NonEmptyStruct2(_) => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
-  --> $DIR/empty-match.rs:64:24
+  --> $DIR/empty-match.rs:67:24
    |
 LL |     match_guarded_arm!((NonEmptyUnion1 { foo: () }));
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered
@@ -262,7 +280,7 @@ LL +                 NonEmptyUnion1 { .. } => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
-  --> $DIR/empty-match.rs:65:24
+  --> $DIR/empty-match.rs:68:24
    |
 LL |     match_guarded_arm!((NonEmptyUnion2 { foo: () }));
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered
@@ -273,6 +291,7 @@ note: `NonEmptyUnion2` defined here
 LL |     union NonEmptyUnion2 {
    |           ^^^^^^^^^^^^^^
    = note: the matched value is of type `NonEmptyUnion2`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
    = note: match arms with guards don't count towards exhaustivity
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
@@ -281,7 +300,7 @@ LL +                 NonEmptyUnion2 { .. } => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
-  --> $DIR/empty-match.rs:66:24
+  --> $DIR/empty-match.rs:69:24
    |
 LL |     match_guarded_arm!(NonEmptyEnum1::Foo(true));
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
@@ -302,7 +321,7 @@ LL +                 NonEmptyEnum1::Foo(_) => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
-  --> $DIR/empty-match.rs:67:24
+  --> $DIR/empty-match.rs:70:24
    |
 LL |     match_guarded_arm!(NonEmptyEnum2::Foo(true));
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
@@ -325,7 +344,7 @@ LL +                 NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
-  --> $DIR/empty-match.rs:68:24
+  --> $DIR/empty-match.rs:71:24
    |
 LL |     match_guarded_arm!(NonEmptyEnum5::V1);
    |                        ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
@@ -353,6 +372,34 @@ LL ~                 _ if false => {},
 LL +                 _ => todo!()
    |
 
-error: aborting due to 22 previous errors
+error[E0004]: non-exhaustive patterns: `[]` not covered
+  --> $DIR/empty-match.rs:72:24
+   |
+LL |     match_guarded_arm!(array0_of_empty);
+   |                        ^^^^^^^^^^^^^^^ pattern `[]` not covered
+   |
+   = note: the matched value is of type `[!; 0]`
+   = note: match arms with guards don't count towards exhaustivity
+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 ~                 _ if false => {},
+LL +                 [] => todo!()
+   |
+
+error[E0004]: non-exhaustive patterns: `[]` not covered
+  --> $DIR/empty-match.rs:73:24
+   |
+LL |     match_guarded_arm!(arrayN_of_empty);
+   |                        ^^^^^^^^^^^^^^^ pattern `[]` not covered
+   |
+   = note: the matched value is of type `[!; N]`
+   = note: match arms with guards don't count towards exhaustivity
+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 ~                 _ if false => {},
+LL +                 [] => todo!()
+   |
+
+error: aborting due to 26 previous errors
 
 For more information about this error, try `rustc --explain E0004`.
diff --git a/tests/ui/pattern/usefulness/empty-match.rs b/tests/ui/pattern/usefulness/empty-match.rs
index 9b22b47a12b..b34427a7c23 100644
--- a/tests/ui/pattern/usefulness/empty-match.rs
+++ b/tests/ui/pattern/usefulness/empty-match.rs
@@ -5,7 +5,7 @@
 #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
 #![deny(unreachable_patterns)]
 
-fn nonempty() {
+fn nonempty<const N: usize>(arrayN_of_empty: [!; N]) {
     macro_rules! match_no_arms {
         ($e:expr) => {
             match $e {}
@@ -42,6 +42,7 @@ fn nonempty() {
         V4,
         V5,
     }
+    let array0_of_empty: [!; 0] = [];
 
     match_no_arms!(0u8); //~ ERROR type `u8` is non-empty
     match_no_arms!(0i8); //~ ERROR type `i8` is non-empty
@@ -54,6 +55,8 @@ fn nonempty() {
     match_no_arms!(NonEmptyEnum1::Foo(true)); //~ ERROR `NonEmptyEnum1::Foo(_)` not covered
     match_no_arms!(NonEmptyEnum2::Foo(true)); //~ ERROR `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
     match_no_arms!(NonEmptyEnum5::V1); //~ ERROR `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
+    match_no_arms!(array0_of_empty); //~ ERROR type `[!; 0]` is non-empty
+    match_no_arms!(arrayN_of_empty); //~ ERROR type `[!; N]` is non-empty
 
     match_guarded_arm!(0u8); //~ ERROR `0_u8..=u8::MAX` not covered
     match_guarded_arm!(0i8); //~ ERROR `i8::MIN..=i8::MAX` not covered
@@ -66,6 +69,8 @@ fn nonempty() {
     match_guarded_arm!(NonEmptyEnum1::Foo(true)); //~ ERROR `NonEmptyEnum1::Foo(_)` not covered
     match_guarded_arm!(NonEmptyEnum2::Foo(true)); //~ ERROR `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
     match_guarded_arm!(NonEmptyEnum5::V1); //~ ERROR `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
+    match_guarded_arm!(array0_of_empty); //~ ERROR `[]` not covered
+    match_guarded_arm!(arrayN_of_empty); //~ ERROR `[]` not covered
 }
 
 fn main() {}
diff --git a/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr
index 416a50b87b5..17cb6fbd94b 100644
--- a/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr
+++ b/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr
@@ -1,18 +1,18 @@
 error: unreachable pattern
-  --> $DIR/empty-types.rs:51:9
+  --> $DIR/empty-types.rs:49:9
    |
 LL |         _ => {}
    |         ^
    |
    = note: this pattern matches no values because `!` is uninhabited
 note: the lint level is defined here
-  --> $DIR/empty-types.rs:17:9
+  --> $DIR/empty-types.rs:15:9
    |
 LL | #![deny(unreachable_patterns)]
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:54:9
+  --> $DIR/empty-types.rs:52:9
    |
 LL |         _x => {}
    |         ^^
@@ -20,7 +20,7 @@ LL |         _x => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error[E0004]: non-exhaustive patterns: type `&!` is non-empty
-  --> $DIR/empty-types.rs:58:11
+  --> $DIR/empty-types.rs:56:11
    |
 LL |     match ref_never {}
    |           ^^^^^^^^^
@@ -35,7 +35,7 @@ LL +     }
    |
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:73:9
+  --> $DIR/empty-types.rs:70:9
    |
 LL |         (_, _) => {}
    |         ^^^^^^
@@ -43,7 +43,7 @@ LL |         (_, _) => {}
    = note: this pattern matches no values because `(u32, !)` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:80:9
+  --> $DIR/empty-types.rs:76:9
    |
 LL |         _ => {}
    |         ^
@@ -51,7 +51,7 @@ LL |         _ => {}
    = note: this pattern matches no values because `(!, !)` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:83:9
+  --> $DIR/empty-types.rs:79:9
    |
 LL |         (_, _) => {}
    |         ^^^^^^
@@ -59,7 +59,7 @@ LL |         (_, _) => {}
    = note: this pattern matches no values because `(!, !)` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:87:9
+  --> $DIR/empty-types.rs:83:9
    |
 LL |         _ => {}
    |         ^
@@ -67,7 +67,7 @@ LL |         _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error[E0004]: non-exhaustive patterns: `Ok(_)` not covered
-  --> $DIR/empty-types.rs:91:11
+  --> $DIR/empty-types.rs:87:11
    |
 LL |     match res_u32_never {}
    |           ^^^^^^^^^^^^^ pattern `Ok(_)` not covered
@@ -86,7 +86,7 @@ LL +     }
    |
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:99:9
+  --> $DIR/empty-types.rs:94:9
    |
 LL |         Err(_) => {}
    |         ^^^^^^
@@ -94,7 +94,7 @@ LL |         Err(_) => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:104:9
+  --> $DIR/empty-types.rs:99:9
    |
 LL |         Err(_) => {}
    |         ^^^^^^
@@ -102,7 +102,7 @@ LL |         Err(_) => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered
-  --> $DIR/empty-types.rs:101:11
+  --> $DIR/empty-types.rs:96:11
    |
 LL |     match res_u32_never {
    |           ^^^^^^^^^^^^^ pattern `Ok(1_u32..=u32::MAX)` not covered
@@ -120,7 +120,7 @@ LL ~         Ok(1_u32..=u32::MAX) => todo!()
    |
 
 error[E0005]: refutable pattern in local binding
-  --> $DIR/empty-types.rs:108:9
+  --> $DIR/empty-types.rs:102:9
    |
 LL |     let Ok(_x) = res_u32_never.as_ref();
    |         ^^^^^^ pattern `Err(_)` not covered
@@ -134,7 +134,7 @@ LL |     let Ok(_x) = res_u32_never.as_ref() else { todo!() };
    |                                         ++++++++++++++++
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:119:9
+  --> $DIR/empty-types.rs:112:9
    |
 LL |         _ => {}
    |         ^
@@ -142,7 +142,7 @@ LL |         _ => {}
    = note: this pattern matches no values because `Result<!, !>` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:123:9
+  --> $DIR/empty-types.rs:115:9
    |
 LL |         Ok(_) => {}
    |         ^^^^^
@@ -150,7 +150,7 @@ LL |         Ok(_) => {}
    = note: this pattern matches no values because `Result<!, !>` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:126:9
+  --> $DIR/empty-types.rs:118:9
    |
 LL |         Ok(_) => {}
    |         ^^^^^
@@ -158,7 +158,7 @@ LL |         Ok(_) => {}
    = note: this pattern matches no values because `Result<!, !>` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:127:9
+  --> $DIR/empty-types.rs:119:9
    |
 LL |         _ => {}
    |         ^
@@ -166,7 +166,7 @@ LL |         _ => {}
    = note: this pattern matches no values because `Result<!, !>` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:130:9
+  --> $DIR/empty-types.rs:122:9
    |
 LL |         Ok(_) => {}
    |         ^^^^^
@@ -174,7 +174,7 @@ LL |         Ok(_) => {}
    = note: this pattern matches no values because `Result<!, !>` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:131:9
+  --> $DIR/empty-types.rs:123:9
    |
 LL |         Err(_) => {}
    |         ^^^^^^
@@ -182,7 +182,7 @@ LL |         Err(_) => {}
    = note: this pattern matches no values because `Result<!, !>` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:140:13
+  --> $DIR/empty-types.rs:132:13
    |
 LL |             _ => {}
    |             ^
@@ -190,7 +190,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:143:13
+  --> $DIR/empty-types.rs:135:13
    |
 LL |             _ if false => {}
    |             ^
@@ -198,7 +198,7 @@ LL |             _ if false => {}
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:152:13
+  --> $DIR/empty-types.rs:143:13
    |
 LL |             Some(_) => {}
    |             ^^^^^^^
@@ -206,7 +206,7 @@ LL |             Some(_) => {}
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:156:13
+  --> $DIR/empty-types.rs:147:13
    |
 LL |             None => {}
    |             ---- matches all the values already
@@ -214,7 +214,7 @@ LL |             _ => {}
    |             ^ unreachable pattern
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:208:13
+  --> $DIR/empty-types.rs:199:13
    |
 LL |             _ => {}
    |             ^
@@ -222,7 +222,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:213:13
+  --> $DIR/empty-types.rs:204:13
    |
 LL |             _ => {}
    |             ^
@@ -230,7 +230,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:218:13
+  --> $DIR/empty-types.rs:209:13
    |
 LL |             _ => {}
    |             ^
@@ -238,7 +238,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:223:13
+  --> $DIR/empty-types.rs:214:13
    |
 LL |             _ => {}
    |             ^
@@ -246,7 +246,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:229:13
+  --> $DIR/empty-types.rs:220:13
    |
 LL |             _ => {}
    |             ^
@@ -254,7 +254,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:288:9
+  --> $DIR/empty-types.rs:279:9
    |
 LL |         _ => {}
    |         ^
@@ -262,7 +262,7 @@ LL |         _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:291:9
+  --> $DIR/empty-types.rs:282:9
    |
 LL |         (_, _) => {}
    |         ^^^^^^
@@ -270,7 +270,7 @@ LL |         (_, _) => {}
    = note: this pattern matches no values because `(!, !)` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:294:9
+  --> $DIR/empty-types.rs:285:9
    |
 LL |         Ok(_) => {}
    |         ^^^^^
@@ -278,7 +278,7 @@ LL |         Ok(_) => {}
    = note: this pattern matches no values because `Result<!, !>` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:295:9
+  --> $DIR/empty-types.rs:286:9
    |
 LL |         Err(_) => {}
    |         ^^^^^^
@@ -286,7 +286,7 @@ LL |         Err(_) => {}
    = note: this pattern matches no values because `Result<!, !>` is uninhabited
 
 error[E0004]: non-exhaustive patterns: type `&[!]` is non-empty
-  --> $DIR/empty-types.rs:327:11
+  --> $DIR/empty-types.rs:318:11
    |
 LL |     match slice_never {}
    |           ^^^^^^^^^^^
@@ -300,7 +300,7 @@ LL +     }
    |
 
 error[E0004]: non-exhaustive patterns: `&[]` not covered
-  --> $DIR/empty-types.rs:338:11
+  --> $DIR/empty-types.rs:329:11
    |
 LL |     match slice_never {
    |           ^^^^^^^^^^^ pattern `&[]` not covered
@@ -313,7 +313,7 @@ LL +         &[] => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `&[]` not covered
-  --> $DIR/empty-types.rs:352:11
+  --> $DIR/empty-types.rs:343:11
    |
 LL |     match slice_never {
    |           ^^^^^^^^^^^ pattern `&[]` not covered
@@ -327,7 +327,7 @@ LL +         &[] => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: type `[!]` is non-empty
-  --> $DIR/empty-types.rs:359:11
+  --> $DIR/empty-types.rs:350:11
    |
 LL |     match *slice_never {}
    |           ^^^^^^^^^^^^
@@ -341,7 +341,7 @@ LL +     }
    |
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:369:9
+  --> $DIR/empty-types.rs:359:9
    |
 LL |         _ => {}
    |         ^
@@ -349,7 +349,7 @@ LL |         _ => {}
    = note: this pattern matches no values because `[!; 3]` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:372:9
+  --> $DIR/empty-types.rs:362:9
    |
 LL |         [_, _, _] => {}
    |         ^^^^^^^^^
@@ -357,7 +357,7 @@ LL |         [_, _, _] => {}
    = note: this pattern matches no values because `[!; 3]` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:375:9
+  --> $DIR/empty-types.rs:365:9
    |
 LL |         [_, ..] => {}
    |         ^^^^^^^
@@ -365,7 +365,7 @@ LL |         [_, ..] => {}
    = note: this pattern matches no values because `[!; 3]` is uninhabited
 
 error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty
-  --> $DIR/empty-types.rs:389:11
+  --> $DIR/empty-types.rs:379:11
    |
 LL |     match array_0_never {}
    |           ^^^^^^^^^^^^^
@@ -379,7 +379,7 @@ LL +     }
    |
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:396:9
+  --> $DIR/empty-types.rs:386:9
    |
 LL |         [] => {}
    |         -- matches all the values already
@@ -387,7 +387,7 @@ LL |         _ => {}
    |         ^ unreachable pattern
 
 error[E0004]: non-exhaustive patterns: `[]` not covered
-  --> $DIR/empty-types.rs:398:11
+  --> $DIR/empty-types.rs:388:11
    |
 LL |     match array_0_never {
    |           ^^^^^^^^^^^^^ pattern `[]` not covered
@@ -401,7 +401,7 @@ LL +         [] => todo!()
    |
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:417:9
+  --> $DIR/empty-types.rs:407:9
    |
 LL |         Some(_) => {}
    |         ^^^^^^^
@@ -409,7 +409,7 @@ LL |         Some(_) => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:422:9
+  --> $DIR/empty-types.rs:412:9
    |
 LL |         Some(_a) => {}
    |         ^^^^^^^^
@@ -417,7 +417,7 @@ LL |         Some(_a) => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:427:9
+  --> $DIR/empty-types.rs:417:9
    |
 LL |         None => {}
    |         ---- matches all the values already
@@ -426,7 +426,7 @@ LL |         _ => {}
    |         ^ unreachable pattern
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:432:9
+  --> $DIR/empty-types.rs:422:9
    |
 LL |         None => {}
    |         ---- matches all the values already
@@ -435,7 +435,7 @@ LL |         _a => {}
    |         ^^ unreachable pattern
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:604:9
+  --> $DIR/empty-types.rs:594:9
    |
 LL |         _ => {}
    |         ^
@@ -443,7 +443,7 @@ LL |         _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:607:9
+  --> $DIR/empty-types.rs:597:9
    |
 LL |         _x => {}
    |         ^^
@@ -451,7 +451,7 @@ LL |         _x => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:610:9
+  --> $DIR/empty-types.rs:600:9
    |
 LL |         _ if false => {}
    |         ^
@@ -459,7 +459,7 @@ LL |         _ if false => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:613:9
+  --> $DIR/empty-types.rs:603:9
    |
 LL |         _x if false => {}
    |         ^^
diff --git a/tests/ui/pattern/usefulness/empty-types.never_pats.stderr b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr
index 4856a2f8e08..1ecb15f2cae 100644
--- a/tests/ui/pattern/usefulness/empty-types.never_pats.stderr
+++ b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr
@@ -1,5 +1,5 @@
 warning: the feature `never_patterns` is incomplete and may not be safe to use and/or cause compiler crashes
-  --> $DIR/empty-types.rs:14:33
+  --> $DIR/empty-types.rs:12:33
    |
 LL | #![cfg_attr(never_pats, feature(never_patterns))]
    |                                 ^^^^^^^^^^^^^^
@@ -8,20 +8,20 @@ LL | #![cfg_attr(never_pats, feature(never_patterns))]
    = note: `#[warn(incomplete_features)]` on by default
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:51:9
+  --> $DIR/empty-types.rs:49:9
    |
 LL |         _ => {}
    |         ^
    |
    = note: this pattern matches no values because `!` is uninhabited
 note: the lint level is defined here
-  --> $DIR/empty-types.rs:17:9
+  --> $DIR/empty-types.rs:15:9
    |
 LL | #![deny(unreachable_patterns)]
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:54:9
+  --> $DIR/empty-types.rs:52:9
    |
 LL |         _x => {}
    |         ^^
@@ -29,7 +29,7 @@ LL |         _x => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error[E0004]: non-exhaustive patterns: type `&!` is non-empty
-  --> $DIR/empty-types.rs:58:11
+  --> $DIR/empty-types.rs:56:11
    |
 LL |     match ref_never {}
    |           ^^^^^^^^^
@@ -43,84 +43,75 @@ LL +         _ => todo!(),
 LL +     }
    |
 
-error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty
-  --> $DIR/empty-types.rs:70:11
-   |
-LL |     match tuple_half_never {}
-   |           ^^^^^^^^^^^^^^^^
-   |
-   = note: the matched value is of type `(u32, !)`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
+error: unreachable pattern
+  --> $DIR/empty-types.rs:70:9
    |
-LL ~     match tuple_half_never {
-LL +         _ => todo!(),
-LL +     }
+LL |         (_, _) => {}
+   |         ^^^^^^
    |
+   = note: this pattern matches no values because `(u32, !)` is uninhabited
 
-error[E0004]: non-exhaustive patterns: type `(!, !)` is non-empty
-  --> $DIR/empty-types.rs:77:11
+error: unreachable pattern
+  --> $DIR/empty-types.rs:76:9
    |
-LL |     match tuple_never {}
-   |           ^^^^^^^^^^^
+LL |         _ => {}
+   |         ^
    |
-   = note: the matched value is of type `(!, !)`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
+   = note: this pattern matches no values because `(!, !)` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:79:9
    |
-LL ~     match tuple_never {
-LL +         _ => todo!(),
-LL +     }
+LL |         (_, _) => {}
+   |         ^^^^^^
    |
+   = note: this pattern matches no values because `(!, !)` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:87:9
+  --> $DIR/empty-types.rs:83:9
    |
 LL |         _ => {}
    |         ^
    |
    = note: this pattern matches no values because `!` is uninhabited
 
-error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(!)` not covered
-  --> $DIR/empty-types.rs:91:11
+error[E0004]: non-exhaustive patterns: `Ok(_)` not covered
+  --> $DIR/empty-types.rs:87:11
    |
 LL |     match res_u32_never {}
-   |           ^^^^^^^^^^^^^ patterns `Ok(_)` and `Err(!)` not covered
+   |           ^^^^^^^^^^^^^ pattern `Ok(_)` not covered
    |
 note: `Result<u32, !>` defined here
   --> $SRC_DIR/core/src/result.rs:LL:COL
   ::: $SRC_DIR/core/src/result.rs:LL:COL
    |
    = note: not covered
-  ::: $SRC_DIR/core/src/result.rs:LL:COL
-   |
-   = note: not covered
    = note: the matched value is of type `Result<u32, !>`
-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
+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 res_u32_never {
-LL +         Ok(_) | Err(!) => todo!(),
+LL +         Ok(_) => todo!(),
 LL +     }
    |
 
-error[E0004]: non-exhaustive patterns: `Err(!)` not covered
-  --> $DIR/empty-types.rs:93:11
+error: unreachable pattern
+  --> $DIR/empty-types.rs:94:9
    |
-LL |     match res_u32_never {
-   |           ^^^^^^^^^^^^^ pattern `Err(!)` not covered
+LL |         Err(_) => {}
+   |         ^^^^^^
    |
-note: `Result<u32, !>` defined here
-  --> $SRC_DIR/core/src/result.rs:LL:COL
-  ::: $SRC_DIR/core/src/result.rs:LL:COL
-   |
-   = note: not covered
-   = note: the matched value is of type `Result<u32, !>`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
+   = note: this pattern matches no values because `!` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:99:9
    |
-LL ~         Ok(_) => {},
-LL +         Err(!)
+LL |         Err(_) => {}
+   |         ^^^^^^
    |
+   = note: this pattern matches no values because `!` is uninhabited
 
 error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered
-  --> $DIR/empty-types.rs:101:11
+  --> $DIR/empty-types.rs:96:11
    |
 LL |     match res_u32_never {
    |           ^^^^^^^^^^^^^ pattern `Ok(1_u32..=u32::MAX)` not covered
@@ -138,21 +129,7 @@ LL ~         Ok(1_u32..=u32::MAX) => todo!()
    |
 
 error[E0005]: refutable pattern in local binding
-  --> $DIR/empty-types.rs:106:9
-   |
-LL |     let Ok(_x) = res_u32_never;
-   |         ^^^^^^ pattern `Err(!)` not covered
-   |
-   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
-   = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
-   = note: the matched value is of type `Result<u32, !>`
-help: you might want to use `let else` to handle the variant that isn't matched
-   |
-LL |     let Ok(_x) = res_u32_never else { todo!() };
-   |                                ++++++++++++++++
-
-error[E0005]: refutable pattern in local binding
-  --> $DIR/empty-types.rs:108:9
+  --> $DIR/empty-types.rs:102:9
    |
 LL |     let Ok(_x) = res_u32_never.as_ref();
    |         ^^^^^^ pattern `Err(_)` not covered
@@ -166,7 +143,7 @@ LL |     let Ok(_x) = res_u32_never.as_ref() else { todo!() };
    |                                         ++++++++++++++++
 
 error[E0005]: refutable pattern in local binding
-  --> $DIR/empty-types.rs:112:9
+  --> $DIR/empty-types.rs:106:9
    |
 LL |     let Ok(_x) = &res_u32_never;
    |         ^^^^^^ pattern `&Err(!)` not covered
@@ -179,47 +156,56 @@ help: you might want to use `let else` to handle the variant that isn't matched
 LL |     let Ok(_x) = &res_u32_never else { todo!() };
    |                                 ++++++++++++++++
 
-error[E0004]: non-exhaustive patterns: `Ok(!)` and `Err(!)` not covered
-  --> $DIR/empty-types.rs:116:11
+error: unreachable pattern
+  --> $DIR/empty-types.rs:112:9
    |
-LL |     match result_never {}
-   |           ^^^^^^^^^^^^ patterns `Ok(!)` and `Err(!)` not covered
+LL |         _ => {}
+   |         ^
    |
-note: `Result<!, !>` defined here
-  --> $SRC_DIR/core/src/result.rs:LL:COL
-  ::: $SRC_DIR/core/src/result.rs:LL:COL
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:115:9
    |
-   = note: not covered
-  ::: $SRC_DIR/core/src/result.rs:LL:COL
+LL |         Ok(_) => {}
+   |         ^^^^^
    |
-   = note: not covered
-   = note: the matched value is of type `Result<!, !>`
-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
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:118:9
    |
-LL ~     match result_never {
-LL +         Ok(!) | Err(!),
-LL +     }
+LL |         Ok(_) => {}
+   |         ^^^^^
    |
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
 
-error[E0004]: non-exhaustive patterns: `Err(!)` not covered
-  --> $DIR/empty-types.rs:121:11
+error: unreachable pattern
+  --> $DIR/empty-types.rs:119:9
    |
-LL |     match result_never {
-   |           ^^^^^^^^^^^^ pattern `Err(!)` not covered
+LL |         _ => {}
+   |         ^
    |
-note: `Result<!, !>` defined here
-  --> $SRC_DIR/core/src/result.rs:LL:COL
-  ::: $SRC_DIR/core/src/result.rs:LL:COL
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:122:9
    |
-   = note: not covered
-   = note: the matched value is of type `Result<!, !>`
-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 |         Ok(_) => {}
+   |         ^^^^^
    |
-LL |         Ok(_) => {}, Err(!)
-   |                    ++++++++
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:140:13
+  --> $DIR/empty-types.rs:123:9
+   |
+LL |         Err(_) => {}
+   |         ^^^^^^
+   |
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:132:13
    |
 LL |             _ => {}
    |             ^
@@ -227,33 +213,31 @@ LL |             _ => {}
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:143:13
+  --> $DIR/empty-types.rs:135:13
    |
 LL |             _ if false => {}
    |             ^
    |
    = note: this pattern matches no values because `Void` is uninhabited
 
-error[E0004]: non-exhaustive patterns: `Some(!)` not covered
-  --> $DIR/empty-types.rs:146:15
-   |
-LL |         match opt_void {
-   |               ^^^^^^^^ pattern `Some(!)` not covered
+error: unreachable pattern
+  --> $DIR/empty-types.rs:143:13
    |
-note: `Option<Void>` defined here
-  --> $SRC_DIR/core/src/option.rs:LL:COL
-  ::: $SRC_DIR/core/src/option.rs:LL:COL
+LL |             Some(_) => {}
+   |             ^^^^^^^
    |
-   = note: not covered
-   = note: the matched value is of type `Option<Void>`
-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 => {},
-LL +             Some(!)
+   = note: this pattern matches no values because `Void` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:147:13
    |
+LL |             None => {}
+   |             ---- matches all the values already
+LL |             _ => {}
+   |             ^ unreachable pattern
 
 error[E0004]: non-exhaustive patterns: `Some(!)` not covered
-  --> $DIR/empty-types.rs:165:15
+  --> $DIR/empty-types.rs:156:15
    |
 LL |         match *ref_opt_void {
    |               ^^^^^^^^^^^^^ pattern `Some(!)` not covered
@@ -264,6 +248,7 @@ note: `Option<Void>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Option<Void>`
+   = note: `Void` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 => {},
@@ -271,7 +256,7 @@ LL +             Some(!)
    |
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:208:13
+  --> $DIR/empty-types.rs:199:13
    |
 LL |             _ => {}
    |             ^
@@ -279,7 +264,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:213:13
+  --> $DIR/empty-types.rs:204:13
    |
 LL |             _ => {}
    |             ^
@@ -287,7 +272,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:218:13
+  --> $DIR/empty-types.rs:209:13
    |
 LL |             _ => {}
    |             ^
@@ -295,7 +280,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:223:13
+  --> $DIR/empty-types.rs:214:13
    |
 LL |             _ => {}
    |             ^
@@ -303,7 +288,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:229:13
+  --> $DIR/empty-types.rs:220:13
    |
 LL |             _ => {}
    |             ^
@@ -311,15 +296,39 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:288:9
+  --> $DIR/empty-types.rs:279:9
    |
 LL |         _ => {}
    |         ^
    |
    = note: this pattern matches no values because `!` is uninhabited
 
+error: unreachable pattern
+  --> $DIR/empty-types.rs:282:9
+   |
+LL |         (_, _) => {}
+   |         ^^^^^^
+   |
+   = note: this pattern matches no values because `(!, !)` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:285:9
+   |
+LL |         Ok(_) => {}
+   |         ^^^^^
+   |
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:286:9
+   |
+LL |         Err(_) => {}
+   |         ^^^^^^
+   |
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
+
 error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty
-  --> $DIR/empty-types.rs:316:11
+  --> $DIR/empty-types.rs:307:11
    |
 LL |     match *x {}
    |           ^^
@@ -333,7 +342,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: type `(!, !)` is non-empty
-  --> $DIR/empty-types.rs:318:11
+  --> $DIR/empty-types.rs:309:11
    |
 LL |     match *x {}
    |           ^^
@@ -347,7 +356,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: `Ok(!)` and `Err(!)` not covered
-  --> $DIR/empty-types.rs:320:11
+  --> $DIR/empty-types.rs:311:11
    |
 LL |     match *x {}
    |           ^^ patterns `Ok(!)` and `Err(!)` not covered
@@ -369,7 +378,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: type `[!; 3]` is non-empty
-  --> $DIR/empty-types.rs:322:11
+  --> $DIR/empty-types.rs:313:11
    |
 LL |     match *x {}
    |           ^^
@@ -383,7 +392,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: type `&[!]` is non-empty
-  --> $DIR/empty-types.rs:327:11
+  --> $DIR/empty-types.rs:318:11
    |
 LL |     match slice_never {}
    |           ^^^^^^^^^^^
@@ -397,12 +406,13 @@ LL +     }
    |
 
 error[E0004]: non-exhaustive patterns: `&[!, ..]` not covered
-  --> $DIR/empty-types.rs:329:11
+  --> $DIR/empty-types.rs:320:11
    |
 LL |     match slice_never {
    |           ^^^^^^^^^^^ pattern `&[!, ..]` not covered
    |
    = note: the matched value is of type `&[!]`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 ~         [] => {},
@@ -410,7 +420,7 @@ LL +         &[!, ..]
    |
 
 error[E0004]: non-exhaustive patterns: `&[]`, `&[!]` and `&[!, !]` not covered
-  --> $DIR/empty-types.rs:338:11
+  --> $DIR/empty-types.rs:329:11
    |
 LL |     match slice_never {
    |           ^^^^^^^^^^^ patterns `&[]`, `&[!]` and `&[!, !]` not covered
@@ -423,7 +433,7 @@ LL +         &[] | &[!] | &[!, !] => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `&[]` and `&[!, ..]` not covered
-  --> $DIR/empty-types.rs:352:11
+  --> $DIR/empty-types.rs:343:11
    |
 LL |     match slice_never {
    |           ^^^^^^^^^^^ patterns `&[]` and `&[!, ..]` not covered
@@ -437,7 +447,7 @@ LL +         &[] | &[!, ..] => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: type `[!]` is non-empty
-  --> $DIR/empty-types.rs:359:11
+  --> $DIR/empty-types.rs:350:11
    |
 LL |     match *slice_never {}
    |           ^^^^^^^^^^^^
@@ -450,22 +460,32 @@ LL +         _ => todo!(),
 LL +     }
    |
 
-error[E0004]: non-exhaustive patterns: type `[!; 3]` is non-empty
-  --> $DIR/empty-types.rs:366:11
+error: unreachable pattern
+  --> $DIR/empty-types.rs:359:9
    |
-LL |     match array_3_never {}
-   |           ^^^^^^^^^^^^^
+LL |         _ => {}
+   |         ^
    |
-   = note: the matched value is of type `[!; 3]`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
+   = note: this pattern matches no values because `[!; 3]` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:362:9
    |
-LL ~     match array_3_never {
-LL +         _ => todo!(),
-LL +     }
+LL |         [_, _, _] => {}
+   |         ^^^^^^^^^
    |
+   = note: this pattern matches no values because `[!; 3]` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:365:9
+   |
+LL |         [_, ..] => {}
+   |         ^^^^^^^
+   |
+   = note: this pattern matches no values because `[!; 3]` is uninhabited
 
 error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty
-  --> $DIR/empty-types.rs:389:11
+  --> $DIR/empty-types.rs:379:11
    |
 LL |     match array_0_never {}
    |           ^^^^^^^^^^^^^
@@ -479,7 +499,7 @@ LL +     }
    |
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:396:9
+  --> $DIR/empty-types.rs:386:9
    |
 LL |         [] => {}
    |         -- matches all the values already
@@ -487,7 +507,7 @@ LL |         _ => {}
    |         ^ unreachable pattern
 
 error[E0004]: non-exhaustive patterns: `[]` not covered
-  --> $DIR/empty-types.rs:398:11
+  --> $DIR/empty-types.rs:388:11
    |
 LL |     match array_0_never {
    |           ^^^^^^^^^^^^^ pattern `[]` not covered
@@ -500,8 +520,42 @@ LL ~         [..] if false => {},
 LL +         [] => todo!()
    |
 
+error: unreachable pattern
+  --> $DIR/empty-types.rs:407:9
+   |
+LL |         Some(_) => {}
+   |         ^^^^^^^
+   |
+   = note: this pattern matches no values because `!` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:412:9
+   |
+LL |         Some(_a) => {}
+   |         ^^^^^^^^
+   |
+   = note: this pattern matches no values because `!` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:417:9
+   |
+LL |         None => {}
+   |         ---- matches all the values already
+LL |         // !useful, !reachable
+LL |         _ => {}
+   |         ^ unreachable pattern
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:422:9
+   |
+LL |         None => {}
+   |         ---- matches all the values already
+LL |         // !useful, !reachable
+LL |         _a => {}
+   |         ^^ unreachable pattern
+
 error[E0004]: non-exhaustive patterns: `&Some(!)` not covered
-  --> $DIR/empty-types.rs:452:11
+  --> $DIR/empty-types.rs:442:11
    |
 LL |     match ref_opt_never {
    |           ^^^^^^^^^^^^^ pattern `&Some(!)` not covered
@@ -512,6 +566,7 @@ note: `Option<!>` defined here
    |
    = note: not covered
    = note: the matched value is of type `&Option<!>`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 => {},
@@ -519,7 +574,7 @@ LL +         &Some(!)
    |
 
 error[E0004]: non-exhaustive patterns: `Some(!)` not covered
-  --> $DIR/empty-types.rs:493:11
+  --> $DIR/empty-types.rs:483:11
    |
 LL |     match *ref_opt_never {
    |           ^^^^^^^^^^^^^^ pattern `Some(!)` not covered
@@ -530,6 +585,7 @@ note: `Option<!>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Option<!>`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 => {},
@@ -537,7 +593,7 @@ LL +         Some(!)
    |
 
 error[E0004]: non-exhaustive patterns: `Err(!)` not covered
-  --> $DIR/empty-types.rs:541:11
+  --> $DIR/empty-types.rs:531:11
    |
 LL |     match *ref_res_never {
    |           ^^^^^^^^^^^^^^ pattern `Err(!)` not covered
@@ -548,6 +604,7 @@ note: `Result<!, !>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Result<!, !>`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 ~         Ok(_) => {},
@@ -555,7 +612,7 @@ LL +         Err(!)
    |
 
 error[E0004]: non-exhaustive patterns: `Err(!)` not covered
-  --> $DIR/empty-types.rs:552:11
+  --> $DIR/empty-types.rs:542:11
    |
 LL |     match *ref_res_never {
    |           ^^^^^^^^^^^^^^ pattern `Err(!)` not covered
@@ -566,6 +623,7 @@ note: `Result<!, !>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Result<!, !>`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 ~         Ok(_a) => {},
@@ -573,7 +631,7 @@ LL +         Err(!)
    |
 
 error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty
-  --> $DIR/empty-types.rs:571:11
+  --> $DIR/empty-types.rs:561:11
    |
 LL |     match *ref_tuple_half_never {}
    |           ^^^^^^^^^^^^^^^^^^^^^
@@ -587,7 +645,7 @@ LL +     }
    |
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:604:9
+  --> $DIR/empty-types.rs:594:9
    |
 LL |         _ => {}
    |         ^
@@ -595,7 +653,7 @@ LL |         _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:607:9
+  --> $DIR/empty-types.rs:597:9
    |
 LL |         _x => {}
    |         ^^
@@ -603,7 +661,7 @@ LL |         _x => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:610:9
+  --> $DIR/empty-types.rs:600:9
    |
 LL |         _ if false => {}
    |         ^
@@ -611,7 +669,7 @@ LL |         _ if false => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:613:9
+  --> $DIR/empty-types.rs:603:9
    |
 LL |         _x if false => {}
    |         ^^
@@ -619,12 +677,13 @@ LL |         _x if false => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error[E0004]: non-exhaustive patterns: `&!` not covered
-  --> $DIR/empty-types.rs:638:11
+  --> $DIR/empty-types.rs:628:11
    |
 LL |     match ref_never {
    |           ^^^^^^^^^ pattern `&!` not covered
    |
    = note: the matched value is of type `&!`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
    = note: references are always considered inhabited
    = note: match arms with guards don't count towards exhaustivity
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
@@ -634,7 +693,7 @@ LL +         &!
    |
 
 error[E0004]: non-exhaustive patterns: `Ok(!)` not covered
-  --> $DIR/empty-types.rs:654:11
+  --> $DIR/empty-types.rs:644:11
    |
 LL |     match *ref_result_never {
    |           ^^^^^^^^^^^^^^^^^ pattern `Ok(!)` not covered
@@ -645,6 +704,7 @@ note: `Result<!, !>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Result<!, !>`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 ~         Err(_) => {},
@@ -652,7 +712,7 @@ LL +         Ok(!)
    |
 
 error[E0004]: non-exhaustive patterns: `Some(!)` not covered
-  --> $DIR/empty-types.rs:674:11
+  --> $DIR/empty-types.rs:664:11
    |
 LL |     match *x {
    |           ^^ pattern `Some(!)` not covered
@@ -663,13 +723,14 @@ note: `Option<Result<!, !>>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Option<Result<!, !>>`
+   = note: `Result<!, !>` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 => {},
 LL +         Some(!)
    |
 
-error: aborting due to 49 previous errors; 1 warning emitted
+error: aborting due to 64 previous errors; 1 warning emitted
 
 Some errors have detailed explanations: E0004, E0005.
 For more information about an error, try `rustc --explain E0004`.
diff --git a/tests/ui/pattern/usefulness/empty-types.normal.stderr b/tests/ui/pattern/usefulness/empty-types.normal.stderr
index 78db9ee349b..c3421cd592e 100644
--- a/tests/ui/pattern/usefulness/empty-types.normal.stderr
+++ b/tests/ui/pattern/usefulness/empty-types.normal.stderr
@@ -1,18 +1,18 @@
 error: unreachable pattern
-  --> $DIR/empty-types.rs:51:9
+  --> $DIR/empty-types.rs:49:9
    |
 LL |         _ => {}
    |         ^
    |
    = note: this pattern matches no values because `!` is uninhabited
 note: the lint level is defined here
-  --> $DIR/empty-types.rs:17:9
+  --> $DIR/empty-types.rs:15:9
    |
 LL | #![deny(unreachable_patterns)]
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:54:9
+  --> $DIR/empty-types.rs:52:9
    |
 LL |         _x => {}
    |         ^^
@@ -20,7 +20,7 @@ LL |         _x => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error[E0004]: non-exhaustive patterns: type `&!` is non-empty
-  --> $DIR/empty-types.rs:58:11
+  --> $DIR/empty-types.rs:56:11
    |
 LL |     match ref_never {}
    |           ^^^^^^^^^
@@ -34,84 +34,75 @@ LL +         _ => todo!(),
 LL +     }
    |
 
-error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty
-  --> $DIR/empty-types.rs:70:11
-   |
-LL |     match tuple_half_never {}
-   |           ^^^^^^^^^^^^^^^^
-   |
-   = note: the matched value is of type `(u32, !)`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
+error: unreachable pattern
+  --> $DIR/empty-types.rs:70:9
    |
-LL ~     match tuple_half_never {
-LL +         _ => todo!(),
-LL +     }
+LL |         (_, _) => {}
+   |         ^^^^^^
    |
+   = note: this pattern matches no values because `(u32, !)` is uninhabited
 
-error[E0004]: non-exhaustive patterns: type `(!, !)` is non-empty
-  --> $DIR/empty-types.rs:77:11
+error: unreachable pattern
+  --> $DIR/empty-types.rs:76:9
    |
-LL |     match tuple_never {}
-   |           ^^^^^^^^^^^
+LL |         _ => {}
+   |         ^
    |
-   = note: the matched value is of type `(!, !)`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
+   = note: this pattern matches no values because `(!, !)` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:79:9
    |
-LL ~     match tuple_never {
-LL +         _ => todo!(),
-LL +     }
+LL |         (_, _) => {}
+   |         ^^^^^^
    |
+   = note: this pattern matches no values because `(!, !)` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:87:9
+  --> $DIR/empty-types.rs:83:9
    |
 LL |         _ => {}
    |         ^
    |
    = note: this pattern matches no values because `!` is uninhabited
 
-error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(_)` not covered
-  --> $DIR/empty-types.rs:91:11
+error[E0004]: non-exhaustive patterns: `Ok(_)` not covered
+  --> $DIR/empty-types.rs:87:11
    |
 LL |     match res_u32_never {}
-   |           ^^^^^^^^^^^^^ patterns `Ok(_)` and `Err(_)` not covered
+   |           ^^^^^^^^^^^^^ pattern `Ok(_)` not covered
    |
 note: `Result<u32, !>` defined here
   --> $SRC_DIR/core/src/result.rs:LL:COL
   ::: $SRC_DIR/core/src/result.rs:LL:COL
    |
    = note: not covered
-  ::: $SRC_DIR/core/src/result.rs:LL:COL
-   |
-   = note: not covered
    = note: the matched value is of type `Result<u32, !>`
-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
+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 res_u32_never {
-LL +         Ok(_) | Err(_) => todo!(),
+LL +         Ok(_) => todo!(),
 LL +     }
    |
 
-error[E0004]: non-exhaustive patterns: `Err(_)` not covered
-  --> $DIR/empty-types.rs:93:11
-   |
-LL |     match res_u32_never {
-   |           ^^^^^^^^^^^^^ pattern `Err(_)` not covered
+error: unreachable pattern
+  --> $DIR/empty-types.rs:94:9
    |
-note: `Result<u32, !>` defined here
-  --> $SRC_DIR/core/src/result.rs:LL:COL
-  ::: $SRC_DIR/core/src/result.rs:LL:COL
+LL |         Err(_) => {}
+   |         ^^^^^^
    |
-   = note: not covered
-   = note: the matched value is of type `Result<u32, !>`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
+   = note: this pattern matches no values because `!` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:99:9
    |
-LL ~         Ok(_) => {},
-LL +         Err(_) => todo!()
+LL |         Err(_) => {}
+   |         ^^^^^^
    |
+   = note: this pattern matches no values because `!` is uninhabited
 
 error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered
-  --> $DIR/empty-types.rs:101:11
+  --> $DIR/empty-types.rs:96:11
    |
 LL |     match res_u32_never {
    |           ^^^^^^^^^^^^^ pattern `Ok(1_u32..=u32::MAX)` not covered
@@ -129,21 +120,7 @@ LL ~         Ok(1_u32..=u32::MAX) => todo!()
    |
 
 error[E0005]: refutable pattern in local binding
-  --> $DIR/empty-types.rs:106:9
-   |
-LL |     let Ok(_x) = res_u32_never;
-   |         ^^^^^^ pattern `Err(_)` not covered
-   |
-   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
-   = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
-   = note: the matched value is of type `Result<u32, !>`
-help: you might want to use `let else` to handle the variant that isn't matched
-   |
-LL |     let Ok(_x) = res_u32_never else { todo!() };
-   |                                ++++++++++++++++
-
-error[E0005]: refutable pattern in local binding
-  --> $DIR/empty-types.rs:108:9
+  --> $DIR/empty-types.rs:102:9
    |
 LL |     let Ok(_x) = res_u32_never.as_ref();
    |         ^^^^^^ pattern `Err(_)` not covered
@@ -157,7 +134,7 @@ LL |     let Ok(_x) = res_u32_never.as_ref() else { todo!() };
    |                                         ++++++++++++++++
 
 error[E0005]: refutable pattern in local binding
-  --> $DIR/empty-types.rs:112:9
+  --> $DIR/empty-types.rs:106:9
    |
 LL |     let Ok(_x) = &res_u32_never;
    |         ^^^^^^ pattern `&Err(_)` not covered
@@ -170,47 +147,56 @@ help: you might want to use `let else` to handle the variant that isn't matched
 LL |     let Ok(_x) = &res_u32_never else { todo!() };
    |                                 ++++++++++++++++
 
-error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(_)` not covered
-  --> $DIR/empty-types.rs:116:11
+error: unreachable pattern
+  --> $DIR/empty-types.rs:112:9
    |
-LL |     match result_never {}
-   |           ^^^^^^^^^^^^ patterns `Ok(_)` and `Err(_)` not covered
+LL |         _ => {}
+   |         ^
    |
-note: `Result<!, !>` defined here
-  --> $SRC_DIR/core/src/result.rs:LL:COL
-  ::: $SRC_DIR/core/src/result.rs:LL:COL
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:115:9
    |
-   = note: not covered
-  ::: $SRC_DIR/core/src/result.rs:LL:COL
+LL |         Ok(_) => {}
+   |         ^^^^^
    |
-   = note: not covered
-   = note: the matched value is of type `Result<!, !>`
-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
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:118:9
    |
-LL ~     match result_never {
-LL +         Ok(_) | Err(_) => todo!(),
-LL +     }
+LL |         Ok(_) => {}
+   |         ^^^^^
    |
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
 
-error[E0004]: non-exhaustive patterns: `Err(_)` not covered
-  --> $DIR/empty-types.rs:121:11
+error: unreachable pattern
+  --> $DIR/empty-types.rs:119:9
    |
-LL |     match result_never {
-   |           ^^^^^^^^^^^^ pattern `Err(_)` not covered
+LL |         _ => {}
+   |         ^
    |
-note: `Result<!, !>` defined here
-  --> $SRC_DIR/core/src/result.rs:LL:COL
-  ::: $SRC_DIR/core/src/result.rs:LL:COL
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:122:9
    |
-   = note: not covered
-   = note: the matched value is of type `Result<!, !>`
-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 |         Ok(_) => {}
+   |         ^^^^^
+   |
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:123:9
    |
-LL |         Ok(_) => {}, Err(_) => todo!()
-   |                    +++++++++++++++++++
+LL |         Err(_) => {}
+   |         ^^^^^^
+   |
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:140:13
+  --> $DIR/empty-types.rs:132:13
    |
 LL |             _ => {}
    |             ^
@@ -218,33 +204,31 @@ LL |             _ => {}
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:143:13
+  --> $DIR/empty-types.rs:135:13
    |
 LL |             _ if false => {}
    |             ^
    |
    = note: this pattern matches no values because `Void` is uninhabited
 
-error[E0004]: non-exhaustive patterns: `Some(_)` not covered
-  --> $DIR/empty-types.rs:146:15
-   |
-LL |         match opt_void {
-   |               ^^^^^^^^ pattern `Some(_)` not covered
-   |
-note: `Option<Void>` defined here
-  --> $SRC_DIR/core/src/option.rs:LL:COL
-  ::: $SRC_DIR/core/src/option.rs:LL:COL
+error: unreachable pattern
+  --> $DIR/empty-types.rs:143:13
    |
-   = note: not covered
-   = note: the matched value is of type `Option<Void>`
-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 |             Some(_) => {}
+   |             ^^^^^^^
    |
-LL ~             None => {},
-LL +             Some(_) => todo!()
+   = note: this pattern matches no values because `Void` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:147:13
    |
+LL |             None => {}
+   |             ---- matches all the values already
+LL |             _ => {}
+   |             ^ unreachable pattern
 
 error[E0004]: non-exhaustive patterns: `Some(_)` not covered
-  --> $DIR/empty-types.rs:165:15
+  --> $DIR/empty-types.rs:156:15
    |
 LL |         match *ref_opt_void {
    |               ^^^^^^^^^^^^^ pattern `Some(_)` not covered
@@ -255,6 +239,7 @@ note: `Option<Void>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Option<Void>`
+   = note: `Void` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 => {},
@@ -262,7 +247,7 @@ LL +             Some(_) => todo!()
    |
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:208:13
+  --> $DIR/empty-types.rs:199:13
    |
 LL |             _ => {}
    |             ^
@@ -270,7 +255,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:213:13
+  --> $DIR/empty-types.rs:204:13
    |
 LL |             _ => {}
    |             ^
@@ -278,7 +263,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:218:13
+  --> $DIR/empty-types.rs:209:13
    |
 LL |             _ => {}
    |             ^
@@ -286,7 +271,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:223:13
+  --> $DIR/empty-types.rs:214:13
    |
 LL |             _ => {}
    |             ^
@@ -294,7 +279,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:229:13
+  --> $DIR/empty-types.rs:220:13
    |
 LL |             _ => {}
    |             ^
@@ -302,15 +287,39 @@ LL |             _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:288:9
+  --> $DIR/empty-types.rs:279:9
    |
 LL |         _ => {}
    |         ^
    |
    = note: this pattern matches no values because `!` is uninhabited
 
+error: unreachable pattern
+  --> $DIR/empty-types.rs:282:9
+   |
+LL |         (_, _) => {}
+   |         ^^^^^^
+   |
+   = note: this pattern matches no values because `(!, !)` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:285:9
+   |
+LL |         Ok(_) => {}
+   |         ^^^^^
+   |
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:286:9
+   |
+LL |         Err(_) => {}
+   |         ^^^^^^
+   |
+   = note: this pattern matches no values because `Result<!, !>` is uninhabited
+
 error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty
-  --> $DIR/empty-types.rs:316:11
+  --> $DIR/empty-types.rs:307:11
    |
 LL |     match *x {}
    |           ^^
@@ -324,7 +333,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: type `(!, !)` is non-empty
-  --> $DIR/empty-types.rs:318:11
+  --> $DIR/empty-types.rs:309:11
    |
 LL |     match *x {}
    |           ^^
@@ -338,7 +347,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(_)` not covered
-  --> $DIR/empty-types.rs:320:11
+  --> $DIR/empty-types.rs:311:11
    |
 LL |     match *x {}
    |           ^^ patterns `Ok(_)` and `Err(_)` not covered
@@ -360,7 +369,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: type `[!; 3]` is non-empty
-  --> $DIR/empty-types.rs:322:11
+  --> $DIR/empty-types.rs:313:11
    |
 LL |     match *x {}
    |           ^^
@@ -374,7 +383,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: type `&[!]` is non-empty
-  --> $DIR/empty-types.rs:327:11
+  --> $DIR/empty-types.rs:318:11
    |
 LL |     match slice_never {}
    |           ^^^^^^^^^^^
@@ -388,12 +397,13 @@ LL +     }
    |
 
 error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
-  --> $DIR/empty-types.rs:329:11
+  --> $DIR/empty-types.rs:320:11
    |
 LL |     match slice_never {
    |           ^^^^^^^^^^^ pattern `&[_, ..]` not covered
    |
    = note: the matched value is of type `&[!]`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 ~         [] => {},
@@ -401,7 +411,7 @@ LL +         &[_, ..] => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `&[]`, `&[_]` and `&[_, _]` not covered
-  --> $DIR/empty-types.rs:338:11
+  --> $DIR/empty-types.rs:329:11
    |
 LL |     match slice_never {
    |           ^^^^^^^^^^^ patterns `&[]`, `&[_]` and `&[_, _]` not covered
@@ -414,7 +424,7 @@ LL +         &[] | &[_] | &[_, _] => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `&[]` and `&[_, ..]` not covered
-  --> $DIR/empty-types.rs:352:11
+  --> $DIR/empty-types.rs:343:11
    |
 LL |     match slice_never {
    |           ^^^^^^^^^^^ patterns `&[]` and `&[_, ..]` not covered
@@ -428,7 +438,7 @@ LL +         &[] | &[_, ..] => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: type `[!]` is non-empty
-  --> $DIR/empty-types.rs:359:11
+  --> $DIR/empty-types.rs:350:11
    |
 LL |     match *slice_never {}
    |           ^^^^^^^^^^^^
@@ -441,22 +451,32 @@ LL +         _ => todo!(),
 LL +     }
    |
 
-error[E0004]: non-exhaustive patterns: type `[!; 3]` is non-empty
-  --> $DIR/empty-types.rs:366:11
+error: unreachable pattern
+  --> $DIR/empty-types.rs:359:9
    |
-LL |     match array_3_never {}
-   |           ^^^^^^^^^^^^^
+LL |         _ => {}
+   |         ^
    |
-   = note: the matched value is of type `[!; 3]`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
+   = note: this pattern matches no values because `[!; 3]` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:362:9
    |
-LL ~     match array_3_never {
-LL +         _ => todo!(),
-LL +     }
+LL |         [_, _, _] => {}
+   |         ^^^^^^^^^
+   |
+   = note: this pattern matches no values because `[!; 3]` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:365:9
+   |
+LL |         [_, ..] => {}
+   |         ^^^^^^^
    |
+   = note: this pattern matches no values because `[!; 3]` is uninhabited
 
 error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty
-  --> $DIR/empty-types.rs:389:11
+  --> $DIR/empty-types.rs:379:11
    |
 LL |     match array_0_never {}
    |           ^^^^^^^^^^^^^
@@ -470,7 +490,7 @@ LL +     }
    |
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:396:9
+  --> $DIR/empty-types.rs:386:9
    |
 LL |         [] => {}
    |         -- matches all the values already
@@ -478,7 +498,7 @@ LL |         _ => {}
    |         ^ unreachable pattern
 
 error[E0004]: non-exhaustive patterns: `[]` not covered
-  --> $DIR/empty-types.rs:398:11
+  --> $DIR/empty-types.rs:388:11
    |
 LL |     match array_0_never {
    |           ^^^^^^^^^^^^^ pattern `[]` not covered
@@ -491,8 +511,42 @@ LL ~         [..] if false => {},
 LL +         [] => todo!()
    |
 
+error: unreachable pattern
+  --> $DIR/empty-types.rs:407:9
+   |
+LL |         Some(_) => {}
+   |         ^^^^^^^
+   |
+   = note: this pattern matches no values because `!` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:412:9
+   |
+LL |         Some(_a) => {}
+   |         ^^^^^^^^
+   |
+   = note: this pattern matches no values because `!` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:417:9
+   |
+LL |         None => {}
+   |         ---- matches all the values already
+LL |         // !useful, !reachable
+LL |         _ => {}
+   |         ^ unreachable pattern
+
+error: unreachable pattern
+  --> $DIR/empty-types.rs:422:9
+   |
+LL |         None => {}
+   |         ---- matches all the values already
+LL |         // !useful, !reachable
+LL |         _a => {}
+   |         ^^ unreachable pattern
+
 error[E0004]: non-exhaustive patterns: `&Some(_)` not covered
-  --> $DIR/empty-types.rs:452:11
+  --> $DIR/empty-types.rs:442:11
    |
 LL |     match ref_opt_never {
    |           ^^^^^^^^^^^^^ pattern `&Some(_)` not covered
@@ -503,6 +557,7 @@ note: `Option<!>` defined here
    |
    = note: not covered
    = note: the matched value is of type `&Option<!>`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 => {},
@@ -510,7 +565,7 @@ LL +         &Some(_) => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `Some(_)` not covered
-  --> $DIR/empty-types.rs:493:11
+  --> $DIR/empty-types.rs:483:11
    |
 LL |     match *ref_opt_never {
    |           ^^^^^^^^^^^^^^ pattern `Some(_)` not covered
@@ -521,6 +576,7 @@ note: `Option<!>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Option<!>`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 => {},
@@ -528,7 +584,7 @@ LL +         Some(_) => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `Err(_)` not covered
-  --> $DIR/empty-types.rs:541:11
+  --> $DIR/empty-types.rs:531:11
    |
 LL |     match *ref_res_never {
    |           ^^^^^^^^^^^^^^ pattern `Err(_)` not covered
@@ -539,6 +595,7 @@ note: `Result<!, !>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Result<!, !>`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 ~         Ok(_) => {},
@@ -546,7 +603,7 @@ LL +         Err(_) => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `Err(_)` not covered
-  --> $DIR/empty-types.rs:552:11
+  --> $DIR/empty-types.rs:542:11
    |
 LL |     match *ref_res_never {
    |           ^^^^^^^^^^^^^^ pattern `Err(_)` not covered
@@ -557,6 +614,7 @@ note: `Result<!, !>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Result<!, !>`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 ~         Ok(_a) => {},
@@ -564,7 +622,7 @@ LL +         Err(_) => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty
-  --> $DIR/empty-types.rs:571:11
+  --> $DIR/empty-types.rs:561:11
    |
 LL |     match *ref_tuple_half_never {}
    |           ^^^^^^^^^^^^^^^^^^^^^
@@ -578,7 +636,7 @@ LL +     }
    |
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:604:9
+  --> $DIR/empty-types.rs:594:9
    |
 LL |         _ => {}
    |         ^
@@ -586,7 +644,7 @@ LL |         _ => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:607:9
+  --> $DIR/empty-types.rs:597:9
    |
 LL |         _x => {}
    |         ^^
@@ -594,7 +652,7 @@ LL |         _x => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:610:9
+  --> $DIR/empty-types.rs:600:9
    |
 LL |         _ if false => {}
    |         ^
@@ -602,7 +660,7 @@ LL |         _ if false => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/empty-types.rs:613:9
+  --> $DIR/empty-types.rs:603:9
    |
 LL |         _x if false => {}
    |         ^^
@@ -610,12 +668,13 @@ LL |         _x if false => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error[E0004]: non-exhaustive patterns: `&_` not covered
-  --> $DIR/empty-types.rs:638:11
+  --> $DIR/empty-types.rs:628:11
    |
 LL |     match ref_never {
    |           ^^^^^^^^^ pattern `&_` not covered
    |
    = note: the matched value is of type `&!`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
    = note: references are always considered inhabited
    = note: match arms with guards don't count towards exhaustivity
 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
@@ -625,7 +684,7 @@ LL +         &_ => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `Ok(_)` not covered
-  --> $DIR/empty-types.rs:654:11
+  --> $DIR/empty-types.rs:644:11
    |
 LL |     match *ref_result_never {
    |           ^^^^^^^^^^^^^^^^^ pattern `Ok(_)` not covered
@@ -636,6 +695,7 @@ note: `Result<!, !>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Result<!, !>`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 ~         Err(_) => {},
@@ -643,7 +703,7 @@ LL +         Ok(_) => todo!()
    |
 
 error[E0004]: non-exhaustive patterns: `Some(_)` not covered
-  --> $DIR/empty-types.rs:674:11
+  --> $DIR/empty-types.rs:664:11
    |
 LL |     match *x {
    |           ^^ pattern `Some(_)` not covered
@@ -654,13 +714,14 @@ note: `Option<Result<!, !>>` defined here
    |
    = note: not covered
    = note: the matched value is of type `Option<Result<!, !>>`
+   = note: `Result<!, !>` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 => {},
 LL +         Some(_) => todo!()
    |
 
-error: aborting due to 49 previous errors
+error: aborting due to 64 previous errors
 
 Some errors have detailed explanations: E0004, E0005.
 For more information about an error, try `rustc --explain E0004`.
diff --git a/tests/ui/pattern/usefulness/empty-types.rs b/tests/ui/pattern/usefulness/empty-types.rs
index cc71f67831d..639c48cea12 100644
--- a/tests/ui/pattern/usefulness/empty-types.rs
+++ b/tests/ui/pattern/usefulness/empty-types.rs
@@ -1,5 +1,4 @@
-//@ revisions: normal min_exh_pats exhaustive_patterns never_pats
-// gate-test-min_exhaustive_patterns
+//@ revisions: normal exhaustive_patterns never_pats
 //
 // This tests correct handling of empty types in exhaustiveness checking.
 //
@@ -10,7 +9,6 @@
 // This feature is useful to avoid `!` falling back to `()` all the time.
 #![feature(never_type_fallback)]
 #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
-#![cfg_attr(min_exh_pats, feature(min_exhaustive_patterns))]
 #![cfg_attr(never_pats, feature(never_patterns))]
 //[never_pats]~^ WARN the feature `never_patterns` is incomplete
 #![allow(dead_code, unreachable_code)]
@@ -68,19 +66,17 @@ fn basic(x: NeverBundle) {
 
     let tuple_half_never: (u32, !) = x.tuple_half_never;
     match tuple_half_never {}
-    //[normal,never_pats]~^ ERROR non-empty
     match tuple_half_never {
-        (_, _) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        (_, _) => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
 
     let tuple_never: (!, !) = x.tuple_never;
     match tuple_never {}
-    //[normal,never_pats]~^ ERROR non-empty
     match tuple_never {
-        _ => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        _ => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
     match tuple_never {
-        (_, _) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        (_, _) => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
     match tuple_never.0 {}
     match tuple_never.0 {
@@ -91,44 +87,40 @@ fn basic(x: NeverBundle) {
     match res_u32_never {}
     //~^ ERROR non-exhaustive
     match res_u32_never {
-        //[normal,never_pats]~^ ERROR non-exhaustive
         Ok(_) => {}
     }
     match res_u32_never {
         Ok(_) => {}
-        Err(_) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        Err(_) => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
     match res_u32_never {
         //~^ ERROR non-exhaustive
         Ok(0) => {}
-        Err(_) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        Err(_) => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
     let Ok(_x) = res_u32_never;
-    //[normal,never_pats]~^ ERROR refutable
     let Ok(_x) = res_u32_never.as_ref();
     //~^ ERROR refutable
     // Non-obvious difference: here there's an implicit dereference in the patterns, which makes the
     // inner place !known_valid. `exhaustive_patterns` ignores this.
     let Ok(_x) = &res_u32_never;
-    //[normal,min_exh_pats,never_pats]~^ ERROR refutable
+    //[normal,never_pats]~^ ERROR refutable
 
     let result_never: Result<!, !> = x.result_never;
     match result_never {}
-    //[normal,never_pats]~^ ERROR non-exhaustive
     match result_never {
-        _ => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        _ => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
     match result_never {
-        //[normal,never_pats]~^ ERROR non-exhaustive
-        Ok(_) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        Ok(_) => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
     match result_never {
-        Ok(_) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
-        _ => {}     //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        Ok(_) => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
+        _ => {}     //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
     match result_never {
-        Ok(_) => {}  //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
-        Err(_) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        Ok(_) => {}  //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
+        Err(_) => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
 }
 
@@ -144,16 +136,15 @@ fn void_same_as_never(x: NeverBundle) {
         }
         let opt_void: Option<Void> = None;
         match opt_void {
-            //[normal,never_pats]~^ ERROR non-exhaustive
             None => {}
         }
         match opt_void {
             None => {}
-            Some(_) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+            Some(_) => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
         }
         match opt_void {
             None => {}
-            _ => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+            _ => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
         }
 
         let ref_void: &Void = &x.void;
@@ -163,7 +154,7 @@ fn void_same_as_never(x: NeverBundle) {
         }
         let ref_opt_void: &Option<Void> = &None;
         match *ref_opt_void {
-            //[normal,min_exh_pats,never_pats]~^ ERROR non-exhaustive
+            //[normal,never_pats]~^ ERROR non-exhaustive
             None => {}
         }
         match *ref_opt_void {
@@ -288,11 +279,11 @@ fn nested_validity_tracking(bundle: NeverBundle) {
         _ => {} //~ ERROR unreachable pattern
     }
     match tuple_never {
-        (_, _) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        (_, _) => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
     match result_never {
-        Ok(_) => {}  //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
-        Err(_) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        Ok(_) => {}  //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
+        Err(_) => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
 
     // These should be considered !known_valid and not warn unreachable.
@@ -313,13 +304,13 @@ fn invalid_empty_match(bundle: NeverBundle) {
     match *x {}
 
     let x: &(u32, !) = &bundle.tuple_half_never;
-    match *x {} //[normal,min_exh_pats,never_pats]~ ERROR non-exhaustive
+    match *x {} //[normal,never_pats]~ ERROR non-exhaustive
     let x: &(!, !) = &bundle.tuple_never;
-    match *x {} //[normal,min_exh_pats,never_pats]~ ERROR non-exhaustive
+    match *x {} //[normal,never_pats]~ ERROR non-exhaustive
     let x: &Result<!, !> = &bundle.result_never;
-    match *x {} //[normal,min_exh_pats,never_pats]~ ERROR non-exhaustive
+    match *x {} //[normal,never_pats]~ ERROR non-exhaustive
     let x: &[!; 3] = &bundle.array_3_never;
-    match *x {} //[normal,min_exh_pats,never_pats]~ ERROR non-exhaustive
+    match *x {} //[normal,never_pats]~ ERROR non-exhaustive
 }
 
 fn arrays_and_slices(x: NeverBundle) {
@@ -327,7 +318,7 @@ fn arrays_and_slices(x: NeverBundle) {
     match slice_never {}
     //~^ ERROR non-empty
     match slice_never {
-        //[normal,min_exh_pats,never_pats]~^ ERROR not covered
+        //[normal,never_pats]~^ ERROR not covered
         [] => {}
     }
     match slice_never {
@@ -336,7 +327,7 @@ fn arrays_and_slices(x: NeverBundle) {
         [_, _, ..] => {}
     }
     match slice_never {
-        //[normal,min_exh_pats]~^ ERROR `&[]`, `&[_]` and `&[_, _]` not covered
+        //[normal]~^ ERROR `&[]`, `&[_]` and `&[_, _]` not covered
         //[exhaustive_patterns]~^^ ERROR `&[]` not covered
         //[never_pats]~^^^ ERROR `&[]`, `&[!]` and `&[!, !]` not covered
         [_, _, _, ..] => {}
@@ -350,7 +341,7 @@ fn arrays_and_slices(x: NeverBundle) {
         _x => {}
     }
     match slice_never {
-        //[normal,min_exh_pats]~^ ERROR `&[]` and `&[_, ..]` not covered
+        //[normal]~^ ERROR `&[]` and `&[_, ..]` not covered
         //[exhaustive_patterns]~^^ ERROR `&[]` not covered
         //[never_pats]~^^^ ERROR `&[]` and `&[!, ..]` not covered
         &[..] if false => {}
@@ -364,15 +355,14 @@ fn arrays_and_slices(x: NeverBundle) {
 
     let array_3_never: [!; 3] = x.array_3_never;
     match array_3_never {}
-    //[normal,never_pats]~^ ERROR non-empty
     match array_3_never {
-        _ => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        _ => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
     match array_3_never {
-        [_, _, _] => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        [_, _, _] => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
     match array_3_never {
-        [_, ..] => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        [_, ..] => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
 
     let ref_array_3_never: &[!; 3] = &array_3_never;
@@ -414,22 +404,22 @@ fn bindings(x: NeverBundle) {
     match opt_never {
         None => {}
         // !useful, !reachable
-        Some(_) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        Some(_) => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
     match opt_never {
         None => {}
         // !useful, !reachable
-        Some(_a) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        Some(_a) => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
     match opt_never {
         None => {}
         // !useful, !reachable
-        _ => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        _ => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
     match opt_never {
         None => {}
         // !useful, !reachable
-        _a => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern
+        _a => {} //[exhaustive_patterns,normal,never_pats]~ ERROR unreachable pattern
     }
 
     // The scrutinee is known_valid, but under the `&` isn't anymore.
@@ -450,7 +440,7 @@ fn bindings(x: NeverBundle) {
         &_a => {}
     }
     match ref_opt_never {
-        //[normal,min_exh_pats,never_pats]~^ ERROR non-exhaustive
+        //[normal,never_pats]~^ ERROR non-exhaustive
         &None => {}
     }
     match ref_opt_never {
@@ -491,7 +481,7 @@ fn bindings(x: NeverBundle) {
         ref _a => {}
     }
     match *ref_opt_never {
-        //[normal,min_exh_pats,never_pats]~^ ERROR non-exhaustive
+        //[normal,never_pats]~^ ERROR non-exhaustive
         None => {}
     }
     match *ref_opt_never {
@@ -539,7 +529,7 @@ fn bindings(x: NeverBundle) {
 
     let ref_res_never: &Result<!, !> = &x.result_never;
     match *ref_res_never {
-        //[normal,min_exh_pats,never_pats]~^ ERROR non-exhaustive
+        //[normal,never_pats]~^ ERROR non-exhaustive
         // useful, reachable
         Ok(_) => {}
     }
@@ -550,7 +540,7 @@ fn bindings(x: NeverBundle) {
         _ => {}
     }
     match *ref_res_never {
-        //[normal,min_exh_pats,never_pats]~^ ERROR non-exhaustive
+        //[normal,never_pats]~^ ERROR non-exhaustive
         // useful, !reachable
         Ok(_a) => {}
     }
@@ -569,7 +559,7 @@ fn bindings(x: NeverBundle) {
 
     let ref_tuple_half_never: &(u32, !) = &x.tuple_half_never;
     match *ref_tuple_half_never {}
-    //[normal,min_exh_pats,never_pats]~^ ERROR non-empty
+    //[normal,never_pats]~^ ERROR non-empty
     match *ref_tuple_half_never {
         // useful, reachable
         (_, _) => {}
@@ -636,7 +626,7 @@ fn guards_and_validity(x: NeverBundle) {
         _a if false => {}
     }
     match ref_never {
-        //[normal,min_exh_pats,never_pats]~^ ERROR non-exhaustive
+        //[normal,never_pats]~^ ERROR non-exhaustive
         // useful, !reachable
         &_a if false => {}
     }
@@ -652,7 +642,7 @@ fn guards_and_validity(x: NeverBundle) {
         Err(_) => {}
     }
     match *ref_result_never {
-        //[normal,min_exh_pats]~^ ERROR `Ok(_)` not covered
+        //[normal]~^ ERROR `Ok(_)` not covered
         //[never_pats]~^^ ERROR `Ok(!)` not covered
         // useful, reachable
         Ok(_) if false => {}
@@ -672,7 +662,7 @@ fn diagnostics_subtlety(x: NeverBundle) {
     // Regression test for diagnostics: don't report `Some(Ok(_))` and `Some(Err(_))`.
     let x: &Option<Result<!, !>> = &None;
     match *x {
-        //[normal,min_exh_pats]~^ ERROR `Some(_)` not covered
+        //[normal]~^ ERROR `Some(_)` not covered
         //[never_pats]~^^ ERROR `Some(!)` not covered
         None => {}
     }
diff --git a/tests/ui/pattern/usefulness/explain-unreachable-pats.rs b/tests/ui/pattern/usefulness/explain-unreachable-pats.rs
index 98f781b6a09..44d194055d9 100644
--- a/tests/ui/pattern/usefulness/explain-unreachable-pats.rs
+++ b/tests/ui/pattern/usefulness/explain-unreachable-pats.rs
@@ -1,5 +1,4 @@
 #![feature(never_type)]
-#![feature(min_exhaustive_patterns)]
 #![deny(unreachable_patterns)]
 //~^ NOTE lint level is defined here
 
diff --git a/tests/ui/pattern/usefulness/explain-unreachable-pats.stderr b/tests/ui/pattern/usefulness/explain-unreachable-pats.stderr
index e2eecf4a9f3..105d4f73f66 100644
--- a/tests/ui/pattern/usefulness/explain-unreachable-pats.stderr
+++ b/tests/ui/pattern/usefulness/explain-unreachable-pats.stderr
@@ -1,5 +1,5 @@
 error: unreachable pattern
-  --> $DIR/explain-unreachable-pats.rs:11:9
+  --> $DIR/explain-unreachable-pats.rs:10:9
    |
 LL |         (1 | 2,) => {}
    |         -------- matches all the values already
@@ -8,19 +8,19 @@ LL |         (2,) => {}
    |         ^^^^ unreachable pattern
    |
 note: the lint level is defined here
-  --> $DIR/explain-unreachable-pats.rs:3:9
+  --> $DIR/explain-unreachable-pats.rs:2:9
    |
 LL | #![deny(unreachable_patterns)]
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error: unreachable pattern
-  --> $DIR/explain-unreachable-pats.rs:22:9
+  --> $DIR/explain-unreachable-pats.rs:21:9
    |
 LL |         (1 | 2,) => {}
    |         ^^^^^^^^ unreachable pattern
    |
 note: these patterns collectively make the last one unreachable
-  --> $DIR/explain-unreachable-pats.rs:22:9
+  --> $DIR/explain-unreachable-pats.rs:21:9
    |
 LL |         (1,) => {}
    |         ---- matches some of the same values
@@ -32,7 +32,7 @@ LL |         (1 | 2,) => {}
    |         ^^^^^^^^ collectively making this unreachable
 
 error: unreachable pattern
-  --> $DIR/explain-unreachable-pats.rs:33:9
+  --> $DIR/explain-unreachable-pats.rs:32:9
    |
 LL |         Err(_) => {}
    |         ^^^^^^
@@ -40,7 +40,7 @@ LL |         Err(_) => {}
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/explain-unreachable-pats.rs:46:9
+  --> $DIR/explain-unreachable-pats.rs:45:9
    |
 LL |         (Err(_), Err(_)) => {}
    |         ^^^^^^^^^^^^^^^^
@@ -48,7 +48,7 @@ LL |         (Err(_), Err(_)) => {}
    = note: this pattern matches no values because `Void2` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/explain-unreachable-pats.rs:52:9
+  --> $DIR/explain-unreachable-pats.rs:51:9
    |
 LL |         (Err(_), Err(_)) => {}
    |         ^^^^^^^^^^^^^^^^
@@ -56,7 +56,7 @@ LL |         (Err(_), Err(_)) => {}
    = note: this pattern matches no values because `Void1` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/explain-unreachable-pats.rs:61:11
+  --> $DIR/explain-unreachable-pats.rs:60:11
    |
 LL |     if let (0
    |             - matches all the values already
@@ -65,13 +65,13 @@ LL |         | 0, _) = (0, 0) {}
    |           ^ unreachable pattern
 
 error: unreachable pattern
-  --> $DIR/explain-unreachable-pats.rs:71:9
+  --> $DIR/explain-unreachable-pats.rs:70:9
    |
 LL |         (_, true) => {}
    |         ^^^^^^^^^ unreachable pattern
    |
 note: these patterns collectively make the last one unreachable
-  --> $DIR/explain-unreachable-pats.rs:71:9
+  --> $DIR/explain-unreachable-pats.rs:70:9
    |
 LL |         (true, _) => {}
    |         --------- matches some of the same values
@@ -83,7 +83,7 @@ LL |         (_, true) => {}
    |         ^^^^^^^^^ collectively making this unreachable
 
 error: unreachable pattern
-  --> $DIR/explain-unreachable-pats.rs:84:9
+  --> $DIR/explain-unreachable-pats.rs:83:9
    |
 LL |         (true, _) => {}
    |         --------- matches all the values already
@@ -92,7 +92,7 @@ LL |         (true, true) => {}
    |         ^^^^^^^^^^^^ unreachable pattern
 
 error: unreachable pattern
-  --> $DIR/explain-unreachable-pats.rs:96:9
+  --> $DIR/explain-unreachable-pats.rs:95:9
    |
 LL |         (_, true, 0..10) => {}
    |         ---------------- matches all the values already
diff --git a/tests/ui/pattern/usefulness/impl-trait.rs b/tests/ui/pattern/usefulness/impl-trait.rs
index 1fec9a2633e..c1cc279f74c 100644
--- a/tests/ui/pattern/usefulness/impl-trait.rs
+++ b/tests/ui/pattern/usefulness/impl-trait.rs
@@ -1,5 +1,4 @@
 #![feature(never_type)]
-#![feature(min_exhaustive_patterns)]
 #![feature(type_alias_impl_trait)]
 #![feature(non_exhaustive_omitted_patterns_lint)]
 #![deny(unreachable_patterns)]
diff --git a/tests/ui/pattern/usefulness/impl-trait.stderr b/tests/ui/pattern/usefulness/impl-trait.stderr
index c079f5a259d..92932e48538 100644
--- a/tests/ui/pattern/usefulness/impl-trait.stderr
+++ b/tests/ui/pattern/usefulness/impl-trait.stderr
@@ -1,18 +1,18 @@
 error: unreachable pattern
-  --> $DIR/impl-trait.rs:17:13
+  --> $DIR/impl-trait.rs:16:13
    |
 LL |             _ => {}
    |             ^
    |
    = note: this pattern matches no values because `Void` is uninhabited
 note: the lint level is defined here
-  --> $DIR/impl-trait.rs:5:9
+  --> $DIR/impl-trait.rs:4:9
    |
 LL | #![deny(unreachable_patterns)]
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error: unreachable pattern
-  --> $DIR/impl-trait.rs:31:13
+  --> $DIR/impl-trait.rs:30:13
    |
 LL |             _ => {}
    |             ^
@@ -20,7 +20,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/impl-trait.rs:45:13
+  --> $DIR/impl-trait.rs:44:13
    |
 LL |             Some(_) => {}
    |             ^^^^^^^
@@ -28,7 +28,7 @@ LL |             Some(_) => {}
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/impl-trait.rs:49:13
+  --> $DIR/impl-trait.rs:48:13
    |
 LL |             None => {}
    |             ---- matches all the values already
@@ -36,7 +36,7 @@ LL |             _ => {}
    |             ^ unreachable pattern
 
 error: unreachable pattern
-  --> $DIR/impl-trait.rs:59:13
+  --> $DIR/impl-trait.rs:58:13
    |
 LL |             Some(_) => {}
    |             ^^^^^^^
@@ -44,7 +44,7 @@ LL |             Some(_) => {}
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/impl-trait.rs:63:13
+  --> $DIR/impl-trait.rs:62:13
    |
 LL |             None => {}
    |             ---- matches all the values already
@@ -52,7 +52,7 @@ LL |             _ => {}
    |             ^ unreachable pattern
 
 error: unreachable pattern
-  --> $DIR/impl-trait.rs:76:9
+  --> $DIR/impl-trait.rs:75:9
    |
 LL |         _ => {}
    |         ^
@@ -60,7 +60,7 @@ LL |         _ => {}
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/impl-trait.rs:86:9
+  --> $DIR/impl-trait.rs:85:9
    |
 LL |         _ => {}
    |         - matches any value
@@ -68,7 +68,7 @@ LL |         Some((a, b)) => {}
    |         ^^^^^^^^^^^^ unreachable pattern
 
 error: unreachable pattern
-  --> $DIR/impl-trait.rs:94:13
+  --> $DIR/impl-trait.rs:93:13
    |
 LL |             _ => {}
    |             ^
@@ -76,7 +76,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/impl-trait.rs:105:9
+  --> $DIR/impl-trait.rs:104:9
    |
 LL |         Some((a, b)) => {}
    |         ------------ matches all the values already
@@ -84,7 +84,7 @@ LL |         Some((mut x, mut y)) => {
    |         ^^^^^^^^^^^^^^^^^^^^ unreachable pattern
 
 error: unreachable pattern
-  --> $DIR/impl-trait.rs:124:13
+  --> $DIR/impl-trait.rs:123:13
    |
 LL |             _ => {}
    |             - matches any value
@@ -92,7 +92,7 @@ LL |             Rec { n: 0, w: Some(Rec { n: 0, w: _ }) } => {}
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable pattern
 
 error: unreachable pattern
-  --> $DIR/impl-trait.rs:138:13
+  --> $DIR/impl-trait.rs:137:13
    |
 LL |             _ => {}
    |             ^
@@ -100,7 +100,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `SecretelyVoid` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/impl-trait.rs:151:13
+  --> $DIR/impl-trait.rs:150:13
    |
 LL |             _ => {}
    |             ^
@@ -108,7 +108,7 @@ LL |             _ => {}
    = note: this pattern matches no values because `SecretelyDoubleVoid` is uninhabited
 
 error[E0004]: non-exhaustive patterns: type `impl Copy` is non-empty
-  --> $DIR/impl-trait.rs:23:11
+  --> $DIR/impl-trait.rs:22:11
    |
 LL |     match return_never_rpit(x) {}
    |           ^^^^^^^^^^^^^^^^^^^^
@@ -122,7 +122,7 @@ LL +     }
    |
 
 error[E0004]: non-exhaustive patterns: type `T` is non-empty
-  --> $DIR/impl-trait.rs:37:11
+  --> $DIR/impl-trait.rs:36:11
    |
 LL |     match return_never_tait(x) {}
    |           ^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/pattern/usefulness/match-privately-empty.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/match-privately-empty.exhaustive_patterns.stderr
index 261a4b3353f..463e104f970 100644
--- a/tests/ui/pattern/usefulness/match-privately-empty.exhaustive_patterns.stderr
+++ b/tests/ui/pattern/usefulness/match-privately-empty.exhaustive_patterns.stderr
@@ -1,5 +1,5 @@
 error[E0004]: non-exhaustive patterns: `Some(Private { misc: true, .. })` not covered
-  --> $DIR/match-privately-empty.rs:15:11
+  --> $DIR/match-privately-empty.rs:14:11
    |
 LL |     match private::DATA {
    |           ^^^^^^^^^^^^^ pattern `Some(Private { misc: true, .. })` not covered
diff --git a/tests/ui/pattern/usefulness/match-privately-empty.normal.stderr b/tests/ui/pattern/usefulness/match-privately-empty.normal.stderr
new file mode 100644
index 00000000000..463e104f970
--- /dev/null
+++ b/tests/ui/pattern/usefulness/match-privately-empty.normal.stderr
@@ -0,0 +1,21 @@
+error[E0004]: non-exhaustive patterns: `Some(Private { misc: true, .. })` not covered
+  --> $DIR/match-privately-empty.rs:14:11
+   |
+LL |     match private::DATA {
+   |           ^^^^^^^^^^^^^ pattern `Some(Private { misc: true, .. })` not covered
+   |
+note: `Option<Private>` defined here
+  --> $SRC_DIR/core/src/option.rs:LL:COL
+  ::: $SRC_DIR/core/src/option.rs:LL:COL
+   |
+   = note: not covered
+   = note: the matched value is of type `Option<Private>`
+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 ~         Some(private::Private { misc: false, .. }) => {},
+LL +         Some(Private { misc: true, .. }) => todo!()
+   |
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0004`.
diff --git a/tests/ui/pattern/usefulness/match-privately-empty.rs b/tests/ui/pattern/usefulness/match-privately-empty.rs
index 7e1d0dc48f2..bfea15af180 100644
--- a/tests/ui/pattern/usefulness/match-privately-empty.rs
+++ b/tests/ui/pattern/usefulness/match-privately-empty.rs
@@ -1,6 +1,5 @@
-//@ revisions: min_exhaustive_patterns exhaustive_patterns
+//@ revisions: normal exhaustive_patterns
 #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
-#![cfg_attr(min_exhaustive_patterns, feature(min_exhaustive_patterns))]
 #![feature(never_type)]
 
 mod private {
diff --git a/tests/ui/pattern/usefulness/slice_of_empty.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/slice_of_empty.exhaustive_patterns.stderr
index e5e581447e6..c4fcd67cfdb 100644
--- a/tests/ui/pattern/usefulness/slice_of_empty.exhaustive_patterns.stderr
+++ b/tests/ui/pattern/usefulness/slice_of_empty.exhaustive_patterns.stderr
@@ -1,5 +1,5 @@
 error[E0004]: non-exhaustive patterns: `&[]` not covered
-  --> $DIR/slice_of_empty.rs:21:11
+  --> $DIR/slice_of_empty.rs:20:11
    |
 LL |     match nevers {
    |           ^^^^^^ pattern `&[]` not covered
diff --git a/tests/ui/pattern/usefulness/slice_of_empty.normal.stderr b/tests/ui/pattern/usefulness/slice_of_empty.normal.stderr
new file mode 100644
index 00000000000..c9afd1bfc90
--- /dev/null
+++ b/tests/ui/pattern/usefulness/slice_of_empty.normal.stderr
@@ -0,0 +1,30 @@
+error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
+  --> $DIR/slice_of_empty.rs:9:11
+   |
+LL |     match nevers {
+   |           ^^^^^^ pattern `&[_, ..]` not covered
+   |
+   = note: the matched value is of type `&[!]`
+   = note: `!` is uninhabited but is not being matched by value, so a wildcard `_` is required
+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 ~         &[] => (),
+LL ~         &[_, ..] => todo!(),
+   |
+
+error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
+  --> $DIR/slice_of_empty.rs:20:11
+   |
+LL |     match nevers {
+   |           ^^^^^^ patterns `&[]` and `&[_, _, ..]` not covered
+   |
+   = note: the matched value is of type `&[!]`
+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 ~         &[_] => (),
+LL ~         &[] | &[_, _, ..] => todo!(),
+   |
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0004`.
diff --git a/tests/ui/pattern/usefulness/slice_of_empty.rs b/tests/ui/pattern/usefulness/slice_of_empty.rs
index 785fccaabf7..e186ba5134d 100644
--- a/tests/ui/pattern/usefulness/slice_of_empty.rs
+++ b/tests/ui/pattern/usefulness/slice_of_empty.rs
@@ -1,6 +1,5 @@
-//@ revisions: min_exhaustive_patterns exhaustive_patterns
+//@ revisions: normal exhaustive_patterns
 #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
-#![cfg_attr(min_exhaustive_patterns, feature(min_exhaustive_patterns))]
 #![feature(never_type)]
 #![deny(unreachable_patterns)]
 
@@ -8,7 +7,7 @@ fn main() {}
 
 fn foo(nevers: &[!]) {
     match nevers {
-        //[min_exhaustive_patterns]~^ ERROR non-exhaustive patterns: `&[_, ..]` not covered
+        //[normal]~^ ERROR non-exhaustive patterns: `&[_, ..]` not covered
         &[] => (),
     };
 
@@ -20,7 +19,7 @@ fn foo(nevers: &[!]) {
 
     match nevers {
         //[exhaustive_patterns]~^ ERROR non-exhaustive patterns: `&[]` not covered
-        //[min_exhaustive_patterns]~^^ ERROR non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
+        //[normal]~^^ ERROR non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
         &[_] => (),
     };
 }
diff --git a/tests/ui/pattern/usefulness/uninhabited.rs b/tests/ui/pattern/usefulness/uninhabited.rs
index 72e602ee8d2..5c774b7874a 100644
--- a/tests/ui/pattern/usefulness/uninhabited.rs
+++ b/tests/ui/pattern/usefulness/uninhabited.rs
@@ -5,7 +5,6 @@
 // `Ty::is_inhabited_from` function.
 #![feature(never_type)]
 #![feature(never_type_fallback)]
-#![feature(min_exhaustive_patterns)]
 #![deny(unreachable_patterns)]
 
 macro_rules! assert_empty {
diff --git a/tests/ui/polymorphization/inline-tainted-body.rs b/tests/ui/polymorphization/inline-tainted-body.rs
new file mode 100644
index 00000000000..13aec97e22b
--- /dev/null
+++ b/tests/ui/polymorphization/inline-tainted-body.rs
@@ -0,0 +1,21 @@
+//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes
+
+#![feature(unboxed_closures)]
+
+use std::sync::Arc;
+
+pub struct WeakOnce<T>();
+//~^ ERROR type parameter `T` is never used
+
+impl<T> WeakOnce<T> {
+    extern "rust-call" fn try_get(&self) -> Option<Arc<T>> {}
+    //~^ ERROR functions with the "rust-call" ABI must take a single non-self tuple argument
+    //~| ERROR mismatched types
+
+    pub fn get(&self) -> Arc<T> {
+        self.try_get()
+            .unwrap_or_else(|| panic!("Singleton {} not available", std::any::type_name::<T>()))
+    }
+}
+
+fn main() {}
diff --git a/tests/ui/polymorphization/inline-tainted-body.stderr b/tests/ui/polymorphization/inline-tainted-body.stderr
new file mode 100644
index 00000000000..5c3bd70adae
--- /dev/null
+++ b/tests/ui/polymorphization/inline-tainted-body.stderr
@@ -0,0 +1,30 @@
+error[E0392]: type parameter `T` is never used
+  --> $DIR/inline-tainted-body.rs:7:21
+   |
+LL | pub struct WeakOnce<T>();
+   |                     ^ unused type parameter
+   |
+   = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
+   = help: if you intended `T` to be a const parameter, use `const T: /* Type */` instead
+
+error: functions with the "rust-call" ABI must take a single non-self tuple argument
+  --> $DIR/inline-tainted-body.rs:11:35
+   |
+LL |     extern "rust-call" fn try_get(&self) -> Option<Arc<T>> {}
+   |                                   ^^^^^
+
+error[E0308]: mismatched types
+  --> $DIR/inline-tainted-body.rs:11:45
+   |
+LL |     extern "rust-call" fn try_get(&self) -> Option<Arc<T>> {}
+   |                           -------           ^^^^^^^^^^^^^^ expected `Option<Arc<T>>`, found `()`
+   |                           |
+   |                           implicitly returns `()` as its body has no tail or `return` expression
+   |
+   = note:   expected enum `Option<Arc<T>>`
+           found unit type `()`
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0308, E0392.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/tests/ui/print-calling-conventions.rs b/tests/ui/print-calling-conventions.rs
new file mode 100644
index 00000000000..302ed088142
--- /dev/null
+++ b/tests/ui/print-calling-conventions.rs
@@ -0,0 +1,2 @@
+//@ compile-flags: --print calling-conventions
+//@ build-pass
diff --git a/tests/ui/print-calling-conventions.stdout b/tests/ui/print-calling-conventions.stdout
new file mode 100644
index 00000000000..da67a57f420
--- /dev/null
+++ b/tests/ui/print-calling-conventions.stdout
@@ -0,0 +1,34 @@
+C
+C-cmse-nonsecure-call
+C-unwind
+Rust
+aapcs
+aapcs-unwind
+avr-interrupt
+avr-non-blocking-interrupt
+cdecl
+cdecl-unwind
+efiapi
+fastcall
+fastcall-unwind
+msp430-interrupt
+ptx-kernel
+riscv-interrupt-m
+riscv-interrupt-s
+rust-call
+rust-cold
+rust-intrinsic
+stdcall
+stdcall-unwind
+system
+system-unwind
+sysv64
+sysv64-unwind
+thiscall
+thiscall-unwind
+unadjusted
+vectorcall
+vectorcall-unwind
+win64
+win64-unwind
+x86-interrupt
diff --git a/tests/ui/privacy/issue-75907.stderr b/tests/ui/privacy/issue-75907.stderr
index f7cb874c2cc..3121cc04478 100644
--- a/tests/ui/privacy/issue-75907.stderr
+++ b/tests/ui/privacy/issue-75907.stderr
@@ -14,7 +14,7 @@ LL |     let Bar(x, y, Foo(z)) = make_bar();
 help: consider making the fields publicly accessible
    |
 LL |     pub(crate) struct Bar(pub u8, pub u8, pub Foo);
-   |                           ~~~     ~~~     +++
+   |                                   ~~~     +++
 
 error[E0532]: cannot match against a tuple struct which contains private fields
   --> $DIR/issue-75907.rs:15:19
diff --git a/tests/ui/privacy/privacy5.stderr b/tests/ui/privacy/privacy5.stderr
index 615b0af2762..ec3abe9b816 100644
--- a/tests/ui/privacy/privacy5.stderr
+++ b/tests/ui/privacy/privacy5.stderr
@@ -53,7 +53,7 @@ LL |     pub struct C(pub isize, isize);
 help: consider making the fields publicly accessible
    |
 LL |     pub struct C(pub isize, pub isize);
-   |                  ~~~        +++
+   |                             +++
 
 error[E0603]: tuple struct constructor `A` is private
   --> $DIR/privacy5.rs:56:12
@@ -262,7 +262,7 @@ LL |     pub struct C(pub isize, isize);
 help: consider making the fields publicly accessible
    |
 LL |     pub struct C(pub isize, pub isize);
-   |                  ~~~        +++
+   |                             +++
 
 error[E0603]: tuple struct constructor `C` is private
   --> $DIR/privacy5.rs:69:12
@@ -281,7 +281,7 @@ LL |     pub struct C(pub isize, isize);
 help: consider making the fields publicly accessible
    |
 LL |     pub struct C(pub isize, pub isize);
-   |                  ~~~        +++
+   |                             +++
 
 error[E0603]: tuple struct constructor `C` is private
   --> $DIR/privacy5.rs:70:12
@@ -300,7 +300,7 @@ LL |     pub struct C(pub isize, isize);
 help: consider making the fields publicly accessible
    |
 LL |     pub struct C(pub isize, pub isize);
-   |                  ~~~        +++
+   |                             +++
 
 error[E0603]: tuple struct constructor `C` is private
   --> $DIR/privacy5.rs:71:12
@@ -319,7 +319,7 @@ LL |     pub struct C(pub isize, isize);
 help: consider making the fields publicly accessible
    |
 LL |     pub struct C(pub isize, pub isize);
-   |                  ~~~        +++
+   |                             +++
 
 error[E0603]: tuple struct constructor `C` is private
   --> $DIR/privacy5.rs:72:18
@@ -338,7 +338,7 @@ LL |     pub struct C(pub isize, isize);
 help: consider making the fields publicly accessible
    |
 LL |     pub struct C(pub isize, pub isize);
-   |                  ~~~        +++
+   |                             +++
 
 error[E0603]: tuple struct constructor `C` is private
   --> $DIR/privacy5.rs:73:18
@@ -357,7 +357,7 @@ LL |     pub struct C(pub isize, isize);
 help: consider making the fields publicly accessible
    |
 LL |     pub struct C(pub isize, pub isize);
-   |                  ~~~        +++
+   |                             +++
 
 error[E0603]: tuple struct constructor `C` is private
   --> $DIR/privacy5.rs:74:18
@@ -376,7 +376,7 @@ LL |     pub struct C(pub isize, isize);
 help: consider making the fields publicly accessible
    |
 LL |     pub struct C(pub isize, pub isize);
-   |                  ~~~        +++
+   |                             +++
 
 error[E0603]: tuple struct constructor `C` is private
   --> $DIR/privacy5.rs:75:18
@@ -395,7 +395,7 @@ LL |     pub struct C(pub isize, isize);
 help: consider making the fields publicly accessible
    |
 LL |     pub struct C(pub isize, pub isize);
-   |                  ~~~        +++
+   |                             +++
 
 error[E0603]: tuple struct constructor `A` is private
   --> $DIR/privacy5.rs:83:17
@@ -452,7 +452,7 @@ LL |     pub struct C(pub isize, isize);
 help: consider making the fields publicly accessible
    |
 LL |     pub struct C(pub isize, pub isize);
-   |                  ~~~        +++
+   |                             +++
 
 error[E0603]: tuple struct constructor `A` is private
   --> $DIR/privacy5.rs:90:20
diff --git a/tests/ui/privacy/restricted/test.stderr b/tests/ui/privacy/restricted/test.stderr
index a48bb671d9f..5deaffbdbf3 100644
--- a/tests/ui/privacy/restricted/test.stderr
+++ b/tests/ui/privacy/restricted/test.stderr
@@ -4,7 +4,10 @@ error[E0433]: failed to resolve: you might be missing crate `bad`
 LL |     pub(in bad::path) mod m1 {}
    |            ^^^ you might be missing crate `bad`
    |
-   = help: consider adding `extern crate bad` to use the `bad` crate
+help: consider importing the `bad` crate
+   |
+LL + extern crate bad;
+   |
 
 error[E0742]: visibilities can only be restricted to ancestor modules
   --> $DIR/test.rs:51:12
diff --git a/tests/ui/proc-macro/auxiliary/parse-invis-delim-issue-128895.rs b/tests/ui/proc-macro/auxiliary/parse-invis-delim-issue-128895.rs
new file mode 100644
index 00000000000..07e135ee8eb
--- /dev/null
+++ b/tests/ui/proc-macro/auxiliary/parse-invis-delim-issue-128895.rs
@@ -0,0 +1,44 @@
+//@ force-host
+//@ no-prefer-dynamic
+
+#![crate_type = "proc-macro"]
+
+extern crate proc_macro;
+
+use proc_macro::*;
+
+// This proc macro ignores its input and returns this token stream
+//
+//   impl <«A1»: Comparable> Comparable for («A1»,) {}
+//
+// where `«`/`»` are invisible delimiters. This was being misparsed in bug
+// #128895.
+#[proc_macro]
+pub fn main(_input: TokenStream) -> TokenStream {
+    let a1 = TokenTree::Group(
+        Group::new(
+            Delimiter::None,
+            std::iter::once(TokenTree::Ident(Ident::new("A1", Span::call_site()))).collect(),
+        )
+    );
+    vec![
+        TokenTree::Ident(Ident::new("impl", Span::call_site())),
+        TokenTree::Punct(Punct::new('<', Spacing::Alone)),
+        a1.clone(),
+        TokenTree::Punct(Punct::new(':', Spacing::Alone)),
+        TokenTree::Ident(Ident::new("Comparable", Span::call_site())),
+        TokenTree::Punct(Punct::new('>', Spacing::Alone)),
+        TokenTree::Ident(Ident::new("Comparable", Span::call_site())),
+        TokenTree::Ident(Ident::new("for", Span::call_site())),
+        TokenTree::Group(
+            Group::new(
+                Delimiter::Parenthesis,
+                vec![
+                    a1.clone(),
+                    TokenTree::Punct(Punct::new(',', Spacing::Alone)),
+                ].into_iter().collect::<TokenStream>(),
+            )
+        ),
+        TokenTree::Group(Group::new(Delimiter::Brace, TokenStream::new())),
+    ].into_iter().collect::<TokenStream>()
+}
diff --git a/tests/ui/proc-macro/parse-invis-delim-issue-128895.rs b/tests/ui/proc-macro/parse-invis-delim-issue-128895.rs
new file mode 100644
index 00000000000..3d5af5fee21
--- /dev/null
+++ b/tests/ui/proc-macro/parse-invis-delim-issue-128895.rs
@@ -0,0 +1,14 @@
+//@ aux-build:parse-invis-delim-issue-128895.rs
+//@ check-pass
+
+#![no_std] // Don't load unnecessary hygiene information from std
+extern crate std;
+
+#[macro_use]
+extern crate parse_invis_delim_issue_128895;
+
+trait Comparable {}
+
+parse_invis_delim_issue_128895::main!();
+
+fn main() {}
diff --git a/tests/ui/process/println-with-broken-pipe.run.stderr b/tests/ui/process/println-with-broken-pipe.run.stderr
index a334c0ad204..f9d138a0424 100644
--- a/tests/ui/process/println-with-broken-pipe.run.stderr
+++ b/tests/ui/process/println-with-broken-pipe.run.stderr
@@ -1,3 +1,3 @@
-thread 'main' panicked at library/std/src/io/stdio.rs:LL:CC:
+thread 'main' panicked at std/src/io/stdio.rs:LL:CC:
 failed printing to stdout: Broken pipe (os error 32)
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
diff --git a/tests/ui/pub/pub-ident-struct-4.fixed b/tests/ui/pub/pub-ident-struct-4.fixed
index a62ece43ece..5fedbb72437 100644
--- a/tests/ui/pub/pub-ident-struct-4.fixed
+++ b/tests/ui/pub/pub-ident-struct-4.fixed
@@ -1,7 +1,6 @@
 //@ run-rustfix
 
-#[allow(dead_code)]
-pub struct T(String);
+pub struct T(#[allow(dead_code)] String);
 //~^ ERROR missing `struct` for struct definition
 
 fn main() {}
diff --git a/tests/ui/pub/pub-ident-struct-4.rs b/tests/ui/pub/pub-ident-struct-4.rs
index 0d56a31beaf..5c721c25a78 100644
--- a/tests/ui/pub/pub-ident-struct-4.rs
+++ b/tests/ui/pub/pub-ident-struct-4.rs
@@ -1,7 +1,6 @@
 //@ run-rustfix
 
-#[allow(dead_code)]
-pub T(String);
+pub T(#[allow(dead_code)] String);
 //~^ ERROR missing `struct` for struct definition
 
 fn main() {}
diff --git a/tests/ui/pub/pub-ident-struct-4.stderr b/tests/ui/pub/pub-ident-struct-4.stderr
index d3072464e05..04965a1a737 100644
--- a/tests/ui/pub/pub-ident-struct-4.stderr
+++ b/tests/ui/pub/pub-ident-struct-4.stderr
@@ -1,12 +1,12 @@
 error: missing `struct` for struct definition
-  --> $DIR/pub-ident-struct-4.rs:4:1
+  --> $DIR/pub-ident-struct-4.rs:3:1
    |
-LL | pub T(String);
+LL | pub T(#[allow(dead_code)] String);
    | ^^^^^
    |
 help: add `struct` here to parse `T` as a struct
    |
-LL | pub struct T(String);
+LL | pub struct T(#[allow(dead_code)] String);
    |     ++++++
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/reachable/unreachable-loop-patterns.rs b/tests/ui/reachable/unreachable-loop-patterns.rs
index 4294a18ba44..d074e3a6ece 100644
--- a/tests/ui/reachable/unreachable-loop-patterns.rs
+++ b/tests/ui/reachable/unreachable-loop-patterns.rs
@@ -1,6 +1,4 @@
 #![feature(never_type, never_type_fallback)]
-#![feature(min_exhaustive_patterns)]
-
 #![allow(unreachable_code)]
 #![deny(unreachable_patterns)]
 
diff --git a/tests/ui/reachable/unreachable-loop-patterns.stderr b/tests/ui/reachable/unreachable-loop-patterns.stderr
index bdd9b5ee411..9b7c2ba4acd 100644
--- a/tests/ui/reachable/unreachable-loop-patterns.stderr
+++ b/tests/ui/reachable/unreachable-loop-patterns.stderr
@@ -1,12 +1,12 @@
 error: unreachable pattern
-  --> $DIR/unreachable-loop-patterns.rs:18:9
+  --> $DIR/unreachable-loop-patterns.rs:16:9
    |
 LL |     for _ in unimplemented!() as Void {}
    |         ^
    |
    = note: this pattern matches no values because `Void` is uninhabited
 note: the lint level is defined here
-  --> $DIR/unreachable-loop-patterns.rs:5:9
+  --> $DIR/unreachable-loop-patterns.rs:3:9
    |
 LL | #![deny(unreachable_patterns)]
    |         ^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/regions/regions-issue-21422.rs b/tests/ui/regions/regions-issue-21422.rs
index 67852a6f5de..54beed9b3ac 100644
--- a/tests/ui/regions/regions-issue-21422.rs
+++ b/tests/ui/regions/regions-issue-21422.rs
@@ -5,7 +5,6 @@
 
 //@ pretty-expanded FIXME #23616
 
-#[allow(dead_code)]
 pub struct P<'a> {
     _ptr: *const &'a u8,
 }
diff --git a/tests/ui/resolve/editions-crate-root-2015.stderr b/tests/ui/resolve/editions-crate-root-2015.stderr
index 74fb7e6019f..7a842aca0fd 100644
--- a/tests/ui/resolve/editions-crate-root-2015.stderr
+++ b/tests/ui/resolve/editions-crate-root-2015.stderr
@@ -4,7 +4,10 @@ error[E0433]: failed to resolve: you might be missing crate `nonexistant`
 LL |     fn global_inner(_: ::nonexistant::Foo) {
    |                          ^^^^^^^^^^^ you might be missing crate `nonexistant`
    |
-   = help: consider adding `extern crate nonexistant` to use the `nonexistant` crate
+help: consider importing the `nonexistant` crate
+   |
+LL + extern crate nonexistant;
+   |
 
 error[E0433]: failed to resolve: you might be missing crate `nonexistant`
   --> $DIR/editions-crate-root-2015.rs:7:30
@@ -12,7 +15,10 @@ error[E0433]: failed to resolve: you might be missing crate `nonexistant`
 LL |     fn crate_inner(_: crate::nonexistant::Foo) {
    |                              ^^^^^^^^^^^ you might be missing crate `nonexistant`
    |
-   = help: consider adding `extern crate nonexistant` to use the `nonexistant` crate
+help: consider importing the `nonexistant` crate
+   |
+LL + extern crate nonexistant;
+   |
 
 error[E0412]: cannot find type `nonexistant` in the crate root
   --> $DIR/editions-crate-root-2015.rs:11:25
diff --git a/tests/ui/resolve/extern-prelude-fail.stderr b/tests/ui/resolve/extern-prelude-fail.stderr
index 4c2d5abb782..77c10f5f995 100644
--- a/tests/ui/resolve/extern-prelude-fail.stderr
+++ b/tests/ui/resolve/extern-prelude-fail.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `extern_prelude`
 LL |     use extern_prelude::S;
    |         ^^^^^^^^^^^^^^ you might be missing crate `extern_prelude`
    |
-   = help: consider adding `extern crate extern_prelude` to use the `extern_prelude` crate
+help: consider importing the `extern_prelude` crate
+   |
+LL + extern crate extern_prelude;
+   |
 
 error[E0433]: failed to resolve: you might be missing crate `extern_prelude`
   --> $DIR/extern-prelude-fail.rs:8:15
@@ -12,7 +15,10 @@ error[E0433]: failed to resolve: you might be missing crate `extern_prelude`
 LL |     let s = ::extern_prelude::S;
    |               ^^^^^^^^^^^^^^ you might be missing crate `extern_prelude`
    |
-   = help: consider adding `extern crate extern_prelude` to use the `extern_prelude` crate
+help: consider importing the `extern_prelude` crate
+   |
+LL + extern crate extern_prelude;
+   |
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/resolve/issue-82865.stderr b/tests/ui/resolve/issue-82865.stderr
index ce0061a2b66..bc7e0f07981 100644
--- a/tests/ui/resolve/issue-82865.stderr
+++ b/tests/ui/resolve/issue-82865.stderr
@@ -4,7 +4,10 @@ error[E0433]: failed to resolve: you might be missing crate `x`
 LL | use x::y::z;
    |     ^ you might be missing crate `x`
    |
-   = help: consider adding `extern crate x` to use the `x` crate
+help: consider importing the `x` crate
+   |
+LL + extern crate x;
+   |
 
 error[E0599]: no function or associated item named `z` found for struct `Box<_, _>` in the current scope
   --> $DIR/issue-82865.rs:8:10
diff --git a/tests/ui/resolve/resolve-bad-visibility.stderr b/tests/ui/resolve/resolve-bad-visibility.stderr
index 8e475735403..281e5afb223 100644
--- a/tests/ui/resolve/resolve-bad-visibility.stderr
+++ b/tests/ui/resolve/resolve-bad-visibility.stderr
@@ -22,7 +22,10 @@ error[E0433]: failed to resolve: you might be missing crate `nonexistent`
 LL | pub(in nonexistent) struct G;
    |        ^^^^^^^^^^^ you might be missing crate `nonexistent`
    |
-   = help: consider adding `extern crate nonexistent` to use the `nonexistent` crate
+help: consider importing the `nonexistent` crate
+   |
+LL + extern crate nonexistent;
+   |
 
 error[E0433]: failed to resolve: you might be missing crate `too_soon`
   --> $DIR/resolve-bad-visibility.rs:8:8
@@ -30,7 +33,10 @@ error[E0433]: failed to resolve: you might be missing crate `too_soon`
 LL | pub(in too_soon) struct H;
    |        ^^^^^^^^ you might be missing crate `too_soon`
    |
-   = help: consider adding `extern crate too_soon` to use the `too_soon` crate
+help: consider importing the `too_soon` crate
+   |
+LL + extern crate too_soon;
+   |
 
 error: aborting due to 5 previous errors
 
diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/check.rs b/tests/ui/rfcs/rfc-0000-never_patterns/check.rs
index dc13dd05fa6..77f79003edc 100644
--- a/tests/ui/rfcs/rfc-0000-never_patterns/check.rs
+++ b/tests/ui/rfcs/rfc-0000-never_patterns/check.rs
@@ -11,22 +11,22 @@ macro_rules! never {
 }
 
 fn no_arms_or_guards(x: Void) {
-    match None::<Void> {
+    match &None::<Void> {
         Some(!) => {}
         //~^ ERROR a never pattern is always unreachable
         None => {}
     }
-    match None::<Void> { //~ ERROR: `Some(!)` not covered
+    match &None::<Void> { //~ ERROR: `&Some(!)` not covered
         Some(!) if true,
         //~^ ERROR guard on a never pattern
         None => {}
     }
-    match None::<Void> { //~ ERROR: `Some(!)` not covered
+    match &None::<Void> { //~ ERROR: `&Some(!)` not covered
         Some(!) if true => {}
         //~^ ERROR a never pattern is always unreachable
         None => {}
     }
-    match None::<Void> {
+    match &None::<Void> {
         Some(never!()) => {}
         //~^ ERROR a never pattern is always unreachable
         None => {}
diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/check.stderr b/tests/ui/rfcs/rfc-0000-never_patterns/check.stderr
index fbf7aa02ac2..4622ea59b54 100644
--- a/tests/ui/rfcs/rfc-0000-never_patterns/check.stderr
+++ b/tests/ui/rfcs/rfc-0000-never_patterns/check.stderr
@@ -31,40 +31,42 @@ LL |         Some(never!()) => {}
    |                           this will never be executed
    |                           help: remove this expression
 
-error[E0004]: non-exhaustive patterns: `Some(!)` not covered
+error[E0004]: non-exhaustive patterns: `&Some(!)` not covered
   --> $DIR/check.rs:19:11
    |
-LL |     match None::<Void> {
-   |           ^^^^^^^^^^^^ pattern `Some(!)` not covered
+LL |     match &None::<Void> {
+   |           ^^^^^^^^^^^^^ pattern `&Some(!)` not covered
    |
 note: `Option<Void>` defined here
   --> $SRC_DIR/core/src/option.rs:LL:COL
   ::: $SRC_DIR/core/src/option.rs:LL:COL
    |
    = note: not covered
-   = note: the matched value is of type `Option<Void>`
+   = note: the matched value is of type `&Option<Void>`
+   = note: `Void` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 => {},
-LL +         Some(!)
+LL +         &Some(!)
    |
 
-error[E0004]: non-exhaustive patterns: `Some(!)` not covered
+error[E0004]: non-exhaustive patterns: `&Some(!)` not covered
   --> $DIR/check.rs:24:11
    |
-LL |     match None::<Void> {
-   |           ^^^^^^^^^^^^ pattern `Some(!)` not covered
+LL |     match &None::<Void> {
+   |           ^^^^^^^^^^^^^ pattern `&Some(!)` not covered
    |
 note: `Option<Void>` defined here
   --> $SRC_DIR/core/src/option.rs:LL:COL
   ::: $SRC_DIR/core/src/option.rs:LL:COL
    |
    = note: not covered
-   = note: the matched value is of type `Option<Void>`
+   = note: the matched value is of type `&Option<Void>`
+   = note: `Void` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 => {},
-LL +         Some(!)
+LL +         &Some(!)
    |
 
 error: aborting due to 6 previous errors
diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/typeck.fail.stderr b/tests/ui/rfcs/rfc-0000-never_patterns/typeck.fail.stderr
index 013a8b53a55..9e2ae2846d5 100644
--- a/tests/ui/rfcs/rfc-0000-never_patterns/typeck.fail.stderr
+++ b/tests/ui/rfcs/rfc-0000-never_patterns/typeck.fail.stderr
@@ -1,5 +1,5 @@
 error: mismatched types
-  --> $DIR/typeck.rs:25:9
+  --> $DIR/typeck.rs:24:9
    |
 LL |         !,
    |         ^ a never pattern must be used on an uninhabited type
@@ -7,7 +7,7 @@ LL |         !,
    = note: the matched value is of type `()`
 
 error: mismatched types
-  --> $DIR/typeck.rs:29:9
+  --> $DIR/typeck.rs:28:9
    |
 LL |         !,
    |         ^ a never pattern must be used on an uninhabited type
@@ -15,7 +15,7 @@ LL |         !,
    = note: the matched value is of type `(i32, bool)`
 
 error: mismatched types
-  --> $DIR/typeck.rs:33:13
+  --> $DIR/typeck.rs:32:13
    |
 LL |         (_, !),
    |             ^ a never pattern must be used on an uninhabited type
@@ -23,7 +23,7 @@ LL |         (_, !),
    = note: the matched value is of type `bool`
 
 error: mismatched types
-  --> $DIR/typeck.rs:38:14
+  --> $DIR/typeck.rs:37:14
    |
 LL |         Some(!),
    |              ^ a never pattern must be used on an uninhabited type
@@ -31,7 +31,7 @@ LL |         Some(!),
    = note: the matched value is of type `i32`
 
 error: mismatched types
-  --> $DIR/typeck.rs:45:9
+  --> $DIR/typeck.rs:44:9
    |
 LL |         !,
    |         ^ a never pattern must be used on an uninhabited type
@@ -39,7 +39,7 @@ LL |         !,
    = note: the matched value is of type `()`
 
 error: mismatched types
-  --> $DIR/typeck.rs:52:9
+  --> $DIR/typeck.rs:51:9
    |
 LL |         !,
    |         ^ a never pattern must be used on an uninhabited type
@@ -47,7 +47,7 @@ LL |         !,
    = note: the matched value is of type `Option<Void>`
 
 error: mismatched types
-  --> $DIR/typeck.rs:57:9
+  --> $DIR/typeck.rs:56:9
    |
 LL |         !,
    |         ^ a never pattern must be used on an uninhabited type
@@ -55,7 +55,7 @@ LL |         !,
    = note: the matched value is of type `[Void]`
 
 error: mismatched types
-  --> $DIR/typeck.rs:63:9
+  --> $DIR/typeck.rs:62:9
    |
 LL |         !,
    |         ^ a never pattern must be used on an uninhabited type
diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/typeck.rs b/tests/ui/rfcs/rfc-0000-never_patterns/typeck.rs
index 8300f953dc1..bf74b282f6c 100644
--- a/tests/ui/rfcs/rfc-0000-never_patterns/typeck.rs
+++ b/tests/ui/rfcs/rfc-0000-never_patterns/typeck.rs
@@ -2,7 +2,6 @@
 //@[pass] check-pass
 //@[fail] check-fail
 #![feature(never_patterns)]
-#![feature(min_exhaustive_patterns)]
 #![allow(incomplete_features)]
 
 #[derive(Copy, Clone)]
diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.exh_pats.stderr b/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.exh_pats.stderr
index a875041d89c..d78f4a5f6eb 100644
--- a/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.exh_pats.stderr
+++ b/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.exh_pats.stderr
@@ -1,18 +1,18 @@
 error: unreachable pattern
-  --> $DIR/unreachable.rs:17:9
+  --> $DIR/unreachable.rs:16:9
    |
 LL |         Err(!),
    |         ^^^^^^
    |
    = note: this pattern matches no values because `Void` is uninhabited
 note: the lint level is defined here
-  --> $DIR/unreachable.rs:7:9
+  --> $DIR/unreachable.rs:6:9
    |
 LL | #![deny(unreachable_patterns)]
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error: unreachable pattern
-  --> $DIR/unreachable.rs:20:19
+  --> $DIR/unreachable.rs:19:19
    |
 LL |     let (Ok(_x) | Err(!)) = res_void;
    |                   ^^^^^^
@@ -20,7 +20,7 @@ LL |     let (Ok(_x) | Err(!)) = res_void;
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/unreachable.rs:22:12
+  --> $DIR/unreachable.rs:21:12
    |
 LL |     if let Err(!) = res_void {}
    |            ^^^^^^
@@ -28,7 +28,7 @@ LL |     if let Err(!) = res_void {}
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/unreachable.rs:24:24
+  --> $DIR/unreachable.rs:23:24
    |
 LL |     if let (Ok(true) | Err(!)) = res_void {}
    |                        ^^^^^^
@@ -36,7 +36,7 @@ LL |     if let (Ok(true) | Err(!)) = res_void {}
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/unreachable.rs:26:23
+  --> $DIR/unreachable.rs:25:23
    |
 LL |     for (Ok(mut _x) | Err(!)) in [res_void] {}
    |                       ^^^^^^
@@ -44,7 +44,7 @@ LL |     for (Ok(mut _x) | Err(!)) in [res_void] {}
    = note: this pattern matches no values because `Void` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/unreachable.rs:30:18
+  --> $DIR/unreachable.rs:29:18
    |
 LL | fn foo((Ok(_x) | Err(!)): Result<bool, Void>) {}
    |                  ^^^^^^
diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.normal.stderr b/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.normal.stderr
new file mode 100644
index 00000000000..a3bf8e80ece
--- /dev/null
+++ b/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.normal.stderr
@@ -0,0 +1,44 @@
+error: unreachable pattern
+  --> $DIR/unreachable.rs:16:9
+   |
+LL |         Err(!),
+   |         ^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/unreachable.rs:6:9
+   |
+LL | #![deny(unreachable_patterns)]
+   |         ^^^^^^^^^^^^^^^^^^^^
+
+error: unreachable pattern
+  --> $DIR/unreachable.rs:19:19
+   |
+LL |     let (Ok(_x) | Err(!)) = res_void;
+   |                   ^^^^^^
+
+error: unreachable pattern
+  --> $DIR/unreachable.rs:21:12
+   |
+LL |     if let Err(!) = res_void {}
+   |            ^^^^^^
+
+error: unreachable pattern
+  --> $DIR/unreachable.rs:23:24
+   |
+LL |     if let (Ok(true) | Err(!)) = res_void {}
+   |                        ^^^^^^
+
+error: unreachable pattern
+  --> $DIR/unreachable.rs:25:23
+   |
+LL |     for (Ok(mut _x) | Err(!)) in [res_void] {}
+   |                       ^^^^^^
+
+error: unreachable pattern
+  --> $DIR/unreachable.rs:29:18
+   |
+LL | fn foo((Ok(_x) | Err(!)): Result<bool, Void>) {}
+   |                  ^^^^^^
+
+error: aborting due to 6 previous errors
+
diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.rs b/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.rs
index 4d20c67cf0f..f68da4aa173 100644
--- a/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.rs
+++ b/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.rs
@@ -1,8 +1,5 @@
-//@ revisions: normal exh_pats
-//@[normal] check-pass
 #![feature(never_patterns)]
 #![allow(incomplete_features)]
-#![cfg_attr(exh_pats, feature(min_exhaustive_patterns))]
 #![allow(dead_code, unreachable_code)]
 #![deny(unreachable_patterns)]
 
@@ -15,17 +12,17 @@ fn main() {
     match res_void {
         Ok(_x) => {}
         Err(!),
-        //[exh_pats]~^ ERROR unreachable
+        //~^ ERROR unreachable
     }
     let (Ok(_x) | Err(!)) = res_void;
-    //[exh_pats]~^ ERROR unreachable
+    //~^ ERROR unreachable
     if let Err(!) = res_void {}
-    //[exh_pats]~^ ERROR unreachable
+    //~^ ERROR unreachable
     if let (Ok(true) | Err(!)) = res_void {}
-    //[exh_pats]~^ ERROR unreachable
+    //~^ ERROR unreachable
     for (Ok(mut _x) | Err(!)) in [res_void] {}
-    //[exh_pats]~^ ERROR unreachable
+    //~^ ERROR unreachable
 }
 
 fn foo((Ok(_x) | Err(!)): Result<bool, Void>) {}
-//[exh_pats]~^ ERROR unreachable
+//~^ ERROR unreachable
diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.stderr b/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.stderr
new file mode 100644
index 00000000000..79b640d9f41
--- /dev/null
+++ b/tests/ui/rfcs/rfc-0000-never_patterns/unreachable.stderr
@@ -0,0 +1,55 @@
+error: unreachable pattern
+  --> $DIR/unreachable.rs:14:9
+   |
+LL |         Err(!),
+   |         ^^^^^^
+   |
+   = note: this pattern matches no values because `Void` is uninhabited
+note: the lint level is defined here
+  --> $DIR/unreachable.rs:4:9
+   |
+LL | #![deny(unreachable_patterns)]
+   |         ^^^^^^^^^^^^^^^^^^^^
+
+error: unreachable pattern
+  --> $DIR/unreachable.rs:17:19
+   |
+LL |     let (Ok(_x) | Err(!)) = res_void;
+   |                   ^^^^^^
+   |
+   = note: this pattern matches no values because `Void` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/unreachable.rs:19:12
+   |
+LL |     if let Err(!) = res_void {}
+   |            ^^^^^^
+   |
+   = note: this pattern matches no values because `Void` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/unreachable.rs:21:24
+   |
+LL |     if let (Ok(true) | Err(!)) = res_void {}
+   |                        ^^^^^^
+   |
+   = note: this pattern matches no values because `Void` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/unreachable.rs:23:23
+   |
+LL |     for (Ok(mut _x) | Err(!)) in [res_void] {}
+   |                       ^^^^^^
+   |
+   = note: this pattern matches no values because `Void` is uninhabited
+
+error: unreachable pattern
+  --> $DIR/unreachable.rs:27:18
+   |
+LL | fn foo((Ok(_x) | Err(!)): Result<bool, Void>) {}
+   |                  ^^^^^^
+   |
+   = note: this pattern matches no values because `Void` is uninhabited
+
+error: aborting due to 6 previous errors
+
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs
index 8f090fe886a..d81896eba19 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs
@@ -1,3 +1,4 @@
+//@ check-pass
 #![feature(never_type)]
 
 #[non_exhaustive]
@@ -28,24 +29,24 @@ pub struct IndirectUninhabitedVariants(UninhabitedVariants);
 struct A;
 
 // This test checks that an empty match on a non-exhaustive uninhabited type through a level of
-// indirection from the defining crate will not compile without `#![feature(exhaustive_patterns)]`.
+// indirection from the defining crate compiles.
 
 fn cannot_empty_match_on_empty_enum_to_anything(x: IndirectUninhabitedEnum) -> A {
-    match x {} //~ ERROR non-exhaustive patterns
+    match x {}
 }
 
 fn cannot_empty_match_on_empty_struct_to_anything(x: IndirectUninhabitedStruct) -> A {
-    match x {} //~ ERROR non-exhaustive patterns
+    match x {}
 }
 
 fn cannot_empty_match_on_empty_tuple_struct_to_anything(x: IndirectUninhabitedTupleStruct) -> A {
-    match x {} //~ ERROR non-exhaustive patterns
+    match x {}
 }
 
 fn cannot_empty_match_on_enum_with_empty_variants_struct_to_anything(
     x: IndirectUninhabitedVariants,
 ) -> A {
-    match x {} //~ ERROR non-exhaustive patterns
+    match x {}
 }
 
 fn main() {}
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr
deleted file mode 100644
index c1219054140..00000000000
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr
+++ /dev/null
@@ -1,79 +0,0 @@
-error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedEnum` is non-empty
-  --> $DIR/indirect_match_same_crate.rs:34:11
-   |
-LL |     match x {}
-   |           ^
-   |
-note: `IndirectUninhabitedEnum` defined here
-  --> $DIR/indirect_match_same_crate.rs:20:12
-   |
-LL | pub struct IndirectUninhabitedEnum(UninhabitedEnum);
-   |            ^^^^^^^^^^^^^^^^^^^^^^^
-   = note: the matched value is of type `IndirectUninhabitedEnum`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
-   |
-LL ~     match x {
-LL +         _ => todo!(),
-LL ~     }
-   |
-
-error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedStruct` is non-empty
-  --> $DIR/indirect_match_same_crate.rs:38:11
-   |
-LL |     match x {}
-   |           ^
-   |
-note: `IndirectUninhabitedStruct` defined here
-  --> $DIR/indirect_match_same_crate.rs:22:12
-   |
-LL | pub struct IndirectUninhabitedStruct(UninhabitedStruct);
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: the matched value is of type `IndirectUninhabitedStruct`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
-   |
-LL ~     match x {
-LL +         _ => todo!(),
-LL ~     }
-   |
-
-error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedTupleStruct` is non-empty
-  --> $DIR/indirect_match_same_crate.rs:42:11
-   |
-LL |     match x {}
-   |           ^
-   |
-note: `IndirectUninhabitedTupleStruct` defined here
-  --> $DIR/indirect_match_same_crate.rs:24:12
-   |
-LL | pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct);
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: the matched value is of type `IndirectUninhabitedTupleStruct`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
-   |
-LL ~     match x {
-LL +         _ => todo!(),
-LL ~     }
-   |
-
-error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedVariants` is non-empty
-  --> $DIR/indirect_match_same_crate.rs:48:11
-   |
-LL |     match x {}
-   |           ^
-   |
-note: `IndirectUninhabitedVariants` defined here
-  --> $DIR/indirect_match_same_crate.rs:26:12
-   |
-LL | pub struct IndirectUninhabitedVariants(UninhabitedVariants);
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: the matched value is of type `IndirectUninhabitedVariants`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
-   |
-LL ~     match x {
-LL +         _ => todo!(),
-LL ~     }
-   |
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0004`.
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs
index c40a2676e84..dd9a570522a 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs
@@ -1,6 +1,5 @@
 //@ aux-build:uninhabited.rs
 #![deny(unreachable_patterns)]
-#![feature(min_exhaustive_patterns)]
 #![feature(never_type)]
 
 extern crate uninhabited;
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr
index ef97c1fa17f..745b196a0e3 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr
@@ -1,5 +1,5 @@
 error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedEnum` is non-empty
-  --> $DIR/indirect_match_with_exhaustive_patterns.rs:23:11
+  --> $DIR/indirect_match_with_exhaustive_patterns.rs:22:11
    |
 LL |     match x {}
    |           ^
@@ -18,7 +18,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedStruct` is non-empty
-  --> $DIR/indirect_match_with_exhaustive_patterns.rs:27:11
+  --> $DIR/indirect_match_with_exhaustive_patterns.rs:26:11
    |
 LL |     match x {}
    |           ^
@@ -37,7 +37,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedTupleStruct` is non-empty
-  --> $DIR/indirect_match_with_exhaustive_patterns.rs:31:11
+  --> $DIR/indirect_match_with_exhaustive_patterns.rs:30:11
    |
 LL |     match x {}
    |           ^
@@ -56,7 +56,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedVariants` is non-empty
-  --> $DIR/indirect_match_with_exhaustive_patterns.rs:37:11
+  --> $DIR/indirect_match_with_exhaustive_patterns.rs:36:11
    |
 LL |     match x {}
    |           ^
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs
index efaec0ebdbe..32f5f504136 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs
@@ -1,7 +1,6 @@
 //@ check-pass
 
 #![deny(unreachable_patterns)]
-#![feature(min_exhaustive_patterns)]
 #![feature(never_type)]
 
 #[non_exhaustive]
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs
index ebbdfba15f3..04f7fe26b5a 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs
@@ -1,3 +1,4 @@
+//@ check-pass
 #![feature(never_type)]
 
 #[non_exhaustive]
@@ -27,15 +28,15 @@ fn cannot_empty_match_on_empty_enum_to_anything(x: UninhabitedEnum) -> A {
 }
 
 fn cannot_empty_match_on_empty_struct_to_anything(x: UninhabitedStruct) -> A {
-    match x {} //~ ERROR non-exhaustive patterns
+    match x {}
 }
 
 fn cannot_empty_match_on_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) -> A {
-    match x {} //~ ERROR non-exhaustive patterns
+    match x {}
 }
 
 fn cannot_empty_match_on_enum_with_empty_variants_struct_to_anything(x: UninhabitedVariants) -> A {
-    match x {} //~ ERROR non-exhaustive patterns
+    match x {}
 }
 
 fn main() {}
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr
deleted file mode 100644
index 7a12aca8520..00000000000
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr
+++ /dev/null
@@ -1,64 +0,0 @@
-error[E0004]: non-exhaustive patterns: type `UninhabitedStruct` is non-empty
-  --> $DIR/match_same_crate.rs:30:11
-   |
-LL |     match x {}
-   |           ^
-   |
-note: `UninhabitedStruct` defined here
-  --> $DIR/match_same_crate.rs:8:12
-   |
-LL | pub struct UninhabitedStruct {
-   |            ^^^^^^^^^^^^^^^^^
-   = note: the matched value is of type `UninhabitedStruct`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
-   |
-LL ~     match x {
-LL +         _ => todo!(),
-LL ~     }
-   |
-
-error[E0004]: non-exhaustive patterns: type `UninhabitedTupleStruct` is non-empty
-  --> $DIR/match_same_crate.rs:34:11
-   |
-LL |     match x {}
-   |           ^
-   |
-note: `UninhabitedTupleStruct` defined here
-  --> $DIR/match_same_crate.rs:13:12
-   |
-LL | pub struct UninhabitedTupleStruct(!);
-   |            ^^^^^^^^^^^^^^^^^^^^^^
-   = note: the matched value is of type `UninhabitedTupleStruct`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
-   |
-LL ~     match x {
-LL +         _ => todo!(),
-LL ~     }
-   |
-
-error[E0004]: non-exhaustive patterns: `UninhabitedVariants::Tuple(_)` and `UninhabitedVariants::Struct { .. }` not covered
-  --> $DIR/match_same_crate.rs:38:11
-   |
-LL |     match x {}
-   |           ^ patterns `UninhabitedVariants::Tuple(_)` and `UninhabitedVariants::Struct { .. }` not covered
-   |
-note: `UninhabitedVariants` defined here
-  --> $DIR/match_same_crate.rs:15:10
-   |
-LL | pub enum UninhabitedVariants {
-   |          ^^^^^^^^^^^^^^^^^^^
-LL |     #[non_exhaustive] Tuple(!),
-   |                       ----- not covered
-LL |     #[non_exhaustive] Struct { x: ! }
-   |                       ------ not covered
-   = note: the matched value is of type `UninhabitedVariants`
-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 x {
-LL +         UninhabitedVariants::Tuple(_) | UninhabitedVariants::Struct { .. } => todo!(),
-LL ~     }
-   |
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0004`.
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs
index 69b15fca0b7..108cac7099e 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs
@@ -1,6 +1,5 @@
 //@ aux-build:uninhabited.rs
 #![deny(unreachable_patterns)]
-#![feature(min_exhaustive_patterns)]
 #![feature(never_type)]
 
 extern crate uninhabited;
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr
index 19e2546b0da..0c8b14ab69d 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr
@@ -1,5 +1,5 @@
 error[E0004]: non-exhaustive patterns: type `UninhabitedEnum` is non-empty
-  --> $DIR/match_with_exhaustive_patterns.rs:22:11
+  --> $DIR/match_with_exhaustive_patterns.rs:21:11
    |
 LL |     match x {}
    |           ^
@@ -18,7 +18,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: type `UninhabitedStruct` is non-empty
-  --> $DIR/match_with_exhaustive_patterns.rs:26:11
+  --> $DIR/match_with_exhaustive_patterns.rs:25:11
    |
 LL |     match x {}
    |           ^
@@ -37,7 +37,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: type `UninhabitedTupleStruct` is non-empty
-  --> $DIR/match_with_exhaustive_patterns.rs:30:11
+  --> $DIR/match_with_exhaustive_patterns.rs:29:11
    |
 LL |     match x {}
    |           ^
@@ -56,7 +56,7 @@ LL ~     }
    |
 
 error[E0004]: non-exhaustive patterns: `UninhabitedVariants::Tuple(_)` and `UninhabitedVariants::Struct { .. }` not covered
-  --> $DIR/match_with_exhaustive_patterns.rs:34:11
+  --> $DIR/match_with_exhaustive_patterns.rs:33:11
    |
 LL |     match x {}
    |           ^ patterns `UninhabitedVariants::Tuple(_)` and `UninhabitedVariants::Struct { .. }` not covered
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs
index bbc5d03d612..468703c78e0 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs
@@ -1,7 +1,6 @@
 //@ check-pass
 
 #![deny(unreachable_patterns)]
-#![feature(min_exhaustive_patterns)]
 #![feature(never_type)]
 
 #[non_exhaustive]
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns.rs
index 0007614988c..be55ad51578 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns.rs
@@ -1,7 +1,6 @@
 //@ aux-build:uninhabited.rs
 //@ build-pass (FIXME(62277): could be check-pass?)
 #![deny(unreachable_patterns)]
-#![feature(min_exhaustive_patterns)]
 
 extern crate uninhabited;
 
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs
index 898be87ccca..1194d7b858d 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs
@@ -1,5 +1,4 @@
 #![deny(unreachable_patterns)]
-#![feature(min_exhaustive_patterns)]
 #![feature(never_type)]
 
 #[non_exhaustive]
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr
index d5192a70ed5..c399bb9083f 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr
@@ -1,5 +1,5 @@
 error: unreachable pattern
-  --> $DIR/patterns_same_crate.rs:52:9
+  --> $DIR/patterns_same_crate.rs:51:9
    |
 LL |         Some(_x) => (),
    |         ^^^^^^^^
@@ -12,7 +12,7 @@ LL | #![deny(unreachable_patterns)]
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error: unreachable pattern
-  --> $DIR/patterns_same_crate.rs:57:9
+  --> $DIR/patterns_same_crate.rs:56:9
    |
 LL |         Some(_x) => (),
    |         ^^^^^^^^
@@ -20,7 +20,7 @@ LL |         Some(_x) => (),
    = note: this pattern matches no values because `UninhabitedVariants` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/patterns_same_crate.rs:61:15
+  --> $DIR/patterns_same_crate.rs:60:15
    |
 LL |     while let PartiallyInhabitedVariants::Struct { x } = partially_inhabited_variant() {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -28,7 +28,7 @@ LL |     while let PartiallyInhabitedVariants::Struct { x } = partially_inhabite
    = note: this pattern matches no values because `!` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/patterns_same_crate.rs:65:15
+  --> $DIR/patterns_same_crate.rs:64:15
    |
 LL |     while let Some(_x) = uninhabited_struct() {
    |               ^^^^^^^^
@@ -36,7 +36,7 @@ LL |     while let Some(_x) = uninhabited_struct() {
    = note: this pattern matches no values because `UninhabitedStruct` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/patterns_same_crate.rs:68:15
+  --> $DIR/patterns_same_crate.rs:67:15
    |
 LL |     while let Some(_x) = uninhabited_tuple_struct() {
    |               ^^^^^^^^
diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
index de002ef71d7..fec4e75290f 100644
--- a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
@@ -34,6 +34,7 @@ fn foo() {
 
 #[target_feature(enable = "sse2")]
 fn bar() {
+    sse2();
     avx_bmi2();
     //~^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe
     Quux.avx_bmi2();
@@ -43,7 +44,6 @@ fn bar() {
 #[target_feature(enable = "avx")]
 fn baz() {
     sse2();
-    //~^ ERROR call to function `sse2` with `#[target_feature]` is unsafe
     avx_bmi2();
     //~^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe
     Quux.avx_bmi2();
@@ -54,7 +54,8 @@ fn baz() {
 #[target_feature(enable = "bmi2")]
 fn qux() {
     sse2();
-    //~^ ERROR call to function `sse2` with `#[target_feature]` is unsafe
+    avx_bmi2();
+    Quux.avx_bmi2();
 }
 
 const _: () = sse2();
@@ -64,8 +65,6 @@ const _: () = sse2_and_fxsr();
 //~^ ERROR call to function `sse2_and_fxsr` with `#[target_feature]` is unsafe
 
 #[deny(unsafe_op_in_unsafe_fn)]
-#[target_feature(enable = "avx")]
-#[target_feature(enable = "bmi2")]
 unsafe fn needs_unsafe_block() {
     sse2();
     //~^ ERROR call to function `sse2` with `#[target_feature]` is unsafe
diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr
index 537819ab859..1ddf05b40a6 100644
--- a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr
+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr
@@ -24,7 +24,7 @@ LL |     Quux.avx_bmi2();
    = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
 
 error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
-  --> $DIR/safe-calls.rs:37:5
+  --> $DIR/safe-calls.rs:38:5
    |
 LL |     avx_bmi2();
    |     ^^^^^^^^^^ call to function with `#[target_feature]`
@@ -32,22 +32,13 @@ LL |     avx_bmi2();
    = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
 
 error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
-  --> $DIR/safe-calls.rs:39:5
+  --> $DIR/safe-calls.rs:40:5
    |
 LL |     Quux.avx_bmi2();
    |     ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
    |
    = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2
 
-error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
-  --> $DIR/safe-calls.rs:45:5
-   |
-LL |     sse2();
-   |     ^^^^^^ call to function with `#[target_feature]`
-   |
-   = help: in order for the call to be safe, the context requires the following additional target feature: sse2
-   = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
-
 error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:47:5
    |
@@ -65,16 +56,7 @@ LL |     Quux.avx_bmi2();
    = help: in order for the call to be safe, the context requires the following additional target feature: bmi2
 
 error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
-  --> $DIR/safe-calls.rs:56:5
-   |
-LL |     sse2();
-   |     ^^^^^^ call to function with `#[target_feature]`
-   |
-   = help: in order for the call to be safe, the context requires the following additional target feature: sse2
-   = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
-
-error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
-  --> $DIR/safe-calls.rs:60:15
+  --> $DIR/safe-calls.rs:61:15
    |
 LL | const _: () = sse2();
    |               ^^^^^^ call to function with `#[target_feature]`
@@ -83,7 +65,7 @@ LL | const _: () = sse2();
    = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
 
 error[E0133]: call to function `sse2_and_fxsr` with `#[target_feature]` is unsafe and requires unsafe function or block
-  --> $DIR/safe-calls.rs:63:15
+  --> $DIR/safe-calls.rs:64:15
    |
 LL | const _: () = sse2_and_fxsr();
    |               ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
@@ -92,7 +74,7 @@ LL | const _: () = sse2_and_fxsr();
    = note: the fxsr and sse2 target features being enabled in the build configuration does not remove the requirement to list them in `#[target_feature]`
 
 error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe block
-  --> $DIR/safe-calls.rs:70:5
+  --> $DIR/safe-calls.rs:69:5
    |
 LL |     sse2();
    |     ^^^^^^ call to function with `#[target_feature]`
@@ -101,16 +83,16 @@ LL |     sse2();
    = help: in order for the call to be safe, the context requires the following additional target feature: sse2
    = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]`
 note: an unsafe function restricts its caller, but its body is safe by default
-  --> $DIR/safe-calls.rs:69:1
+  --> $DIR/safe-calls.rs:68:1
    |
 LL | unsafe fn needs_unsafe_block() {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 note: the lint level is defined here
-  --> $DIR/safe-calls.rs:66:8
+  --> $DIR/safe-calls.rs:67:8
    |
 LL | #[deny(unsafe_op_in_unsafe_fn)]
    |        ^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 12 previous errors
+error: aborting due to 10 previous errors
 
 For more information about this error, try `rustc --explain E0133`.
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr
index 9d1ca5dbf2c..b451555ec3c 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr
@@ -40,7 +40,7 @@ error: `~const` can only be applied to `#[const_trait]` traits
 LL | const fn a<T: ~const Destruct>(_: T) {}
    |                      ^^^^^^^^
 
-error[E0049]: method `foo` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `foo` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const-drop.rs:54:5
    |
 LL |     #[const_trait]
@@ -49,7 +49,7 @@ LL |     pub trait SomeTrait {
 LL |         fn foo();
    |               - expected 0 const parameters
 
-error[E0049]: method `foo` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `foo` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const-drop.rs:54:5
    |
 LL |     #[const_trait]
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr
index 2f93f9a6743..296614f7fd0 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr
@@ -40,7 +40,7 @@ error: `~const` can only be applied to `#[const_trait]` traits
 LL | const fn a<T: ~const Destruct>(_: T) {}
    |                      ^^^^^^^^
 
-error[E0049]: method `foo` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `foo` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const-drop.rs:54:5
    |
 LL |     #[const_trait]
@@ -49,7 +49,7 @@ LL |     pub trait SomeTrait {
 LL |         fn foo();
    |               - expected 0 const parameters
 
-error[E0049]: method `foo` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `foo` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const-drop.rs:54:5
    |
 LL |     #[const_trait]
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr
index b4c4cf0a890..7643697874f 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr
@@ -1,4 +1,4 @@
-error[E0049]: method `bar` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `bar` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const-default-bound-non-const-specialized-bound.rs:16:1
    |
 LL | #[const_trait]
@@ -16,7 +16,7 @@ LL | |     T: Foo, //FIXME ~ ERROR missing `~const` qualifier
 LL | |     T: Specialize,
    | |__________________^
 
-error[E0049]: method `baz` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `baz` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const-default-bound-non-const-specialized-bound.rs:36:1
    |
 LL | #[const_trait]
@@ -25,7 +25,7 @@ LL | trait Baz {
 LL |     fn baz();
    |           - expected 0 const parameters
 
-error[E0049]: method `baz` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `baz` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const-default-bound-non-const-specialized-bound.rs:36:1
    |
 LL | #[const_trait]
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.stderr
index cabf201405f..9b2ae8d739c 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.stderr
@@ -1,4 +1,4 @@
-error[E0049]: method `value` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `value` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const-default-const-specialized.rs:10:1
    |
 LL | #[const_trait]
@@ -7,7 +7,7 @@ LL | trait Value {
 LL |     fn value() -> u32;
    |             - expected 0 const parameters
 
-error[E0049]: method `value` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `value` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const-default-const-specialized.rs:10:1
    |
 LL | #[const_trait]
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/default-keyword.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/default-keyword.stderr
index 52c8708f2c8..18a25045f4b 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/default-keyword.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/default-keyword.stderr
@@ -1,4 +1,4 @@
-error[E0049]: method `foo` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `foo` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/default-keyword.rs:7:1
    |
 LL | #[const_trait]
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.stderr
index 1aa34637ca4..ecdc7b930e6 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.stderr
@@ -1,4 +1,4 @@
-error[E0049]: method `foo` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `foo` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/issue-95186-specialize-on-tilde-const.rs:14:1
    |
 LL | #[const_trait]
@@ -7,7 +7,7 @@ LL | trait Foo {
 LL |     fn foo();
    |           - expected 0 const parameters
 
-error[E0049]: method `foo` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `foo` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/issue-95186-specialize-on-tilde-const.rs:14:1
    |
 LL | #[const_trait]
@@ -18,7 +18,7 @@ LL |     fn foo();
    |
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
-error[E0049]: method `bar` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `bar` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/issue-95186-specialize-on-tilde-const.rs:30:1
    |
 LL | #[const_trait]
@@ -27,7 +27,7 @@ LL | trait Bar {
 LL |     fn bar() {}
    |           - expected 0 const parameters
 
-error[E0049]: method `bar` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `bar` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/issue-95186-specialize-on-tilde-const.rs:30:1
    |
 LL | #[const_trait]
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.stderr
index 0e0f391b086..6679bb46537 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.stderr
@@ -1,4 +1,4 @@
-error[E0049]: method `bar` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `bar` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/issue-95187-same-trait-bound-different-constness.rs:18:1
    |
 LL | #[const_trait]
@@ -7,7 +7,7 @@ LL | trait Bar {
 LL |     fn bar();
    |           - expected 0 const parameters
 
-error[E0049]: method `bar` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `bar` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/issue-95187-same-trait-bound-different-constness.rs:18:1
    |
 LL | #[const_trait]
@@ -18,7 +18,7 @@ LL |     fn bar();
    |
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
-error[E0049]: method `baz` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `baz` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/issue-95187-same-trait-bound-different-constness.rs:38:1
    |
 LL | #[const_trait]
@@ -27,7 +27,7 @@ LL | trait Baz {
 LL |     fn baz();
    |           - expected 0 const parameters
 
-error[E0049]: method `baz` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `baz` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/issue-95187-same-trait-bound-different-constness.rs:38:1
    |
 LL | #[const_trait]
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.stderr
index d49beb93259..7f363922947 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.stderr
@@ -1,4 +1,4 @@
-error[E0049]: method `value` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `value` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/non-const-default-const-specialized.rs:9:1
    |
 LL | #[const_trait]
@@ -7,7 +7,7 @@ LL | trait Value {
 LL |     fn value() -> u32;
    |             - expected 0 const parameters
 
-error[E0049]: method `value` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `value` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/non-const-default-const-specialized.rs:9:1
    |
 LL | #[const_trait]
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr
index d082cd6de60..bf273f349b4 100644
--- a/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr
+++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr
@@ -1,4 +1,4 @@
-error[E0049]: method `a` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `a` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/specializing-constness-2.rs:9:1
    |
 LL | #[const_trait]
@@ -7,7 +7,7 @@ LL | pub trait A {
 LL |     fn a() -> u32;
    |         - expected 0 const parameters
 
-error[E0049]: method `a` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `a` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/specializing-constness-2.rs:9:1
    |
 LL | #[const_trait]
diff --git a/tests/ui/rust-2018/auxiliary/edition-lint-infer-outlives-macro.rs b/tests/ui/rust-2018/edition-lint-inter-outlives/auxiliary/edition-lint-infer-outlives-macro.rs
index d45fa10f022..d45fa10f022 100644
--- a/tests/ui/rust-2018/auxiliary/edition-lint-infer-outlives-macro.rs
+++ b/tests/ui/rust-2018/edition-lint-inter-outlives/auxiliary/edition-lint-infer-outlives-macro.rs
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives-macro.fixed b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.fixed
index 435857224ac..435857224ac 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives-macro.fixed
+++ b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.fixed
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives-macro.rs b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.rs
index 6c879231a16..6c879231a16 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives-macro.rs
+++ b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.rs
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives-macro.stderr b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.stderr
index d684911be39..d684911be39 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives-macro.stderr
+++ b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-macro.stderr
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives-multispan.rs b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-multispan.rs
index d2254acb33f..d2254acb33f 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives-multispan.rs
+++ b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-multispan.rs
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives-multispan.stderr b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-multispan.stderr
index 1f4190665b9..1f4190665b9 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives-multispan.stderr
+++ b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives-multispan.stderr
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives.fixed b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives.fixed
index c4948051c18..c4948051c18 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives.fixed
+++ b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives.fixed
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives.rs b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives.rs
index c80e91ca12c..c80e91ca12c 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives.rs
+++ b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives.rs
diff --git a/tests/ui/rust-2018/edition-lint-infer-outlives.stderr b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives.stderr
index dbf301fd8a1..dbf301fd8a1 100644
--- a/tests/ui/rust-2018/edition-lint-infer-outlives.stderr
+++ b/tests/ui/rust-2018/edition-lint-inter-outlives/edition-lint-infer-outlives.stderr
diff --git a/tests/ui/rust-2018/edition-lint-inter-outlives/explicit-outlives-recursive-119228.fixed b/tests/ui/rust-2018/edition-lint-inter-outlives/explicit-outlives-recursive-119228.fixed
new file mode 100644
index 00000000000..7b9fac8f408
--- /dev/null
+++ b/tests/ui/rust-2018/edition-lint-inter-outlives/explicit-outlives-recursive-119228.fixed
@@ -0,0 +1,41 @@
+//@ run-rustfix
+//@ check-pass
+#![deny(explicit_outlives_requirements)]
+
+pub trait TypeCx {
+    type Ty;
+}
+
+pub struct Pat<Cx: TypeCx> {
+    pub ty: Cx::Ty,
+}
+
+// Simple recursive case: no warning
+pub struct MyTypeContextSimpleRecursive<'thir, 'tcx: 'thir> {
+    pub pat: Pat<MyTypeContextSimpleRecursive<'thir, 'tcx>>,
+}
+impl<'thir, 'tcx: 'thir> TypeCx for MyTypeContextSimpleRecursive<'thir, 'tcx> {
+    type Ty = ();
+}
+
+// Non-recursive case: we want a warning
+pub struct MyTypeContextNotRecursive<'thir, 'tcx: 'thir> {
+    pub tcx: &'tcx (),
+    pub thir: &'thir (),
+}
+impl<'thir, 'tcx: 'thir> TypeCx for MyTypeContextNotRecursive<'thir, 'tcx> {
+    type Ty = ();
+}
+
+
+// Mixed-recursive case: we want a warning
+pub struct MyTypeContextMixedRecursive<'thir, 'tcx: 'thir> {
+    pub pat: Pat<MyTypeContextMixedRecursive<'thir, 'tcx>>,
+    pub tcx: &'tcx (),
+    pub thir: &'thir (),
+}
+impl<'thir, 'tcx: 'thir> TypeCx for MyTypeContextMixedRecursive<'thir, 'tcx> {
+    type Ty = ();
+}
+
+fn main() {}
diff --git a/tests/ui/rust-2018/edition-lint-inter-outlives/explicit-outlives-recursive-119228.rs b/tests/ui/rust-2018/edition-lint-inter-outlives/explicit-outlives-recursive-119228.rs
new file mode 100644
index 00000000000..7b9fac8f408
--- /dev/null
+++ b/tests/ui/rust-2018/edition-lint-inter-outlives/explicit-outlives-recursive-119228.rs
@@ -0,0 +1,41 @@
+//@ run-rustfix
+//@ check-pass
+#![deny(explicit_outlives_requirements)]
+
+pub trait TypeCx {
+    type Ty;
+}
+
+pub struct Pat<Cx: TypeCx> {
+    pub ty: Cx::Ty,
+}
+
+// Simple recursive case: no warning
+pub struct MyTypeContextSimpleRecursive<'thir, 'tcx: 'thir> {
+    pub pat: Pat<MyTypeContextSimpleRecursive<'thir, 'tcx>>,
+}
+impl<'thir, 'tcx: 'thir> TypeCx for MyTypeContextSimpleRecursive<'thir, 'tcx> {
+    type Ty = ();
+}
+
+// Non-recursive case: we want a warning
+pub struct MyTypeContextNotRecursive<'thir, 'tcx: 'thir> {
+    pub tcx: &'tcx (),
+    pub thir: &'thir (),
+}
+impl<'thir, 'tcx: 'thir> TypeCx for MyTypeContextNotRecursive<'thir, 'tcx> {
+    type Ty = ();
+}
+
+
+// Mixed-recursive case: we want a warning
+pub struct MyTypeContextMixedRecursive<'thir, 'tcx: 'thir> {
+    pub pat: Pat<MyTypeContextMixedRecursive<'thir, 'tcx>>,
+    pub tcx: &'tcx (),
+    pub thir: &'thir (),
+}
+impl<'thir, 'tcx: 'thir> TypeCx for MyTypeContextMixedRecursive<'thir, 'tcx> {
+    type Ty = ();
+}
+
+fn main() {}
diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-already-future.rs b/tests/ui/rust-2024/prelude-migration/future-poll-already-future.rs
new file mode 100644
index 00000000000..7bf5118c340
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/future-poll-already-future.rs
@@ -0,0 +1,17 @@
+//@ revisions: e2021 e2024
+//@[e2021] edition: 2021
+//@[e2024] edition: 2024
+//@[e2024] compile-flags: -Zunstable-options
+//@ check-pass
+
+#![deny(rust_2024_prelude_collisions)]
+
+use std::future::Future;
+
+fn main() {
+    core::pin::pin!(async {}).poll(&mut context());
+}
+
+fn context() -> core::task::Context<'static> {
+    loop {}
+}
diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.fixed b/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.fixed
new file mode 100644
index 00000000000..44850c8c45b
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.fixed
@@ -0,0 +1,21 @@
+//@ revisions: e2021 e2024
+//@[e2021] edition: 2021
+//@[e2021] run-rustfix
+//@[e2024] edition: 2024
+//@[e2024] compile-flags: -Zunstable-options
+//@[e2024] check-pass
+
+#![deny(rust_2024_prelude_collisions)]
+trait Meow {
+    fn poll(&self, _ctx: &mut core::task::Context<'_>) {}
+}
+impl<T> Meow for T {}
+fn main() {
+    Meow::poll(&core::pin::pin!(async {}), &mut context());
+    //[e2021]~^ ERROR trait method `poll` will become ambiguous in Rust 2024
+    //[e2021]~| WARN this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+}
+
+fn context() -> core::task::Context<'static> {
+    loop {}
+}
diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.stderr b/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.stderr
new file mode 100644
index 00000000000..496b3197c34
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/future-poll-async-block.e2021.stderr
@@ -0,0 +1,16 @@
+error: trait method `poll` will become ambiguous in Rust 2024
+  --> $DIR/future-poll-async-block.rs:14:5
+   |
+LL |     core::pin::pin!(async {}).poll(&mut context());
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::poll(&core::pin::pin!(async {}), &mut context())`
+   |
+   = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/prelude.html>
+note: the lint level is defined here
+  --> $DIR/future-poll-async-block.rs:8:9
+   |
+LL | #![deny(rust_2024_prelude_collisions)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-async-block.rs b/tests/ui/rust-2024/prelude-migration/future-poll-async-block.rs
new file mode 100644
index 00000000000..614e4c786c5
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/future-poll-async-block.rs
@@ -0,0 +1,21 @@
+//@ revisions: e2021 e2024
+//@[e2021] edition: 2021
+//@[e2021] run-rustfix
+//@[e2024] edition: 2024
+//@[e2024] compile-flags: -Zunstable-options
+//@[e2024] check-pass
+
+#![deny(rust_2024_prelude_collisions)]
+trait Meow {
+    fn poll(&self, _ctx: &mut core::task::Context<'_>) {}
+}
+impl<T> Meow for T {}
+fn main() {
+    core::pin::pin!(async {}).poll(&mut context());
+    //[e2021]~^ ERROR trait method `poll` will become ambiguous in Rust 2024
+    //[e2021]~| WARN this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+}
+
+fn context() -> core::task::Context<'static> {
+    loop {}
+}
diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.fixed b/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.fixed
new file mode 100644
index 00000000000..c96d1dcecc2
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.fixed
@@ -0,0 +1,21 @@
+//@ revisions: e2021 e2024
+//@[e2021] edition: 2021
+//@[e2021] run-rustfix
+//@[e2024] edition: 2024
+//@[e2024] compile-flags: -Zunstable-options
+//@[e2024] check-pass
+
+#![deny(rust_2024_prelude_collisions)]
+trait Meow {
+    fn poll(&self) {}
+}
+impl<T> Meow for T {}
+fn main() {
+    // This is a deliberate false positive.
+    // While `()` does not implement `Future` and can therefore not be ambiguous, we
+    // do not check that in the lint, as that introduces additional complexities.
+    // Just checking whether the self type is `Pin<&mut _>` is enough.
+    Meow::poll(&core::pin::pin!(()));
+    //[e2021]~^ ERROR trait method `poll` will become ambiguous in Rust 2024
+    //[e2021]~| WARN this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+}
diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.stderr b/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.stderr
new file mode 100644
index 00000000000..020a00ccdec
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.e2021.stderr
@@ -0,0 +1,16 @@
+error: trait method `poll` will become ambiguous in Rust 2024
+  --> $DIR/future-poll-not-future-pinned.rs:18:5
+   |
+LL |     core::pin::pin!(()).poll();
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::poll(&core::pin::pin!(()))`
+   |
+   = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/prelude.html>
+note: the lint level is defined here
+  --> $DIR/future-poll-not-future-pinned.rs:8:9
+   |
+LL | #![deny(rust_2024_prelude_collisions)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.rs b/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.rs
new file mode 100644
index 00000000000..21b170a5f1d
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/future-poll-not-future-pinned.rs
@@ -0,0 +1,21 @@
+//@ revisions: e2021 e2024
+//@[e2021] edition: 2021
+//@[e2021] run-rustfix
+//@[e2024] edition: 2024
+//@[e2024] compile-flags: -Zunstable-options
+//@[e2024] check-pass
+
+#![deny(rust_2024_prelude_collisions)]
+trait Meow {
+    fn poll(&self) {}
+}
+impl<T> Meow for T {}
+fn main() {
+    // This is a deliberate false positive.
+    // While `()` does not implement `Future` and can therefore not be ambiguous, we
+    // do not check that in the lint, as that introduces additional complexities.
+    // Just checking whether the self type is `Pin<&mut _>` is enough.
+    core::pin::pin!(()).poll();
+    //[e2021]~^ ERROR trait method `poll` will become ambiguous in Rust 2024
+    //[e2021]~| WARN this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+}
diff --git a/tests/ui/rust-2024/prelude-migration/future-poll-not-future.rs b/tests/ui/rust-2024/prelude-migration/future-poll-not-future.rs
new file mode 100644
index 00000000000..899b69ebfc2
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/future-poll-not-future.rs
@@ -0,0 +1,15 @@
+//@ revisions: e2021 e2024
+//@[e2021] edition: 2021
+//@[e2024] edition: 2024
+//@[e2024] compile-flags: -Zunstable-options
+//@ check-pass
+
+#![deny(rust_2024_prelude_collisions)]
+trait Meow {
+    fn poll(&self) {}
+}
+impl<T> Meow for T {}
+fn main() {
+    // As the self type here is not `Pin<&mut _>`, the lint does not fire.
+    ().poll();
+}
diff --git a/tests/ui/rust-2024/prelude-migration/in_2024_compatibility.rs b/tests/ui/rust-2024/prelude-migration/in_2024_compatibility.rs
new file mode 100644
index 00000000000..b6a5d278720
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/in_2024_compatibility.rs
@@ -0,0 +1,17 @@
+//@ edition: 2021
+
+#![deny(rust_2024_compatibility)]
+
+trait Meow {
+    fn poll(&self, _ctx: &mut core::task::Context<'_>) {}
+}
+impl<T> Meow for T {}
+fn main() {
+    core::pin::pin!(async {}).poll(&mut context());
+    //~^ ERROR trait method `poll` will become ambiguous in Rust 2024
+    //~| WARN this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+}
+
+fn context() -> core::task::Context<'static> {
+    loop {}
+}
diff --git a/tests/ui/rust-2024/prelude-migration/in_2024_compatibility.stderr b/tests/ui/rust-2024/prelude-migration/in_2024_compatibility.stderr
new file mode 100644
index 00000000000..5865029d65d
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/in_2024_compatibility.stderr
@@ -0,0 +1,17 @@
+error: trait method `poll` will become ambiguous in Rust 2024
+  --> $DIR/in_2024_compatibility.rs:10:5
+   |
+LL |     core::pin::pin!(async {}).poll(&mut context());
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::poll(&core::pin::pin!(async {}), &mut context())`
+   |
+   = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/prelude.html>
+note: the lint level is defined here
+  --> $DIR/in_2024_compatibility.rs:3:9
+   |
+LL | #![deny(rust_2024_compatibility)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^
+   = note: `#[deny(rust_2024_prelude_collisions)]` implied by `#[deny(rust_2024_compatibility)]`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.fixed b/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.fixed
new file mode 100644
index 00000000000..0b0873eb238
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.fixed
@@ -0,0 +1,29 @@
+//@ revisions: e2021 e2024
+//@[e2021] edition: 2021
+//@[e2021] run-rustfix
+//@[e2024] edition: 2024
+//@[e2024] compile-flags: -Zunstable-options
+//@[e2024] check-pass
+
+#![deny(rust_2024_prelude_collisions)]
+trait Meow {
+    fn into_future(&self) {}
+}
+impl Meow for Cat {}
+
+struct Cat;
+
+impl core::future::IntoFuture for Cat {
+    type Output = ();
+    type IntoFuture = core::future::Ready<()>;
+
+    fn into_future(self) -> Self::IntoFuture {
+        core::future::ready(())
+    }
+}
+
+fn main() {
+    Meow::into_future(&Cat);
+    //[e2021]~^ ERROR trait method `into_future` will become ambiguous in Rust 2024
+    //[e2021]~| WARN this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+}
diff --git a/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.stderr b/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.stderr
new file mode 100644
index 00000000000..b74e80e2a4a
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/into-future-adt.e2021.stderr
@@ -0,0 +1,16 @@
+error: trait method `into_future` will become ambiguous in Rust 2024
+  --> $DIR/into-future-adt.rs:26:5
+   |
+LL |     Cat.into_future();
+   |     ^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::into_future(&Cat)`
+   |
+   = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/prelude.html>
+note: the lint level is defined here
+  --> $DIR/into-future-adt.rs:8:9
+   |
+LL | #![deny(rust_2024_prelude_collisions)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/rust-2024/prelude-migration/into-future-adt.rs b/tests/ui/rust-2024/prelude-migration/into-future-adt.rs
new file mode 100644
index 00000000000..0db70930bc7
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/into-future-adt.rs
@@ -0,0 +1,29 @@
+//@ revisions: e2021 e2024
+//@[e2021] edition: 2021
+//@[e2021] run-rustfix
+//@[e2024] edition: 2024
+//@[e2024] compile-flags: -Zunstable-options
+//@[e2024] check-pass
+
+#![deny(rust_2024_prelude_collisions)]
+trait Meow {
+    fn into_future(&self) {}
+}
+impl Meow for Cat {}
+
+struct Cat;
+
+impl core::future::IntoFuture for Cat {
+    type Output = ();
+    type IntoFuture = core::future::Ready<()>;
+
+    fn into_future(self) -> Self::IntoFuture {
+        core::future::ready(())
+    }
+}
+
+fn main() {
+    Cat.into_future();
+    //[e2021]~^ ERROR trait method `into_future` will become ambiguous in Rust 2024
+    //[e2021]~| WARN this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+}
diff --git a/tests/ui/rust-2024/prelude-migration/into-future-already-into-future.rs b/tests/ui/rust-2024/prelude-migration/into-future-already-into-future.rs
new file mode 100644
index 00000000000..6bc2ea31705
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/into-future-already-into-future.rs
@@ -0,0 +1,24 @@
+//@ revisions: e2021 e2024
+//@[e2021] edition: 2021
+//@[e2024] edition: 2024
+//@[e2024] compile-flags: -Zunstable-options
+//@ check-pass
+
+#![deny(rust_2024_prelude_collisions)]
+
+use core::future::IntoFuture;
+
+struct Cat;
+
+impl IntoFuture for Cat {
+    type Output = ();
+    type IntoFuture = core::future::Ready<()>;
+
+    fn into_future(self) -> Self::IntoFuture {
+        core::future::ready(())
+    }
+}
+
+fn main() {
+    let _ = Cat.into_future();
+}
diff --git a/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.fixed b/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.fixed
new file mode 100644
index 00000000000..a798014d93d
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.fixed
@@ -0,0 +1,23 @@
+//@ revisions: e2021 e2024
+//@[e2021] edition: 2021
+//@[e2021] run-rustfix
+//@[e2024] edition: 2024
+//@[e2024] compile-flags: -Zunstable-options
+//@[e2024] check-pass
+
+#![deny(rust_2024_prelude_collisions)]
+trait Meow {
+    fn into_future(&self) {}
+}
+impl Meow for Cat {}
+
+struct Cat;
+
+fn main() {
+    // This is a false positive, but it should be rare enough to not matter, and checking whether
+    // it implements the trait can have other nontrivial consequences, so it was decided to accept
+    // this.
+    Meow::into_future(&Cat);
+    //[e2021]~^ ERROR trait method `into_future` will become ambiguous in Rust 2024
+    //[e2021]~| WARN this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+}
diff --git a/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.stderr b/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.stderr
new file mode 100644
index 00000000000..6ea4580ca72
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.e2021.stderr
@@ -0,0 +1,16 @@
+error: trait method `into_future` will become ambiguous in Rust 2024
+  --> $DIR/into-future-not-into-future.rs:20:5
+   |
+LL |     Cat.into_future();
+   |     ^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `Meow::into_future(&Cat)`
+   |
+   = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/prelude.html>
+note: the lint level is defined here
+  --> $DIR/into-future-not-into-future.rs:8:9
+   |
+LL | #![deny(rust_2024_prelude_collisions)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.rs b/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.rs
new file mode 100644
index 00000000000..23e81cfe6b4
--- /dev/null
+++ b/tests/ui/rust-2024/prelude-migration/into-future-not-into-future.rs
@@ -0,0 +1,23 @@
+//@ revisions: e2021 e2024
+//@[e2021] edition: 2021
+//@[e2021] run-rustfix
+//@[e2024] edition: 2024
+//@[e2024] compile-flags: -Zunstable-options
+//@[e2024] check-pass
+
+#![deny(rust_2024_prelude_collisions)]
+trait Meow {
+    fn into_future(&self) {}
+}
+impl Meow for Cat {}
+
+struct Cat;
+
+fn main() {
+    // This is a false positive, but it should be rare enough to not matter, and checking whether
+    // it implements the trait can have other nontrivial consequences, so it was decided to accept
+    // this.
+    Cat.into_future();
+    //[e2021]~^ ERROR trait method `into_future` will become ambiguous in Rust 2024
+    //[e2021]~| WARN this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
+}
diff --git a/tests/ui/rust-2024/safe-outside-extern.rs b/tests/ui/rust-2024/safe-outside-extern.rs
index 6773df5ef03..674b78dc571 100644
--- a/tests/ui/rust-2024/safe-outside-extern.rs
+++ b/tests/ui/rust-2024/safe-outside-extern.rs
@@ -1,29 +1,21 @@
-//@ revisions: gated ungated
-#![cfg_attr(gated, feature(unsafe_extern_blocks))]
-
 safe fn foo() {}
 //~^ ERROR: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
-//[ungated]~| ERROR: unsafe extern {}` blocks and `safe` keyword are experimental [E0658]
 
 safe static FOO: i32 = 1;
 //~^ ERROR: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
-//[ungated]~| ERROR: unsafe extern {}` blocks and `safe` keyword are experimental [E0658]
 
 trait Foo {
     safe fn foo();
     //~^ ERROR: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
-    //[ungated]~| ERROR: unsafe extern {}` blocks and `safe` keyword are experimental [E0658]
 }
 
 impl Foo for () {
     safe fn foo() {}
     //~^ ERROR: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
-    //[ungated]~| ERROR: unsafe extern {}` blocks and `safe` keyword are experimental [E0658]
 }
 
 type FnPtr = safe fn(i32, i32) -> i32;
 //~^ ERROR: function pointers cannot be declared with `safe` safety qualifier
-//[ungated]~| ERROR: unsafe extern {}` blocks and `safe` keyword are experimental [E0658]
 
 unsafe static LOL: u8 = 0;
 //~^ ERROR: static items cannot be declared with `unsafe` safety qualifier outside of `extern` block
diff --git a/tests/ui/rust-2024/safe-outside-extern.stderr b/tests/ui/rust-2024/safe-outside-extern.stderr
new file mode 100644
index 00000000000..19d7c5fde0b
--- /dev/null
+++ b/tests/ui/rust-2024/safe-outside-extern.stderr
@@ -0,0 +1,38 @@
+error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
+  --> $DIR/safe-outside-extern.rs:1:1
+   |
+LL | safe fn foo() {}
+   | ^^^^^^^^^^^^^^^^
+
+error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
+  --> $DIR/safe-outside-extern.rs:4:1
+   |
+LL | safe static FOO: i32 = 1;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
+  --> $DIR/safe-outside-extern.rs:8:5
+   |
+LL |     safe fn foo();
+   |     ^^^^^^^^^^^^^^
+
+error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
+  --> $DIR/safe-outside-extern.rs:13:5
+   |
+LL |     safe fn foo() {}
+   |     ^^^^^^^^^^^^^^^^
+
+error: function pointers cannot be declared with `safe` safety qualifier
+  --> $DIR/safe-outside-extern.rs:17:14
+   |
+LL | type FnPtr = safe fn(i32, i32) -> i32;
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: static items cannot be declared with `unsafe` safety qualifier outside of `extern` block
+  --> $DIR/safe-outside-extern.rs:20:1
+   |
+LL | unsafe static LOL: u8 = 0;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 6 previous errors
+
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2021.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2021.stderr
index 3a99caa719b..77554da10e6 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2021.stderr
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2021.stderr
@@ -1,5 +1,5 @@
 error[E0133]: call to unsafe function `test1` is unsafe and requires unsafe function or block
-  --> $DIR/extern-items-unsafe.rs:14:5
+  --> $DIR/extern-items-unsafe.rs:12:5
    |
 LL |     test1(TEST1);
    |     ^^^^^^^^^^^^ call to unsafe function
@@ -7,7 +7,7 @@ LL |     test1(TEST1);
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
 error[E0133]: use of extern static is unsafe and requires unsafe function or block
-  --> $DIR/extern-items-unsafe.rs:14:11
+  --> $DIR/extern-items-unsafe.rs:12:11
    |
 LL |     test1(TEST1);
    |           ^^^^^ use of extern static
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2024.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2024.stderr
index fcf937b7ac5..33b752782d5 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2024.stderr
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.edition2024.stderr
@@ -1,5 +1,5 @@
 error[E0133]: call to unsafe function `test1` is unsafe and requires unsafe block
-  --> $DIR/extern-items-unsafe.rs:14:5
+  --> $DIR/extern-items-unsafe.rs:12:5
    |
 LL |     test1(TEST1);
    |     ^^^^^^^^^^^^ call to unsafe function
@@ -7,7 +7,7 @@ LL |     test1(TEST1);
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
 error[E0133]: use of extern static is unsafe and requires unsafe block
-  --> $DIR/extern-items-unsafe.rs:14:11
+  --> $DIR/extern-items-unsafe.rs:12:11
    |
 LL |     test1(TEST1);
    |           ^^^^^ use of extern static
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.rs b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.rs
index ad569a256db..721e07acca5 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.rs
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items-unsafe.rs
@@ -3,8 +3,6 @@
 //@[edition2024] edition:2024
 //@[edition2024] compile-flags: -Zunstable-options
 
-#![feature(unsafe_extern_blocks)]
-
 unsafe extern "C" {
     static TEST1: i32;
     fn test1(i: i32);
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.edition2024.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.edition2024.stderr
index d456cfc6829..8ef7c2caf21 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.edition2024.stderr
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.edition2024.stderr
@@ -1,5 +1,5 @@
 error: extern blocks must be unsafe
-  --> $DIR/extern-items.rs:9:1
+  --> $DIR/extern-items.rs:7:1
    |
 LL | / extern "C" {
 LL | |
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.rs b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.rs
index 16fa1bbb8a4..08805c36347 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.rs
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/extern-items.rs
@@ -4,8 +4,6 @@
 //@[edition2024] edition:2024
 //@[edition2024] compile-flags: -Zunstable-options
 
-#![feature(unsafe_extern_blocks)]
-
 extern "C" {
     //[edition2024]~^ ERROR extern blocks must be unsafe
     static TEST1: i32;
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.rs b/tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.rs
index 57c03e4d896..67df8c14b39 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.rs
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.rs
@@ -1,6 +1,3 @@
-//@ revisions: gated ungated
-#![cfg_attr(gated, feature(unsafe_extern_blocks))]
-
 trait Bar {}
 safe impl Bar for () { }
 //~^ ERROR expected one of `!` or `::`, found keyword `impl`
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.gated.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.stderr
index 80e7a45f57e..f1021726b18 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.gated.stderr
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/safe-impl-trait.stderr
@@ -1,5 +1,5 @@
 error: expected one of `!` or `::`, found keyword `impl`
-  --> $DIR/safe-impl-trait.rs:5:6
+  --> $DIR/safe-impl-trait.rs:2:6
    |
 LL | safe impl Bar for () { }
    |      ^^^^ expected one of `!` or `::`
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/safe-items.rs b/tests/ui/rust-2024/unsafe-extern-blocks/safe-items.rs
index 74cd5621fce..b0b8a8b012a 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/safe-items.rs
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/safe-items.rs
@@ -4,8 +4,6 @@
 //@[edition2024] compile-flags: -Zunstable-options
 //@ check-pass
 
-#![feature(unsafe_extern_blocks)]
-
 unsafe extern "C" {
     safe static TEST1: i32;
     safe fn test1(i: i32);
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.rs b/tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.rs
index e73cb45b188..52773b4cbbb 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.rs
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.rs
@@ -1,6 +1,3 @@
-//@ revisions: gated ungated
-#![cfg_attr(gated, feature(unsafe_extern_blocks))]
-
 safe trait Foo {}
 //~^ ERROR expected one of `!` or `::`, found keyword `trait`
 
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.stderr
new file mode 100644
index 00000000000..1733336a797
--- /dev/null
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/safe-trait.stderr
@@ -0,0 +1,8 @@
+error: expected one of `!` or `::`, found keyword `trait`
+  --> $DIR/safe-trait.rs:1:6
+   |
+LL | safe trait Foo {}
+   |      ^^^^^ expected one of `!` or `::`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2021.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2021.stderr
index e90613357b1..93797987286 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2021.stderr
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2021.stderr
@@ -1,5 +1,5 @@
 error: items in unadorned `extern` blocks cannot have safety qualifiers
-  --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:10:5
+  --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:8:5
    |
 LL |     safe static TEST1: i32;
    |     ^^^^^^^^^^^^^^^^^^^^^^^
@@ -10,7 +10,7 @@ LL | unsafe extern "C" {
    | ++++++
 
 error: items in unadorned `extern` blocks cannot have safety qualifiers
-  --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:12:5
+  --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:10:5
    |
 LL |     safe fn test1(i: i32);
    |     ^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2024.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2024.stderr
index 1207ee158cc..e9db6006c0b 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2024.stderr
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.edition2024.stderr
@@ -1,5 +1,5 @@
 error: extern blocks must be unsafe
-  --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:8:1
+  --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:6:1
    |
 LL | / extern "C" {
 LL | |
@@ -11,7 +11,7 @@ LL | | }
    | |_^
 
 error: items in unadorned `extern` blocks cannot have safety qualifiers
-  --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:10:5
+  --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:8:5
    |
 LL |     safe static TEST1: i32;
    |     ^^^^^^^^^^^^^^^^^^^^^^^
@@ -22,7 +22,7 @@ LL | unsafe extern "C" {
    | ++++++
 
 error: items in unadorned `extern` blocks cannot have safety qualifiers
-  --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:12:5
+  --> $DIR/safe-unsafe-on-unadorned-extern-block.rs:10:5
    |
 LL |     safe fn test1(i: i32);
    |     ^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.rs b/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.rs
index 11f55cb195f..4badb50b267 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.rs
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/safe-unsafe-on-unadorned-extern-block.rs
@@ -3,8 +3,6 @@
 //@[edition2024] edition:2024
 //@[edition2024] compile-flags: -Zunstable-options
 
-#![feature(unsafe_extern_blocks)]
-
 extern "C" {
     //[edition2024]~^ ERROR extern blocks must be unsafe
     safe static TEST1: i32;
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.fixed b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.fixed
index 10c19759d8a..f686809615f 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.fixed
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.fixed
@@ -1,6 +1,5 @@
 //@ run-rustfix
 
-#![feature(unsafe_extern_blocks)]
 #![deny(missing_unsafe_on_extern)]
 #![allow(unused)]
 
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.rs b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.rs
index b81e52ddc58..00f1cbdab54 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.rs
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.rs
@@ -1,6 +1,5 @@
 //@ run-rustfix
 
-#![feature(unsafe_extern_blocks)]
 #![deny(missing_unsafe_on_extern)]
 #![allow(unused)]
 
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.stderr
index 0a3c2cd25e3..bb1d068ceb9 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.stderr
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-extern-suggestion.stderr
@@ -1,5 +1,5 @@
 error: extern blocks should be unsafe
-  --> $DIR/unsafe-extern-suggestion.rs:7:1
+  --> $DIR/unsafe-extern-suggestion.rs:6:1
    |
 LL |   extern "C" {
    |   ^
@@ -16,7 +16,7 @@ LL | | }
    = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024!
    = note: for more information, see issue #123743 <https://github.com/rust-lang/rust/issues/123743>
 note: the lint level is defined here
-  --> $DIR/unsafe-extern-suggestion.rs:4:9
+  --> $DIR/unsafe-extern-suggestion.rs:3:9
    |
 LL | #![deny(missing_unsafe_on_extern)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2021.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2021.stderr
index 8bb7ffefeea..e3626bb497e 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2021.stderr
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2021.stderr
@@ -1,5 +1,5 @@
 error[E0133]: call to unsafe function `test1` is unsafe and requires unsafe function or block
-  --> $DIR/unsafe-items.rs:20:5
+  --> $DIR/unsafe-items.rs:18:5
    |
 LL |     test1(TEST1);
    |     ^^^^^^^^^^^^ call to unsafe function
@@ -7,7 +7,7 @@ LL |     test1(TEST1);
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
 error[E0133]: use of extern static is unsafe and requires unsafe function or block
-  --> $DIR/unsafe-items.rs:20:11
+  --> $DIR/unsafe-items.rs:18:11
    |
 LL |     test1(TEST1);
    |           ^^^^^ use of extern static
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2024.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2024.stderr
index 9a30142a632..89bc501b7b5 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2024.stderr
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.edition2024.stderr
@@ -1,5 +1,5 @@
 error[E0133]: call to unsafe function `test1` is unsafe and requires unsafe block
-  --> $DIR/unsafe-items.rs:20:5
+  --> $DIR/unsafe-items.rs:18:5
    |
 LL |     test1(TEST1);
    |     ^^^^^^^^^^^^ call to unsafe function
@@ -7,7 +7,7 @@ LL |     test1(TEST1);
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
 error[E0133]: use of extern static is unsafe and requires unsafe block
-  --> $DIR/unsafe-items.rs:20:11
+  --> $DIR/unsafe-items.rs:18:11
    |
 LL |     test1(TEST1);
    |           ^^^^^ use of extern static
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.rs b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.rs
index 9066953abc6..dc2bae892a9 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.rs
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-items.rs
@@ -3,8 +3,6 @@
 //@[edition2024] edition:2024
 //@[edition2024] compile-flags: -Zunstable-options
 
-#![feature(unsafe_extern_blocks)]
-
 unsafe extern "C" {
     unsafe static TEST1: i32;
     unsafe fn test1(i: i32);
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.fixed b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.fixed
index 2ff595cc44d..857d34eef85 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.fixed
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.fixed
@@ -1,6 +1,5 @@
 //@ run-rustfix
 
-#![feature(unsafe_extern_blocks)]
 #![allow(dead_code)]
 
 unsafe extern "C" {
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.rs b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.rs
index 6fe43f7a5b4..edab9850d79 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.rs
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.rs
@@ -1,6 +1,5 @@
 //@ run-rustfix
 
-#![feature(unsafe_extern_blocks)]
 #![allow(dead_code)]
 
 extern "C" {
diff --git a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.stderr b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.stderr
index 05d23d001ad..073245e650b 100644
--- a/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.stderr
+++ b/tests/ui/rust-2024/unsafe-extern-blocks/unsafe-on-extern-block-issue-126756.stderr
@@ -1,5 +1,5 @@
 error: items in unadorned `extern` blocks cannot have safety qualifiers
-  --> $DIR/unsafe-on-extern-block-issue-126756.rs:7:5
+  --> $DIR/unsafe-on-extern-block-issue-126756.rs:6:5
    |
 LL |     unsafe fn foo();
    |     ^^^^^^^^^^^^^^^^
diff --git a/tests/ui/sanitizer/cfi-assoc-ty-lifetime-issue-123053.rs b/tests/ui/sanitizer/cfi/assoc-ty-lifetime-issue-123053.rs
index dd604b6bf7d..dd604b6bf7d 100644
--- a/tests/ui/sanitizer/cfi-assoc-ty-lifetime-issue-123053.rs
+++ b/tests/ui/sanitizer/cfi/assoc-ty-lifetime-issue-123053.rs
diff --git a/tests/ui/sanitizer/cfi-async-closures.rs b/tests/ui/sanitizer/cfi/async-closures.rs
index d94f2992d84..d94f2992d84 100644
--- a/tests/ui/sanitizer/cfi-async-closures.rs
+++ b/tests/ui/sanitizer/cfi/async-closures.rs
diff --git a/tests/ui/sanitizer/cfi/can-reveal-opaques.rs b/tests/ui/sanitizer/cfi/can-reveal-opaques.rs
new file mode 100644
index 00000000000..55988a62a8c
--- /dev/null
+++ b/tests/ui/sanitizer/cfi/can-reveal-opaques.rs
@@ -0,0 +1,44 @@
+//@ needs-sanitizer-cfi
+//@ compile-flags: -Ccodegen-units=1 -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi
+//@ no-prefer-dynamic
+//@ only-x86_64-unknown-linux-gnu
+//@ build-pass
+
+// See comment below for why this test exists.
+
+trait Tr<U> {
+    type Projection;
+}
+
+impl<F, U> Tr<U> for F
+where
+    F: Fn() -> U
+{
+    type Projection = U;
+}
+
+fn test<B: Tr<U>, U>(b: B) -> B::Projection
+{
+    todo!()
+}
+
+fn main() {
+    fn rpit_fn() -> impl Sized {}
+
+    // When CFI runs, it tries to compute the signature of the call. This
+    // ends up giving us a signature of:
+    //     `fn test::<rpit_fn, ()>() -> <rpit_fn as Tr<()>>::Projection`,
+    // where `rpit_fn` is the ZST FnDef for the function. However, we were
+    // previously using a Reveal::UserFacing param-env. This means that the
+    // `<rpit_fn as Tr<()>>::Projection` return type is impossible to normalize,
+    // since it would require proving `rpit_fn: Fn() -> ()`, but we cannot
+    // prove that the `impl Sized` opaque is `()` with a user-facing param-env.
+    // This leads to a normalization error, and then an ICE.
+    //
+    // Side-note:
+    // So why is the second generic of `test` "`()`", and not the
+    // `impl Sized` since we inferred it from the return type of `rpit_fn`
+    // during typeck? Well, that's because we're using the generics from the
+    // terminator of the MIR, which has had the RevealAll pass performed on it.
+    let _ = test(rpit_fn);
+}
diff --git a/tests/ui/sanitizer/cfi-canonical-jump-tables-requires-cfi.rs b/tests/ui/sanitizer/cfi/canonical-jump-tables-requires-cfi.rs
index 10c5bf6ea5e..10c5bf6ea5e 100644
--- a/tests/ui/sanitizer/cfi-canonical-jump-tables-requires-cfi.rs
+++ b/tests/ui/sanitizer/cfi/canonical-jump-tables-requires-cfi.rs
diff --git a/tests/ui/sanitizer/cfi-canonical-jump-tables-requires-cfi.stderr b/tests/ui/sanitizer/cfi/canonical-jump-tables-requires-cfi.stderr
index de67d6a6b7f..de67d6a6b7f 100644
--- a/tests/ui/sanitizer/cfi-canonical-jump-tables-requires-cfi.stderr
+++ b/tests/ui/sanitizer/cfi/canonical-jump-tables-requires-cfi.stderr
diff --git a/tests/ui/sanitizer/cfi-closures.rs b/tests/ui/sanitizer/cfi/closures.rs
index 9f9002da674..9f9002da674 100644
--- a/tests/ui/sanitizer/cfi-closures.rs
+++ b/tests/ui/sanitizer/cfi/closures.rs
diff --git a/tests/ui/sanitizer/cfi-complex-receiver.rs b/tests/ui/sanitizer/cfi/complex-receiver.rs
index c7b45a775ca..c7b45a775ca 100644
--- a/tests/ui/sanitizer/cfi-complex-receiver.rs
+++ b/tests/ui/sanitizer/cfi/complex-receiver.rs
diff --git a/tests/ui/sanitizer/cfi-coroutine.rs b/tests/ui/sanitizer/cfi/coroutine.rs
index ad994fcf737..ad994fcf737 100644
--- a/tests/ui/sanitizer/cfi-coroutine.rs
+++ b/tests/ui/sanitizer/cfi/coroutine.rs
diff --git a/tests/ui/sanitizer/cfi-drop-in-place.rs b/tests/ui/sanitizer/cfi/drop-in-place.rs
index 8ce2c432602..8ce2c432602 100644
--- a/tests/ui/sanitizer/cfi-drop-in-place.rs
+++ b/tests/ui/sanitizer/cfi/drop-in-place.rs
diff --git a/tests/ui/sanitizer/cfi-drop-no-principal.rs b/tests/ui/sanitizer/cfi/drop-no-principal.rs
index c1c88c8c71c..c1c88c8c71c 100644
--- a/tests/ui/sanitizer/cfi-drop-no-principal.rs
+++ b/tests/ui/sanitizer/cfi/drop-no-principal.rs
diff --git a/tests/ui/sanitizer/cfi-fn-ptr.rs b/tests/ui/sanitizer/cfi/fn-ptr.rs
index 505b4b8e7f0..505b4b8e7f0 100644
--- a/tests/ui/sanitizer/cfi-fn-ptr.rs
+++ b/tests/ui/sanitizer/cfi/fn-ptr.rs
diff --git a/tests/ui/sanitizer/cfi-generalize-pointers-attr-cfg.rs b/tests/ui/sanitizer/cfi/generalize-pointers-attr-cfg.rs
index d46002c69fd..d46002c69fd 100644
--- a/tests/ui/sanitizer/cfi-generalize-pointers-attr-cfg.rs
+++ b/tests/ui/sanitizer/cfi/generalize-pointers-attr-cfg.rs
diff --git a/tests/ui/sanitizer/cfi-generalize-pointers-requires-cfi.rs b/tests/ui/sanitizer/cfi/generalize-pointers-requires-cfi.rs
index 8ba13bd3639..8ba13bd3639 100644
--- a/tests/ui/sanitizer/cfi-generalize-pointers-requires-cfi.rs
+++ b/tests/ui/sanitizer/cfi/generalize-pointers-requires-cfi.rs
diff --git a/tests/ui/sanitizer/cfi-generalize-pointers-requires-cfi.stderr b/tests/ui/sanitizer/cfi/generalize-pointers-requires-cfi.stderr
index 621708de241..621708de241 100644
--- a/tests/ui/sanitizer/cfi-generalize-pointers-requires-cfi.stderr
+++ b/tests/ui/sanitizer/cfi/generalize-pointers-requires-cfi.stderr
diff --git a/tests/ui/sanitizer/cfi-invalid-attr-cfi-encoding.rs b/tests/ui/sanitizer/cfi/invalid-attr-encoding.rs
index 7ef6bd2f0ac..7ef6bd2f0ac 100644
--- a/tests/ui/sanitizer/cfi-invalid-attr-cfi-encoding.rs
+++ b/tests/ui/sanitizer/cfi/invalid-attr-encoding.rs
diff --git a/tests/ui/sanitizer/cfi-invalid-attr-cfi-encoding.stderr b/tests/ui/sanitizer/cfi/invalid-attr-encoding.stderr
index 93ec134241e..1aa6bef17b1 100644
--- a/tests/ui/sanitizer/cfi-invalid-attr-cfi-encoding.stderr
+++ b/tests/ui/sanitizer/cfi/invalid-attr-encoding.stderr
@@ -1,5 +1,5 @@
 error: malformed `cfi_encoding` attribute input
-  --> $DIR/cfi-invalid-attr-cfi-encoding.rs:10:1
+  --> $DIR/invalid-attr-encoding.rs:10:1
    |
 LL | #[cfi_encoding]
    | ^^^^^^^^^^^^^^^ help: must be of the form: `#[cfi_encoding = "encoding"]`
diff --git a/tests/ui/sanitizer/cfi-is-incompatible-with-kcfi.aarch64.stderr b/tests/ui/sanitizer/cfi/is-incompatible-with-kcfi.aarch64.stderr
index 7f596a19104..7f596a19104 100644
--- a/tests/ui/sanitizer/cfi-is-incompatible-with-kcfi.aarch64.stderr
+++ b/tests/ui/sanitizer/cfi/is-incompatible-with-kcfi.aarch64.stderr
diff --git a/tests/ui/sanitizer/cfi-is-incompatible-with-kcfi.rs b/tests/ui/sanitizer/cfi/is-incompatible-with-kcfi.rs
index c628709d7a1..c628709d7a1 100644
--- a/tests/ui/sanitizer/cfi-is-incompatible-with-kcfi.rs
+++ b/tests/ui/sanitizer/cfi/is-incompatible-with-kcfi.rs
diff --git a/tests/ui/sanitizer/cfi-is-incompatible-with-kcfi.x86_64.stderr b/tests/ui/sanitizer/cfi/is-incompatible-with-kcfi.x86_64.stderr
index 7f596a19104..7f596a19104 100644
--- a/tests/ui/sanitizer/cfi-is-incompatible-with-kcfi.x86_64.stderr
+++ b/tests/ui/sanitizer/cfi/is-incompatible-with-kcfi.x86_64.stderr
diff --git a/tests/ui/sanitizer/cfi-normalize-integers-attr-cfg.rs b/tests/ui/sanitizer/cfi/normalize-integers-attr-cfg.rs
index 24c2c2c13da..24c2c2c13da 100644
--- a/tests/ui/sanitizer/cfi-normalize-integers-attr-cfg.rs
+++ b/tests/ui/sanitizer/cfi/normalize-integers-attr-cfg.rs
diff --git a/tests/ui/sanitizer/cfi-normalize-integers-requires-cfi.rs b/tests/ui/sanitizer/cfi/normalize-integers-requires-cfi.rs
index a7ecefbf7ef..a7ecefbf7ef 100644
--- a/tests/ui/sanitizer/cfi-normalize-integers-requires-cfi.rs
+++ b/tests/ui/sanitizer/cfi/normalize-integers-requires-cfi.rs
diff --git a/tests/ui/sanitizer/cfi-normalize-integers-requires-cfi.stderr b/tests/ui/sanitizer/cfi/normalize-integers-requires-cfi.stderr
index 748fb60dad9..748fb60dad9 100644
--- a/tests/ui/sanitizer/cfi-normalize-integers-requires-cfi.stderr
+++ b/tests/ui/sanitizer/cfi/normalize-integers-requires-cfi.stderr
diff --git a/tests/ui/sanitizer/cfi-requires-lto.rs b/tests/ui/sanitizer/cfi/requires-lto.rs
index 5a34f696e05..5a34f696e05 100644
--- a/tests/ui/sanitizer/cfi-requires-lto.rs
+++ b/tests/ui/sanitizer/cfi/requires-lto.rs
diff --git a/tests/ui/sanitizer/cfi-requires-lto.stderr b/tests/ui/sanitizer/cfi/requires-lto.stderr
index efc0c43138e..efc0c43138e 100644
--- a/tests/ui/sanitizer/cfi-requires-lto.stderr
+++ b/tests/ui/sanitizer/cfi/requires-lto.stderr
diff --git a/tests/ui/sanitizer/cfi-self-ref.rs b/tests/ui/sanitizer/cfi/self-ref.rs
index 3b524ac661c..3b524ac661c 100644
--- a/tests/ui/sanitizer/cfi-self-ref.rs
+++ b/tests/ui/sanitizer/cfi/self-ref.rs
diff --git a/tests/ui/sanitizer/cfi/sized-associated-ty.rs b/tests/ui/sanitizer/cfi/sized-associated-ty.rs
new file mode 100644
index 00000000000..f5b4e22e9d9
--- /dev/null
+++ b/tests/ui/sanitizer/cfi/sized-associated-ty.rs
@@ -0,0 +1,38 @@
+// Check that we only elaborate non-`Self: Sized` associated types when
+// erasing the receiver from trait ref.
+
+//@ revisions: cfi kcfi
+// FIXME(#122848) Remove only-linux once OSX CFI binaries work
+//@ only-linux
+//@ [cfi] needs-sanitizer-cfi
+//@ [kcfi] needs-sanitizer-kcfi
+//@ compile-flags: -C target-feature=-crt-static
+//@ [cfi] compile-flags: -C codegen-units=1 -C lto -C prefer-dynamic=off -C opt-level=0
+//@ [cfi] compile-flags: -Z sanitizer=cfi
+//@ [kcfi] compile-flags: -Z sanitizer=kcfi
+//@ [kcfi] compile-flags: -C panic=abort -C prefer-dynamic=off
+//@ run-pass
+
+trait Foo {
+    type Bar<'a>
+    where
+        Self: Sized;
+
+    fn test(&self);
+}
+
+impl Foo for () {
+    type Bar<'a> = ()
+    where
+        Self: Sized;
+
+    fn test(&self) {}
+}
+
+fn test(x: &dyn Foo) {
+    x.test();
+}
+
+fn main() {
+    test(&());
+}
diff --git a/tests/ui/sanitizer/cfi-supertraits.rs b/tests/ui/sanitizer/cfi/supertraits.rs
index 4bb6177577f..4bb6177577f 100644
--- a/tests/ui/sanitizer/cfi-supertraits.rs
+++ b/tests/ui/sanitizer/cfi/supertraits.rs
diff --git a/tests/ui/sanitizer/cfi-virtual-auto.rs b/tests/ui/sanitizer/cfi/virtual-auto.rs
index 6971d516a20..6971d516a20 100644
--- a/tests/ui/sanitizer/cfi-virtual-auto.rs
+++ b/tests/ui/sanitizer/cfi/virtual-auto.rs
diff --git a/tests/ui/sanitizer/cfi-with-rustc-lto-requires-single-codegen-unit.rs b/tests/ui/sanitizer/cfi/with-rustc-lto-requires-single-codegen-unit.rs
index 954e4ec3b85..954e4ec3b85 100644
--- a/tests/ui/sanitizer/cfi-with-rustc-lto-requires-single-codegen-unit.rs
+++ b/tests/ui/sanitizer/cfi/with-rustc-lto-requires-single-codegen-unit.rs
diff --git a/tests/ui/sanitizer/cfi-with-rustc-lto-requires-single-codegen-unit.stderr b/tests/ui/sanitizer/cfi/with-rustc-lto-requires-single-codegen-unit.stderr
index 8d6dc1d8f1e..8d6dc1d8f1e 100644
--- a/tests/ui/sanitizer/cfi-with-rustc-lto-requires-single-codegen-unit.stderr
+++ b/tests/ui/sanitizer/cfi/with-rustc-lto-requires-single-codegen-unit.stderr
diff --git a/tests/ui/short-error-format.stderr b/tests/ui/short-error-format.stderr
index 8a22d673b98..1a4a6d4df88 100644
--- a/tests/ui/short-error-format.stderr
+++ b/tests/ui/short-error-format.stderr
@@ -1,3 +1,3 @@
-$DIR/short-error-format.rs:6:9: error[E0308]: mismatched types
-$DIR/short-error-format.rs:8:7: error[E0599]: no method named `salut` found for type `u32` in the current scope
+$DIR/short-error-format.rs:6:9: error[E0308]: mismatched types: expected `u32`, found `String`
+$DIR/short-error-format.rs:8:7: error[E0599]: no method named `salut` found for type `u32` in the current scope: method not found in `u32`
 error: aborting due to 2 previous errors
diff --git a/tests/ui/span/issue-42234-unknown-receiver-type.full.stderr b/tests/ui/span/issue-42234-unknown-receiver-type.full.stderr
index e01e1edab5a..6559845c23e 100644
--- a/tests/ui/span/issue-42234-unknown-receiver-type.full.stderr
+++ b/tests/ui/span/issue-42234-unknown-receiver-type.full.stderr
@@ -17,10 +17,6 @@ error[E0282]: type annotations needed
 LL |         .sum::<_>()
    |          ^^^ cannot infer type of the type parameter `S` declared on the method `sum`
    |
-help: consider specifying the generic argument
-   |
-LL |         .sum::<_>()
-   |             ~~~~~
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/span/send-is-not-static-std-sync.stderr b/tests/ui/span/send-is-not-static-std-sync.stderr
index 50b8ffe0114..6bc3ed8d24f 100644
--- a/tests/ui/span/send-is-not-static-std-sync.stderr
+++ b/tests/ui/span/send-is-not-static-std-sync.stderr
@@ -15,7 +15,7 @@ LL |         *lock.lock().unwrap() = &z;
 help: consider cloning the value if the performance cost is acceptable
    |
 LL -     *lock.lock().unwrap() = &*y;
-LL +     *lock.lock().unwrap() = y.clone();
+LL +     *lock.lock().unwrap() = &y.clone();
    |
 
 error[E0597]: `z` does not live long enough
@@ -48,7 +48,7 @@ LL |         *lock.write().unwrap() = &z;
 help: consider cloning the value if the performance cost is acceptable
    |
 LL -     *lock.write().unwrap() = &*y;
-LL +     *lock.write().unwrap() = y.clone();
+LL +     *lock.write().unwrap() = &y.clone();
    |
 
 error[E0597]: `z` does not live long enough
@@ -81,7 +81,7 @@ LL |         tx.send(&z).unwrap();
 help: consider cloning the value if the performance cost is acceptable
    |
 LL -     tx.send(&*y);
-LL +     tx.send(y.clone());
+LL +     tx.send(&y.clone());
    |
 
 error[E0597]: `z` does not live long enough
diff --git a/tests/ui/specialization/const_trait_impl.stderr b/tests/ui/specialization/const_trait_impl.stderr
index e39138983c6..643f1de3e8d 100644
--- a/tests/ui/specialization/const_trait_impl.stderr
+++ b/tests/ui/specialization/const_trait_impl.stderr
@@ -1,4 +1,4 @@
-error[E0049]: method `foo` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `foo` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const_trait_impl.rs:6:1
    |
 LL | #[const_trait]
@@ -7,7 +7,7 @@ LL | pub unsafe trait Sup {
 LL |     fn foo() -> u32;
    |           - expected 0 const parameters
 
-error[E0049]: method `foo` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `foo` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const_trait_impl.rs:6:1
    |
 LL | #[const_trait]
@@ -36,7 +36,7 @@ error: `~const` can only be applied to `#[const_trait]` traits
 LL | impl<T: ~const Default + ~const Sub> const A for T {
    |                ^^^^^^^
 
-error[E0049]: method `a` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `a` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const_trait_impl.rs:29:1
    |
 LL | #[const_trait]
@@ -45,7 +45,7 @@ LL | pub trait A {
 LL |     fn a() -> u32;
    |         - expected 0 const parameters
 
-error[E0049]: method `a` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `a` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const_trait_impl.rs:29:1
    |
 LL | #[const_trait]
@@ -56,7 +56,7 @@ LL |     fn a() -> u32;
    |
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
-error[E0049]: method `a` has 1 const parameter but its trait declaration has 0 const parameters
+error[E0049]: associated function `a` has 1 const parameter but its trait declaration has 0 const parameters
   --> $DIR/const_trait_impl.rs:29:1
    |
 LL | #[const_trait]
diff --git a/tests/ui/stable-mir-print/basic_function.stdout b/tests/ui/stable-mir-print/basic_function.stdout
index 3926c1048f5..76288c2aa49 100644
--- a/tests/ui/stable-mir-print/basic_function.stdout
+++ b/tests/ui/stable-mir-print/basic_function.stdout
@@ -44,14 +44,14 @@ fn demux(_1: u8) -> u8 {
     let mut _0: u8;
     debug input => _1;
     bb0: {
-        switchInt(_1) -> [0: bb2, 1: bb3, 2: bb4, otherwise: bb1];
+        switchInt(_1) -> [0: bb4, 1: bb3, 2: bb2, otherwise: bb1];
     }
     bb1: {
         _0 = 0_u8;
         goto -> bb5;
     }
     bb2: {
-        _0 = 10_u8;
+        _0 = 8_u8;
         goto -> bb5;
     }
     bb3: {
@@ -59,7 +59,7 @@ fn demux(_1: u8) -> u8 {
         goto -> bb5;
     }
     bb4: {
-        _0 = 8_u8;
+        _0 = 10_u8;
         goto -> bb5;
     }
     bb5: {
diff --git a/tests/ui/static/static-lifetime.rs b/tests/ui/static/static-lifetime.rs
index ce1eeb6105f..a861a2ffeda 100644
--- a/tests/ui/static/static-lifetime.rs
+++ b/tests/ui/static/static-lifetime.rs
@@ -1,6 +1,7 @@
 pub trait Arbitrary: Sized + 'static {}
 
 impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {} //~ ERROR lifetime bound
+//~^ ERROR cannot infer an appropriate lifetime for lifetime parameter `'a`
 
 fn main() {
 }
diff --git a/tests/ui/static/static-lifetime.stderr b/tests/ui/static/static-lifetime.stderr
index 8c9434ce3cb..7a956dbfeef 100644
--- a/tests/ui/static/static-lifetime.stderr
+++ b/tests/ui/static/static-lifetime.stderr
@@ -11,6 +11,32 @@ LL | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}
    |      ^^
    = note: but lifetime parameter must outlive the static lifetime
 
-error: aborting due to 1 previous error
+error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
+  --> $DIR/static-lifetime.rs:3:34
+   |
+LL | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}
+   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
+  --> $DIR/static-lifetime.rs:3:6
+   |
+LL | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}
+   |      ^^
+note: ...so that the types are compatible
+  --> $DIR/static-lifetime.rs:3:34
+   |
+LL | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}
+   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: expected `<Cow<'a, A> as Arbitrary>`
+              found `<Cow<'_, A> as Arbitrary>`
+   = note: but, the lifetime must be valid for the static lifetime...
+note: ...so that the declared lifetime parameter bounds are satisfied
+  --> $DIR/static-lifetime.rs:3:34
+   |
+LL | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}
+   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0478`.
+Some errors have detailed explanations: E0478, E0495.
+For more information about an error, try `rustc --explain E0478`.
diff --git a/tests/ui/statics/unsizing-wfcheck-issue-127299.rs b/tests/ui/statics/unsizing-wfcheck-issue-127299.rs
new file mode 100644
index 00000000000..cd15be54ec7
--- /dev/null
+++ b/tests/ui/statics/unsizing-wfcheck-issue-127299.rs
@@ -0,0 +1,17 @@
+// This ensures we don't ICE in situations like rust-lang/rust#127299.
+
+trait Qux {
+    fn bar() -> i32;
+}
+
+pub struct Lint {
+    pub desc: &'static dyn Qux,
+    //~^ ERROR cannot be made into an object
+}
+
+static FOO: &Lint = &Lint { desc: "desc" };
+//~^ ERROR cannot be shared between threads safely
+//~| ERROR cannot be made into an object
+//~| ERROR cannot be made into an object
+
+fn main() {}
diff --git a/tests/ui/statics/unsizing-wfcheck-issue-127299.stderr b/tests/ui/statics/unsizing-wfcheck-issue-127299.stderr
new file mode 100644
index 00000000000..49e8d87f354
--- /dev/null
+++ b/tests/ui/statics/unsizing-wfcheck-issue-127299.stderr
@@ -0,0 +1,87 @@
+error[E0038]: the trait `Qux` cannot be made into an object
+  --> $DIR/unsizing-wfcheck-issue-127299.rs:8:24
+   |
+LL |     pub desc: &'static dyn Qux,
+   |                        ^^^^^^^ `Qux` cannot be made into an object
+   |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/unsizing-wfcheck-issue-127299.rs:4:8
+   |
+LL | trait Qux {
+   |       --- this trait cannot be made into an object...
+LL |     fn bar() -> i32;
+   |        ^^^ ...because associated function `bar` has no `self` parameter
+help: consider turning `bar` into a method by giving it a `&self` argument
+   |
+LL |     fn bar(&self) -> i32;
+   |            +++++
+help: alternatively, consider constraining `bar` so it does not apply to trait objects
+   |
+LL |     fn bar() -> i32 where Self: Sized;
+   |                     +++++++++++++++++
+
+error[E0277]: `(dyn Qux + 'static)` cannot be shared between threads safely
+  --> $DIR/unsizing-wfcheck-issue-127299.rs:12:13
+   |
+LL | static FOO: &Lint = &Lint { desc: "desc" };
+   |             ^^^^^ `(dyn Qux + 'static)` cannot be shared between threads safely
+   |
+   = help: within `&'static Lint`, the trait `Sync` is not implemented for `(dyn Qux + 'static)`, which is required by `&'static Lint: Sync`
+   = note: required because it appears within the type `&'static (dyn Qux + 'static)`
+note: required because it appears within the type `Lint`
+  --> $DIR/unsizing-wfcheck-issue-127299.rs:7:12
+   |
+LL | pub struct Lint {
+   |            ^^^^
+   = note: required because it appears within the type `&'static Lint`
+   = note: shared static variables must have a type that implements `Sync`
+
+error[E0038]: the trait `Qux` cannot be made into an object
+  --> $DIR/unsizing-wfcheck-issue-127299.rs:12:35
+   |
+LL | static FOO: &Lint = &Lint { desc: "desc" };
+   |                                   ^^^^^^ `Qux` cannot be made into an object
+   |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/unsizing-wfcheck-issue-127299.rs:4:8
+   |
+LL | trait Qux {
+   |       --- this trait cannot be made into an object...
+LL |     fn bar() -> i32;
+   |        ^^^ ...because associated function `bar` has no `self` parameter
+   = note: required for the cast from `&'static str` to `&'static (dyn Qux + 'static)`
+help: consider turning `bar` into a method by giving it a `&self` argument
+   |
+LL |     fn bar(&self) -> i32;
+   |            +++++
+help: alternatively, consider constraining `bar` so it does not apply to trait objects
+   |
+LL |     fn bar() -> i32 where Self: Sized;
+   |                     +++++++++++++++++
+
+error[E0038]: the trait `Qux` cannot be made into an object
+  --> $DIR/unsizing-wfcheck-issue-127299.rs:12:35
+   |
+LL | static FOO: &Lint = &Lint { desc: "desc" };
+   |                                   ^^^^^^ `Qux` cannot be made into an object
+   |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/unsizing-wfcheck-issue-127299.rs:4:8
+   |
+LL | trait Qux {
+   |       --- this trait cannot be made into an object...
+LL |     fn bar() -> i32;
+   |        ^^^ ...because associated function `bar` has no `self` parameter
+help: consider turning `bar` into a method by giving it a `&self` argument
+   |
+LL |     fn bar(&self) -> i32;
+   |            +++++
+help: alternatively, consider constraining `bar` so it does not apply to trait objects
+   |
+LL |     fn bar() -> i32 where Self: Sized;
+   |                     +++++++++++++++++
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0038, E0277.
+For more information about an error, try `rustc --explain E0038`.
diff --git a/tests/ui/structs-enums/newtype-struct-with-dtor.rs b/tests/ui/structs-enums/newtype-struct-with-dtor.rs
index 16439a7fedd..19672e41c9a 100644
--- a/tests/ui/structs-enums/newtype-struct-with-dtor.rs
+++ b/tests/ui/structs-enums/newtype-struct-with-dtor.rs
@@ -3,10 +3,8 @@
 #![allow(unused_variables)]
 //@ pretty-expanded FIXME #23616
 
-#[allow(dead_code)]
 pub struct Fd(u32);
 
-#[allow(dead_code)]
 fn foo(a: u32) {}
 
 impl Drop for Fd {
diff --git a/tests/ui/structs-enums/uninstantiable-struct.rs b/tests/ui/structs-enums/uninstantiable-struct.rs
index 1074dbcd6e6..97bc7d8414e 100644
--- a/tests/ui/structs-enums/uninstantiable-struct.rs
+++ b/tests/ui/structs-enums/uninstantiable-struct.rs
@@ -1,5 +1,4 @@
 //@ run-pass
-#[allow(dead_code)]
-pub struct Z(&'static Z);
+pub struct Z(#[allow(dead_code)] &'static Z);
 
 pub fn main() {}
diff --git a/tests/ui/structs/field-implied-unsizing-wfcheck.rs b/tests/ui/structs/field-implied-unsizing-wfcheck.rs
new file mode 100644
index 00000000000..a46c9b5a68b
--- /dev/null
+++ b/tests/ui/structs/field-implied-unsizing-wfcheck.rs
@@ -0,0 +1,32 @@
+struct FooStruct {
+    nested: &'static Bar<dyn std::fmt::Debug>,
+    //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
+}
+
+struct FooTuple(&'static Bar<dyn std::fmt::Debug>);
+//~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
+
+enum FooEnum1 {
+    Struct { nested: &'static Bar<dyn std::fmt::Debug> },
+    //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
+}
+
+enum FooEnum2 {
+    Tuple(&'static Bar<dyn std::fmt::Debug>),
+    //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
+}
+
+struct Bar<T>(T);
+
+fn main() {
+    // Ensure there's an error at the construction site, for error tainting purposes.
+
+    FooStruct { nested: &Bar(4) };
+    //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
+    FooTuple(&Bar(4));
+    //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
+    FooEnum1::Struct { nested: &Bar(4) };
+    //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
+    FooEnum2::Tuple(&Bar(4));
+    //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
+}
diff --git a/tests/ui/structs/field-implied-unsizing-wfcheck.stderr b/tests/ui/structs/field-implied-unsizing-wfcheck.stderr
new file mode 100644
index 00000000000..47d486ffa33
--- /dev/null
+++ b/tests/ui/structs/field-implied-unsizing-wfcheck.stderr
@@ -0,0 +1,163 @@
+error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
+  --> $DIR/field-implied-unsizing-wfcheck.rs:2: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/field-implied-unsizing-wfcheck.rs:19: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/field-implied-unsizing-wfcheck.rs:19:12
+   |
+LL | struct Bar<T>(T);
+   |            ^  - ...if indirection were used here: `Box<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/field-implied-unsizing-wfcheck.rs:6:17
+   |
+LL | struct FooTuple(&'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/field-implied-unsizing-wfcheck.rs:19: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/field-implied-unsizing-wfcheck.rs:19:12
+   |
+LL | struct Bar<T>(T);
+   |            ^  - ...if indirection were used here: `Box<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/field-implied-unsizing-wfcheck.rs:10:22
+   |
+LL |     Struct { 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/field-implied-unsizing-wfcheck.rs:19: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/field-implied-unsizing-wfcheck.rs:19:12
+   |
+LL | struct Bar<T>(T);
+   |            ^  - ...if indirection were used here: `Box<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/field-implied-unsizing-wfcheck.rs:15:11
+   |
+LL |     Tuple(&'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/field-implied-unsizing-wfcheck.rs:19: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/field-implied-unsizing-wfcheck.rs:19:12
+   |
+LL | struct Bar<T>(T);
+   |            ^  - ...if indirection were used here: `Box<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/field-implied-unsizing-wfcheck.rs:24:25
+   |
+LL |     FooStruct { nested: &Bar(4) };
+   |                         ^^^^^^^ 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/field-implied-unsizing-wfcheck.rs:19: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/field-implied-unsizing-wfcheck.rs:19:12
+   |
+LL | struct Bar<T>(T);
+   |            ^  - ...if indirection were used here: `Box<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/field-implied-unsizing-wfcheck.rs:26:14
+   |
+LL |     FooTuple(&Bar(4));
+   |              ^^^^^^^ 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/field-implied-unsizing-wfcheck.rs:19: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/field-implied-unsizing-wfcheck.rs:19:12
+   |
+LL | struct Bar<T>(T);
+   |            ^  - ...if indirection were used here: `Box<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/field-implied-unsizing-wfcheck.rs:28:32
+   |
+LL |     FooEnum1::Struct { nested: &Bar(4) };
+   |                                ^^^^^^^ 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/field-implied-unsizing-wfcheck.rs:19: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/field-implied-unsizing-wfcheck.rs:19:12
+   |
+LL | struct Bar<T>(T);
+   |            ^  - ...if indirection were used here: `Box<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/field-implied-unsizing-wfcheck.rs:30:21
+   |
+LL |     FooEnum2::Tuple(&Bar(4));
+   |                     ^^^^^^^ 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/field-implied-unsizing-wfcheck.rs:19: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/field-implied-unsizing-wfcheck.rs:19: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
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/suggestions/borrow-for-loop-head.stderr b/tests/ui/suggestions/borrow-for-loop-head.stderr
index a8de9986c31..55fcb44168c 100644
--- a/tests/ui/suggestions/borrow-for-loop-head.stderr
+++ b/tests/ui/suggestions/borrow-for-loop-head.stderr
@@ -10,9 +10,8 @@ LL |         for j in a {
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -     for i in &a {
-LL +     for i in a.clone() {
-   |
+LL |     for i in &a.clone() {
+   |                ++++++++
 
 error[E0382]: use of moved value: `a`
   --> $DIR/borrow-for-loop-head.rs:4:18
diff --git a/tests/ui/suggestions/derive-clone-for-eq.fixed b/tests/ui/suggestions/derive-clone-for-eq.fixed
index cf800c6e47d..4dc362f9478 100644
--- a/tests/ui/suggestions/derive-clone-for-eq.fixed
+++ b/tests/ui/suggestions/derive-clone-for-eq.fixed
@@ -1,7 +1,6 @@
 //@ run-rustfix
 // https://github.com/rust-lang/rust/issues/79076
 
-#[allow(dead_code)]
 #[derive(Clone, Eq)] //~ ERROR [E0277]
 pub struct Struct<T: std::clone::Clone>(T);
 
diff --git a/tests/ui/suggestions/derive-clone-for-eq.rs b/tests/ui/suggestions/derive-clone-for-eq.rs
index 84736426bac..b3635000f16 100644
--- a/tests/ui/suggestions/derive-clone-for-eq.rs
+++ b/tests/ui/suggestions/derive-clone-for-eq.rs
@@ -1,7 +1,6 @@
 //@ run-rustfix
 // https://github.com/rust-lang/rust/issues/79076
 
-#[allow(dead_code)]
 #[derive(Clone, Eq)] //~ ERROR [E0277]
 pub struct Struct<T>(T);
 
diff --git a/tests/ui/suggestions/derive-clone-for-eq.stderr b/tests/ui/suggestions/derive-clone-for-eq.stderr
index 54670fbffcf..6fae6e1316d 100644
--- a/tests/ui/suggestions/derive-clone-for-eq.stderr
+++ b/tests/ui/suggestions/derive-clone-for-eq.stderr
@@ -1,11 +1,11 @@
 error[E0277]: the trait bound `T: Clone` is not satisfied
-  --> $DIR/derive-clone-for-eq.rs:5:17
+  --> $DIR/derive-clone-for-eq.rs:4:17
    |
 LL | #[derive(Clone, Eq)]
    |                 ^^ the trait `Clone` is not implemented for `T`, which is required by `Struct<T>: PartialEq`
    |
 note: required for `Struct<T>` to implement `PartialEq`
-  --> $DIR/derive-clone-for-eq.rs:8:19
+  --> $DIR/derive-clone-for-eq.rs:7:19
    |
 LL | impl<T: Clone, U> PartialEq<U> for Struct<T>
    |         -----     ^^^^^^^^^^^^     ^^^^^^^^^
diff --git a/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.stderr b/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.stderr
index aeeec3aca34..3a1f685f16b 100644
--- a/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.stderr
+++ b/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.stderr
@@ -2,18 +2,13 @@ error[E0700]: hidden type for `impl Iterator<Item = i32>` captures lifetime that
   --> $DIR/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs:7:5
    |
 LL |   fn bar(src: &crate::Foo) -> impl Iterator<Item = i32> {
-   |                ----------     ------------------------- opaque type defined here
-   |                |
-   |                hidden type `FilterMap<std::slice::Iter<'static, i32>, {closure@$DIR/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs:9:21: 9:24}>` captures the anonymous lifetime defined here
+   |                               ------------------------- opaque type defined here
 LL | /     [0].into_iter()
 LL | |
 LL | |         .filter_map(|_| foo(src))
    | |_________________________________^
    |
-help: to declare that `impl Iterator<Item = i32>` captures `'_`, you can introduce a named lifetime parameter `'a`
-   |
-LL | fn bar<'a>(src: &'a crate::Foo<'a>) -> impl Iterator<Item = i32> + 'a  {
-   |       ++++       ++           ++++                               ++++
+   = note: hidden type `FilterMap<std::slice::Iter<'static, i32>, {closure@$DIR/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs:9:21: 9:24}>` captures lifetime `'_`
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.stderr b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.stderr
index a2a78ddc705..db16fff826f 100644
--- a/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.stderr
+++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl-2.stderr
@@ -44,15 +44,13 @@ LL | #[derive(Debug, Copy, Clone)]
    |                       ----- in this derive macro expansion
 LL | pub struct AABB<K: Debug> {
 LL |     pub loc: Vector2<K>,
-   |     ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `K`, which is required by `Vector2<K>: Clone`
+   |     ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `K`
    |
-note: required for `Vector2<K>` to implement `Clone`
-  --> $DIR/missing-bound-in-derive-copy-impl-2.rs:4:23
+note: required by a bound in `Vector2`
+  --> $DIR/missing-bound-in-derive-copy-impl-2.rs:5:31
    |
-LL | #[derive(Debug, Copy, Clone)]
-   |                       ^^^^^
 LL | pub struct Vector2<T: Debug + Copy + Clone> {
-   |                               ---- unsatisfied trait bound introduced in this `derive` macro
+   |                               ^^^^ required by this bound in `Vector2`
    = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
 help: consider further restricting this bound
    |
diff --git a/tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr b/tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr
index 2ae0871b815..cf383b5c8ff 100644
--- a/tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr
+++ b/tests/ui/suggestions/missing-bound-in-derive-copy-impl.stderr
@@ -95,15 +95,13 @@ LL | #[derive(Debug, Copy, Clone)]
    |                       ----- in this derive macro expansion
 LL | pub struct AABB<K> {
 LL |     pub loc: Vector2<K>,
-   |     ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `K`, which is required by `Vector2<K>: Clone`
+   |     ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `K`
    |
-note: required for `Vector2<K>` to implement `Clone`
-  --> $DIR/missing-bound-in-derive-copy-impl.rs:3:23
+note: required by a bound in `Vector2`
+  --> $DIR/missing-bound-in-derive-copy-impl.rs:4:31
    |
-LL | #[derive(Debug, Copy, Clone)]
-   |                       ^^^^^
 LL | pub struct Vector2<T: Debug + Copy + Clone> {
-   |                               ---- unsatisfied trait bound introduced in this `derive` macro
+   |                               ^^^^ required by this bound in `Vector2`
    = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
 help: consider restricting type parameter `K`
    |
diff --git a/tests/ui/suggestions/option-content-move.fixed b/tests/ui/suggestions/option-content-move.fixed
index ef07d55871e..4a5a9483c20 100644
--- a/tests/ui/suggestions/option-content-move.fixed
+++ b/tests/ui/suggestions/option-content-move.fixed
@@ -1,5 +1,4 @@
 //@ run-rustfix
-#[allow(dead_code)]
 pub struct LipogramCorpora {
     selections: Vec<(char, Option<String>)>,
 }
@@ -18,7 +17,6 @@ impl LipogramCorpora {
     }
 }
 
-#[allow(dead_code)]
 pub struct LipogramCorpora2 {
     selections: Vec<(char, Result<String, String>)>,
 }
diff --git a/tests/ui/suggestions/option-content-move.rs b/tests/ui/suggestions/option-content-move.rs
index 5be6358fd6a..90d05c74399 100644
--- a/tests/ui/suggestions/option-content-move.rs
+++ b/tests/ui/suggestions/option-content-move.rs
@@ -1,5 +1,4 @@
 //@ run-rustfix
-#[allow(dead_code)]
 pub struct LipogramCorpora {
     selections: Vec<(char, Option<String>)>,
 }
@@ -18,7 +17,6 @@ impl LipogramCorpora {
     }
 }
 
-#[allow(dead_code)]
 pub struct LipogramCorpora2 {
     selections: Vec<(char, Result<String, String>)>,
 }
diff --git a/tests/ui/suggestions/option-content-move.stderr b/tests/ui/suggestions/option-content-move.stderr
index b4ec5b180d2..a382a04344a 100644
--- a/tests/ui/suggestions/option-content-move.stderr
+++ b/tests/ui/suggestions/option-content-move.stderr
@@ -1,5 +1,5 @@
 error[E0507]: cannot move out of `selection.1` which is behind a shared reference
-  --> $DIR/option-content-move.rs:11:20
+  --> $DIR/option-content-move.rs:10:20
    |
 LL |                 if selection.1.unwrap().contains(selection.0) {
    |                    ^^^^^^^^^^^ -------- `selection.1` moved due to this method call
@@ -19,7 +19,7 @@ LL |                 if selection.1.clone().unwrap().contains(selection.0) {
    |                               ++++++++
 
 error[E0507]: cannot move out of `selection.1` which is behind a shared reference
-  --> $DIR/option-content-move.rs:30:20
+  --> $DIR/option-content-move.rs:28:20
    |
 LL |                 if selection.1.unwrap().contains(selection.0) {
    |                    ^^^^^^^^^^^ -------- `selection.1` moved due to this method call
diff --git a/tests/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr b/tests/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr
index 618ccba0d3d..dde6060c433 100644
--- a/tests/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr
+++ b/tests/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr
@@ -40,7 +40,7 @@ LL |     let _ = vec![1, 2, 3].into_iter().collect::Vec<_>>();
 help: surround the type parameters with angle brackets
    |
 LL |     let _ = vec![1, 2, 3].into_iter().collect::<Vec<_>>();
-   |                                                +      ~
+   |                                                +
 
 error: aborting due to 4 previous errors
 
diff --git a/tests/ui/target-feature/asm-implied-features-issue-128125.rs b/tests/ui/target-feature/asm-implied-features-issue-128125.rs
new file mode 100644
index 00000000000..2b4f1d7df85
--- /dev/null
+++ b/tests/ui/target-feature/asm-implied-features-issue-128125.rs
@@ -0,0 +1,10 @@
+//@ only-x86_64
+//@ build-pass
+#![allow(dead_code)]
+
+#[target_feature(enable = "avx2")]
+unsafe fn demo(v: std::arch::x86_64::__m256i) {
+    std::arch::asm!("/* {v} */", v = in(ymm_reg) v);
+}
+
+fn main() {}
diff --git a/tests/ui/target-feature/implicit-features-cli.rs b/tests/ui/target-feature/implicit-features-cli.rs
new file mode 100644
index 00000000000..34e7c3d5066
--- /dev/null
+++ b/tests/ui/target-feature/implicit-features-cli.rs
@@ -0,0 +1,9 @@
+//@ only-wasm32-wasip1
+//@ compile-flags: -Ctarget-feature=+relaxed-simd --crate-type=lib
+//@ build-pass
+
+use std::arch::wasm32::*;
+
+pub fn test(a: v128, b: v128, m: v128) -> v128 {
+    i64x2_relaxed_laneselect(a, b, m)
+}
diff --git a/tests/ui/target-feature/implicit-features.rs b/tests/ui/target-feature/implicit-features.rs
new file mode 100644
index 00000000000..b9c48b0822d
--- /dev/null
+++ b/tests/ui/target-feature/implicit-features.rs
@@ -0,0 +1,10 @@
+//@ only-wasm32-wasip1
+//@ compile-flags: --crate-type=lib
+//@ build-pass
+
+use std::arch::wasm32::*;
+
+#[target_feature(enable = "relaxed-simd")]
+pub fn test(a: v128, b: v128, m: v128) -> v128 {
+    i64x2_relaxed_laneselect(a, b, m)
+}
diff --git a/tests/ui/target-feature/implied-features.rs b/tests/ui/target-feature/implied-features.rs
new file mode 100644
index 00000000000..4fdd843e6c2
--- /dev/null
+++ b/tests/ui/target-feature/implied-features.rs
@@ -0,0 +1,24 @@
+//@ only-x86_64
+//@ build-pass
+#![feature(target_feature_11)]
+#![allow(dead_code)]
+
+#[target_feature(enable = "ssse3")]
+fn call_ssse3() {}
+
+#[target_feature(enable = "avx")]
+fn call_avx() {}
+
+#[target_feature(enable = "avx2")]
+fn test_avx2() {
+    call_ssse3();
+    call_avx();
+}
+
+#[target_feature(enable = "fma")]
+fn test_fma() {
+    call_ssse3();
+    call_avx();
+}
+
+fn main() {}
diff --git a/tests/ui/target-feature/wasm-relaxed-simd.rs b/tests/ui/target-feature/wasm-relaxed-simd.rs
new file mode 100644
index 00000000000..34e7c3d5066
--- /dev/null
+++ b/tests/ui/target-feature/wasm-relaxed-simd.rs
@@ -0,0 +1,9 @@
+//@ only-wasm32-wasip1
+//@ compile-flags: -Ctarget-feature=+relaxed-simd --crate-type=lib
+//@ build-pass
+
+use std::arch::wasm32::*;
+
+pub fn test(a: v128, b: v128, m: v128) -> v128 {
+    i64x2_relaxed_laneselect(a, b, m)
+}
diff --git a/tests/ui/traits/alias/not-a-marker.rs b/tests/ui/traits/alias/not-a-marker.rs
new file mode 100644
index 00000000000..b004b9ff9ae
--- /dev/null
+++ b/tests/ui/traits/alias/not-a-marker.rs
@@ -0,0 +1,7 @@
+#![feature(trait_alias, marker_trait_attr)]
+
+#[marker]
+//~^ ERROR attribute should be applied to a trait
+trait Foo = Send;
+
+fn main() {}
diff --git a/tests/ui/traits/alias/not-a-marker.stderr b/tests/ui/traits/alias/not-a-marker.stderr
new file mode 100644
index 00000000000..2f3f6fea30f
--- /dev/null
+++ b/tests/ui/traits/alias/not-a-marker.stderr
@@ -0,0 +1,11 @@
+error: attribute should be applied to a trait
+  --> $DIR/not-a-marker.rs:3:1
+   |
+LL | #[marker]
+   | ^^^^^^^^^
+LL |
+LL | trait Foo = Send;
+   | ----------------- not a trait
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/traits/non_lifetime_binders/shadowed.rs b/tests/ui/traits/non_lifetime_binders/shadowed.rs
new file mode 100644
index 00000000000..1c480e3940b
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/shadowed.rs
@@ -0,0 +1,18 @@
+#![feature(non_lifetime_binders)]
+//~^ WARN the feature `non_lifetime_binders` is incomplete
+
+fn function<T>() where for<T> (): Sized {}
+//~^ ERROR the name `T` is already used for a generic parameter
+
+struct Struct<T>(T) where for<T> (): Sized;
+//~^ ERROR the name `T` is already used for a generic parameter
+
+impl<T> Struct<T> {
+    fn method() where for<T> (): Sized {}
+    //~^ ERROR the name `T` is already used for a generic parameter
+}
+
+fn repeated() where for<T, T> (): Sized {}
+//~^ ERROR the name `T` is already used for a generic parameter
+
+fn main() {}
diff --git a/tests/ui/traits/non_lifetime_binders/shadowed.stderr b/tests/ui/traits/non_lifetime_binders/shadowed.stderr
new file mode 100644
index 00000000000..59a073aefc9
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/shadowed.stderr
@@ -0,0 +1,44 @@
+error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
+  --> $DIR/shadowed.rs:4:28
+   |
+LL | fn function<T>() where for<T> (): Sized {}
+   |             -              ^ already used
+   |             |
+   |             first use of `T`
+
+error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
+  --> $DIR/shadowed.rs:7:31
+   |
+LL | struct Struct<T>(T) where for<T> (): Sized;
+   |               -               ^ already used
+   |               |
+   |               first use of `T`
+
+error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
+  --> $DIR/shadowed.rs:11:27
+   |
+LL | impl<T> Struct<T> {
+   |      - first use of `T`
+LL |     fn method() where for<T> (): Sized {}
+   |                           ^ already used
+
+error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
+  --> $DIR/shadowed.rs:15:28
+   |
+LL | fn repeated() where for<T, T> (): Sized {}
+   |                         -  ^ already used
+   |                         |
+   |                         first use of `T`
+
+warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
+  --> $DIR/shadowed.rs:1:12
+   |
+LL | #![feature(non_lifetime_binders)]
+   |            ^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
+   = note: `#[warn(incomplete_features)]` on by default
+
+error: aborting due to 4 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0403`.
diff --git a/tests/ui/traits/object/generics.rs b/tests/ui/traits/object/generics.rs
index 0ae562c0d30..462b0bc5bb7 100644
--- a/tests/ui/traits/object/generics.rs
+++ b/tests/ui/traits/object/generics.rs
@@ -7,7 +7,6 @@ pub trait Trait2<A> {
     fn doit(&self) -> A;
 }
 
-#[allow(dead_code)]
 pub struct Impl<A1, A2, A3> {
     m1: marker::PhantomData<(A1,A2,A3)>,
     /*
diff --git a/tests/ui/try-block/try-block-bad-lifetime.stderr b/tests/ui/try-block/try-block-bad-lifetime.stderr
index 6f693295357..28941cb0a9e 100644
--- a/tests/ui/try-block/try-block-bad-lifetime.stderr
+++ b/tests/ui/try-block/try-block-bad-lifetime.stderr
@@ -34,11 +34,6 @@ LL |             Err(k) ?;
 ...
 LL |         ::std::mem::drop(k);
    |                          ^ value used here after move
-   |
-help: consider cloning the value if the performance cost is acceptable
-   |
-LL |             Err(k.clone()) ?;
-   |                  ++++++++
 
 error[E0506]: cannot assign to `i` because it is borrowed
   --> $DIR/try-block-bad-lifetime.rs:32:9
diff --git a/tests/ui/try-trait/try-operator-custom.rs b/tests/ui/try-trait/try-operator-custom.rs
index ab0772dd228..936c0b0689a 100644
--- a/tests/ui/try-trait/try-operator-custom.rs
+++ b/tests/ui/try-trait/try-operator-custom.rs
@@ -31,7 +31,6 @@ impl<U, V> Try for MyResult<U, V> {
 impl<U, V, W> FromResidual<MyResult<Never, V>> for MyResult<U, W> where V: Into<W> {
     fn from_residual(x: MyResult<Never, V>) -> Self {
         match x {
-            MyResult::Awesome(u) => match u {},
             MyResult::Terrible(e) => MyResult::Terrible(e.into()),
         }
     }
@@ -42,7 +41,6 @@ type ResultResidual<E> = Result<std::convert::Infallible, E>;
 impl<U, V, W> FromResidual<ResultResidual<V>> for MyResult<U, W> where V: Into<W> {
     fn from_residual(x: ResultResidual<V>) -> Self {
         match x {
-            Ok(v) => match v {}
             Err(e) => MyResult::Terrible(e.into()),
         }
     }
@@ -51,7 +49,6 @@ impl<U, V, W> FromResidual<ResultResidual<V>> for MyResult<U, W> where V: Into<W
 impl<U, V, W> FromResidual<MyResult<Never, V>> for Result<U, W> where V: Into<W> {
     fn from_residual(x: MyResult<Never, V>) -> Self {
         match x {
-            MyResult::Awesome(u) => match u {},
             MyResult::Terrible(e) => Err(e.into()),
         }
     }
diff --git a/tests/ui/type-inference/unbounded-type-param-in-fn-with-assoc-type.stderr b/tests/ui/type-inference/unbounded-type-param-in-fn-with-assoc-type.stderr
index dc0bea58a70..bf8829c0925 100644
--- a/tests/ui/type-inference/unbounded-type-param-in-fn-with-assoc-type.stderr
+++ b/tests/ui/type-inference/unbounded-type-param-in-fn-with-assoc-type.stderr
@@ -12,3 +12,13 @@ LL |     foo::<T, U>();
 error: aborting due to 1 previous error
 
 For more information about this error, try `rustc --explain E0282`.
+Future incompatibility report: Future breakage diagnostic:
+warning: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+  --> $DIR/unbounded-type-param-in-fn-with-assoc-type.rs:3:11
+   |
+LL | fn foo<T, U = u64>() -> (T, U) {
+   |           ^^^^^^^
+   |
+   = 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 #36887 <https://github.com/rust-lang/rust/issues/36887>
+
diff --git a/tests/ui/feature-gates/feature-gate-default_type_parameter_fallback.rs b/tests/ui/type/default_type_parameter_in_fn_or_impl.rs
index 33038e24bc6..33038e24bc6 100644
--- a/tests/ui/feature-gates/feature-gate-default_type_parameter_fallback.rs
+++ b/tests/ui/type/default_type_parameter_in_fn_or_impl.rs
diff --git a/tests/ui/type/default_type_parameter_in_fn_or_impl.stderr b/tests/ui/type/default_type_parameter_in_fn_or_impl.stderr
new file mode 100644
index 00000000000..a3205cd3c29
--- /dev/null
+++ b/tests/ui/type/default_type_parameter_in_fn_or_impl.stderr
@@ -0,0 +1,43 @@
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+  --> $DIR/default_type_parameter_in_fn_or_impl.rs:3:8
+   |
+LL | fn avg<T=i32>(_: T) {}
+   |        ^^^^^
+   |
+   = 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 #36887 <https://github.com/rust-lang/rust/issues/36887>
+   = note: `#[deny(invalid_type_param_default)]` on by default
+
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+  --> $DIR/default_type_parameter_in_fn_or_impl.rs:8:6
+   |
+LL | impl<T=i32> S<T> {}
+   |      ^^^^^
+   |
+   = 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 #36887 <https://github.com/rust-lang/rust/issues/36887>
+
+error: aborting due to 2 previous errors
+
+Future incompatibility report: Future breakage diagnostic:
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+  --> $DIR/default_type_parameter_in_fn_or_impl.rs:3:8
+   |
+LL | fn avg<T=i32>(_: T) {}
+   |        ^^^^^
+   |
+   = 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 #36887 <https://github.com/rust-lang/rust/issues/36887>
+   = note: `#[deny(invalid_type_param_default)]` on by default
+
+Future breakage diagnostic:
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+  --> $DIR/default_type_parameter_in_fn_or_impl.rs:8:6
+   |
+LL | impl<T=i32> S<T> {}
+   |      ^^^^^
+   |
+   = 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 #36887 <https://github.com/rust-lang/rust/issues/36887>
+   = note: `#[deny(invalid_type_param_default)]` on by default
+
diff --git a/tests/ui/type/pattern_types/feature-gate-pattern_types.stderr b/tests/ui/type/pattern_types/feature-gate-pattern_types.stderr
index 6f74b89d224..03e91b52a2a 100644
--- a/tests/ui/type/pattern_types/feature-gate-pattern_types.stderr
+++ b/tests/ui/type/pattern_types/feature-gate-pattern_types.stderr
@@ -4,6 +4,7 @@ error[E0658]: use of unstable library feature 'core_pattern_type'
 LL | type NonNullU32 = pattern_type!(u32 is 1..);
    |                   ^^^^^^^^^^^^
    |
+   = note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
    = help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -13,6 +14,7 @@ error[E0658]: use of unstable library feature 'core_pattern_type'
 LL | type Percent = pattern_type!(u32 is 0..=100);
    |                ^^^^^^^^^^^^
    |
+   = note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
    = help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -22,6 +24,7 @@ error[E0658]: use of unstable library feature 'core_pattern_type'
 LL | type Negative = pattern_type!(i32 is ..=0);
    |                 ^^^^^^^^^^^^
    |
+   = note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
    = help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -31,6 +34,7 @@ error[E0658]: use of unstable library feature 'core_pattern_type'
 LL | type Positive = pattern_type!(i32 is 0..);
    |                 ^^^^^^^^^^^^
    |
+   = note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
    = help: add `#![feature(core_pattern_type)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
@@ -40,6 +44,7 @@ error[E0658]: use of unstable library feature 'core_pattern_type'
 LL | type Always = pattern_type!(Option<u32> is Some(_));
    |               ^^^^^^^^^^^^
    |
+   = note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information
    = help: add `#![feature(core_pattern_type)]` 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/type/pattern_types/missing-is.rs b/tests/ui/type/pattern_types/missing-is.rs
new file mode 100644
index 00000000000..2fbcc1908ef
--- /dev/null
+++ b/tests/ui/type/pattern_types/missing-is.rs
@@ -0,0 +1,8 @@
+#![feature(core_pattern_type, core_pattern_types)]
+
+use std::pat::pattern_type;
+
+fn main() {
+    let x: pattern_type!(i32 0..1);
+    //~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, or `is`, found `0`
+}
diff --git a/tests/ui/type/pattern_types/missing-is.stderr b/tests/ui/type/pattern_types/missing-is.stderr
new file mode 100644
index 00000000000..8ed654fe907
--- /dev/null
+++ b/tests/ui/type/pattern_types/missing-is.stderr
@@ -0,0 +1,8 @@
+error: expected one of `!`, `(`, `+`, `::`, `<`, or `is`, found `0`
+  --> $DIR/missing-is.rs:6:30
+   |
+LL |     let x: pattern_type!(i32 0..1);
+   |                              ^ expected one of `!`, `(`, `+`, `::`, `<`, or `is`
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/typeck/issue-36708.stderr b/tests/ui/typeck/issue-36708.stderr
index 3589796b6aa..0aca575320f 100644
--- a/tests/ui/typeck/issue-36708.stderr
+++ b/tests/ui/typeck/issue-36708.stderr
@@ -1,4 +1,4 @@
-error[E0049]: method `foo` has 1 type parameter but its trait declaration has 0 type parameters
+error[E0049]: associated function `foo` has 1 type parameter but its trait declaration has 0 type parameters
   --> $DIR/issue-36708.rs:8:12
    |
 LL |     fn foo<T>() {}
diff --git a/tests/ui/typeck/suggest-arg-comma-delete-ice.rs b/tests/ui/typeck/suggest-arg-comma-delete-ice.rs
new file mode 100644
index 00000000000..48d02e13eca
--- /dev/null
+++ b/tests/ui/typeck/suggest-arg-comma-delete-ice.rs
@@ -0,0 +1,19 @@
+//! Previously, we tried to remove extra arg commas when providing extra arg removal suggestions.
+//! One of the edge cases is having to account for an arg that has a closing delimiter `)`
+//! following it. However, the previous suggestion code assumed that the delimiter is in fact
+//! exactly the 1-byte `)` character. This assumption was proven incorrect, because we recover
+//! from Unicode-confusable delimiters in the parser, which means that the ending delimiter could be
+//! a multi-byte codepoint that looks *like* a `)`. Subtracing 1 byte could land us in the middle of
+//! a codepoint, triggering a codepoint boundary assertion.
+//!
+//! issue: rust-lang/rust#128717
+
+fn main() {
+    // The following example has been modified from #128717 to remove irrelevant Unicode as they do
+    // not otherwise partake in the right delimiter calculation causing the codepoint boundary
+    // assertion.
+    main(rahh);
+    //~^ ERROR unknown start of token
+    //~| ERROR this function takes 0 arguments but 1 argument was supplied
+    //~| ERROR cannot find value `rahh` in this scope
+}
diff --git a/tests/ui/typeck/suggest-arg-comma-delete-ice.stderr b/tests/ui/typeck/suggest-arg-comma-delete-ice.stderr
new file mode 100644
index 00000000000..53608391f3c
--- /dev/null
+++ b/tests/ui/typeck/suggest-arg-comma-delete-ice.stderr
@@ -0,0 +1,38 @@
+error: unknown start of token: \u{ff09}
+  --> $DIR/suggest-arg-comma-delete-ice.rs:15:14
+   |
+LL |     main(rahh);
+   |              ^^
+   |
+help: Unicode character ')' (Fullwidth Right Parenthesis) looks like ')' (Right Parenthesis), but it is not
+   |
+LL |     main(rahh);
+   |              ~
+
+error[E0425]: cannot find value `rahh` in this scope
+  --> $DIR/suggest-arg-comma-delete-ice.rs:15:10
+   |
+LL |     main(rahh);
+   |          ^^^^ not found in this scope
+
+error[E0061]: this function takes 0 arguments but 1 argument was supplied
+  --> $DIR/suggest-arg-comma-delete-ice.rs:15:5
+   |
+LL |     main(rahh);
+   |     ^^^^ ---- unexpected argument
+   |
+note: function defined here
+  --> $DIR/suggest-arg-comma-delete-ice.rs:11:4
+   |
+LL | fn main() {
+   |    ^^^^
+help: remove the extra argument
+   |
+LL -     main(rahh);
+LL +     main();
+   |
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0061, E0425.
+For more information about an error, try `rustc --explain E0061`.
diff --git a/tests/ui/underscore-imports/issue-110164.stderr b/tests/ui/underscore-imports/issue-110164.stderr
index 240742996e1..d8a4b6bbb75 100644
--- a/tests/ui/underscore-imports/issue-110164.stderr
+++ b/tests/ui/underscore-imports/issue-110164.stderr
@@ -38,33 +38,25 @@ error[E0432]: unresolved import `_`
   --> $DIR/issue-110164.rs:8:5
    |
 LL | use _::*;
-   |     ^ you might be missing crate `_`
-   |
-   = help: consider adding `extern crate _` to use the `_` crate
+   |     ^ `_` is not a valid crate or module name
 
 error[E0432]: unresolved import `_`
   --> $DIR/issue-110164.rs:5:5
    |
 LL | use _::a;
-   |     ^ you might be missing crate `_`
-   |
-   = help: consider adding `extern crate _` to use the `_` crate
+   |     ^ `_` is not a valid crate or module name
 
 error[E0432]: unresolved import `_`
   --> $DIR/issue-110164.rs:13:9
    |
 LL |     use _::a;
-   |         ^ you might be missing crate `_`
-   |
-   = help: consider adding `extern crate _` to use the `_` crate
+   |         ^ `_` is not a valid crate or module name
 
 error[E0432]: unresolved import `_`
   --> $DIR/issue-110164.rs:16:9
    |
 LL |     use _::*;
-   |         ^ you might be missing crate `_`
-   |
-   = help: consider adding `extern crate _` to use the `_` crate
+   |         ^ `_` is not a valid crate or module name
 
 error: aborting due to 10 previous errors
 
diff --git a/tests/ui/uninhabited/exhaustive-wo-nevertype-issue-51221.rs b/tests/ui/uninhabited/exhaustive-wo-nevertype-issue-51221.rs
index 3130fb3fe9e..722d9b4ed29 100644
--- a/tests/ui/uninhabited/exhaustive-wo-nevertype-issue-51221.rs
+++ b/tests/ui/uninhabited/exhaustive-wo-nevertype-issue-51221.rs
@@ -1,7 +1,5 @@
 //@ check-pass
 
-#![feature(min_exhaustive_patterns)]
-
 enum Void {}
 fn main() {
     let a: Option<Void> = None;
diff --git a/tests/ui/uninhabited/uninhabited-irrefutable.exhaustive_patterns.stderr b/tests/ui/uninhabited/uninhabited-irrefutable.exhaustive_patterns.stderr
index bc1a9fa4191..50f33607c06 100644
--- a/tests/ui/uninhabited/uninhabited-irrefutable.exhaustive_patterns.stderr
+++ b/tests/ui/uninhabited/uninhabited-irrefutable.exhaustive_patterns.stderr
@@ -1,5 +1,5 @@
 error[E0005]: refutable pattern in local binding
-  --> $DIR/uninhabited-irrefutable.rs:31:9
+  --> $DIR/uninhabited-irrefutable.rs:30:9
    |
 LL |     let Foo::D(_y, _z) = x;
    |         ^^^^^^^^^^^^^^ pattern `Foo::A(_)` not covered
@@ -7,7 +7,7 @@ LL |     let Foo::D(_y, _z) = x;
    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
    = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
 note: `Foo` defined here
-  --> $DIR/uninhabited-irrefutable.rs:20:6
+  --> $DIR/uninhabited-irrefutable.rs:19:6
    |
 LL | enum Foo {
    |      ^^^
diff --git a/tests/ui/uninhabited/uninhabited-irrefutable.normal.stderr b/tests/ui/uninhabited/uninhabited-irrefutable.normal.stderr
new file mode 100644
index 00000000000..50f33607c06
--- /dev/null
+++ b/tests/ui/uninhabited/uninhabited-irrefutable.normal.stderr
@@ -0,0 +1,26 @@
+error[E0005]: refutable pattern in local binding
+  --> $DIR/uninhabited-irrefutable.rs:30:9
+   |
+LL |     let Foo::D(_y, _z) = x;
+   |         ^^^^^^^^^^^^^^ pattern `Foo::A(_)` not covered
+   |
+   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
+   = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
+note: `Foo` defined here
+  --> $DIR/uninhabited-irrefutable.rs:19:6
+   |
+LL | enum Foo {
+   |      ^^^
+LL |
+LL |     A(foo::SecretlyEmpty),
+   |     - not covered
+   = note: pattern `Foo::A(_)` is currently uninhabited, but this variant contains private fields which may become inhabited in the future
+   = note: the matched value is of type `Foo`
+help: you might want to use `let else` to handle the variant that isn't matched
+   |
+LL |     let Foo::D(_y, _z) = x else { todo!() };
+   |                            ++++++++++++++++
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0005`.
diff --git a/tests/ui/uninhabited/uninhabited-irrefutable.rs b/tests/ui/uninhabited/uninhabited-irrefutable.rs
index c1f4e5f8e27..cbaa9896003 100644
--- a/tests/ui/uninhabited/uninhabited-irrefutable.rs
+++ b/tests/ui/uninhabited/uninhabited-irrefutable.rs
@@ -1,6 +1,5 @@
-//@ revisions: min_exhaustive_patterns exhaustive_patterns
+//@ revisions: normal exhaustive_patterns
 #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
-#![cfg_attr(min_exhaustive_patterns, feature(min_exhaustive_patterns))]
 #![feature(never_type)]
 
 mod foo {
diff --git a/tests/ui/uninhabited/uninhabited-matches-feature-gated.rs b/tests/ui/uninhabited/uninhabited-matches-feature-gated.rs
index e804afcf9ed..1b158dd48e9 100644
--- a/tests/ui/uninhabited/uninhabited-matches-feature-gated.rs
+++ b/tests/ui/uninhabited/uninhabited-matches-feature-gated.rs
@@ -15,10 +15,10 @@ fn main() {
     let _ = match x {}; //~ ERROR non-exhaustive
 
     let x: (Void,) = unsafe { zeroed() };
-    let _ = match x {}; //~ ERROR non-exhaustive
+    let _ = match x {};
 
     let x: [Void; 1] = unsafe { zeroed() };
-    let _ = match x {}; //~ ERROR non-exhaustive
+    let _ = match x {};
 
     let x: &[Void] = unsafe { zeroed() };
     let _ = match x {   //~ ERROR non-exhaustive
@@ -29,11 +29,10 @@ fn main() {
     let _ = match x {}; // okay
 
     let x: Result<u32, Void> = Ok(23);
-    let _ = match x {   //~ ERROR non-exhaustive
+    let _ = match x {
         Ok(x) => x,
     };
 
     let x: Result<u32, Void> = Ok(23);
     let Ok(x) = x;
-    //~^ ERROR refutable
 }
diff --git a/tests/ui/uninhabited/uninhabited-matches-feature-gated.stderr b/tests/ui/uninhabited/uninhabited-matches-feature-gated.stderr
index 466d7f2eadb..2cd3c9375d0 100644
--- a/tests/ui/uninhabited/uninhabited-matches-feature-gated.stderr
+++ b/tests/ui/uninhabited/uninhabited-matches-feature-gated.stderr
@@ -36,34 +36,6 @@ LL +         _ => todo!(),
 LL ~     };
    |
 
-error[E0004]: non-exhaustive patterns: type `(Void,)` is non-empty
-  --> $DIR/uninhabited-matches-feature-gated.rs:18:19
-   |
-LL |     let _ = match x {};
-   |                   ^
-   |
-   = note: the matched value is of type `(Void,)`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
-   |
-LL ~     let _ = match x {
-LL +         _ => todo!(),
-LL ~     };
-   |
-
-error[E0004]: non-exhaustive patterns: type `[Void; 1]` is non-empty
-  --> $DIR/uninhabited-matches-feature-gated.rs:21:19
-   |
-LL |     let _ = match x {};
-   |                   ^
-   |
-   = note: the matched value is of type `[Void; 1]`
-help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
-   |
-LL ~     let _ = match x {
-LL +         _ => todo!(),
-LL ~     };
-   |
-
 error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
   --> $DIR/uninhabited-matches-feature-gated.rs:24:19
    |
@@ -71,45 +43,13 @@ LL |     let _ = match x {
    |                   ^ pattern `&[_, ..]` not covered
    |
    = note: the matched value is of type `&[Void]`
+   = note: `Void` is uninhabited but is not being matched by value, so a wildcard `_` is required
 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 ~         &[] => (),
 LL ~         &[_, ..] => todo!(),
    |
 
-error[E0004]: non-exhaustive patterns: `Err(_)` not covered
-  --> $DIR/uninhabited-matches-feature-gated.rs:32:19
-   |
-LL |     let _ = match x {
-   |                   ^ pattern `Err(_)` not covered
-   |
-note: `Result<u32, Void>` defined here
-  --> $SRC_DIR/core/src/result.rs:LL:COL
-  ::: $SRC_DIR/core/src/result.rs:LL:COL
-   |
-   = note: not covered
-   = note: the matched value is of type `Result<u32, Void>`
-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 ~         Ok(x) => x,
-LL ~         Err(_) => todo!(),
-   |
-
-error[E0005]: refutable pattern in local binding
-  --> $DIR/uninhabited-matches-feature-gated.rs:37:9
-   |
-LL |     let Ok(x) = x;
-   |         ^^^^^ pattern `Err(_)` not covered
-   |
-   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
-   = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
-   = note: the matched value is of type `Result<u32, Void>`
-help: you might want to use `let else` to handle the variant that isn't matched
-   |
-LL |     let Ok(x) = x else { todo!() };
-   |                   ++++++++++++++++
-
-error: aborting due to 7 previous errors
+error: aborting due to 3 previous errors
 
-Some errors have detailed explanations: E0004, E0005.
-For more information about an error, try `rustc --explain E0004`.
+For more information about this error, try `rustc --explain E0004`.
diff --git a/tests/ui/uninhabited/uninhabited-patterns.rs b/tests/ui/uninhabited/uninhabited-patterns.rs
index ae12c0fc4af..988383e691b 100644
--- a/tests/ui/uninhabited/uninhabited-patterns.rs
+++ b/tests/ui/uninhabited/uninhabited-patterns.rs
@@ -1,6 +1,5 @@
 #![feature(box_patterns)]
 #![feature(never_type)]
-#![feature(min_exhaustive_patterns)]
 #![deny(unreachable_patterns)]
 
 mod foo {
diff --git a/tests/ui/uninhabited/uninhabited-patterns.stderr b/tests/ui/uninhabited/uninhabited-patterns.stderr
index ca62386d7ef..4e4aaa93f80 100644
--- a/tests/ui/uninhabited/uninhabited-patterns.stderr
+++ b/tests/ui/uninhabited/uninhabited-patterns.stderr
@@ -1,18 +1,18 @@
 error: unreachable pattern
-  --> $DIR/uninhabited-patterns.rs:30:9
+  --> $DIR/uninhabited-patterns.rs:29:9
    |
 LL |         Ok(box _) => (),
    |         ^^^^^^^^^
    |
    = note: this pattern matches no values because `NotSoSecretlyEmpty` is uninhabited
 note: the lint level is defined here
-  --> $DIR/uninhabited-patterns.rs:4:9
+  --> $DIR/uninhabited-patterns.rs:3:9
    |
 LL | #![deny(unreachable_patterns)]
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error: unreachable pattern
-  --> $DIR/uninhabited-patterns.rs:39:9
+  --> $DIR/uninhabited-patterns.rs:38:9
    |
 LL |         Err(Ok(_y)) => (),
    |         ^^^^^^^^^^^
@@ -20,7 +20,7 @@ LL |         Err(Ok(_y)) => (),
    = note: this pattern matches no values because `NotSoSecretlyEmpty` is uninhabited
 
 error: unreachable pattern
-  --> $DIR/uninhabited-patterns.rs:42:15
+  --> $DIR/uninhabited-patterns.rs:41:15
    |
 LL |     while let Some(_y) = foo() {
    |               ^^^^^^^^
diff --git a/tests/ui/unop/unop-move-semantics.stderr b/tests/ui/unop/unop-move-semantics.stderr
index bc9b3ea9903..0ae918d434a 100644
--- a/tests/ui/unop/unop-move-semantics.stderr
+++ b/tests/ui/unop/unop-move-semantics.stderr
@@ -40,7 +40,7 @@ help: if `T` implemented `Clone`, you could clone the value
 LL | fn move_borrowed<T: Not<Output=T>>(x: T, mut y: T) {
    |                  ^ consider constraining this type parameter with `Clone`
 LL |     let m = &x;
-   |             -- you could clone this value
+   |              - you could clone this value
 
 error[E0505]: cannot move out of `y` because it is borrowed
   --> $DIR/unop-move-semantics.rs:17:6
@@ -63,7 +63,7 @@ LL | fn move_borrowed<T: Not<Output=T>>(x: T, mut y: T) {
    |                  ^ consider constraining this type parameter with `Clone`
 LL |     let m = &x;
 LL |     let n = &mut y;
-   |             ------ you could clone this value
+   |                  - you could clone this value
 
 error[E0507]: cannot move out of `*m` which is behind a mutable reference
   --> $DIR/unop-move-semantics.rs:24:6
diff --git a/tests/ui/unpretty/expanded-exhaustive.rs b/tests/ui/unpretty/expanded-exhaustive.rs
index 92c2e7b4884..29472df897a 100644
--- a/tests/ui/unpretty/expanded-exhaustive.rs
+++ b/tests/ui/unpretty/expanded-exhaustive.rs
@@ -25,7 +25,6 @@
 #![feature(trait_alias)]
 #![feature(try_blocks)]
 #![feature(unnamed_fields)]
-#![feature(unsafe_extern_blocks)]
 #![feature(yeet_expr)]
 #![allow(incomplete_features)]
 
diff --git a/tests/ui/unpretty/expanded-exhaustive.stdout b/tests/ui/unpretty/expanded-exhaustive.stdout
index 137a8aa5510..cf2f6f8cbaa 100644
--- a/tests/ui/unpretty/expanded-exhaustive.stdout
+++ b/tests/ui/unpretty/expanded-exhaustive.stdout
@@ -26,7 +26,6 @@
 #![feature(trait_alias)]
 #![feature(try_blocks)]
 #![feature(unnamed_fields)]
-#![feature(unsafe_extern_blocks)]
 #![feature(yeet_expr)]
 #![allow(incomplete_features)]
 #[prelude_import]
diff --git a/tests/ui/unresolved/unresolved-asterisk-imports.stderr b/tests/ui/unresolved/unresolved-asterisk-imports.stderr
index 299ec699775..ed01f3fdbea 100644
--- a/tests/ui/unresolved/unresolved-asterisk-imports.stderr
+++ b/tests/ui/unresolved/unresolved-asterisk-imports.stderr
@@ -4,7 +4,10 @@ error[E0432]: unresolved import `not_existing_crate`
 LL | use not_existing_crate::*;
    |     ^^^^^^^^^^^^^^^^^^ you might be missing crate `not_existing_crate`
    |
-   = help: consider adding `extern crate not_existing_crate` to use the `not_existing_crate` crate
+help: consider importing the `not_existing_crate` crate
+   |
+LL + extern crate not_existing_crate;
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/unresolved/unresolved-import.rs b/tests/ui/unresolved/unresolved-import.rs
index e8f3b323e33..ee520d65e6f 100644
--- a/tests/ui/unresolved/unresolved-import.rs
+++ b/tests/ui/unresolved/unresolved-import.rs
@@ -1,7 +1,8 @@
 use foo::bar;
 //~^ ERROR unresolved import `foo` [E0432]
 //~| NOTE you might be missing crate `foo`
-//~| HELP consider adding `extern crate foo` to use the `foo` crate
+//~| HELP consider importing the `foo` crate
+//~| SUGGESTION extern crate foo;
 
 use bar::Baz as x;
 //~^ ERROR unresolved import `bar::Baz` [E0432]
diff --git a/tests/ui/unresolved/unresolved-import.stderr b/tests/ui/unresolved/unresolved-import.stderr
index 7b03717c827..a1ff2f19eb6 100644
--- a/tests/ui/unresolved/unresolved-import.stderr
+++ b/tests/ui/unresolved/unresolved-import.stderr
@@ -4,10 +4,13 @@ error[E0432]: unresolved import `foo`
 LL | use foo::bar;
    |     ^^^ you might be missing crate `foo`
    |
-   = help: consider adding `extern crate foo` to use the `foo` crate
+help: consider importing the `foo` crate
+   |
+LL + extern crate foo;
+   |
 
 error[E0432]: unresolved import `bar::Baz`
-  --> $DIR/unresolved-import.rs:6:5
+  --> $DIR/unresolved-import.rs:7:5
    |
 LL | use bar::Baz as x;
    |     ^^^^^---^^^^^
@@ -16,7 +19,7 @@ LL | use bar::Baz as x;
    |     no `Baz` in `bar`
 
 error[E0432]: unresolved import `food::baz`
-  --> $DIR/unresolved-import.rs:12:5
+  --> $DIR/unresolved-import.rs:13:5
    |
 LL | use food::baz;
    |     ^^^^^^---
@@ -25,7 +28,7 @@ LL | use food::baz;
    |     no `baz` in `food`
 
 error[E0432]: unresolved import `food::beens`
-  --> $DIR/unresolved-import.rs:18:12
+  --> $DIR/unresolved-import.rs:19:12
    |
 LL | use food::{beens as Foo};
    |            -----^^^^^^^
@@ -34,13 +37,13 @@ LL | use food::{beens as Foo};
    |            help: a similar name exists in the module: `beans`
 
 error[E0432]: unresolved import `MyEnum`
-  --> $DIR/unresolved-import.rs:43:9
+  --> $DIR/unresolved-import.rs:44:9
    |
 LL |     use MyEnum::*;
    |         ^^^^^^ help: a similar path exists: `self::MyEnum`
 
 error[E0432]: unresolved import `Enum`
-  --> $DIR/unresolved-import.rs:54:9
+  --> $DIR/unresolved-import.rs:55:9
    |
 LL |     use Enum::*;
    |         ^^^^ help: a similar path exists: `self::Enum`
diff --git a/tests/ui/variance/variance-issue-20533.stderr b/tests/ui/variance/variance-issue-20533.stderr
index 0a810b7222e..21d8de6ae88 100644
--- a/tests/ui/variance/variance-issue-20533.stderr
+++ b/tests/ui/variance/variance-issue-20533.stderr
@@ -17,7 +17,7 @@ LL | struct AffineU32(u32);
    | ^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type
 ...
 LL |         let x = foo(&a);
-   |                     -- you could clone this value
+   |                      - you could clone this value
 
 error[E0505]: cannot move out of `a` because it is borrowed
   --> $DIR/variance-issue-20533.rs:41:14
@@ -38,7 +38,7 @@ LL | struct AffineU32(u32);
    | ^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type
 ...
 LL |         let x = bar(&a);
-   |                     -- you could clone this value
+   |                      - you could clone this value
 
 error[E0505]: cannot move out of `a` because it is borrowed
   --> $DIR/variance-issue-20533.rs:47:14
@@ -59,7 +59,7 @@ LL | struct AffineU32(u32);
    | ^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type
 ...
 LL |         let x = baz(&a);
-   |                     -- you could clone this value
+   |                      - you could clone this value
 
 error[E0505]: cannot move out of `a` because it is borrowed
   --> $DIR/variance-issue-20533.rs:53:14
@@ -80,7 +80,7 @@ LL | struct AffineU32(u32);
    | ^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type
 ...
 LL |         let x = bat(&a);
-   |                     -- you could clone this value
+   |                      - you could clone this value
 
 error[E0505]: cannot move out of `a` because it is borrowed
   --> $DIR/variance-issue-20533.rs:59:14
@@ -96,9 +96,8 @@ LL |         drop(x);
    |
 help: consider cloning the value if the performance cost is acceptable
    |
-LL -         let x = foo(&a);
-LL +         let x = foo(a.clone());
-   |
+LL |         let x = foo(&a.clone());
+   |                       ++++++++
 
 error: aborting due to 5 previous errors
 
diff --git a/tests/ui/wf/wf-in-where-clause-static.current.stderr b/tests/ui/wf/wf-in-where-clause-static.current.stderr
new file mode 100644
index 00000000000..d0bb89884c6
--- /dev/null
+++ b/tests/ui/wf/wf-in-where-clause-static.current.stderr
@@ -0,0 +1,12 @@
+error[E0716]: temporary value dropped while borrowed
+  --> $DIR/wf-in-where-clause-static.rs:18:18
+   |
+LL |     let s = foo(&String::from("blah blah blah"));
+   |             -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-- 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 `'static`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0716`.
diff --git a/tests/ui/wf/wf-in-where-clause-static.next.stderr b/tests/ui/wf/wf-in-where-clause-static.next.stderr
new file mode 100644
index 00000000000..d0bb89884c6
--- /dev/null
+++ b/tests/ui/wf/wf-in-where-clause-static.next.stderr
@@ -0,0 +1,12 @@
+error[E0716]: temporary value dropped while borrowed
+  --> $DIR/wf-in-where-clause-static.rs:18:18
+   |
+LL |     let s = foo(&String::from("blah blah blah"));
+   |             -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-- 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 `'static`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0716`.
diff --git a/tests/ui/wf/wf-in-where-clause-static.rs b/tests/ui/wf/wf-in-where-clause-static.rs
index a3d360e1fb5..8ee654ef7cf 100644
--- a/tests/ui/wf/wf-in-where-clause-static.rs
+++ b/tests/ui/wf/wf-in-where-clause-static.rs
@@ -1,9 +1,6 @@
-//@ check-pass
-//@ known-bug: #98117
-
-// Should fail. Functions are responsible for checking the well-formedness of
-// their own where clauses, so this should fail and require an explicit bound
-// `T: 'static`.
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
 
 use std::fmt::Display;
 
@@ -19,5 +16,6 @@ where
 
 fn main() {
     let s = foo(&String::from("blah blah blah"));
+    //~^ ERROR temporary value dropped while borrowed
     println!("{}", s);
 }